Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266041
b: refs/heads/master
c: 1832552
h: refs/heads/master
i:
  266039: bbac5f0
v: v3
  • Loading branch information
Helmut Schaa authored and John W. Linville committed Sep 14, 2011
1 parent 2186ab5 commit 3a22551
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 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: 1ea57b1f12c045db5fca5d1299963ca1c70983ea
refs/heads/master: 183255235aadefd5a987021346e7aee2cbe721eb
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,12 @@ static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
}
#endif /* CONFIG_RT2X00_LIB_DEBUGFS */

/*
* Utility functions.
*/
u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
struct ieee80211_vif *vif);

/*
* Interrupt context handlers.
*/
Expand Down
16 changes: 16 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
#include "rt2x00.h"
#include "rt2x00lib.h"

/*
* Utility functions.
*/
u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
struct ieee80211_vif *vif)
{
/*
* When in STA mode, bssidx is always 0 otherwise local_address[5]
* contains the bss number, see BSS_ID_MASK comments for details.
*/
if (rt2x00dev->intf_sta_count)
return 0;
return vif->addr[5] & (rt2x00dev->ops->max_ap_intf - 1);
}
EXPORT_SYMBOL_GPL(rt2x00lib_get_bssidx);

/*
* Radio control handlers.
*/
Expand Down
10 changes: 1 addition & 9 deletions trunk/drivers/net/wireless/rt2x00/rt2x00mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,

memset(&crypto, 0, sizeof(crypto));

/*
* When in STA mode, bssidx is always 0 otherwise local_address[5]
* contains the bss number, see BSS_ID_MASK comments for details.
*/
if (rt2x00dev->intf_sta_count)
crypto.bssidx = 0;
else
crypto.bssidx = vif->addr[5] & (rt2x00dev->ops->max_ap_intf - 1);

crypto.bssidx = rt2x00lib_get_bssidx(rt2x00dev, vif);
crypto.cipher = rt2x00crypto_key_to_cipher(key);
if (crypto.cipher == CIPHER_NONE)
return -EOPNOTSUPP;
Expand Down

0 comments on commit 3a22551

Please sign in to comment.