Ticket #110 (reopened enhancement)

Opened 4 years ago

Last modified 2 years ago

[RFC/PATCH/RESEND] Add support to USB3 descriptors

Reported by: merez Owned by:
Milestone: libusb/libusbx 1.2.0 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

0001-Add-support-to-USB3-descriptors.patch (12.6 KB) - added by merez 4 years ago.
0001-Add-definitions-for-Endpoint-Companion-and-BOS-descr.patch (26.4 KB) - added by hjelmn 2 years ago.
Counter proposal based off now already existing FreeBSD API

Download all attachments as: .zip

Change History

comment:1 Changed 4 years ago by stuge

I'm afraid your patch doesn't seem to have made it together with the initial ticket. Please do attach the patch. Thanks!

comment:2 Changed 2 years 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.

Last edited 2 years ago by xiaofan (previous) (diff)

comment:3 Changed 2 years ago by xiaofan

Might be able to correlate this change with usbutils which has support for USB 3.0 descriptors as well.

https://github.com/gregkh/usbutils/blob/master/lsusb.c

comment:4 Changed 2 years 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 2 years 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 2 years 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 2 years 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.

Last edited 2 years ago by hjelmn (previous) (diff)

comment:8 Changed 2 years 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 2 years ago by hjelmn

  • Resolution set to fixed
  • Status changed from new to closed

Tested 1.0.16-rc6. Works.

comment:10 Changed 2 years ago by hjelmn

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening to track when this makes it into libusb.git

Changed 2 years ago by hjelmn

Counter proposal based off now already existing FreeBSD API

Note: See TracTickets for help on using tickets.