Skip to content

Commit 7c01431

Browse files
matnymangregkh
authored andcommitted
USB: clarify USB_DT_USB_SSP_CAP_SIZE(ssac) definition
USB_DT_USB_SSP_CAP_SIZE(ssac) gives the size of the SSP capability descriptor. The descriptor consists of 12 bytes plus a array of SSA entries. The number of SSA entries is stored in a SSAC value in the first 12 bytes, The USB3.1 specification 9.6.2.5 defines SSAC as zero based: "The number of Sublink Speed Attributes = SSAC + 1." This is not intuitive and has already caused some confusion. Make a small modifiaction to the USB_DT_USB_SSP_CAP_SIZE(ssac) definition to make it a bit clearer Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e142dc1 commit 7c01431

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • include/uapi/linux/usb

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,9 +1077,9 @@ struct usb_ptm_cap_descriptor {
10771077
#define USB_DT_USB_PTM_ID_SIZE 3
10781078
/*
10791079
* The size of the descriptor for the Sublink Speed Attribute Count
1080-
* (SSAC) specified in bmAttributes[4:0].
1080+
* (SSAC) specified in bmAttributes[4:0]. SSAC is zero-based
10811081
*/
1082-
#define USB_DT_USB_SSP_CAP_SIZE(ssac) (16 + ssac * 4)
1082+
#define USB_DT_USB_SSP_CAP_SIZE(ssac) (12 + (ssac + 1) * 4)
10831083

10841084
/*-------------------------------------------------------------------------*/
10851085

0 commit comments

Comments
 (0)