--- - branch: MAIN date: Sun Apr 17 13:15:37 UTC 2022 files: - new: '1.120' old: '1.119' path: src/sys/dev/usb/usb.h pathrev: src/sys/dev/usb/usb.h@1.120 type: modified id: 20220417T131537Z.c6cf1ffc59a84b174a0c637fc056977710852493 log: | usbdi(9): Restore usb_descriptor_t to its correct definition. Descriptors in the USB spec all start with bLength and bDescriptorType. bDescriptorSubtype is only for certain class-specific descriptors. Many descriptors, such as usb_device_descriptor_t, _do not_ have bDescriptorSubtype, so using a structure that has bDescriptorSubtype for such descrpitors is wrong. There is some history here: - Back in 1998, when augustss@ introduced the USB stack, the type usb_descriptor_t was erroneously defined with a bDescriptorSubtype member. - In 2007, drochner@ removed this member to accurately reflect the USB spec. - In 2018, khorben@ appeared to have accidentally reintroduced it while importing the umb(4) driver from OpenBSD, which still has the erroneous bDescriptorSubtype member in usb_descriptor_t. The umb(4) driver has since been adjusted to correctly use usb_cdc_descriptor_t instead of usb_descriptor_t (and I have now restored umidi_cs_descriptor_t which I had removed last month before I realized this history of usb_descriptor_t), so this member is no longer necessary. module: src subject: 'CVS commit: src/sys/dev/usb' unixtime: '1650201337' user: riastradh