aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt73usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-11-15 17:41:31 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-11-18 21:47:37 -0500
commitb242e891c218162cfbae064b1a9136cdbed5ee53 (patch)
tree3e460f49ffd103881082bc561d0536109517b617 /drivers/net/wireless/rt2x00/rt73usb.c
parent2ffbb8377c7a0713baf6644e285adc27a5654582 (diff)
rt2x00: Request usb_maxpacket() once
The usb max packet size won't change during the device's presence. We should store it in a variable inside rt2x00dev and use that. This should also fix a division error when the device is being hot-unplugged while a frame is being send out. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index dc640bf6b5eb..c0671c2e6e73 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1251,7 +1251,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1251} 1251}
1252 1252
1253static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, 1253static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
1254 int maxpacket, struct sk_buff *skb) 1254 struct sk_buff *skb)
1255{ 1255{
1256 int length; 1256 int length;
1257 1257
@@ -1260,7 +1260,7 @@ static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev,
1260 * but it must _not_ be a multiple of the USB packet size. 1260 * but it must _not_ be a multiple of the USB packet size.
1261 */ 1261 */
1262 length = roundup(skb->len, 4); 1262 length = roundup(skb->len, 4);
1263 length += (4 * !(length % maxpacket)); 1263 length += (4 * !(length % rt2x00dev->usb_maxpacket));
1264 1264
1265 return length; 1265 return length;
1266} 1266}