Ticket #110 (reopened enhancement)
Opened 2 years ago
Last modified 4 weeks ago
[RFC/PATCH/RESEND] Add support to USB3 descriptors
| Reported by: | merez | Owned by: | |
|---|---|---|---|
| Milestone: | 1.0.16 | Component: | libusb-1.0 |
| Keywords: | Cc: | ablay@… | |
| Blocked By: | Blocks: |
Description
This patch adds support of USB3 descriptors to libusb-1.0:
- Add definitions for Endpoint Companion and BOS descriptors.
- Add APIs for parsing the Endpoint Companion and BOS descriptors.
Attachments
Change History
comment:1 Changed 2 years ago by stuge
Changed 2 years ago by merez
comment:2 Changed 7 weeks ago by hjelmn
- Milestone set to 1.0.16
Looks good to me. Xiaofan or Peter please review and I will apply this to 1.0.16.
comment:3 Changed 6 weeks ago by xiaofan
Might be able to correlate this change with usbutils which has support for USB 3.0 descriptors as well.
comment:4 Changed 6 weeks ago by xiaofan
Another thing is that it is better to make sure that it is compatible with FreeBSD's implementation.
http://svnweb.freebsd.org/base/head/lib/libusb/libusb.h?view=markup
407 int libusb_parse_ss_endpoint_comp(const void *buf, int len, struct libusb_ss_endpoint_companion_descriptor ep_comp);
408 void libusb_free_ss_endpoint_comp(struct libusb_ss_endpoint_companion_descriptor *ep_comp);
409 int libusb_parse_bos_descriptor(const void *buf, int len, struct libusb_bos_descriptor bos);
410 void libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos);
comment:5 Changed 6 weeks ago by hjelmn
Good point. I see some differences and since the freebsd one is already released I will modify this patch to match and commit it for a final 1.0.16 rc.
comment:6 Changed 6 weeks ago by hjelmn
Hmm, the freebsd parsing method doesn't fit what we would normally do in libusb. This is the problem with sitting on a patch for this long!
comment:7 Changed 6 weeks ago by hjelmn
I modified the API, data structures, and definitions to fit what is already provided for FreeBSD. Please see:
http://git.libusb.org/?p=libusb/libusb-darwin.git;a=commitdiff;h=7c901bb72e8c946fd84baa2b8ee24f67394c9c00;hp=55c23742dece5bed4f010d0cf44a2dddb8439d45;js=1
If there are no objections this will make it into 1.0.16.
comment:8 Changed 6 weeks ago by hjelmn
I clean up my changes and the patch a little bit to better fit the libusb 1.0 coding style. Please see my branch for the changes and please test! I don't have many USB 3.0 devices to verify.
Peter, if you are available please take a look.
comment:9 Changed 6 weeks ago by hjelmn
- Resolution set to fixed
- Status changed from new to closed
Tested 1.0.16-rc6. Works.
comment:10 Changed 4 weeks ago by hjelmn
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening to track when this makes it into libusb.git
I'm afraid your patch doesn't seem to have made it together with the initial ticket. Please do attach the patch. Thanks!