Skip to contentSkip to conversation

Add usb_endpoint_descriptor to be part of the struct usb_ep

PATCH Alan Stern 1 participant 1 message Oct 7, 2010 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Alan Stern

author
#1 lore raw
Quoted 11 lines · tlinder

Change ep_choose() and usb_ep_enable() prototypes to use endpoint descriptor from usb_ep. This optimization prevents the FDs from handling the endpoint chosen descriptor.
This optimization is not full though. To fully exploit this change one needs to update all the UDCs as well since in the current implementation each of them saves the endpoint descriptor in it's internal (and extended) endpoint structure.
This patch is a preparation for adding SuperSpeed support to the gadget framework.

...

include/linux/usb/gadget.h struct usb_ep_ops { · line 140

Quoted 13 lines
include/linux/usb/gadget.h +5 -0
index d3ef42d..5e5198d 100644
@@ -133,18 +133,25 @@ struct usb_ep_ops {
  *      the endpoint descriptor used to configure the endpoint.
  * @driver_data:for use by the gadget driver.  all other fields are
  *	read-only to gadget drivers.
+ * @bEndpointAddress: used to identify ep when finding descriptor that matches
+ *	connection speed
+ * @desc:endpoint descriptor.  this pointer set before endpoint is enabled and
+ *	remains valid until the endpoint is disabled; the data byte order
+ *	is little-endian (usb-standard).

The kerneldoc for @driver_data states that @bEndpointAddress and @desc are read-only for gadget drivers. This contradicts the changes this patch makes to those drivers.

Alan Stern