diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-06-17 11:43:56 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:30 -0400 |
commit | 3b8d81e020f77c9da8b85b0685c8cd2ca7c7b150 (patch) | |
tree | a19fcddbf28fecdbd13ad009fe07b8afc5e95c90 /net/mac80211/iface.c | |
parent | c4029083e2acb82229c43b791c07afb089d972ff (diff) |
mac80211: remove master netdev
With the internal 'pending' queue system in place, we can simply
put packets there instead of pushing them off to the master dev,
getting rid of the master interface completely.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r-- | net/mac80211/iface.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 090aa5a47182..2f797a86ced5 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -190,10 +190,6 @@ static int ieee80211_open(struct net_device *dev) | |||
190 | ETH_ALEN); | 190 | ETH_ALEN); |
191 | } | 191 | } |
192 | 192 | ||
193 | if (compare_ether_addr(null_addr, local->mdev->dev_addr) == 0) | ||
194 | memcpy(local->mdev->dev_addr, local->hw.wiphy->perm_addr, | ||
195 | ETH_ALEN); | ||
196 | |||
197 | /* | 193 | /* |
198 | * Validate the MAC address for this device. | 194 | * Validate the MAC address for this device. |
199 | */ | 195 | */ |
@@ -229,9 +225,9 @@ static int ieee80211_open(struct net_device *dev) | |||
229 | if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS) | 225 | if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS) |
230 | local->fif_other_bss++; | 226 | local->fif_other_bss++; |
231 | 227 | ||
232 | netif_addr_lock_bh(local->mdev); | 228 | spin_lock_bh(&local->filter_lock); |
233 | ieee80211_configure_filter(local); | 229 | ieee80211_configure_filter(local); |
234 | netif_addr_unlock_bh(local->mdev); | 230 | spin_unlock_bh(&local->filter_lock); |
235 | break; | 231 | break; |
236 | default: | 232 | default: |
237 | conf.vif = &sdata->vif; | 233 | conf.vif = &sdata->vif; |
@@ -243,9 +239,9 @@ static int ieee80211_open(struct net_device *dev) | |||
243 | 239 | ||
244 | if (ieee80211_vif_is_mesh(&sdata->vif)) { | 240 | if (ieee80211_vif_is_mesh(&sdata->vif)) { |
245 | local->fif_other_bss++; | 241 | local->fif_other_bss++; |
246 | netif_addr_lock_bh(local->mdev); | 242 | spin_lock_bh(&local->filter_lock); |
247 | ieee80211_configure_filter(local); | 243 | ieee80211_configure_filter(local); |
248 | netif_addr_unlock_bh(local->mdev); | 244 | spin_unlock_bh(&local->filter_lock); |
249 | 245 | ||
250 | ieee80211_start_mesh(sdata); | 246 | ieee80211_start_mesh(sdata); |
251 | } | 247 | } |
@@ -279,10 +275,6 @@ static int ieee80211_open(struct net_device *dev) | |||
279 | } | 275 | } |
280 | 276 | ||
281 | if (local->open_count == 0) { | 277 | if (local->open_count == 0) { |
282 | res = dev_open(local->mdev); | ||
283 | WARN_ON(res); | ||
284 | if (res) | ||
285 | goto err_del_interface; | ||
286 | tasklet_enable(&local->tx_pending_tasklet); | 278 | tasklet_enable(&local->tx_pending_tasklet); |
287 | tasklet_enable(&local->tasklet); | 279 | tasklet_enable(&local->tasklet); |
288 | } | 280 | } |
@@ -393,7 +385,14 @@ static int ieee80211_stop(struct net_device *dev) | |||
393 | if (sdata->flags & IEEE80211_SDATA_PROMISC) | 385 | if (sdata->flags & IEEE80211_SDATA_PROMISC) |
394 | atomic_dec(&local->iff_promiscs); | 386 | atomic_dec(&local->iff_promiscs); |
395 | 387 | ||
396 | dev_mc_unsync(local->mdev, dev); | 388 | netif_addr_lock_bh(dev); |
389 | spin_lock_bh(&local->filter_lock); | ||
390 | __dev_addr_unsync(&local->mc_list, &local->mc_count, | ||
391 | &dev->mc_list, &dev->mc_count); | ||
392 | ieee80211_configure_filter(local); | ||
393 | spin_unlock_bh(&local->filter_lock); | ||
394 | netif_addr_unlock_bh(dev); | ||
395 | |||
397 | del_timer_sync(&local->dynamic_ps_timer); | 396 | del_timer_sync(&local->dynamic_ps_timer); |
398 | cancel_work_sync(&local->dynamic_ps_enable_work); | 397 | cancel_work_sync(&local->dynamic_ps_enable_work); |
399 | 398 | ||
@@ -442,9 +441,9 @@ static int ieee80211_stop(struct net_device *dev) | |||
442 | if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS) | 441 | if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS) |
443 | local->fif_other_bss--; | 442 | local->fif_other_bss--; |
444 | 443 | ||
445 | netif_addr_lock_bh(local->mdev); | 444 | spin_lock_bh(&local->filter_lock); |
446 | ieee80211_configure_filter(local); | 445 | ieee80211_configure_filter(local); |
447 | netif_addr_unlock_bh(local->mdev); | 446 | spin_unlock_bh(&local->filter_lock); |
448 | break; | 447 | break; |
449 | case NL80211_IFTYPE_STATION: | 448 | case NL80211_IFTYPE_STATION: |
450 | del_timer_sync(&sdata->u.mgd.chswitch_timer); | 449 | del_timer_sync(&sdata->u.mgd.chswitch_timer); |
@@ -487,9 +486,9 @@ static int ieee80211_stop(struct net_device *dev) | |||
487 | local->fif_other_bss--; | 486 | local->fif_other_bss--; |
488 | atomic_dec(&local->iff_allmultis); | 487 | atomic_dec(&local->iff_allmultis); |
489 | 488 | ||
490 | netif_addr_lock_bh(local->mdev); | 489 | spin_lock_bh(&local->filter_lock); |
491 | ieee80211_configure_filter(local); | 490 | ieee80211_configure_filter(local); |
492 | netif_addr_unlock_bh(local->mdev); | 491 | spin_unlock_bh(&local->filter_lock); |
493 | 492 | ||
494 | ieee80211_stop_mesh(sdata); | 493 | ieee80211_stop_mesh(sdata); |
495 | } | 494 | } |
@@ -535,9 +534,6 @@ static int ieee80211_stop(struct net_device *dev) | |||
535 | ieee80211_recalc_ps(local, -1); | 534 | ieee80211_recalc_ps(local, -1); |
536 | 535 | ||
537 | if (local->open_count == 0) { | 536 | if (local->open_count == 0) { |
538 | if (netif_running(local->mdev)) | ||
539 | dev_close(local->mdev); | ||
540 | |||
541 | drv_stop(local); | 537 | drv_stop(local); |
542 | 538 | ||
543 | ieee80211_led_radio(local, false); | 539 | ieee80211_led_radio(local, false); |
@@ -584,8 +580,11 @@ static void ieee80211_set_multicast_list(struct net_device *dev) | |||
584 | atomic_dec(&local->iff_promiscs); | 580 | atomic_dec(&local->iff_promiscs); |
585 | sdata->flags ^= IEEE80211_SDATA_PROMISC; | 581 | sdata->flags ^= IEEE80211_SDATA_PROMISC; |
586 | } | 582 | } |
587 | 583 | spin_lock_bh(&local->filter_lock); | |
588 | dev_mc_sync(local->mdev, dev); | 584 | __dev_addr_sync(&local->mc_list, &local->mc_count, |
585 | &dev->mc_list, &dev->mc_count); | ||
586 | ieee80211_configure_filter(local); | ||
587 | spin_unlock_bh(&local->filter_lock); | ||
589 | } | 588 | } |
590 | 589 | ||
591 | /* | 590 | /* |