aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-10-08 02:48:38 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-09 05:30:09 -0400
commitf1d65583bc5bd43ace8abb9d4f4d9e8da407f708 (patch)
tree7c51dcf4057ab096c49700567162ceeb7458e226 /net/mac80211
parent6d027bcc8a4e2518ae825b0ff3dd069ab1abfe96 (diff)
mac80211: add post_channel_switch driver operation
As a counterpart to the pre_channel_switch operation, add a post_channel_switch operation. This allows the drivers to go back to a normal configuration after the channel switch is completed. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c7
-rw-r--r--net/mac80211/driver-ops.h16
-rw-r--r--net/mac80211/mlme.c9
-rw-r--r--net/mac80211/trace.h6
4 files changed, 37 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 647a2f6eb7dc..9d58b30b096a 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2919,7 +2919,6 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
2919 return err; 2919 return err;
2920 2920
2921 ieee80211_bss_info_change_notify(sdata, changed); 2921 ieee80211_bss_info_change_notify(sdata, changed);
2922 cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
2923 2922
2924 if (sdata->csa_block_tx) { 2923 if (sdata->csa_block_tx) {
2925 ieee80211_wake_vif_queues(local, sdata, 2924 ieee80211_wake_vif_queues(local, sdata,
@@ -2927,6 +2926,12 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
2927 sdata->csa_block_tx = false; 2926 sdata->csa_block_tx = false;
2928 } 2927 }
2929 2928
2929 err = drv_post_channel_switch(sdata);
2930 if (err)
2931 return err;
2932
2933 cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
2934
2930 return 0; 2935 return 0;
2931} 2936}
2932 2937
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 5522672129ce..0a6090644769 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1214,6 +1214,22 @@ drv_pre_channel_switch(struct ieee80211_sub_if_data *sdata,
1214 return ret; 1214 return ret;
1215} 1215}
1216 1216
1217static inline int
1218drv_post_channel_switch(struct ieee80211_sub_if_data *sdata)
1219{
1220 struct ieee80211_local *local = sdata->local;
1221 int ret = 0;
1222
1223 if (!check_sdata_in_driver(sdata))
1224 return -EIO;
1225
1226 trace_drv_post_channel_switch(local, sdata);
1227 if (local->ops->post_channel_switch)
1228 ret = local->ops->post_channel_switch(&local->hw, &sdata->vif);
1229 trace_drv_return_int(local, ret);
1230 return ret;
1231}
1232
1217static inline int drv_join_ibss(struct ieee80211_local *local, 1233static inline int drv_join_ibss(struct ieee80211_local *local,
1218 struct ieee80211_sub_if_data *sdata) 1234 struct ieee80211_sub_if_data *sdata)
1219{ 1235{
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d23d6d97e453..cb1a8c3bc73f 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1010,6 +1010,15 @@ static void ieee80211_chswitch_work(struct work_struct *work)
1010 sdata->csa_block_tx = false; 1010 sdata->csa_block_tx = false;
1011 } 1011 }
1012 1012
1013 ret = drv_post_channel_switch(sdata);
1014 if (ret) {
1015 sdata_info(sdata,
1016 "driver post channel switch failed, disconnecting\n");
1017 ieee80211_queue_work(&local->hw,
1018 &ifmgd->csa_connection_drop_work);
1019 goto out;
1020 }
1021
1013 ieee80211_sta_reset_beacon_monitor(sdata); 1022 ieee80211_sta_reset_beacon_monitor(sdata);
1014 ieee80211_sta_reset_conn_monitor(sdata); 1023 ieee80211_sta_reset_conn_monitor(sdata);
1015 1024
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 30476d2c7302..ca0e12dd23c0 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -2141,6 +2141,12 @@ TRACE_EVENT(drv_pre_channel_switch,
2141 ) 2141 )
2142); 2142);
2143 2143
2144DEFINE_EVENT(local_sdata_evt, drv_post_channel_switch,
2145 TP_PROTO(struct ieee80211_local *local,
2146 struct ieee80211_sub_if_data *sdata),
2147 TP_ARGS(local, sdata)
2148);
2149
2144 2150
2145#ifdef CONFIG_MAC80211_MESSAGE_TRACING 2151#ifdef CONFIG_MAC80211_MESSAGE_TRACING
2146#undef TRACE_SYSTEM 2152#undef TRACE_SYSTEM