Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ath/if_ath_keycache.c
Show First 20 Lines • Show All 419 Lines • ▼ Show 20 Lines | |||||
* that the MIC key for a TKIP key at slot i is assumed by the | * that the MIC key for a TKIP key at slot i is assumed by the | ||||
* hardware to be at slot i+64. This limits TKIP keys to the first | * hardware to be at slot i+64. This limits TKIP keys to the first | ||||
* 64 entries. | * 64 entries. | ||||
*/ | */ | ||||
int | int | ||||
ath_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, | ath_key_alloc(struct ieee80211vap *vap, struct ieee80211_key *k, | ||||
ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) | ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) | ||||
{ | { | ||||
struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; | struct ath_softc *sc = vap->iv_ic->ic_softc; | ||||
/* | /* | ||||
* Group key allocation must be handled specially for | * Group key allocation must be handled specially for | ||||
* parts that do not support multicast key cache search | * parts that do not support multicast key cache search | ||||
* functionality. For those parts the key id must match | * functionality. For those parts the key id must match | ||||
* the h/w key index so lookups find the right key. On | * the h/w key index so lookups find the right key. On | ||||
* parts w/ the key search facility we install the sender's | * parts w/ the key search facility we install the sender's | ||||
* mac address (with the high bit set) and let the hardware | * mac address (with the high bit set) and let the hardware | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* | /* | ||||
* Delete an entry in the key cache allocated by ath_key_alloc. | * Delete an entry in the key cache allocated by ath_key_alloc. | ||||
*/ | */ | ||||
int | int | ||||
ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) | ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) | ||||
{ | { | ||||
struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; | struct ath_softc *sc = vap->iv_ic->ic_softc; | ||||
struct ath_hal *ah = sc->sc_ah; | struct ath_hal *ah = sc->sc_ah; | ||||
const struct ieee80211_cipher *cip = k->wk_cipher; | const struct ieee80211_cipher *cip = k->wk_cipher; | ||||
u_int keyix = k->wk_keyix; | u_int keyix = k->wk_keyix; | ||||
DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: delete key %u\n", __func__, keyix); | DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: delete key %u\n", __func__, keyix); | ||||
ATH_LOCK(sc); | ATH_LOCK(sc); | ||||
ath_power_set_power_state(sc, HAL_PM_AWAKE); | ath_power_set_power_state(sc, HAL_PM_AWAKE); | ||||
Show All 28 Lines | |||||
/* | /* | ||||
* Set the key cache contents for the specified key. Key cache | * Set the key cache contents for the specified key. Key cache | ||||
* slot(s) must already have been allocated by ath_key_alloc. | * slot(s) must already have been allocated by ath_key_alloc. | ||||
*/ | */ | ||||
int | int | ||||
ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, | ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, | ||||
const u_int8_t mac[IEEE80211_ADDR_LEN]) | const u_int8_t mac[IEEE80211_ADDR_LEN]) | ||||
{ | { | ||||
struct ath_softc *sc = vap->iv_ic->ic_ifp->if_softc; | struct ath_softc *sc = vap->iv_ic->ic_softc; | ||||
return ath_keyset(sc, vap, k, vap->iv_bss); | return ath_keyset(sc, vap, k, vap->iv_bss); | ||||
} | } |