Hello. The attached patch adds some definitions and structs that were missing from usbspec.h. I needed this to build the latest version of Microsoft's usbview program ( https://github.com/DavidEGrayson/nixcrpkgs/tree/master/pkgs/usbview ).

Thanks!

--David Grayson


From 029639a7e7dfa21160ea3f361e41585443c68912 Mon Sep 17 00:00:00 2001
From: David Grayson <[email protected]>
Date: Mon, 17 Apr 2017 09:43:39 -0700
Subject: [PATCH] usbspec: Add some missing structs and definitions.

---
 mingw-w64-headers/include/usbspec.h | 55 +++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/mingw-w64-headers/include/usbspec.h 
b/mingw-w64-headers/include/usbspec.h
index 86557d8d..97ab5f3b 100644
--- a/mingw-w64-headers/include/usbspec.h
+++ b/mingw-w64-headers/include/usbspec.h
@@ -213,6 +213,13 @@ typedef struct _USB_BOS_DESCRIPTOR {
 #define USB_DEVICE_CAPABILITY_USB20_EXTENSION 0x02
 #define USB_DEVICE_CAPABILITY_SUPERSPEED_USB 0x03
 #define USB_DEVICE_CAPABILITY_CONTAINER_ID 0x04
+#define USB_DEVICE_CAPABILITY_PLATFORM 0x05
+#define USB_DEVICE_CAPABILITY_POWER_DELIVERY 0x06
+#define USB_DEVICE_CAPABILITY_BATTERY_INFO 0x07
+#define USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT 0x08
+#define USB_DEVICE_CAPABILITY_PD_PROVIDER_PORT 0x09
+#define USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB 0x0A
+#define USB_DEVICE_CAPABILITY_PRECISION_TIME_MEASUREMENT 0x0B
 #define USB_DEVICE_CAPABILITY_BILLBOARD 0x0D
 
 typedef struct _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR {
@@ -666,6 +673,54 @@ typedef struct 
_USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR {
   ULONG dwBytesPerInterval;
 } 
USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR,*PUSB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR;
 
+typedef union _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED {
+  ULONG AsUlong32;
+  struct {
+    ULONG SublinkSpeedAttrID:4;
+    ULONG LaneSpeedExponent:2;
+    ULONG SublinkTypeMode:1;
+    ULONG SublinkTypeDir:1;
+    ULONG Reserved:6;
+    ULONG LinkProtocol:2;
+    ULONG LaneSpeedMantissa:16;
+  };
+} USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED, 
*PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED;
+
+typedef struct _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR {
+  UCHAR bLength;
+  UCHAR bDescriptorType;
+  UCHAR bDevCapabilityType;
+  UCHAR bReserved;
+  union {
+    ULONG AsUlong;
+    struct {
+      ULONG SublinkSpeedAttrCount:5;
+      ULONG SublinkSpeedIDCount:4;
+      ULONG Reserved:23;
+    };
+  } bmAttributes;
+  union {
+    USHORT AsUshort;
+    struct {
+      USHORT SublinkSpeedAttrID:4;
+      USHORT Reserved:4;
+      USHORT MinRxLaneCount:4;
+      USHORT MinTxLaneCount:4;
+    };
+  } wFunctionalitySupport;
+  USHORT wReserved;
+  USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED bmSublinkSpeedAttr[1];
+} 
USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR,*PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR;
+
+typedef struct _USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR {
+  UCHAR bLength;
+  UCHAR bDescriptorType;
+  UCHAR bDevCapabilityType;
+  UCHAR bReserved;
+  GUID PlatformCapabilityUuid;
+  UCHAR CapabililityData[1];
+} 
USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR,*PUSB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR;
+
 #include <poppack.h>
 
 #endif
-- 
2.12.1

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to