• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

linux-3.0.x for AP-SH4A-0A Board


Commit MetaInfo

Revisão024d78c79eb4ee5395ed8f13233b5b15e3445db3 (tree)
Hora2011-08-18 02:55:51
AutorSebastian Andrzej Siewior <bigeasy@linu...>
CommiterGreg Kroah-Hartman

Mensagem de Log

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>

Mudança Sumário

Diff

--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -123,10 +123,11 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
123123 }
124124
125125 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);
128128 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);
130131 else
131132 max_tx = 999999;
132133 if (le16_to_cpu(desc->wBytesPerInterval) > max_tx) {
@@ -134,10 +135,10 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno,
134135 "config %d interface %d altsetting %d ep %d: "
135136 "setting to %d\n",
136137 usb_endpoint_xfer_isoc(&ep->desc) ? "Isoc" : "Int",
137- desc->wBytesPerInterval,
138+ le16_to_cpu(desc->wBytesPerInterval),
138139 cfgno, inum, asnum, ep->desc.bEndpointAddress,
139140 max_tx);
140- ep->ss_ep_comp.wBytesPerInterval = max_tx;
141+ ep->ss_ep_comp.wBytesPerInterval = cpu_to_le16(max_tx);
141142 }
142143 }
143144