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)
Mon, Nov 17, 1:10 PM
Unknown Object (File)
Sat, Nov 15, 11:06 PM
Unknown Object (File)
Tue, Nov 4, 1:02 PM
Unknown Object (File)
Tue, Nov 4, 7:26 AM
Unknown Object (File)
Mon, Nov 3, 5:48 AM
Unknown Object (File)
Fri, Oct 31, 1:27 AM
Unknown Object (File)
Thu, Oct 30, 2:43 AM
Unknown Object (File)
Wed, Oct 29, 2:08 AM
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 65002
Build 61885: 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
512
524
lib/libusb/libusb.h
79

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
736

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

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

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?

791

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
534
535
lib/libusb/libusb10_desc.c
742

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
276

It seems that we already have this in line 316?