linux-3.0.x for AP-SH4A-0A Board
Revisão | 024d78c79eb4ee5395ed8f13233b5b15e3445db3 (tree) |
---|---|
Hora | 2011-08-18 02:55:51 |
Autor | Sebastian Andrzej Siewior <bigeasy@linu...> |
Commiter | Greg Kroah-Hartman |
usb/config: use proper endian access for wMaxPacketSize
commit 7de7c7d2cb49900e0b967be871bf695c7d6135c9 upstream.
wMaxPacketSize is le16 and should be accessed as such. Also fix the
wBytesPerInterval assignment while here.
v2: also fix the wBytesPerInterval assigment, noticed by Matt Evans
This patch should be backported to the 3.0 kernel.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Acked-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
@@ -123,10 +123,11 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | ||
123 | 123 | } |
124 | 124 | |
125 | 125 | if (usb_endpoint_xfer_isoc(&ep->desc)) |
126 | - max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1) * | |
127 | - (desc->bmAttributes + 1); | |
126 | + max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) * | |
127 | + le16_to_cpu(ep->desc.wMaxPacketSize); | |
128 | 128 | else if (usb_endpoint_xfer_int(&ep->desc)) |
129 | - max_tx = ep->desc.wMaxPacketSize * (desc->bMaxBurst + 1); | |
129 | + max_tx = le16_to_cpu(ep->desc.wMaxPacketSize) * | |
130 | + (desc->bMaxBurst + 1); | |
130 | 131 | else |
131 | 132 | max_tx = 999999; |
132 | 133 | if (le16_to_cpu(desc->wBytesPerInterval) > max_tx) { |
@@ -134,10 +135,10 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, | ||
134 | 135 | "config %d interface %d altsetting %d ep %d: " |
135 | 136 | "setting to %d\n", |
136 | 137 | usb_endpoint_xfer_isoc(&ep->desc) ? "Isoc" : "Int", |
137 | - desc->wBytesPerInterval, | |
138 | + le16_to_cpu(desc->wBytesPerInterval), | |
138 | 139 | cfgno, inum, asnum, ep->desc.bEndpointAddress, |
139 | 140 | max_tx); |
140 | - ep->ss_ep_comp.wBytesPerInterval = max_tx; | |
141 | + ep->ss_ep_comp.wBytesPerInterval = cpu_to_le16(max_tx); | |
141 | 142 | } |
142 | 143 | } |
143 | 144 |