Page MenuHomeFreeBSD

libusb: add parser for interface association descriptor
Needs ReviewPublic

Authored by aokblast on Jun 20 2025, 6:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 6:20 PM
Unknown Object (File)
Thu, Oct 9, 8:52 PM
Unknown Object (File)
Thu, Oct 9, 6:25 AM
Unknown Object (File)
Wed, Oct 8, 9:11 PM
Unknown Object (File)
Sun, Oct 5, 12:16 PM
Unknown Object (File)
Sat, Oct 4, 5:49 PM
Unknown Object (File)
Thu, Oct 2, 3:09 PM
Unknown Object (File)
Wed, Oct 1, 11:14 PM
Subscribers

Details

Reviewers
bapt
kevans
Group Reviewers
USB

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 66480
Build 63363: arc lint + arc unit

Event Timeline

Reorder libusb20_config to prevent ABI break

@kevans Do you think we should show IADs inside usbconfig? If so, what is your opinion about the format? IAD is a structure that cover multiple interfaces into 1 usb function. In that case, all interface should have a new indent and put the IAD on the top of It.

aokblast retitled this revision from libusb: add parser for parser for parser for parser for interface association descriptor to libusb: add parser for interface association descriptor.Jun 20 2025, 7:35 PM

Implement libusb_get_active_iad

lwhsu added inline comments.
lib/libusb/libusb.3
550
562
lib/libusb/libusb.h
80

Let's have this sorting enum member change in another commit, also, it seems that LIBUSB_DT_BOS should be placed after LIBUSB_DT_INTERFACE_ASSOCIATION ?

lib/libusb/libusb10_desc.c
786

This config will not be free()'d in the following early return:

  • if (iads == NULL)
  • if (niad == 0)
  • if (iad == NULL)
839

Maybe calling the parameter iad_arr to match the definition of libusb_get_active_interface_association_descriptors?

Or, even align more with libusb_get_interface_association_descriptors to be called iad_array?

841

Do we need to check desc is not null first?

lib/libusb/libusb20_desc.h
260

From the spec, iFunction seems using UINT8_T?

in man page and code, there are iad_array and iad_arr, would be nice if this naming can be consistent.

lib/libusb/libusb.3
572
573
lib/libusb/libusb10_desc.c
792

Does this also mean success? If so, should we set iad_arr = NULL to prevent that caller still pass the returned iad_arr to free() ?

lib/libusb/libusb20_desc.h
259

is this bInterfaceProtocol only in LIBUSB20_INTERFACE_DESC but not in LIBUSB20_INTERFACE_ASSOCIATION_DESC?

lib/libusb/libusb.h
293

It seems that we already have this in line 316?