Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183601
b: refs/heads/master
c: 0e5ded5
h: refs/heads/master
i:
  183599: d8d0325
v: v3
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Jan 12, 2010
1 parent 5413625 commit 4c084a4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 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: d524215f6cad245249df8def19125ae6fd0bcc9b
refs/heads/master: 0e5ded5a87c097760abd68521b86f1025dedc7d7
12 changes: 6 additions & 6 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
rcu_read_lock();

if (mac_addr) {
sta = sta_info_get(sdata, mac_addr);
sta = sta_info_get_bss(sdata, mac_addr);
if (!sta) {
ieee80211_key_free(key);
err = -ENOENT;
Expand Down Expand Up @@ -179,7 +179,7 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
if (mac_addr) {
ret = -ENOENT;

sta = sta_info_get(sdata, mac_addr);
sta = sta_info_get_bss(sdata, mac_addr);
if (!sta)
goto out_unlock;

Expand Down Expand Up @@ -226,7 +226,7 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
rcu_read_lock();

if (mac_addr) {
sta = sta_info_get(sdata, mac_addr);
sta = sta_info_get_bss(sdata, mac_addr);
if (!sta)
goto out;

Expand Down Expand Up @@ -419,7 +419,7 @@ static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,

rcu_read_lock();

sta = sta_info_get(sdata, mac);
sta = sta_info_get_bss(sdata, mac);
if (sta) {
ret = 0;
sta_set_sinfo(sta, sinfo);
Expand Down Expand Up @@ -775,7 +775,7 @@ static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev,
if (mac) {
rcu_read_lock();

sta = sta_info_get(sdata, mac);
sta = sta_info_get_bss(sdata, mac);
if (!sta) {
rcu_read_unlock();
return -ENOENT;
Expand Down Expand Up @@ -803,7 +803,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,

rcu_read_lock();

sta = sta_info_get(sdata, mac);
sta = sta_info_get_bss(sdata, mac);
if (!sta) {
rcu_read_unlock();
return -ENOENT;
Expand Down
21 changes: 21 additions & 0 deletions trunk/net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,27 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
return sta;
}

/*
* Get sta info either from the specified interface
* or from one of its vlans
*/
struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
const u8 *addr)
{
struct ieee80211_local *local = sdata->local;
struct sta_info *sta;

sta = rcu_dereference(local->sta_hash[STA_HASH(addr)]);
while (sta) {
if ((sta->sdata == sdata ||
sta->sdata->bss == sdata->bss) &&
memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
break;
sta = rcu_dereference(sta->hnext);
}
return sta;
}

struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,
int idx)
{
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/mac80211/sta_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ static inline u32 get_sta_flags(struct sta_info *sta)
struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
const u8 *addr);

struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
const u8 *addr);

static inline
void for_each_sta_info_type_check(struct ieee80211_local *local,
const u8 *addr,
Expand Down

0 comments on commit 4c084a4

Please sign in to comment.