aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-11-05 15:49:02 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-11-05 15:49:02 -0500
commit353c78152c10027b8da5de446bad3472f977fcdc (patch)
tree8663ca32b912e8b3df428f570b7fd376aa3aa0cb /net/mac80211/mlme.c
parent01925efdf7e03b4b803b5c9f985163d687f7f017 (diff)
parentd0a361a5b3f5aa28778a0c336de5a911fc0cd678 (diff)
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Conflicts: net/wireless/reg.c
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d7bdc4b97dde..d7504ab61a34 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -958,9 +958,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
958 struct cfg80211_bss *cbss = ifmgd->associated; 958 struct cfg80211_bss *cbss = ifmgd->associated;
959 struct ieee80211_chanctx *chanctx; 959 struct ieee80211_chanctx *chanctx;
960 enum ieee80211_band current_band; 960 enum ieee80211_band current_band;
961 u8 count; 961 struct ieee80211_csa_ie csa_ie;
962 u8 mode;
963 struct cfg80211_chan_def new_chandef = {};
964 int res; 962 int res;
965 963
966 sdata_assert_lock(sdata); 964 sdata_assert_lock(sdata);
@@ -976,24 +974,24 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
976 return; 974 return;
977 975
978 current_band = cbss->channel->band; 976 current_band = cbss->channel->band;
977 memset(&csa_ie, 0, sizeof(csa_ie));
979 res = ieee80211_parse_ch_switch_ie(sdata, elems, beacon, current_band, 978 res = ieee80211_parse_ch_switch_ie(sdata, elems, beacon, current_band,
980 ifmgd->flags, 979 ifmgd->flags,
981 ifmgd->associated->bssid, &count, 980 ifmgd->associated->bssid, &csa_ie);
982 &mode, &new_chandef);
983 if (res < 0) 981 if (res < 0)
984 ieee80211_queue_work(&local->hw, 982 ieee80211_queue_work(&local->hw,
985 &ifmgd->csa_connection_drop_work); 983 &ifmgd->csa_connection_drop_work);
986 if (res) 984 if (res)
987 return; 985 return;
988 986
989 if (!cfg80211_chandef_usable(local->hw.wiphy, &new_chandef, 987 if (!cfg80211_chandef_usable(local->hw.wiphy, &csa_ie.chandef,
990 IEEE80211_CHAN_DISABLED)) { 988 IEEE80211_CHAN_DISABLED)) {
991 sdata_info(sdata, 989 sdata_info(sdata,
992 "AP %pM switches to unsupported channel (%d MHz, width:%d, CF1/2: %d/%d MHz), disconnecting\n", 990 "AP %pM switches to unsupported channel (%d MHz, width:%d, CF1/2: %d/%d MHz), disconnecting\n",
993 ifmgd->associated->bssid, 991 ifmgd->associated->bssid,
994 new_chandef.chan->center_freq, 992 csa_ie.chandef.chan->center_freq,
995 new_chandef.width, new_chandef.center_freq1, 993 csa_ie.chandef.width, csa_ie.chandef.center_freq1,
996 new_chandef.center_freq2); 994 csa_ie.chandef.center_freq2);
997 ieee80211_queue_work(&local->hw, 995 ieee80211_queue_work(&local->hw,
998 &ifmgd->csa_connection_drop_work); 996 &ifmgd->csa_connection_drop_work);
999 return; 997 return;
@@ -1037,9 +1035,9 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1037 } 1035 }
1038 mutex_unlock(&local->chanctx_mtx); 1036 mutex_unlock(&local->chanctx_mtx);
1039 1037
1040 local->csa_chandef = new_chandef; 1038 local->csa_chandef = csa_ie.chandef;
1041 1039
1042 if (mode) 1040 if (csa_ie.mode)
1043 ieee80211_stop_queues_by_reason(&local->hw, 1041 ieee80211_stop_queues_by_reason(&local->hw,
1044 IEEE80211_MAX_QUEUE_MAP, 1042 IEEE80211_MAX_QUEUE_MAP,
1045 IEEE80211_QUEUE_STOP_REASON_CSA); 1043 IEEE80211_QUEUE_STOP_REASON_CSA);
@@ -1048,9 +1046,9 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1048 /* use driver's channel switch callback */ 1046 /* use driver's channel switch callback */
1049 struct ieee80211_channel_switch ch_switch = { 1047 struct ieee80211_channel_switch ch_switch = {
1050 .timestamp = timestamp, 1048 .timestamp = timestamp,
1051 .block_tx = mode, 1049 .block_tx = csa_ie.mode,
1052 .chandef = new_chandef, 1050 .chandef = csa_ie.chandef,
1053 .count = count, 1051 .count = csa_ie.count,
1054 }; 1052 };
1055 1053
1056 drv_channel_switch(local, &ch_switch); 1054 drv_channel_switch(local, &ch_switch);
@@ -1058,11 +1056,11 @@ ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
1058 } 1056 }
1059 1057
1060 /* channel switch handled in software */ 1058 /* channel switch handled in software */
1061 if (count <= 1) 1059 if (csa_ie.count <= 1)
1062 ieee80211_queue_work(&local->hw, &ifmgd->chswitch_work); 1060 ieee80211_queue_work(&local->hw, &ifmgd->chswitch_work);
1063 else 1061 else
1064 mod_timer(&ifmgd->chswitch_timer, 1062 mod_timer(&ifmgd->chswitch_timer,
1065 TU_TO_EXP_TIME(count * cbss->beacon_interval)); 1063 TU_TO_EXP_TIME(csa_ie.count * cbss->beacon_interval));
1066} 1064}
1067 1065
1068static u32 ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata, 1066static u32 ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,
@@ -3500,7 +3498,7 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
3500 ieee80211_beacon_connection_loss_work); 3498 ieee80211_beacon_connection_loss_work);
3501 INIT_WORK(&ifmgd->csa_connection_drop_work, 3499 INIT_WORK(&ifmgd->csa_connection_drop_work,
3502 ieee80211_csa_connection_drop_work); 3500 ieee80211_csa_connection_drop_work);
3503 INIT_WORK(&ifmgd->request_smps_work, ieee80211_request_smps_work); 3501 INIT_WORK(&ifmgd->request_smps_work, ieee80211_request_smps_mgd_work);
3504 setup_timer(&ifmgd->timer, ieee80211_sta_timer, 3502 setup_timer(&ifmgd->timer, ieee80211_sta_timer,
3505 (unsigned long) sdata); 3503 (unsigned long) sdata);
3506 setup_timer(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, 3504 setup_timer(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer,