From owner-svn-src-user@FreeBSD.ORG Wed Sep 21 13:19:46 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F0291065670; Wed, 21 Sep 2011 13:19:46 +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 F34EC8FC12; Wed, 21 Sep 2011 13:19:45 +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 p8LDJjln077226; Wed, 21 Sep 2011 13:19:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p8LDJjup077222; Wed, 21 Sep 2011 13:19:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109211319.p8LDJjup077222@svn.freebsd.org> From: Adrian Chadd Date: Wed, 21 Sep 2011 13:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225714 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2011 13:19:46 -0000 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