On 9/4/26 4:29 AM, Thinh Nguyen wrote:
Hello Thinh,
@@ -2709,6 +2712,27 @@ static int fsg_bind(struct usb_configuration *c, struct
usb_function *f)
return -ENOMEM;
}
}
+
+ if (gadget_is_superspeed(gadget)) {
Nitpick -- you could invert the conditional here and reduce indent:
if (!gadget_is_superspeed(gadget))
return 0;
...
+ unsigned int max_burst;
+
+ /* Calculate bMaxBurst, we know packet size is 1024 */
+ max_burst = min_t(unsigned int, 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)) {
+ free(f->hs_descriptors);
+ free(f->descriptors);
+ return -ENOMEM;
+ }
+ }
+
return 0;
The series looks good to me otherwise, I'd like to give Mattijs a chance
to look at it and pick it.
Thank you !