diff options
author | Bob Copeland <me@bobcopeland.com> | 2008-12-18 23:23:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-19 15:24:02 -0500 |
commit | fd6effcaf8a894c0a0f602b943dbc54a170d4418 (patch) | |
tree | 121c93ef571292b7a9d9e89294ba88f29c75ae3e /drivers/net/wireless/ath5k/base.c | |
parent | 520eb82076993b7f55ef9b80771d264272e5127b (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.c | 8 |
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: | |||
1762 | * not try to remove padding from short control frames that do | 1762 | * not try to remove padding from short control frames that do |
1763 | * not have payload. */ | 1763 | * not have payload. */ |
1764 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 1764 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
1765 | padsize = hdrlen & 3; | 1765 | padsize = ath5k_pad_size(hdrlen); |
1766 | if (padsize && hdrlen >= 24) { | 1766 | if (padsize) { |
1767 | memmove(skb->data + padsize, skb->data, hdrlen); | 1767 | memmove(skb->data + padsize, skb->data, hdrlen); |
1768 | skb_pull(skb, padsize); | 1768 | skb_pull(skb, padsize); |
1769 | } | 1769 | } |
@@ -2638,8 +2638,8 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2638 | * if this is not the case we add the padding after the header | 2638 | * if this is not the case we add the padding after the header |
2639 | */ | 2639 | */ |
2640 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 2640 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
2641 | padsize = hdrlen & 3; | 2641 | padsize = ath5k_pad_size(hdrlen); |
2642 | if (padsize && hdrlen >= 24) { | 2642 | if (padsize) { |
2643 | 2643 | ||
2644 | if (skb_headroom(skb) < padsize) { | 2644 | if (skb_headroom(skb) < padsize) { |
2645 | ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough" | 2645 | ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough" |