From owner-svn-src-all@FreeBSD.ORG Tue Nov 8 19:25:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06121106564A; Tue, 8 Nov 2011 19:25:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9C078FC12; Tue, 8 Nov 2011 19:25:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA8JPq9Z045368; Tue, 8 Nov 2011 19:25:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA8JPqgY045364; Tue, 8 Nov 2011 19:25:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111081925.pA8JPqgY045364@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Nov 2011 19:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227357 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2011 19:25:53 -0000 Author: adrian Date: Tue Nov 8 19:25:52 2011 New Revision: 227357 URL: http://svn.freebsd.org/changeset/base/227357 Log: Add a 'vap' to ath_keyset(). Add some code (which is currently disabled) which modifies the group multicast key cache behaviour. I haven't yet figured out what the exact/correct behaviour is so I'm leaving it disabled. It's worth investigating and "correcting", especially for future work with mesh/ibss and encryption. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_keycache.c head/sys/dev/ath/if_ath_keycache.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Nov 8 19:18:34 2011 (r227356) +++ head/sys/dev/ath/if_ath.c Tue Nov 8 19:25:52 2011 (r227357) @@ -5165,7 +5165,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: head/sys/dev/ath/if_ath_keycache.c ============================================================================== --- head/sys/dev/ath/if_ath_keycache.c Tue Nov 8 19:18:34 2011 (r227356) +++ head/sys/dev/ath/if_ath_keycache.c Tue Nov 8 19:25:52 2011 (r227357) @@ -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,23 @@ 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) { + /* + * XXX TODO: check this: + * + * 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 0 + if ((vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_IBSS) && +#else + if ( +#endif + (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 +510,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: head/sys/dev/ath/if_ath_keycache.h ============================================================================== --- head/sys/dev/ath/if_ath_keycache.h Tue Nov 8 19:18:34 2011 (r227356) +++ head/sys/dev/ath/if_ath_keycache.h Tue Nov 8 19:25:52 2011 (r227357) @@ -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