diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-09-15 09:13:13 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-16 15:46:01 -0400 |
commit | 2d2080c3c1d52e186166afc3efe5067291e618bf (patch) | |
tree | e90c4bcb6320e68cceb6a1695895cceae2e14cb3 /net | |
parent | 46a5ebaf02d69e26ee0f47a0b8d2d9bc619240d4 (diff) |
mac80211: set running state earlier
When an interface is brought up, the recent changes
to allow changing type-while-up only set the running
bit after everything was done. This broke a number
of things, including idle calculation for monitor
interfaces, and it also broke WDS station insertion
(although nobody noticed yet).
Thus, change the code to set the running bit earlier,
but keep it after the driver's add_interface was
called because otherwise drivers may iterate over
interfaces they haven't fully set up yet.
Reported-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/iface.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index c1cc200ac81f..95908aaa8a68 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -280,6 +280,8 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) | |||
280 | netif_carrier_on(dev); | 280 | netif_carrier_on(dev); |
281 | } | 281 | } |
282 | 282 | ||
283 | set_bit(SDATA_STATE_RUNNING, &sdata->state); | ||
284 | |||
283 | if (sdata->vif.type == NL80211_IFTYPE_WDS) { | 285 | if (sdata->vif.type == NL80211_IFTYPE_WDS) { |
284 | /* Create STA entry for the WDS peer */ | 286 | /* Create STA entry for the WDS peer */ |
285 | sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr, | 287 | sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr, |
@@ -331,8 +333,6 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) | |||
331 | 333 | ||
332 | netif_tx_start_all_queues(dev); | 334 | netif_tx_start_all_queues(dev); |
333 | 335 | ||
334 | set_bit(SDATA_STATE_RUNNING, &sdata->state); | ||
335 | |||
336 | return 0; | 336 | return 0; |
337 | err_del_interface: | 337 | err_del_interface: |
338 | drv_remove_interface(local, &sdata->vif); | 338 | drv_remove_interface(local, &sdata->vif); |
@@ -343,6 +343,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) | |||
343 | sdata->bss = NULL; | 343 | sdata->bss = NULL; |
344 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | 344 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
345 | list_del(&sdata->u.vlan.list); | 345 | list_del(&sdata->u.vlan.list); |
346 | clear_bit(SDATA_STATE_RUNNING, &sdata->state); | ||
346 | return res; | 347 | return res; |
347 | } | 348 | } |
348 | 349 | ||