aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-12-23 07:15:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-28 16:55:07 -0500
commit1ed32e4fc8cfc9656cc1101e7f9617d485fcbe7b (patch)
tree81697637a36eb4776df39c81a77a9e09ec951a1a /net
parent98b6218388e345064c3f2d3c161383a18274c638 (diff)
mac80211: remove struct ieee80211_if_init_conf
All its members (vif, mac_addr, type) are now available in the vif struct directly, so we can pass that instead of the conf struct. I generated this patch (except the mac80211 and header file changes) with this semantic patch: @@ identifier conf, fn, hw; type tp; @@ tp fn(struct ieee80211_hw *hw, -struct ieee80211_if_init_conf *conf) +struct ieee80211_vif *vif) { <... ( -conf->type +vif->type | -conf->mac_addr +vif->addr | -conf->vif +vif ) ...> } Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/driver-ops.h12
-rw-r--r--net/mac80211/iface.c14
-rw-r--r--net/mac80211/pm.c6
-rw-r--r--net/mac80211/util.c9
4 files changed, 12 insertions, 29 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index cbe133bcdf34..bc7c8f55487a 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -36,18 +36,18 @@ static inline void drv_stop(struct ieee80211_local *local)
36} 36}
37 37
38static inline int drv_add_interface(struct ieee80211_local *local, 38static inline int drv_add_interface(struct ieee80211_local *local,
39 struct ieee80211_if_init_conf *conf) 39 struct ieee80211_vif *vif)
40{ 40{
41 int ret = local->ops->add_interface(&local->hw, conf); 41 int ret = local->ops->add_interface(&local->hw, vif);
42 trace_drv_add_interface(local, vif_to_sdata(conf->vif), ret); 42 trace_drv_add_interface(local, vif_to_sdata(vif), ret);
43 return ret; 43 return ret;
44} 44}
45 45
46static inline void drv_remove_interface(struct ieee80211_local *local, 46static inline void drv_remove_interface(struct ieee80211_local *local,
47 struct ieee80211_if_init_conf *conf) 47 struct ieee80211_vif *vif)
48{ 48{
49 local->ops->remove_interface(&local->hw, conf); 49 local->ops->remove_interface(&local->hw, vif);
50 trace_drv_remove_interface(local, vif_to_sdata(conf->vif)); 50 trace_drv_remove_interface(local, vif_to_sdata(vif));
51} 51}
52 52
53static inline int drv_config(struct ieee80211_local *local, u32 changed) 53static inline int drv_config(struct ieee80211_local *local, u32 changed)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 7d410f15281a..00a1f4ccdaf1 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -96,7 +96,6 @@ static int ieee80211_open(struct net_device *dev)
96 struct ieee80211_sub_if_data *nsdata; 96 struct ieee80211_sub_if_data *nsdata;
97 struct ieee80211_local *local = sdata->local; 97 struct ieee80211_local *local = sdata->local;
98 struct sta_info *sta; 98 struct sta_info *sta;
99 struct ieee80211_if_init_conf conf;
100 u32 changed = 0; 99 u32 changed = 0;
101 int res; 100 int res;
102 u32 hw_reconf_flags = 0; 101 u32 hw_reconf_flags = 0;
@@ -248,10 +247,7 @@ static int ieee80211_open(struct net_device *dev)
248 ieee80211_configure_filter(local); 247 ieee80211_configure_filter(local);
249 break; 248 break;
250 default: 249 default:
251 conf.vif = &sdata->vif; 250 res = drv_add_interface(local, &sdata->vif);
252 conf.type = sdata->vif.type;
253 conf.mac_addr = sdata->vif.addr;
254 res = drv_add_interface(local, &conf);
255 if (res) 251 if (res)
256 goto err_stop; 252 goto err_stop;
257 253
@@ -334,7 +330,7 @@ static int ieee80211_open(struct net_device *dev)
334 330
335 return 0; 331 return 0;
336 err_del_interface: 332 err_del_interface:
337 drv_remove_interface(local, &conf); 333 drv_remove_interface(local, &sdata->vif);
338 err_stop: 334 err_stop:
339 if (!local->open_count) 335 if (!local->open_count)
340 drv_stop(local); 336 drv_stop(local);
@@ -349,7 +345,6 @@ static int ieee80211_stop(struct net_device *dev)
349{ 345{
350 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 346 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
351 struct ieee80211_local *local = sdata->local; 347 struct ieee80211_local *local = sdata->local;
352 struct ieee80211_if_init_conf conf;
353 struct sta_info *sta; 348 struct sta_info *sta;
354 unsigned long flags; 349 unsigned long flags;
355 struct sk_buff *skb, *tmp; 350 struct sk_buff *skb, *tmp;
@@ -533,12 +528,9 @@ static int ieee80211_stop(struct net_device *dev)
533 BSS_CHANGED_BEACON_ENABLED); 528 BSS_CHANGED_BEACON_ENABLED);
534 } 529 }
535 530
536 conf.vif = &sdata->vif;
537 conf.type = sdata->vif.type;
538 conf.mac_addr = sdata->vif.addr;
539 /* disable all keys for as long as this netdev is down */ 531 /* disable all keys for as long as this netdev is down */
540 ieee80211_disable_keys(sdata); 532 ieee80211_disable_keys(sdata);
541 drv_remove_interface(local, &conf); 533 drv_remove_interface(local, &sdata->vif);
542 } 534 }
543 535
544 sdata->bss = NULL; 536 sdata->bss = NULL;
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 913dc7e3b29e..47f818959ad7 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -10,7 +10,6 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
10{ 10{
11 struct ieee80211_local *local = hw_to_local(hw); 11 struct ieee80211_local *local = hw_to_local(hw);
12 struct ieee80211_sub_if_data *sdata; 12 struct ieee80211_sub_if_data *sdata;
13 struct ieee80211_if_init_conf conf;
14 struct sta_info *sta; 13 struct sta_info *sta;
15 unsigned long flags; 14 unsigned long flags;
16 15
@@ -100,10 +99,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
100 ieee80211_bss_info_change_notify(sdata, 99 ieee80211_bss_info_change_notify(sdata,
101 BSS_CHANGED_BEACON_ENABLED); 100 BSS_CHANGED_BEACON_ENABLED);
102 101
103 conf.vif = &sdata->vif; 102 drv_remove_interface(local, &sdata->vif);
104 conf.type = sdata->vif.type;
105 conf.mac_addr = sdata->vif.addr;
106 drv_remove_interface(local, &conf);
107 } 103 }
108 104
109 /* stop hardware - this must stop RX */ 105 /* stop hardware - this must stop RX */
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 1fdb80ff9241..4b930308b1fb 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1075,7 +1075,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1075{ 1075{
1076 struct ieee80211_hw *hw = &local->hw; 1076 struct ieee80211_hw *hw = &local->hw;
1077 struct ieee80211_sub_if_data *sdata; 1077 struct ieee80211_sub_if_data *sdata;
1078 struct ieee80211_if_init_conf conf;
1079 struct sta_info *sta; 1078 struct sta_info *sta;
1080 unsigned long flags; 1079 unsigned long flags;
1081 int res; 1080 int res;
@@ -1094,12 +1093,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1094 list_for_each_entry(sdata, &local->interfaces, list) { 1093 list_for_each_entry(sdata, &local->interfaces, list) {
1095 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && 1094 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
1096 sdata->vif.type != NL80211_IFTYPE_MONITOR && 1095 sdata->vif.type != NL80211_IFTYPE_MONITOR &&
1097 ieee80211_sdata_running(sdata)) { 1096 ieee80211_sdata_running(sdata))
1098 conf.vif = &sdata->vif; 1097 res = drv_add_interface(local, &sdata->vif);
1099 conf.type = sdata->vif.type;
1100 conf.mac_addr = sdata->vif.addr;
1101 res = drv_add_interface(local, &conf);
1102 }
1103 } 1098 }
1104 1099
1105 /* add STAs back */ 1100 /* add STAs back */