Skip to content

Commit 446fa3a

Browse files
jysnpsfelipebalbi
authored andcommitted
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>
1 parent 7b05d3b commit 446fa3a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • include/uapi/linux/usb

‎include/uapi/linux/usb/ch9.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,12 @@ struct usb_ptm_cap_descriptor {
923923
__u8 bDevCapabilityType;
924924
} __attribute__((packed));
925925

926+
/*
927+
* The size of the descriptor for the Sublink Speed Attribute Count
928+
* (SSAC) specified in bmAttributes[4:0].
929+
*/
930+
#define USB_DT_USB_SSP_CAP_SIZE(ssac) (16 + ssac * 4)
931+
926932
/*-------------------------------------------------------------------------*/
927933

928934
/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with

0 commit comments

Comments
 (0)