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.
This commit is contained in:
Adrian Chadd 2011-11-08 19:25:52 +00:00
parent 16d4de92f9
commit 55c7b87745
3 changed files with 23 additions and 6 deletions

View File

@ -5165,7 +5165,7 @@ ath_setup_stationkey(struct ieee80211_node *ni)
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);
}
}

View File

@ -178,7 +178,8 @@ ath_keyset_tkip(struct ath_softc *sc, const struct ieee80211_key *k,
* 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 struct ieee80211_key *k,
} 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, const struct ieee80211_key *k,
{
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);
}

View File

@ -37,7 +37,7 @@ extern int ath_key_alloc(struct ieee80211vap *, struct ieee80211_key *,
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