diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-04-03 04:24:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-11 16:23:48 -0400 |
commit | 3edaf3e61fda3aa9ff8d38445bf92f2bec23bf63 (patch) | |
tree | 55cb71f4299d413dd8bd23caeb54304854588b1d /net/mac80211/cfg.c | |
parent | fe40cb6274988852aa5a84440d8f81c00cea4028 (diff) |
mac80211: manage AP netdev carrier state
The AP netdev is really only active when beaconing, so
manage the carrier state accordingly. Also do that for
VLAN interfaces enslaved to a given AP interface.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 42e1fb2e700f..667d93943399 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -644,6 +644,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, | |||
644 | 644 | ||
645 | ieee80211_bss_info_change_notify(sdata, changed); | 645 | ieee80211_bss_info_change_notify(sdata, changed); |
646 | 646 | ||
647 | netif_carrier_on(dev); | ||
648 | list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) | ||
649 | netif_carrier_on(vlan->dev); | ||
650 | |||
647 | return 0; | 651 | return 0; |
648 | } | 652 | } |
649 | 653 | ||
@@ -669,7 +673,7 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
669 | 673 | ||
670 | static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) | 674 | static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) |
671 | { | 675 | { |
672 | struct ieee80211_sub_if_data *sdata; | 676 | struct ieee80211_sub_if_data *sdata, *vlan; |
673 | struct beacon_data *old; | 677 | struct beacon_data *old; |
674 | 678 | ||
675 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 679 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
@@ -678,6 +682,10 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) | |||
678 | if (!old) | 682 | if (!old) |
679 | return -ENOENT; | 683 | return -ENOENT; |
680 | 684 | ||
685 | list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) | ||
686 | netif_carrier_off(vlan->dev); | ||
687 | netif_carrier_off(dev); | ||
688 | |||
681 | RCU_INIT_POINTER(sdata->u.ap.beacon, NULL); | 689 | RCU_INIT_POINTER(sdata->u.ap.beacon, NULL); |
682 | 690 | ||
683 | kfree_rcu(old, rcu_head); | 691 | kfree_rcu(old, rcu_head); |