Skip to contentSkip to conversation

usb: uapi: add usb 3.0 authentication declarations

PATCH New Oliver Neukum 1 participant 2 messages Mar 19 USB

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 usb: uapi: add usb 3.0 authentication declarations

This adds the USB authentication extensions to the uapi chapter 9 declarations, so that user space tools correctly operate on the descriptor and commands. This is necessary for sniffing and debugging in gadget mode to correctly work, even though the kernel does not use these requests in host mode.

---

V2: corrected typo

 include/uapi/linux/usb/ch9.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
include/uapi/linux/usb/ch9.h +13 -0
index 8003243a4937..62771e38a83d 100644
@@ -102,6 +102,8 @@
 #define USB_REQ_LOOPBACK_DATA_WRITE	0x15
 #define USB_REQ_LOOPBACK_DATA_READ	0x16
 #define USB_REQ_SET_INTERFACE_DS	0x17
+#define USB_REQ_AUTH_IN			0x18
+#define USB_REQ_AUTH_OUT		0x19
 
 /* specific requests for USB Power Delivery */
 #define USB_REQ_GET_PARTNER_PDO		20
@@ -1147,6 +1149,17 @@ struct usb_ptm_cap_descriptor {
 
 /*-------------------------------------------------------------------------*/
 
+struct usb_authentication_capability_descriptor {
+	__u8  bLength;
+	__u8  bDescriptorType; /* set to USB_DT_DEVICE_CAPABILITY */
+	__u8  bmAttributes;
+
+	__u8  bcdProtocolVersion;
+	__u8  bcdCapability;
+} __attribute__((packed));
+
+/*-------------------------------------------------------------------------*/
+
 /* USB_DT_WIRELESS_ENDPOINT_COMP:  companion descriptor associated with
  * each endpoint descriptor for a wireless device
  */
Signature · 1 line
2.53.0
#1 lore raw

PATCH v2 2/2 USB: uapi: add BULK_MAX_PACKET_UPDATE

The spec for Embedded USB2 Version 2.0 adds a new feature request. This needs to be added to uapi for monitoring.

---

V2: improved naming and commenting

 include/uapi/linux/usb/ch9.h | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
include/uapi/linux/usb/ch9.h +11 -9
index 62771e38a83d..c3e593378377 100644
@@ -123,15 +123,17 @@
  * are at most sixteen features of each type.)  Hubs may also support a
  * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
  */
-#define USB_DEVICE_SELF_POWERED		0	/* (read only) */
-#define USB_DEVICE_REMOTE_WAKEUP	1	/* dev may initiate wakeup */
-#define USB_DEVICE_TEST_MODE		2	/* (wired high speed only) */
-#define USB_DEVICE_BATTERY		2	/* (wireless) */
-#define USB_DEVICE_B_HNP_ENABLE		3	/* (otg) dev may initiate HNP */
-#define USB_DEVICE_WUSB_DEVICE		3	/* (wireless)*/
-#define USB_DEVICE_A_HNP_SUPPORT	4	/* (otg) RH port supports HNP */
-#define USB_DEVICE_A_ALT_HNP_SUPPORT	5	/* (otg) other RH port does */
-#define USB_DEVICE_DEBUG_MODE		6	/* (special devices only) */
+#define USB_DEVICE_SELF_POWERED				0	/* (read only) */
+#define USB_DEVICE_REMOTE_WAKEUP			1	/* dev may initiate wakeup */
+#define USB_DEVICE_TEST_MODE				2	/* (wired high speed only) */
+#define USB_DEVICE_BATTERY				2	/* (wireless) */
+#define USB_DEVICE_B_HNP_ENABLE				3	/* (otg) dev may initiate HNP */
+#define USB_DEVICE_WUSB_DEVICE				3	/* (wireless)*/
+#define USB_DEVICE_A_HNP_SUPPORT			4	/* (otg) RH port supports HNP */
+#define USB_DEVICE_A_ALT_HNP_SUPPORT			5	/* (otg) other RH port does */
+#define USB_DEVICE_DEBUG_MODE				6	/* (special devices only) */
+
+#define USB_DEVICE_BULK_MAX_PACKET_UPDATE		8	/* (eUSB2v2) bump maxpacket to 1024 */
 
 /*
  * Test Mode Selectors
Signature · 1 line
2.53.0