Johannes Berg a écrit :
On Thu, 2008-12-11 at 14:08 -0800, Harvey Harrison wrote:
On Thu, 2008-12-11 at 22:58 +0100, Benoit PAPILLAULT wrote:
Padding the 802.11 header to a multiple of 4 bytes needs to be done only
for DATA frames. This fixes a bug where 2 bytes were missing in monitor
mode for ACK frames.
Without commenting on whether or not this is needed
/*
@@ -2623,6 +2629,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
unsigned long flags;
int hdrlen;
int pad;
+ const struct ieee80211_hdr * hdr = (const struct ieee80211_hdr *)skb;
skb->data perhaps.
For sure, there's a second place like that too.
johannes
Nice catch! I wonder how it was working in my preliminary tests. Sorry
for the duplicates with the same patch for ath9k. The padding/unpadding
stuff is needed by the hardware, ie the hardware insert padding on RX
and expect padding on TX, as mentioned in earlier ath5k and madwifi
source code.
According to my tests, there are 4 kinds of frames:
- Management
- Control
- Data (including QoS data)
- Invalid
Management frames have a fixed header of 24 bytes, so are already a
multiple of 4. Control frames are either 10 (ACK!) or 16 bytes and it's
clear that none of them needs padding (hence the current bug). Data
frames can be 24, 26, 30 or 32 bytes so it clearly needs some
padding/unpadding in some cases. At last, we don't care about Invalid frame.
The ath9k patch does padding/unpadding for hdrlen >= 24, which appears
to be equivalent and simpler to compute. I will rewrite the patch using
the ath9k formula.
Regards,
Benoit
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html