svn commit: r225714 - user/adrian/if_ath_tx/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Wed Sep 21 13:19:46 UTC 2011


Author: adrian
Date: Wed Sep 21 13:19:45 2011
New Revision: 225714
URL: http://svn.freebsd.org/changeset/base/225714

Log:
  Don't use the multicast key search key method in STA mode - just
  use it in adhoc/hostap mode for now.
  
  Obtained from:	Atheros, Linux ath9k

Modified:
  user/adrian/if_ath_tx/sys/dev/ath/if_ath.c
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_keycache.c
  user/adrian/if_ath_tx/sys/dev/ath/if_ath_keycache.h

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c	Wed Sep 21 13:15:18 2011	(r225713)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c	Wed Sep 21 13:19:45 2011	(r225714)
@@ -5322,7 +5322,7 @@ ath_setup_stationkey(struct ieee80211_no
 		ni->ni_ucastkey.wk_flags |= IEEE80211_KEY_DEVKEY;
 		IEEE80211_ADDR_COPY(ni->ni_ucastkey.wk_macaddr, ni->ni_macaddr);
 		/* NB: this will create a pass-thru key entry */
-		ath_keyset(sc, &ni->ni_ucastkey, vap->iv_bss);
+		ath_keyset(sc, vap, &ni->ni_ucastkey, vap->iv_bss);
 	}
 }
 

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_keycache.c
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_keycache.c	Wed Sep 21 13:15:18 2011	(r225713)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_keycache.c	Wed Sep 21 13:19:45 2011	(r225714)
@@ -178,7 +178,8 @@ ath_keyset_tkip(struct ath_softc *sc, co
  * cache slots for TKIP with hardware MIC support.
  */
 int
-ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k,
+ath_keyset(struct ath_softc *sc, struct ieee80211vap *vap,
+	const struct ieee80211_key *k,
 	struct ieee80211_node *bss)
 {
 #define	N(a)	(sizeof(a)/sizeof(a[0]))
@@ -212,7 +213,17 @@ ath_keyset(struct ath_softc *sc, const s
 	} else
 		hk.kv_type = HAL_CIPHER_CLR;
 
-	if ((k->wk_flags & IEEE80211_KEY_GROUP) && sc->sc_mcastkey) {
+	/*
+	 * Group keys on hardware that supports multicast frame
+	 * key search should only be done in adhoc/hostap mode,
+	 * not STA mode.
+	 *
+	 * XXX TODO: what about mesh, tdma?
+	 */
+	if ((vap->iv_opmode == IEEE80211_M_HOSTAP ||
+	     vap->iv_opmode == IEEE80211_M_IBSS) &&
+	    (k->wk_flags & IEEE80211_KEY_GROUP) &&
+	    sc->sc_mcastkey) {
 		/*
 		 * Group keys on hardware that supports multicast frame
 		 * key search use a MAC that is the sender's address with
@@ -493,5 +504,5 @@ ath_key_set(struct ieee80211vap *vap, co
 {
 	struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc;
 
-	return ath_keyset(sc, k, vap->iv_bss);
+	return ath_keyset(sc, vap, k, vap->iv_bss);
 }

Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_keycache.h
==============================================================================
--- user/adrian/if_ath_tx/sys/dev/ath/if_ath_keycache.h	Wed Sep 21 13:15:18 2011	(r225713)
+++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_keycache.h	Wed Sep 21 13:19:45 2011	(r225714)
@@ -37,7 +37,7 @@ extern int ath_key_alloc(struct ieee8021
 extern int ath_key_delete(struct ieee80211vap *, const struct ieee80211_key *);
 extern int ath_key_set(struct ieee80211vap *, const struct ieee80211_key *,
     const u_int8_t mac[IEEE80211_ADDR_LEN]);
-extern int ath_keyset(struct ath_softc *sc, const struct ieee80211_key *k,
-    struct ieee80211_node *bss);
+extern int ath_keyset(struct ath_softc *sc, struct ieee80211vap *vap,
+    const struct ieee80211_key *k, struct ieee80211_node *bss);
 
 #endif


More information about the svn-src-user mailing list