diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-12-29 06:55:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:42 -0500 |
commit | dc822b5db479dc0178d5c04cbb656dad0b6564fb (patch) | |
tree | f06d09fb4d70830ce1489f4589cb03a491833955 /drivers/net/wireless/ath9k/main.c | |
parent | b3093664c931aa06fc50da42e25b3b6dc307a915 (diff) |
mac80211: clean up set_key callback
The set_key callback now seems rather odd, passing a MAC address
instead of a station struct, and a local address instead of a
vif struct. Change that.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Bob Copeland <me@bobcopeland.com> [ath5k]
Acked-by: Ivo van Doorn <ivdoorn@gmail.com> [rt2x00]
Acked-by: Christian Lamparter <chunkeey@web.de> [p54]
Tested-by: Kalle Valo <kalle.valo@nokia.com> [iwl3945]
Tested-by: Samuel Ortiz <samuel@sortiz.org> [iwl3945]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 5cbda9245560..a4046a97c016 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -794,7 +794,7 @@ static int ath_reserve_key_cache_slot(struct ath_softc *sc) | |||
794 | } | 794 | } |
795 | 795 | ||
796 | static int ath_key_config(struct ath_softc *sc, | 796 | static int ath_key_config(struct ath_softc *sc, |
797 | const u8 *addr, | 797 | struct ieee80211_sta *sta, |
798 | struct ieee80211_key_conf *key) | 798 | struct ieee80211_key_conf *key) |
799 | { | 799 | { |
800 | struct ath9k_keyval hk; | 800 | struct ath9k_keyval hk; |
@@ -828,7 +828,10 @@ static int ath_key_config(struct ath_softc *sc, | |||
828 | } else if (key->keyidx) { | 828 | } else if (key->keyidx) { |
829 | struct ieee80211_vif *vif; | 829 | struct ieee80211_vif *vif; |
830 | 830 | ||
831 | mac = addr; | 831 | if (WARN_ON(!sta)) |
832 | return -EOPNOTSUPP; | ||
833 | mac = sta->addr; | ||
834 | |||
832 | vif = sc->sc_vaps[0]; | 835 | vif = sc->sc_vaps[0]; |
833 | if (vif->type != NL80211_IFTYPE_AP) { | 836 | if (vif->type != NL80211_IFTYPE_AP) { |
834 | /* Only keyidx 0 should be used with unicast key, but | 837 | /* Only keyidx 0 should be used with unicast key, but |
@@ -837,7 +840,10 @@ static int ath_key_config(struct ath_softc *sc, | |||
837 | } else | 840 | } else |
838 | return -EIO; | 841 | return -EIO; |
839 | } else { | 842 | } else { |
840 | mac = addr; | 843 | if (WARN_ON(!sta)) |
844 | return -EOPNOTSUPP; | ||
845 | mac = sta->addr; | ||
846 | |||
841 | if (key->alg == ALG_TKIP) | 847 | if (key->alg == ALG_TKIP) |
842 | idx = ath_reserve_key_cache_slot_tkip(sc); | 848 | idx = ath_reserve_key_cache_slot_tkip(sc); |
843 | else | 849 | else |
@@ -2320,8 +2326,8 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, | |||
2320 | 2326 | ||
2321 | static int ath9k_set_key(struct ieee80211_hw *hw, | 2327 | static int ath9k_set_key(struct ieee80211_hw *hw, |
2322 | enum set_key_cmd cmd, | 2328 | enum set_key_cmd cmd, |
2323 | const u8 *local_addr, | 2329 | struct ieee80211_vif *vif, |
2324 | const u8 *addr, | 2330 | struct ieee80211_sta *sta, |
2325 | struct ieee80211_key_conf *key) | 2331 | struct ieee80211_key_conf *key) |
2326 | { | 2332 | { |
2327 | struct ath_softc *sc = hw->priv; | 2333 | struct ath_softc *sc = hw->priv; |
@@ -2331,7 +2337,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw, | |||
2331 | 2337 | ||
2332 | switch (cmd) { | 2338 | switch (cmd) { |
2333 | case SET_KEY: | 2339 | case SET_KEY: |
2334 | ret = ath_key_config(sc, addr, key); | 2340 | ret = ath_key_config(sc, sta, key); |
2335 | if (ret >= 0) { | 2341 | if (ret >= 0) { |
2336 | key->hw_key_idx = ret; | 2342 | key->hw_key_idx = ret; |
2337 | /* push IV and Michael MIC generation to stack */ | 2343 | /* push IV and Michael MIC generation to stack */ |