Hello. On 18-03-2011 16:33, Felipe Balbi wrote:
Use SuperSpeed descriptors where necessary.
Signed-off-by: Felipe Balbi<balbi@xxxxxx> --- drivers/usb/gadget/composite.c | 30 ++++++++++++++++++++++++------ 1 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 44631fc..5fe5b88 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c
[...]
@@ -266,7 +268,9 @@ static int config_buf(struct usb_configuration *config, list_for_each_entry(f,&config->functions, list) { struct usb_descriptor_header **descriptors; - if (speed == USB_SPEED_HIGH) + if (speed == USB_SPEED_SUPER) + descriptors = f->ss_descriptors; + else if (speed == USB_SPEED_HIGH) descriptors = f->hs_descriptors; else descriptors = f->descriptors;
*switch* statement seems more appropriate here...
@@ -308,7 +312,10 @@ static int config_desc(struct usb_composite_dev *cdev, unsigned w_value) w_value&= 0xff; list_for_each_entry(c,&cdev->configs, list) { /* ignore configs that won't work at this speed */ - if (speed == USB_SPEED_HIGH) { + if (speed == USB_SPEED_SUPER) { + if (!c->superspeed) + continue; + } else if (speed == USB_SPEED_HIGH) { if (!c->highspeed) continue; } else {
And here too...
@@ -435,7 +450,9 @@ static int set_config(struct usb_composite_dev *cdev, * function's setup callback instead of the current * configuration's setup callback. */ - if (gadget->speed == USB_SPEED_HIGH) + if (gadget->speed == USB_SPEED_SUPER) + descriptors = f->ss_descriptors; + else if (gadget->speed == USB_SPEED_HIGH) descriptors = f->hs_descriptors;
Here as well... WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html