summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath5k/base.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2008-12-18 23:23:05 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:24:02 -0500
commitfd6effcaf8a894c0a0f602b943dbc54a170d4418 (patch)
tree121c93ef571292b7a9d9e89294ba88f29c75ae3e /drivers/net/wireless/ath5k/base.c
parent520eb82076993b7f55ef9b80771d264272e5127b (diff)
ath5k: correct packet length in tx descriptors
Packet length calculation (which includes frame check sequence) should take into account whether we add a pad field or not. Extract the calculation into a helper and use it in both places. Changes to desc.c Changes-licensed-under: ISC Changes to ath5k.h, base.c Changes-licensed-under: 3-Clause-BSD Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath5k/base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index 9b5f31aab574..4af2607deec0 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1762,8 +1762,8 @@ accept:
* not try to remove padding from short control frames that do
* not have payload. */
hdrlen = ieee80211_get_hdrlen_from_skb(skb);
- padsize = hdrlen & 3;
- if (padsize && hdrlen >= 24) {
+ padsize = ath5k_pad_size(hdrlen);
+ if (padsize) {
memmove(skb->data + padsize, skb->data, hdrlen);
skb_pull(skb, padsize);
}
@@ -2638,8 +2638,8 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
* if this is not the case we add the padding after the header
*/
hdrlen = ieee80211_get_hdrlen_from_skb(skb);
- padsize = hdrlen & 3;
- if (padsize && hdrlen >= 24) {
+ padsize = ath5k_pad_size(hdrlen);
+ if (padsize) {
if (skb_headroom(skb) < padsize) {
ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough"