Hi, Felipe Balbi <[email protected]> writes: > According to USB 3.1 Specification, that field is 2 > bytes wide and is named with a 'w' prefix, not 'b'. > > Just to make grepping in the spec easier, let's > match the name. > > Signed-off-by: Felipe Balbi <[email protected]>
I'll wait for another week or so, if nobody has any objections to this
series, I plan on sending it to Greg on my pull request.
If anybody needs a resend, just let me know ;-) (patch left below for
reference)
> ---
> drivers/usb/core/hub.c | 8 ++++----
> drivers/usb/gadget/composite.c | 4 ++--
> drivers/usb/host/xhci-hub.c | 2 +-
> drivers/usb/host/xhci.c | 2 +-
> include/linux/usb/gadget.h | 2 +-
> include/uapi/linux/usb/ch9.h | 2 +-
> 6 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 1d5fc32d06d0..0f87c62a81db 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -152,7 +152,7 @@ int usb_device_supports_lpm(struct usb_device *udev)
> }
>
> if (udev->bos->ss_cap->bU1devExitLat == 0 &&
> - udev->bos->ss_cap->bU2DevExitLat == 0) {
> + udev->bos->ss_cap->wU2DevExitLat == 0) {
> if (udev->parent)
> dev_info(&udev->dev, "LPM exit latency is zeroed,
> disabling LPM.\n");
> else
> @@ -311,9 +311,9 @@ static void usb_set_lpm_parameters(struct usb_device
> *udev)
> return;
>
> udev_u1_del = udev->bos->ss_cap->bU1devExitLat;
> - udev_u2_del = le16_to_cpu(udev->bos->ss_cap->bU2DevExitLat);
> + udev_u2_del = le16_to_cpu(udev->bos->ss_cap->wU2DevExitLat);
> hub_u1_del = udev->parent->bos->ss_cap->bU1devExitLat;
> - hub_u2_del = le16_to_cpu(udev->parent->bos->ss_cap->bU2DevExitLat);
> + hub_u2_del = le16_to_cpu(udev->parent->bos->ss_cap->wU2DevExitLat);
>
> usb_set_lpm_mel(udev, &udev->u1_params, udev_u1_del,
> hub, &udev->parent->u1_params, hub_u1_del);
> @@ -3909,7 +3909,7 @@ static void usb_enable_link_state(struct usb_hcd *hcd,
> struct usb_device *udev,
> {
> int timeout, ret;
> __u8 u1_mel = udev->bos->ss_cap->bU1devExitLat;
> - __le16 u2_mel = udev->bos->ss_cap->bU2DevExitLat;
> + __le16 u2_mel = udev->bos->ss_cap->wU2DevExitLat;
>
> /* If the device says it doesn't have *any* exit latency to come out of
> * U1 or U2, it's probably lying. Assume it doesn't implement that link
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 32176f779861..7c914dabfed4 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -646,11 +646,11 @@ static int bos_desc(struct usb_composite_dev *cdev)
> cdev->gadget->ops->get_config_params(&dcd_config_params);
> else {
> dcd_config_params.bU1devExitLat = USB_DEFAULT_U1_DEV_EXIT_LAT;
> - dcd_config_params.bU2DevExitLat =
> + dcd_config_params.wU2DevExitLat =
> cpu_to_le16(USB_DEFAULT_U2_DEV_EXIT_LAT);
> }
> ss_cap->bU1devExitLat = dcd_config_params.bU1devExitLat;
> - ss_cap->bU2DevExitLat = dcd_config_params.bU2DevExitLat;
> + ss_cap->wU2DevExitLat = dcd_config_params.wU2DevExitLat;
>
> /* The SuperSpeedPlus USB Device Capability descriptor */
> if (gadget_is_superspeed_plus(cdev->gadget)) {
> diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
> index 730b9fd26685..ea1a7349ef02 100644
> --- a/drivers/usb/host/xhci-hub.c
> +++ b/drivers/usb/host/xhci-hub.c
> @@ -48,7 +48,7 @@ static u8 usb_bos_descriptor [] = {
> 0x03, /* bFunctionalitySupport,
> USB 3.0 speed only */
> 0x00, /* bU1DevExitLat, set later. */
> - 0x00, 0x00, /* __le16 bU2DevExitLat, set later. */
> + 0x00, 0x00, /* __le16 wU2DevExitLat, set later. */
> /* Second device capability, SuperSpeedPlus */
> 0x1c, /* bLength 28, will be adjusted later */
> USB_DT_DEVICE_CAPABILITY, /* Device Capability */
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 01d96c9b3a75..6b86d1112ef1 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -4405,7 +4405,7 @@ static unsigned long long
> xhci_calculate_intel_u2_timeout(
> (xhci_service_interval_to_ns(desc) > timeout_ns))
> timeout_ns = xhci_service_interval_to_ns(desc);
>
> - u2_del_ns = le16_to_cpu(udev->bos->ss_cap->bU2DevExitLat) * 1000ULL;
> + u2_del_ns = le16_to_cpu(udev->bos->ss_cap->wU2DevExitLat) * 1000ULL;
> if (u2_del_ns > timeout_ns)
> timeout_ns = u2_del_ns;
>
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index 8e81f9eb95e4..ad29bfa23bd9 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -279,7 +279,7 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep)
> struct usb_dcd_config_params {
> __u8 bU1devExitLat; /* U1 Device exit Latency */
> #define USB_DEFAULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */
> - __le16 bU2DevExitLat; /* U2 Device exit Latency */
> + __le16 wU2DevExitLat; /* U2 Device exit Latency */
> #define USB_DEFAULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */
> };
>
> diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h
> index a8acc24765fe..35b2a3109e2b 100644
> --- a/include/uapi/linux/usb/ch9.h
> +++ b/include/uapi/linux/usb/ch9.h
> @@ -889,7 +889,7 @@ struct usb_ss_cap_descriptor { /* Link Power
> Management */
> #define USB_5GBPS_OPERATION (1 << 3) /* Operation at 5Gbps */
> __u8 bFunctionalitySupport;
> __u8 bU1devExitLat;
> - __le16 bU2DevExitLat;
> + __le16 wU2DevExitLat;
> } __attribute__((packed));
>
> #define USB_DT_USB_SS_CAP_SIZE 10
> --
> 2.9.1
>
--
balbi
signature.asc
Description: PGP signature
