The branch stable/14 has been updated by bapt:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=05275cf75a19e9f5919bf0a2ee86b5b946d0dc07

commit 05275cf75a19e9f5919bf0a2ee86b5b946d0dc07
Author:     SHENGYI HUNG <aokbl...@freebsd.org>
AuthorDate: 2025-05-15 10:30:45 +0000
Commit:     Baptiste Daroussin <b...@freebsd.org>
CommitDate: 2025-06-23 07:40:33 +0000

    libusb: add SUPER_PLUS in speed enum.
    
    Summary:
    Some application(like usbmuxd) start to use LIBUSB_SPEED_SUPER_PLUS now.
    Though we don't have the corresponding infra in kernel right now, it is
    harmless to have this enum value in userspace to prevent the compile error
    
    Reviewed By: bapt
    Sponsored By: FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D50359
    
    (cherry picked from commit f938c0a90313125a9518307e80ca92d4c71f7745)
---
 lib/libusb/libusb.3       | 2 +-
 lib/libusb/libusb.h       | 1 +
 lib/libusb/libusb01.c     | 2 ++
 lib/libusb/libusb10.c     | 5 +++++
 lib/libusb/libusb20.3     | 1 +
 lib/libusb/libusb20.h     | 1 +
 usr.sbin/usbconfig/dump.c | 2 ++
 7 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/libusb/libusb.3 b/lib/libusb/libusb.3
index fe07e86623c8..1ca0e677d96f 100644
--- a/lib/libusb/libusb.3
+++ b/lib/libusb/libusb.3
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd January 26, 2023
+.Dd May 16, 2025
 .Dt LIBUSB 3
 .Os
 .Sh NAME
diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h
index 732fc9dca1e0..cdac94b17c64 100644
--- a/lib/libusb/libusb.h
+++ b/lib/libusb/libusb.h
@@ -216,6 +216,7 @@ enum libusb_speed {
        LIBUSB_SPEED_FULL = 2,
        LIBUSB_SPEED_HIGH = 3,
        LIBUSB_SPEED_SUPER = 4,
+       LIBUSB_SPEED_SUPER_PLUS = 5,
 };
 
 enum libusb_transfer_status {
diff --git a/lib/libusb/libusb01.c b/lib/libusb/libusb01.c
index 7017016693af..f246e74353a6 100644
--- a/lib/libusb/libusb01.c
+++ b/lib/libusb/libusb01.c
@@ -130,6 +130,8 @@ usb_get_transfer_by_ep_no(usb_dev_handle * dev, uint8_t 
ep_no)
                bufsize = 4096;
        } else if (speed == LIBUSB20_SPEED_SUPER) {
                bufsize = 65536;
+       } else if (speed == LIBUSB20_SPEED_SUPER_PLUS) {
+               bufsize = 131072;
        } else {
                bufsize = 16384;
        }
diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c
index 5564bfd8b499..f8912b5c47cb 100644
--- a/lib/libusb/libusb10.c
+++ b/lib/libusb/libusb10.c
@@ -437,6 +437,8 @@ libusb_get_device_speed(libusb_device *dev)
                return (LIBUSB_SPEED_HIGH);
        case LIBUSB20_SPEED_SUPER:
                return (LIBUSB_SPEED_SUPER);
+       case LIBUSB20_SPEED_SUPER_PLUS:
+               return (LIBUSB_SPEED_SUPER_PLUS);
        default:
                break;
        }
@@ -1066,6 +1068,9 @@ libusb10_get_buffsize(struct libusb20_device *pdev, 
libusb_transfer *xfer)
                case LIBUSB20_SPEED_SUPER:
                        ret = 65536;
                        break;
+               case LIBUSB20_SPEED_SUPER_PLUS:
+                       ret = 131072;
+                       break;
                default:
                        ret = 16384;
                        break;
diff --git a/lib/libusb/libusb20.3 b/lib/libusb/libusb20.3
index 1d07db8f32a4..7854b0f8ed7e 100644
--- a/lib/libusb/libusb20.3
+++ b/lib/libusb/libusb20.3
@@ -858,6 +858,7 @@ returns the current speed of the given USB device.
 .It LIBUSB20_SPEED_HIGH
 .It LIBUSB20_SPEED_VARIABLE
 .It LIBUSB20_SPEED_SUPER
+.It LIBUSB20_SPEED_SUPER_PLUS
 .El
 .
 .Pp
diff --git a/lib/libusb/libusb20.h b/lib/libusb/libusb20.h
index 7bca2f7508c7..c132c58a9f69 100644
--- a/lib/libusb/libusb20.h
+++ b/lib/libusb/libusb20.h
@@ -159,6 +159,7 @@ enum {
        LIBUSB20_SPEED_HIGH,
        LIBUSB20_SPEED_VARIABLE,
        LIBUSB20_SPEED_SUPER,
+       LIBUSB20_SPEED_SUPER_PLUS,
 };
 
 /** \ingroup misc
diff --git a/usr.sbin/usbconfig/dump.c b/usr.sbin/usbconfig/dump.c
index 2a4a5300efeb..10ff2125853e 100644
--- a/usr.sbin/usbconfig/dump.c
+++ b/usr.sbin/usbconfig/dump.c
@@ -100,6 +100,8 @@ dump_speed(uint8_t value)
                return ("VARIABLE (52-480Mbps)");
        case LIBUSB20_SPEED_SUPER:
                return ("SUPER (5.0Gbps)");
+       case LIBUSB20_SPEED_SUPER_PLUS:
+               return ("SUPER+(10-20Gbps)");
        default:
                break;
        }

Reply via email to