diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2007-10-06 08:15:46 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:55:13 -0400 |
commit | dd9fa2d21aebbb618318954867c5dfe3751328be (patch) | |
tree | 5487966881a7c4ca7061d52572d583ec4a9877d6 /drivers/net/wireless/rt2x00/rt73usb.c | |
parent | 9ee8f57e0adfd929759fee1ec6a7900ae6851bc5 (diff) |
[PATCH] rt2x00: Add get_tx_data_len callback function
The TX datalen must always be converted to a value rt73 and rt2500usb
understand. Both require to use a different size then skb->len.
First off this is required because the descriptor must be added,
but the second is because the value must be a multiple of either 2 or 4,
and it should not be a multiple of the USB packetmax
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.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 919cca593bc1..4a78ca79c94a 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -1286,6 +1286,21 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1286 | rt2x00_desc_write(txd, 0, word); | 1286 | rt2x00_desc_write(txd, 0, word); |
1287 | } | 1287 | } |
1288 | 1288 | ||
1289 | static int rt73usb_get_tx_data_len(struct rt2x00_dev *rt2x00dev, | ||
1290 | int maxpacket, struct sk_buff *skb) | ||
1291 | { | ||
1292 | int length; | ||
1293 | |||
1294 | /* | ||
1295 | * The length _must_ be a multiple of 4, | ||
1296 | * but it must _not_ be a multiple of the USB packet size. | ||
1297 | */ | ||
1298 | length = roundup(skb->len, 4); | ||
1299 | length += (4 * !(length % maxpacket)); | ||
1300 | |||
1301 | return length; | ||
1302 | } | ||
1303 | |||
1289 | /* | 1304 | /* |
1290 | * TX data initialization | 1305 | * TX data initialization |
1291 | */ | 1306 | */ |
@@ -2012,6 +2027,7 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = { | |||
2012 | .link_tuner = rt73usb_link_tuner, | 2027 | .link_tuner = rt73usb_link_tuner, |
2013 | .write_tx_desc = rt73usb_write_tx_desc, | 2028 | .write_tx_desc = rt73usb_write_tx_desc, |
2014 | .write_tx_data = rt2x00usb_write_tx_data, | 2029 | .write_tx_data = rt2x00usb_write_tx_data, |
2030 | .get_tx_data_len = rt73usb_get_tx_data_len, | ||
2015 | .kick_tx_queue = rt73usb_kick_tx_queue, | 2031 | .kick_tx_queue = rt73usb_kick_tx_queue, |
2016 | .fill_rxdone = rt73usb_fill_rxdone, | 2032 | .fill_rxdone = rt73usb_fill_rxdone, |
2017 | .config_mac_addr = rt73usb_config_mac_addr, | 2033 | .config_mac_addr = rt73usb_config_mac_addr, |