usb/ch9: use proper endianess for wBytesPerInterval
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 11 Apr 2011 18:19:12 +0000 (20:19 +0200)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 2 May 2011 23:42:51 +0000 (16:42 -0700)
while going through Tatyana's changes for the gadget framework I noticed
that this type is not defined as __le16.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/core/config.c
drivers/usb/host/xhci-mem.c
include/linux/usb/ch9.h

index 83126b03e7cfca7c70e508db1fc6fee24bfa0258..c962608b4b9abc8b7d403eefb567f2018f9ba98d 100644 (file)
@@ -129,7 +129,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
                max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1);
        else
                max_tx = 999999;
-       if (desc->wBytesPerInterval > max_tx) {
+       if (le16_to_cpu(desc->wBytesPerInterval) > max_tx) {
                dev_warn(ddev, "%s endpoint with wBytesPerInterval of %d in "
                                "config %d interface %d altsetting %d ep %d: "
                                "setting to %d\n",
index 500ec7a9eb8a36b79ff2ba8f28aa157a8d59f90e..a4fc4d92938581fef8cc0c39b610901d777d9932 100644 (file)
@@ -1130,7 +1130,7 @@ static u32 xhci_get_max_esit_payload(struct xhci_hcd *xhci,
                return 0;
 
        if (udev->speed == USB_SPEED_SUPER)
-               return ep->ss_ep_comp.wBytesPerInterval;
+               return le16_to_cpu(ep->ss_ep_comp.wBytesPerInterval);
 
        max_packet = GET_MAX_PACKET(le16_to_cpu(ep->desc.wMaxPacketSize));
        max_burst = (le16_to_cpu(ep->desc.wMaxPacketSize) & 0x1800) >> 11;
index b72f305ce6bd0986ae8ec07daec1f998277d9650..0fd3fbdd8283fe1004698ed22f8860eb3abecec9 100644 (file)
@@ -579,7 +579,7 @@ struct usb_ss_ep_comp_descriptor {
 
        __u8  bMaxBurst;
        __u8  bmAttributes;
-       __u16 wBytesPerInterval;
+       __le16 wBytesPerInterval;
 } __attribute__ ((packed));
 
 #define USB_DT_SS_EP_COMP_SIZE         6