Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] Fix breakage on WEP for cards that rely on software decoding
@ 2007-08-28 22:45 Adam Baker
  2007-08-29  8:39 ` Johannes Berg
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Adam Baker @ 2007-08-28 22:45 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Ivo van Doorn, rt2400-devel

The test to drop out of ieee80211_rx_h_load_key if we don't know the IV should
check if the packet has already been decrypted, otherwise we need to load
the key to be able to decrypt it

Signed-off-by: Adam Baker <linux@baker-net.org.uk>
---

When using rt2x00 with WEP we get continuous reports of "RX WEP frame, but
no key set" without this patch. As the rt2x00 driver currently relies on
mac80211 to perform the decryption I believe it would be incorrect for the driver
to set IEEE80211_HW_WEP_INCLUDE_IV. Also reading some of the code
comments it appears that even for a card that does HW decryption there are
circumstances where the SW decryption will get used and in those cases
we need to set the key.

The patch was generated against the rt2x00 git but looks like it applies to
the current wireless-dev everything.

---
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 9c02dff..5bf7185 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -363,7 +363,8 @@ ieee80211_rx_h_load_key(struct ieee80211
 		 * we somehow allow the driver to tell us which key
 		 * the hardware used if this flag is set?
 		 */
-		if (!(rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV))
+		if ((rx->u.rx.status->flag & RX_FLAG_DECRYPTED) &&
+		    (!(rx->local->hw.flags & IEEE80211_HW_WEP_INCLUDE_IV)))
 			return TXRX_CONTINUE;
 
 		hdrlen = ieee80211_get_hdrlen(rx->fc);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-30 12:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-28 22:45 [PATCH] Fix breakage on WEP for cards that rely on software decoding Adam Baker
2007-08-29  8:39 ` Johannes Berg
2007-08-29 11:31 ` Johannes Berg
2007-08-29 12:09 ` Johannes Berg
2007-08-29 21:23   ` [Rt2400-devel] " Adam Baker
2007-08-30 12:00     ` Johannes Berg
2007-08-30 12:24       ` Robin Cornelius

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox