Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08f8cabf authored by John Youn's avatar John Youn Committed by Felipe Balbi
Browse files

usb: gadget: composite: Access SSP Dev Cap fields properly



Access multi-byte fields of the SSP Dev Cap descriptor using the correct
endianness.

Fixes: f228a8de ("usb: gadget: composite: Return SSP Dev Cap descriptor")
Signed-off-by: default avatarJohn Youn <johnyoun@synopsys.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 38e58986
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -656,7 +656,8 @@ static int bos_desc(struct usb_composite_dev *cdev)
		ssp_cap->bmAttributes = cpu_to_le32(1);

		/* Min RX/TX Lane Count = 1 */
		ssp_cap->wFunctionalitySupport = (1 << 8) | (1 << 12);
		ssp_cap->wFunctionalitySupport =
			cpu_to_le16((1 << 8) | (1 << 12));

		/*
		 * bmSublinkSpeedAttr[0]:
@@ -666,7 +667,7 @@ static int bos_desc(struct usb_composite_dev *cdev)
		 *   LSM = 10 (10 Gbps)
		 */
		ssp_cap->bmSublinkSpeedAttr[0] =
			(3 << 4) | (1 << 14) | (0xa << 16);
			cpu_to_le32((3 << 4) | (1 << 14) | (0xa << 16));
		/*
		 * bmSublinkSpeedAttr[1] =
		 *   ST  = Symmetric, TX
@@ -675,7 +676,8 @@ static int bos_desc(struct usb_composite_dev *cdev)
		 *   LSM = 10 (10 Gbps)
		 */
		ssp_cap->bmSublinkSpeedAttr[1] =
			(3 << 4) | (1 << 14) | (0xa << 16) | (1 << 7);
			cpu_to_le32((3 << 4) | (1 << 14) |
				    (0xa << 16) | (1 << 7));
	}

	return le16_to_cpu(bos->wTotalLength);