aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-10-19 09:44:42 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-26 06:57:06 -0400
commit1041638f2bba0f1de75e66086d50fb1251d64dcf (patch)
tree95d5ea3a83302d27887dcdc2d425682216937f3f /net/mac80211/cfg.c
parent7b20b8e8d70a0f4f18c254b42e5b157f93731e9f (diff)
mac80211: add explicit AP/GO driver operations
Depending on the driver, a lot of setup may be necessary to start operating as an AP, some of which may fail. Add an explicit AP start driver method to make such failures easier to handle, and add an AP stop driver method for symmetry. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 95bf3d5d009f..34fd3eba3090 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -922,6 +922,15 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
922 return err; 922 return err;
923 changed |= err; 923 changed |= err;
924 924
925 err = drv_start_ap(sdata->local, sdata);
926 if (err) {
927 old = rtnl_dereference(sdata->u.ap.beacon);
928 if (old)
929 kfree_rcu(old, rcu_head);
930 RCU_INIT_POINTER(sdata->u.ap.beacon, NULL);
931 return err;
932 }
933
925 ieee80211_bss_info_change_notify(sdata, changed); 934 ieee80211_bss_info_change_notify(sdata, changed);
926 935
927 netif_carrier_on(dev); 936 netif_carrier_on(dev);
@@ -979,6 +988,8 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
979 sta_info_flush(local, sdata); 988 sta_info_flush(local, sdata);
980 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED); 989 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED);
981 990
991 drv_stop_ap(sdata->local, sdata);
992
982 /* free all potentially still buffered bcast frames */ 993 /* free all potentially still buffered bcast frames */
983 local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps.bc_buf); 994 local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps.bc_buf);
984 skb_queue_purge(&sdata->u.ap.ps.bc_buf); 995 skb_queue_purge(&sdata->u.ap.ps.bc_buf);