From e80c1508d3469ecf1042adee3905d6305351de79 Mon Sep 17 00:00:00 2001 From: Harry Mallon Date: Thu, 7 Feb 2019 15:15:03 +0000 Subject: windows_winusb: Add support for reporting super speed plus devices Closes #531 Signed-off-by: Nathan Hjelm --- libusb/os/windows_winusb.c | 3 +++ libusb/os/windows_winusb.h | 4 +++- libusb/version_nano.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libusb/os/windows_winusb.c b/libusb/os/windows_winusb.c index e3d5cfa..63d4f00 100644 --- a/libusb/os/windows_winusb.c +++ b/libusb/os/windows_winusb.c @@ -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; diff --git a/libusb/os/windows_winusb.h b/libusb/os/windows_winusb.h index 3a911d5..dd8fde5 100644 --- a/libusb/os/windows_winusb.h +++ b/libusb/os/windows_winusb.h @@ -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; diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 46449d4..1d98258 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 11387 +#define LIBUSB_NANO 11388 -- cgit v1.2.1