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
This commit is contained in:
SHENGYI HUNG
2025-05-15 18:30:45 +08:00
committed by Baptiste Daroussin
parent a7e183c0c9
commit f938c0a903
7 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -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
+1
View File
@@ -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 {
+2
View File
@@ -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;
}
+5
View File
@@ -445,6 +445,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;
}
@@ -1074,6 +1076,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;
+1
View File
@@ -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
+1
View File
@@ -159,6 +159,7 @@ enum {
LIBUSB20_SPEED_HIGH,
LIBUSB20_SPEED_VARIABLE,
LIBUSB20_SPEED_SUPER,
LIBUSB20_SPEED_SUPER_PLUS,
};
/** \ingroup misc
+2
View File
@@ -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;
}