summaryrefslogtreecommitdiff
path: root/include/uapi/linux/usb
diff options
context:
space:
mode:
authorJohn Youn <John.Youn@synopsys.com>2016-02-06 04:05:12 +0300
committerFelipe Balbi <balbi@kernel.org>2016-03-04 16:14:22 +0300
commit446fa3a95df1e8b78f25e1babc41e46edd200821 (patch)
tree0e5d8aad4c5c142907309bd7fa827d5d65ba273f /include/uapi/linux/usb
parent7b05d3b37437f8d50a75545a0fd56ee585c58821 (diff)
downloadlinux-446fa3a95df1e8b78f25e1babc41e46edd200821.tar.xz
usb: ch9: Add size macro for SSP dev cap descriptor
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>
Diffstat (limited to 'include/uapi/linux/usb')
-rw-r--r--include/uapi/linux/usb/ch9.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
index 252ac16635dc..28bee8d44735 100644
--- a/include/uapi/linux/usb/ch9.h
+++ b/include/uapi/linux/usb/ch9.h
@@ -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