diff options
author | Felipe Balbi <balbi@ti.com> | 2011-08-03 11:33:27 (GMT) |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-10-13 17:39:59 (GMT) |
commit | 4bb99b7c82bac1488a0228d2363db1f68d90f6f3 (patch) | |
tree | 62741be3938a236aba3539402f7030d2eeb417bd /drivers/usb/gadget/f_mass_storage.c | |
parent | 089b837a39552ee49a4ea4c188e8c3517473f10c (diff) | |
download | linux-fsl-qoriq-4bb99b7c82bac1488a0228d2363db1f68d90f6f3.tar.xz |
usb: gadget: storage: add superspeed support
this patch adds superspeed descriptors for the
storage gadgets.
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/f_mass_storage.c')
-rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 927ee88..52583a2 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -3023,6 +3023,28 @@ static int fsg_bind(struct usb_configuration *c, struct usb_function *f) } } + if (gadget_is_superspeed(gadget)) { + unsigned max_burst; + + /* Calculate bMaxBurst, we know packet size is 1024 */ + max_burst = min_t(unsigned, FSG_BUFLEN / 1024, 15); + + fsg_ss_bulk_in_desc.bEndpointAddress = + fsg_fs_bulk_in_desc.bEndpointAddress; + fsg_ss_bulk_in_comp_desc.bMaxBurst = max_burst; + + fsg_ss_bulk_out_desc.bEndpointAddress = + fsg_fs_bulk_out_desc.bEndpointAddress; + fsg_ss_bulk_out_comp_desc.bMaxBurst = max_burst; + + f->ss_descriptors = usb_copy_descriptors(fsg_ss_function); + if (unlikely(!f->ss_descriptors)) { + usb_free_descriptors(f->hs_descriptors); + usb_free_descriptors(f->descriptors); + return -ENOMEM; + } + } + return 0; autoconf_fail: |