summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/desc.c
diff options
context:
space:
mode:
authorBob Copeland <me@bobcopeland.com>2008-12-19 05:23:05 +0100
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 21:24:02 +0100
commitfd6effcaf8a894c0a0f602b943dbc54a170d4418 (patch)
tree121c93ef571292b7a9d9e89294ba88f29c75ae3e /drivers/net/wireless/ath5k/desc.c
parentmac80211: implement dynamic power save (diff)
downloadlinux-fd6effcaf8a894c0a0f602b943dbc54a170d4418.tar.xz
linux-fd6effcaf8a894c0a0f602b943dbc54a170d4418.zip
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/desc.c')
-rw-r--r--drivers/net/wireless/ath5k/desc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath5k/desc.c b/drivers/net/wireless/ath5k/desc.c
index 5e362a7a3620..b40a9287a39a 100644
--- a/drivers/net/wireless/ath5k/desc.c
+++ b/drivers/net/wireless/ath5k/desc.c
@@ -71,7 +71,7 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
/* Verify and set frame length */
/* remove padding we might have added before */
- frame_len = pkt_len - (hdr_len & 3) + FCS_LEN;
+ frame_len = pkt_len - ath5k_pad_size(hdr_len) + FCS_LEN;
if (frame_len & ~AR5K_2W_TX_DESC_CTL0_FRAME_LEN)
return -EINVAL;
@@ -202,7 +202,7 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah,
/* Verify and set frame length */
/* remove padding we might have added before */
- frame_len = pkt_len - (hdr_len & 3) + FCS_LEN;
+ frame_len = pkt_len - ath5k_pad_size(hdr_len) + FCS_LEN;
if (frame_len & ~AR5K_4W_TX_DESC_CTL0_FRAME_LEN)
return -EINVAL;