windows_winusb: Add support for reporting super speed plus devices
authorHarry Mallon <hjmallon@gmail.com>
Thu, 7 Feb 2019 15:15:03 +0000 (15:15 +0000)
committerNathan Hjelm <hjelmn@google.com>
Fri, 9 Aug 2019 16:21:03 +0000 (09:21 -0700)
Closes #531

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
libusb/os/windows_winusb.c
libusb/os/windows_winusb.h
libusb/version_nano.h

index e3d5cfa..63d4f00 100644 (file)
@@ -909,6 +909,8 @@ static int init_device(struct libusb_device *dev, struct libusb_device *parent_d
                                &conn_info_v2, sizeof(conn_info_v2), &conn_info_v2, sizeof(conn_info_v2), &size, NULL)) {
                                usbi_warn(ctx, "could not get node connection information (V2) for device '%s': %s",
                                          priv->dev_id,  windows_error_str(0));
+                       } else if (conn_info_v2.Flags.DeviceIsOperatingAtSuperSpeedPlusOrHigher) {
+                               conn_info.Speed = 4;
                        } else if (conn_info_v2.Flags.DeviceIsOperatingAtSuperSpeedOrHigher) {
                                conn_info.Speed = 3;
                        }
@@ -926,6 +928,7 @@ static int init_device(struct libusb_device *dev, struct libusb_device *parent_d
                case 1: dev->speed = LIBUSB_SPEED_FULL; break;
                case 2: dev->speed = LIBUSB_SPEED_HIGH; break;
                case 3: dev->speed = LIBUSB_SPEED_SUPER; break;
+               case 4: dev->speed = LIBUSB_SPEED_SUPER_PLUS; break;
                default:
                        usbi_warn(ctx, "unknown device speed %u", conn_info.Speed);
                        break;
index 3a911d5..dd8fde5 100644 (file)
@@ -397,7 +397,9 @@ typedef union _USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS {
        struct {
                ULONG DeviceIsOperatingAtSuperSpeedOrHigher:1;
                ULONG DeviceIsSuperSpeedCapableOrHigher:1;
-               ULONG ReservedMBZ:30;
+               ULONG DeviceIsOperatingAtSuperSpeedPlusOrHigher:1;
+               ULONG DeviceIsSuperSpeedPlusCapableOrHigher:1;
+               ULONG ReservedMBZ:28;
        };
 } USB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS, *PUSB_NODE_CONNECTION_INFORMATION_EX_V2_FLAGS;
 
index 46449d4..1d98258 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11387
+#define LIBUSB_NANO 11388