Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135065
b: refs/heads/master
c: 3f53dd6
h: refs/heads/master
i:
  135063: 530fc85
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Mar 5, 2009
1 parent 3bf28e2 commit 85609e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 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: 998a5a7d6aabe7e450759e0d82c8a79afd5a97ff
refs/heads/master: 3f53dd64f192450cb331c0fecfc26ca952fb242f
18 changes: 13 additions & 5 deletions trunk/drivers/net/wireless/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,8 @@ static int ath_keyset(struct ath_softc *sc, u16 keyix,
}

static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key,
struct ath9k_keyval *hk,
const u8 *addr)
struct ath9k_keyval *hk, const u8 *addr,
bool authenticator)
{
const u8 *key_rxmic;
const u8 *key_txmic;
Expand All @@ -659,7 +659,13 @@ static int ath_setkey_tkip(struct ath_softc *sc, u16 keyix, const u8 *key,

if (addr == NULL) {
/* Group key installation */
memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
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);
}
if (!sc->splitmic) {
Expand Down Expand Up @@ -769,6 +775,7 @@ static int ath_reserve_key_cache_slot(struct ath_softc *sc)
}

static int ath_key_config(struct ath_softc *sc,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
struct ieee80211_key_conf *key)
{
Expand Down Expand Up @@ -828,7 +835,8 @@ static int ath_key_config(struct ath_softc *sc,
}

if (key->alg == ALG_TKIP)
ret = ath_setkey_tkip(sc, idx, key->key, &hk, mac);
ret = ath_setkey_tkip(sc, idx, key->key, &hk, mac,
vif->type == NL80211_IFTYPE_AP);
else
ret = ath_keyset(sc, idx, &hk, mac);

Expand Down Expand Up @@ -2481,7 +2489,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw,

switch (cmd) {
case SET_KEY:
ret = ath_key_config(sc, sta, key);
ret = ath_key_config(sc, vif, sta, key);
if (ret >= 0) {
key->hw_key_idx = ret;
/* push IV and Michael MIC generation to stack */
Expand Down

0 comments on commit 85609e1

Please sign in to comment.