usb: ch9: Add size macro for SSP dev cap descriptor
authorJohn Youn <John.Youn@synopsys.com>
Sat, 6 Feb 2016 01:05:12 +0000 (17:05 -0800)
committerFelipe Balbi <balbi@kernel.org>
Fri, 4 Mar 2016 13:14:22 +0000 (15:14 +0200)
The SuperspeedPlus Device Capability Descriptor has a variable size
depending on the number of sublink speed attributes.

This patch adds a macro to calculate that size. The macro takes one
argument, the Sublink Speed Attribute Count (SSAC) as reported by the
descriptor in bmAttributes[4:0].

See USB 3.1 9.6.2.5, Table 9-19.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
include/uapi/linux/usb/ch9.h

index 252ac16635dce1f820c90ecb92c1609862fcaf25..28bee8d4473513748f65fed1893e92fe3c783d29 100644 (file)
@@ -923,6 +923,12 @@ struct usb_ptm_cap_descriptor {
        __u8  bDevCapabilityType;
 } __attribute__((packed));
 
+/*
+ * The size of the descriptor for the Sublink Speed Attribute Count
+ * (SSAC) specified in bmAttributes[4:0].
+ */
+#define USB_DT_USB_SSP_CAP_SIZE(ssac)  (16 + ssac * 4)
+
 /*-------------------------------------------------------------------------*/
 
 /* USB_DT_WIRELESS_ENDPOINT_COMP:  companion descriptor associated with
This page took 0.025109 seconds and 5 git commands to generate.