aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-11-25 11:46:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-21 18:38:51 -0500
commitabe60632f311d515b082b450504ee24006023951 (patch)
treea51fc3b135fa8a31cc0d7953be43502ecc6433c6 /net/mac80211/cfg.c
parent15920d8afc87861672e16fa95ae2764b065d6dd3 (diff)
mac80211: make station management completely depend on vif
The station management currently uses the virtual interface, but you cannot add the same station to multiple virtual interfaces if you're communicating with it in multiple ways. This restriction should be lifted so that in the future we can, for instance, support bluetooth 3 with an access point that mac80211 is already associated to. We can do that by requiring all sta_info_get users to provide the virtual interface and making the RX code aware that an address may match more than one station struct. Thanks to the previous patches this one isn't all that large and except for the RX and TX status paths changes has low complexity. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 93ee1fd5c08..14e1f4015a7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -150,7 +150,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
150 rcu_read_lock(); 150 rcu_read_lock();
151 151
152 if (mac_addr) { 152 if (mac_addr) {
153 sta = sta_info_get(sdata->local, mac_addr); 153 sta = sta_info_get(sdata, mac_addr);
154 if (!sta) { 154 if (!sta) {
155 ieee80211_key_free(key); 155 ieee80211_key_free(key);
156 err = -ENOENT; 156 err = -ENOENT;
@@ -181,7 +181,7 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
181 if (mac_addr) { 181 if (mac_addr) {
182 ret = -ENOENT; 182 ret = -ENOENT;
183 183
184 sta = sta_info_get(sdata->local, mac_addr); 184 sta = sta_info_get(sdata, mac_addr);
185 if (!sta) 185 if (!sta)
186 goto out_unlock; 186 goto out_unlock;
187 187
@@ -228,7 +228,7 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
228 rcu_read_lock(); 228 rcu_read_lock();
229 229
230 if (mac_addr) { 230 if (mac_addr) {
231 sta = sta_info_get(sdata->local, mac_addr); 231 sta = sta_info_get(sdata, mac_addr);
232 if (!sta) 232 if (!sta)
233 goto out; 233 goto out;
234 234
@@ -414,15 +414,13 @@ static int ieee80211_dump_station(struct wiphy *wiphy, struct net_device *dev,
414static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev, 414static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
415 u8 *mac, struct station_info *sinfo) 415 u8 *mac, struct station_info *sinfo)
416{ 416{
417 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 417 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
418 struct sta_info *sta; 418 struct sta_info *sta;
419 int ret = -ENOENT; 419 int ret = -ENOENT;
420 420
421 rcu_read_lock(); 421 rcu_read_lock();
422 422
423 /* XXX: verify sta->dev == dev */ 423 sta = sta_info_get(sdata, mac);
424
425 sta = sta_info_get(local, mac);
426 if (sta) { 424 if (sta) {
427 ret = 0; 425 ret = 0;
428 sta_set_sinfo(sta, sinfo); 426 sta_set_sinfo(sta, sinfo);
@@ -778,8 +776,7 @@ static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev,
778 if (mac) { 776 if (mac) {
779 rcu_read_lock(); 777 rcu_read_lock();
780 778
781 /* XXX: get sta belonging to dev */ 779 sta = sta_info_get(sdata, mac);
782 sta = sta_info_get(local, mac);
783 if (!sta) { 780 if (!sta) {
784 rcu_read_unlock(); 781 rcu_read_unlock();
785 return -ENOENT; 782 return -ENOENT;
@@ -800,14 +797,14 @@ static int ieee80211_change_station(struct wiphy *wiphy,
800 u8 *mac, 797 u8 *mac,
801 struct station_parameters *params) 798 struct station_parameters *params)
802{ 799{
800 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
803 struct ieee80211_local *local = wiphy_priv(wiphy); 801 struct ieee80211_local *local = wiphy_priv(wiphy);
804 struct sta_info *sta; 802 struct sta_info *sta;
805 struct ieee80211_sub_if_data *vlansdata; 803 struct ieee80211_sub_if_data *vlansdata;
806 804
807 rcu_read_lock(); 805 rcu_read_lock();
808 806
809 /* XXX: get sta belonging to dev */ 807 sta = sta_info_get(sdata, mac);
810 sta = sta_info_get(local, mac);
811 if (!sta) { 808 if (!sta) {
812 rcu_read_unlock(); 809 rcu_read_unlock();
813 return -ENOENT; 810 return -ENOENT;
@@ -846,7 +843,6 @@ static int ieee80211_change_station(struct wiphy *wiphy,
846static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev, 843static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
847 u8 *dst, u8 *next_hop) 844 u8 *dst, u8 *next_hop)
848{ 845{
849 struct ieee80211_local *local = wiphy_priv(wiphy);
850 struct ieee80211_sub_if_data *sdata; 846 struct ieee80211_sub_if_data *sdata;
851 struct mesh_path *mpath; 847 struct mesh_path *mpath;
852 struct sta_info *sta; 848 struct sta_info *sta;
@@ -855,7 +851,7 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
855 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 851 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
856 852
857 rcu_read_lock(); 853 rcu_read_lock();
858 sta = sta_info_get(local, next_hop); 854 sta = sta_info_get(sdata, next_hop);
859 if (!sta) { 855 if (!sta) {
860 rcu_read_unlock(); 856 rcu_read_unlock();
861 return -ENOENT; 857 return -ENOENT;
@@ -894,7 +890,6 @@ static int ieee80211_change_mpath(struct wiphy *wiphy,
894 struct net_device *dev, 890 struct net_device *dev,
895 u8 *dst, u8 *next_hop) 891 u8 *dst, u8 *next_hop)
896{ 892{
897 struct ieee80211_local *local = wiphy_priv(wiphy);
898 struct ieee80211_sub_if_data *sdata; 893 struct ieee80211_sub_if_data *sdata;
899 struct mesh_path *mpath; 894 struct mesh_path *mpath;
900 struct sta_info *sta; 895 struct sta_info *sta;
@@ -903,7 +898,7 @@ static int ieee80211_change_mpath(struct wiphy *wiphy,
903 898
904 rcu_read_lock(); 899 rcu_read_lock();
905 900
906 sta = sta_info_get(local, next_hop); 901 sta = sta_info_get(sdata, next_hop);
907 if (!sta) { 902 if (!sta) {
908 rcu_read_unlock(); 903 rcu_read_unlock();
909 return -ENOENT; 904 return -ENOENT;