aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath5k/base.c
diff options
context:
space:
mode:
authorBruno Randolf <bruno@thinktube.com>2008-02-05 04:44:55 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-02-15 13:44:17 -0500
commit281c56dd276e587a7b4a65764ac68ae250e73235 (patch)
treeeead674f8740656d386465cc9dcef7feb867f9ff /drivers/net/wireless/ath5k/base.c
parentbd196ec7f03fff6935f66a9a3cf27accd34a75b9 (diff)
ath5k: correct padding in tx descriptors
when setting up the tx descriptors for the hardware we must account for any padding between the header and the data we might have added previously. frame len is the length of the frame in the air (including FCS but no padding) and buffer len is the length of the buffer (including padding, but without FCS). changing the way ah_setup_tx_desc is called: now excluding the FCS, since it's easier to add that in the function where we need it. before this fix we sent trailing zero bytes after the packet (because frame len included the padding) which was not a big problem without WEP, but with WEP this resultes in a wrong WEP checksum and the packet is discarded - which is how i noticed at all ;) an easy way to run into header padding problems, btw, is to connect to a QoS (WME) enabled access point (eg. madwifi) - QoS data frames are 2 byte longer and will require padding. this patch applies on top of luis latest patch series from 04.02.2008. drivers/net/wireless/ath5k/base.c: Changes-licensed-under: 3-Clause-BSD drivers/net/wireless/ath5k/hw.c: Changes-licensed-under: ISC Signed-off-by: Bruno Randolf <bruno@thinktube.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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index ddc87149fe3..dfdaec02073 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -1256,7 +1256,7 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
1256 if (ctl->flags & IEEE80211_TXCTL_NO_ACK) 1256 if (ctl->flags & IEEE80211_TXCTL_NO_ACK)
1257 flags |= AR5K_TXDESC_NOACK; 1257 flags |= AR5K_TXDESC_NOACK;
1258 1258
1259 pktlen = skb->len + FCS_LEN; 1259 pktlen = skb->len;
1260 1260
1261 if (!(ctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) { 1261 if (!(ctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) {
1262 keyidx = ctl->key_idx; 1262 keyidx = ctl->key_idx;
@@ -1952,7 +1952,7 @@ ath5k_beacon_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
1952 } 1952 }
1953 1953
1954 ds->ds_data = bf->skbaddr; 1954 ds->ds_data = bf->skbaddr;
1955 ret = ah->ah_setup_tx_desc(ah, ds, skb->len + FCS_LEN, 1955 ret = ah->ah_setup_tx_desc(ah, ds, skb->len,
1956 ieee80211_get_hdrlen_from_skb(skb), 1956 ieee80211_get_hdrlen_from_skb(skb),
1957 AR5K_PKT_TYPE_BEACON, (ctl->power_level * 2), ctl->tx_rate, 1, 1957 AR5K_PKT_TYPE_BEACON, (ctl->power_level * 2), ctl->tx_rate, 1,
1958 AR5K_TXKEYIX_INVALID, antenna, flags, 0, 0); 1958 AR5K_TXKEYIX_INVALID, antenna, flags, 0, 0);