From 6c0284641d4c5616063664b4620468d0a8bf7aa6 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 8 Jan 2010 16:55:15 +0000 Subject: mac80211: various wds related fixes git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19076 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/mac80211/patches/560-vlan_sta_lookup.patch | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 package/mac80211/patches/560-vlan_sta_lookup.patch (limited to 'package/mac80211/patches/560-vlan_sta_lookup.patch') diff --git a/package/mac80211/patches/560-vlan_sta_lookup.patch b/package/mac80211/patches/560-vlan_sta_lookup.patch new file mode 100644 index 000000000..ad15ca974 --- /dev/null +++ b/package/mac80211/patches/560-vlan_sta_lookup.patch @@ -0,0 +1,98 @@ +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -119,6 +119,27 @@ struct sta_info *sta_info_get(struct iee + 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) + { +--- a/net/mac80211/sta_info.h ++++ b/net/mac80211/sta_info.h +@@ -408,6 +408,9 @@ static inline u32 get_sta_flags(struct s + 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, +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -148,7 +148,7 @@ static int ieee80211_add_key(struct wiph + 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; +@@ -179,7 +179,7 @@ static int ieee80211_del_key(struct wiph + 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; + +@@ -226,7 +226,7 @@ static int ieee80211_get_key(struct wiph + 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; + +@@ -419,7 +419,7 @@ static int ieee80211_get_station(struct + + 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); +@@ -775,7 +775,7 @@ static int ieee80211_del_station(struct + 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; +@@ -803,7 +803,7 @@ static int ieee80211_change_station(stru + + rcu_read_lock(); + +- sta = sta_info_get(sdata, mac); ++ sta = sta_info_get_bss(sdata, mac); + if (!sta) { + rcu_read_unlock(); + return -ENOENT; -- cgit v1.2.3