aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2011-09-08 08:34:22 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-14 13:56:53 -0400
commit183255235aadefd5a987021346e7aee2cbe721eb (patch)
tree8511999e114d7e8922b744cff5b990ea125d1578 /drivers/net
parent1ea57b1f12c045db5fca5d1299963ca1c70983ea (diff)
rt2x00: Move bssidx calculation into its own function
This will be used by a later patch. No functional changes. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c16
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c10
3 files changed, 23 insertions, 9 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index f82bfeb79ebb..d454ec8f5c6f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -1226,6 +1226,12 @@ static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
1226#endif /* CONFIG_RT2X00_LIB_DEBUGFS */ 1226#endif /* CONFIG_RT2X00_LIB_DEBUGFS */
1227 1227
1228/* 1228/*
1229 * Utility functions.
1230 */
1231u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
1232 struct ieee80211_vif *vif);
1233
1234/*
1229 * Interrupt context handlers. 1235 * Interrupt context handlers.
1230 */ 1236 */
1231void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev); 1237void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 92ff6a72a2bb..634b084a6527 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -33,6 +33,22 @@
33#include "rt2x00lib.h" 33#include "rt2x00lib.h"
34 34
35/* 35/*
36 * Utility functions.
37 */
38u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
39 struct ieee80211_vif *vif)
40{
41 /*
42 * When in STA mode, bssidx is always 0 otherwise local_address[5]
43 * contains the bss number, see BSS_ID_MASK comments for details.
44 */
45 if (rt2x00dev->intf_sta_count)
46 return 0;
47 return vif->addr[5] & (rt2x00dev->ops->max_ap_intf - 1);
48}
49EXPORT_SYMBOL_GPL(rt2x00lib_get_bssidx);
50
51/*
36 * Radio control handlers. 52 * Radio control handlers.
37 */ 53 */
38int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev) 54int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 4ccf23805973..9db9378820bf 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -504,15 +504,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
504 504
505 memset(&crypto, 0, sizeof(crypto)); 505 memset(&crypto, 0, sizeof(crypto));
506 506
507 /* 507 crypto.bssidx = rt2x00lib_get_bssidx(rt2x00dev, vif);
508 * When in STA mode, bssidx is always 0 otherwise local_address[5]
509 * contains the bss number, see BSS_ID_MASK comments for details.
510 */
511 if (rt2x00dev->intf_sta_count)
512 crypto.bssidx = 0;
513 else
514 crypto.bssidx = vif->addr[5] & (rt2x00dev->ops->max_ap_intf - 1);
515
516 crypto.cipher = rt2x00crypto_key_to_cipher(key); 508 crypto.cipher = rt2x00crypto_key_to_cipher(key);
517 if (crypto.cipher == CIPHER_NONE) 509 if (crypto.cipher == CIPHER_NONE)
518 return -EOPNOTSUPP; 510 return -EOPNOTSUPP;