Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135097
b: refs/heads/master
c: d216aaa
h: refs/heads/master
i:
  135095: 3579ab2
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Mar 5, 2009
1 parent 7792025 commit bd347ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aebe2b5624b9a3c00b78b1b285c43de73c81f7c5
refs/heads/master: d216aaa674feb14a4aeb56bc3708f69d81c39d45
42 changes: 16 additions & 26 deletions trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,17 +638,6 @@ static u32 ath_get_extchanmode(struct ath_softc *sc,
return chanmode;
}

static int ath_keyset(struct ath_softc *sc, u16 keyix,
struct ath9k_keyval *hk, const u8 mac[ETH_ALEN])
{
bool status;

status = ath9k_hw_set_keycache_entry(sc->sc_ah,
keyix, hk, mac);

return status != false;
}

static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key,
struct ath9k_keyval *hk, const u8 *addr,
bool authenticator)
Expand All @@ -660,40 +649,41 @@ static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key,
key_rxmic = key + NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY;

if (addr == NULL) {
/* Group key installation */
/*
* Group key installation - only two key cache entries are used
* regardless of splitmic capability since group key is only
* used either for TX or RX.
*/
if (authenticator) {
memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_mic));
} else {
memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
memcpy(hk->kv_txmic, key_rxmic, sizeof(hk->kv_mic));
}
return ath_keyset(sc, keyix, hk, addr);
return ath9k_hw_set_keycache_entry(sc->sc_ah, keyix, hk, addr);
}
if (!sc->splitmic) {
/*
* data key goes at first index,
* the hal handles the MIC keys at index+64.
*/
/* TX and RX keys share the same key cache entry. */
memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_txmic));
return ath_keyset(sc, keyix, hk, addr);
return ath9k_hw_set_keycache_entry(sc->sc_ah, keyix, hk, addr);
}
/*
* TX key goes at first index, RX key at +32.
* The hal handles the MIC keys at index+64.
*/

/* Separate key cache entries for TX and RX */

/* TX key goes at first index, RX key at +32. */
memcpy(hk->kv_mic, key_txmic, sizeof(hk->kv_mic));
if (!ath_keyset(sc, keyix, hk, NULL)) {
/* Txmic entry failed. No need to proceed further */
if (!ath9k_hw_set_keycache_entry(sc->sc_ah, keyix, hk, NULL)) {
/* TX MIC entry failed. No need to proceed further */
DPRINTF(sc, ATH_DBG_KEYCACHE,
"Setting TX MIC Key Failed\n");
return 0;
}

memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
/* XXX delete tx key on failure? */
return ath_keyset(sc, keyix + 32, hk, addr);
return ath9k_hw_set_keycache_entry(sc->sc_ah, keyix + 32, hk, addr);
}

static int ath_reserve_key_cache_slot_tkip(struct ath_softc *sc)
Expand Down Expand Up @@ -840,7 +830,7 @@ static int ath_key_config(struct ath_softc *sc,
ret = ath_setkey_tkip(sc, idx, key->key, &hk, mac,
vif->type == NL80211_IFTYPE_AP);
else
ret = ath_keyset(sc, idx, &hk, mac);
ret = ath9k_hw_set_keycache_entry(sc->sc_ah, idx, &hk, mac);

if (!ret)
return -EIO;
Expand Down

0 comments on commit bd347ff

Please sign in to comment.