git: 6e575d08a5f5 - main - usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum

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

URL: https://cgit.FreeBSD.org/src/commit/?id=6e575d08a5f5030562593bba5b47cc176d0b9bb7

commit 6e575d08a5f5030562593bba5b47cc176d0b9bb7
Author:     ShengYi Hung <aokblast@FreeBSD.org>
AuthorDate: 2026-05-22 15:32:25 +0000
Commit:     ShengYi Hung <aokblast@FreeBSD.org>
CommitDate: 2026-11-02 03:02:10 +0000

    usb: Add SSP and SSPx2 speed and move USB_*_MAX into enum
    
    Add the USB 3.1 and 3.2 speeds and revisions.  The speeds are in USB
    3.2 rank order, so they can be compared directly.
    
    Also, move USB_*_MAX into the enums.
    
    Reviewed by:    bz
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D57194
---
 sys/dev/usb/usb.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
index da27c97bd5c7..8ac2445c3c1f 100644
--- a/sys/dev/usb/usb.h
+++ b/sys/dev/usb/usb.h
@@ -761,8 +761,12 @@ enum usb_dev_speed {
 	USB_SPEED_FULL,
 	USB_SPEED_HIGH,
 	USB_SPEED_SUPER,
+	/* Enhanced SuperSpeed links are in USB 3.2 rank order */
+	USB_SPEED_SUPER_PLUS_X2,	/* SuperSpeedPlus Gen1x2 = 10 Gbps */
+	USB_SPEED_SUPER_PLUS,		/* SuperSpeedPlus Gen2x1 = 10 Gbps */
+	USB_SPEED_SUPER_PLUS_GEN2_X2,	/* SuperSpeedPlus Gen2x2 = 20 Gbps */
+	USB_SPEED_MAX,
 };
-#define	USB_SPEED_MAX	(USB_SPEED_SUPER+1)
 
 /*
  * The "USB_REV" macros defines all the supported USB revisions.
@@ -774,9 +778,11 @@ enum usb_revision {
 	USB_REV_1_1,
 	USB_REV_2_0,
 	USB_REV_2_5,
-	USB_REV_3_0
+	USB_REV_3_0,
+	USB_REV_3_1,
+	USB_REV_3_2,
+	USB_REV_MAX,
 };
-#define	USB_REV_MAX	(USB_REV_3_0+1)
 
 /*
  * Supported host controller modes.
@@ -784,9 +790,9 @@ enum usb_revision {
 enum usb_hc_mode {
 	USB_MODE_HOST,		/* initiates transfers */
 	USB_MODE_DEVICE,	/* bus transfer target */
-	USB_MODE_DUAL		/* can be host or device */
+	USB_MODE_DUAL,		/* can be host or device */
+	USB_MODE_MAX,
 };
-#define	USB_MODE_MAX	(USB_MODE_DUAL+1)
 
 /*
  * The "USB_STATE" enums define all the supported device states.
@@ -797,8 +803,8 @@ enum usb_dev_state {
 	USB_STATE_POWERED,
 	USB_STATE_ADDRESSED,
 	USB_STATE_CONFIGURED,
+	USB_STATE_MAX,
 };
-#define	USB_STATE_MAX	(USB_STATE_CONFIGURED+1)
 
 /*
  * The "USB_EP_MODE" macros define all the currently supported