git: 23ef0bdb48f3 - main - usb: Add SSPlus device capability descriptor

From: ShengYi Hung <aokblast_at_FreeBSD.org>
Date: Mon, 02 Nov 2026 03:02:52 UTC
The branch main has been updated by aokblast:

URL: https://cgit.FreeBSD.org/src/commit/?id=23ef0bdb48f3f9065769404c77c17f10b9a14576

commit 23ef0bdb48f3f9065769404c77c17f10b9a14576
Author:     ShengYi Hung <aokblast@FreeBSD.org>
AuthorDate: 2026-05-22 16:29:40 +0000
Commit:     ShengYi Hung <aokblast@FreeBSD.org>
CommitDate: 2026-11-02 03:02:11 +0000

    usb: Add SSPlus device capability descriptor
    
    Add the SuperSpeedPlus USB Device Capability descriptor and its field
    macros.
    
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D57203
---
 sys/dev/usb/usb.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
index 90078df11361..c0d5db766ffb 100644
--- a/sys/dev/usb/usb.h
+++ b/sys/dev/usb/usb.h
@@ -331,6 +331,7 @@ struct usb_bos_cap_descriptor {
 #define	USB_DEVCAP_USB2EXT	0x02
 #define	USB_DEVCAP_SUPER_SPEED	0x03
 #define	USB_DEVCAP_CONTAINER_ID	0x04
+#define	USB_DEVCAP_SUPERSPEED_PLUS	0x0A
 	/* data ... */
 } __packed;
 typedef struct usb_bos_cap_descriptor usb_bos_cap_descriptor_t;
@@ -371,6 +372,33 @@ struct usb_devcap_container_id_descriptor {
 typedef struct usb_devcap_container_id_descriptor
 		usb_devcap_container_id_descriptor_t;
 
+struct usb_devcap_ss_plus_descriptor_header {
+	uByte	bLength;
+	uByte	bDescriptorType;
+	uByte	bDevCapabilityType;
+	uByte	bReserved;
+#define USB_DEVCAP_SSPLUS_SSAC_GET(x) ((x) & 0x1F)
+#define USB_DEVCAP_SSPLUS_SSAC_SET(v) ((v) & 0x1F)
+#define USB_DEVCAP_SSPLUS_SSIC_SET(v) (((v) & 0x0F) << 5)
+	uDWord	bmAttributes;
+	uWord	wFunctionalitySupport;
+	uWord   wReserved;
+} __packed;
+
+struct usb_devcap_ss_plus_descriptor {
+	struct usb_devcap_ss_plus_descriptor_header hdr;
+#define USB_DEVCAP_SSPLUS_SSID_GET(x) ((x) & 0x0F)
+#define USB_DEVCAP_SSPLUS_LSE_GET(x) (((x) >> 4) & 0x03)
+#define USB_DEVCAP_SSPLUS_ST_GET(x) (((x) >> 6) & 0x03)
+#define USB_DEVCAP_SSPLUS_LP_GET(x) (((x) >> 14) & 0x03)
+#define USB_DEVCAP_SSPLUS_LP_SS 0
+#define USB_DEVCAP_SSPLUS_LP_SSP 1
+#define USB_DEVCAP_SSPLUS_LSM_GET(x)  (((x) >> 16) & 0xFFFF)
+	uDWord   bmSublinkSpeedAttr[];
+} __packed;
+typedef struct usb_devcap_ss_plus_descriptor
+		usb_devcap_ss_plus_descriptor_t;
+
 /* Device class codes */
 #define	UDCLASS_IN_INTERFACE	0x00
 #define	UDCLASS_COMM		0x02