aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-03-09 07:12:35 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-03-12 14:19:38 -0400
commit3cc5240b5e036abb565c8ac7cffdcceb06a13517 (patch)
tree1c4cb69866792f9ac9b856e59949b9aa77da2bdb /net
parent177958e9679c23537411066cc41b205635dacb14 (diff)
mac80211: set channel back after disassociating
As we've discussed, we want to avoid channel changes while associated. While the part when we actually associate needs a bit more work, the bit that happens on disassociating can be changed quite easily. Move the channel type change later in the disassociate process to set the channel only after the driver was told that it's now disassociated. As the driver could expect powersave to be enabled only when associated, this thus results in splitting the config call, but overall what happens makes more sense this way. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1d09df248c56..5c2ba80c2932 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1394,7 +1394,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1394 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 1394 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1395 struct ieee80211_local *local = sdata->local; 1395 struct ieee80211_local *local = sdata->local;
1396 struct sta_info *sta; 1396 struct sta_info *sta;
1397 u32 changed = 0, config_changed = 0; 1397 u32 changed = 0;
1398 u8 bssid[ETH_ALEN]; 1398 u8 bssid[ETH_ALEN];
1399 1399
1400 ASSERT_MGD_MTX(ifmgd); 1400 ASSERT_MGD_MTX(ifmgd);
@@ -1454,9 +1454,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1454 changed |= BSS_CHANGED_ASSOC; 1454 changed |= BSS_CHANGED_ASSOC;
1455 sdata->vif.bss_conf.assoc = false; 1455 sdata->vif.bss_conf.assoc = false;
1456 1456
1457 /* channel(_type) changes are handled by ieee80211_hw_config */
1458 WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT));
1459
1460 /* on the next assoc, re-program HT parameters */ 1457 /* on the next assoc, re-program HT parameters */
1461 sdata->ht_opmode_valid = false; 1458 sdata->ht_opmode_valid = false;
1462 memset(&ifmgd->ht_capa, 0, sizeof(ifmgd->ht_capa)); 1459 memset(&ifmgd->ht_capa, 0, sizeof(ifmgd->ht_capa));
@@ -1469,12 +1466,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1469 1466
1470 if (local->hw.conf.flags & IEEE80211_CONF_PS) { 1467 if (local->hw.conf.flags & IEEE80211_CONF_PS) {
1471 local->hw.conf.flags &= ~IEEE80211_CONF_PS; 1468 local->hw.conf.flags &= ~IEEE80211_CONF_PS;
1472 config_changed |= IEEE80211_CONF_CHANGE_PS; 1469 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
1473 } 1470 }
1474 local->ps_sdata = NULL; 1471 local->ps_sdata = NULL;
1475 1472
1476 ieee80211_hw_config(local, config_changed);
1477
1478 /* Disable ARP filtering */ 1473 /* Disable ARP filtering */
1479 if (sdata->vif.bss_conf.arp_filter_enabled) { 1474 if (sdata->vif.bss_conf.arp_filter_enabled) {
1480 sdata->vif.bss_conf.arp_filter_enabled = false; 1475 sdata->vif.bss_conf.arp_filter_enabled = false;
@@ -1488,6 +1483,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1488 changed |= BSS_CHANGED_BSSID | BSS_CHANGED_HT; 1483 changed |= BSS_CHANGED_BSSID | BSS_CHANGED_HT;
1489 ieee80211_bss_info_change_notify(sdata, changed); 1484 ieee80211_bss_info_change_notify(sdata, changed);
1490 1485
1486 /* channel(_type) changes are handled by ieee80211_hw_config */
1487 WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT));
1488 ieee80211_hw_config(local, 0);
1489
1491 /* disassociated - set to defaults now */ 1490 /* disassociated - set to defaults now */
1492 ieee80211_set_wmm_default(sdata, false); 1491 ieee80211_set_wmm_default(sdata, false);
1493 1492