diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-03-02 09:56:59 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-05 15:53:46 -0500 |
commit | 3abead59fcdeb56df8b83288a2f5edbe6423b0bb (patch) | |
tree | dd9ee248d46e9a7fe6e583507bebc93015b8e4d6 /net | |
parent | 293702a3fb75832613e2af097bdc3ac8ef775b33 (diff) |
mac80211: combine QoS with other BSS changes
When associating and particularly when disassociating
there's no need to notify the driver about changes
with multiple calls to bss_info_changed, we should
combine the QoS enabling/disabling into the same call
as otherwise the driver could get confused about QoS
suddenly getting disabled while connected.
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/ieee80211_i.h | 3 | ||||
-rw-r--r-- | net/mac80211/iface.c | 2 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 12 | ||||
-rw-r--r-- | net/mac80211/util.c | 9 |
4 files changed, 17 insertions, 9 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index c4130588b035..24cb1080e238 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1348,7 +1348,8 @@ int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, | |||
1348 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, | 1348 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, |
1349 | struct ieee80211_hdr *hdr, const u8 *tsc, | 1349 | struct ieee80211_hdr *hdr, const u8 *tsc, |
1350 | gfp_t gfp); | 1350 | gfp_t gfp); |
1351 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata); | 1351 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, |
1352 | bool bss_notify); | ||
1352 | void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); | 1353 | void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb); |
1353 | 1354 | ||
1354 | void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata, | 1355 | void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata, |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 620ca8d2ad42..401c01f0731e 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -304,7 +304,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up) | |||
304 | * need to initialise the hardware if the hardware | 304 | * need to initialise the hardware if the hardware |
305 | * doesn't start up with sane defaults | 305 | * doesn't start up with sane defaults |
306 | */ | 306 | */ |
307 | ieee80211_set_wmm_default(sdata); | 307 | ieee80211_set_wmm_default(sdata, true); |
308 | } | 308 | } |
309 | 309 | ||
310 | set_bit(SDATA_STATE_RUNNING, &sdata->state); | 310 | set_bit(SDATA_STATE_RUNNING, &sdata->state); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 7190da4f2138..92c5eb124d6f 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1277,7 +1277,6 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local, | |||
1277 | 1277 | ||
1278 | /* enable WMM or activate new settings */ | 1278 | /* enable WMM or activate new settings */ |
1279 | sdata->vif.bss_conf.qos = true; | 1279 | sdata->vif.bss_conf.qos = true; |
1280 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_QOS); | ||
1281 | } | 1280 | } |
1282 | 1281 | ||
1283 | static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, | 1282 | static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, |
@@ -1455,8 +1454,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1455 | changed |= BSS_CHANGED_ASSOC; | 1454 | changed |= BSS_CHANGED_ASSOC; |
1456 | sdata->vif.bss_conf.assoc = false; | 1455 | sdata->vif.bss_conf.assoc = false; |
1457 | 1456 | ||
1458 | ieee80211_set_wmm_default(sdata); | ||
1459 | |||
1460 | /* channel(_type) changes are handled by ieee80211_hw_config */ | 1457 | /* channel(_type) changes are handled by ieee80211_hw_config */ |
1461 | WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT)); | 1458 | WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT)); |
1462 | 1459 | ||
@@ -1484,10 +1481,16 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1484 | changed |= BSS_CHANGED_ARP_FILTER; | 1481 | changed |= BSS_CHANGED_ARP_FILTER; |
1485 | } | 1482 | } |
1486 | 1483 | ||
1484 | sdata->vif.bss_conf.qos = false; | ||
1485 | changed |= BSS_CHANGED_QOS; | ||
1486 | |||
1487 | /* The BSSID (not really interesting) and HT changed */ | 1487 | /* The BSSID (not really interesting) and HT changed */ |
1488 | changed |= BSS_CHANGED_BSSID | BSS_CHANGED_HT; | 1488 | changed |= BSS_CHANGED_BSSID | BSS_CHANGED_HT; |
1489 | ieee80211_bss_info_change_notify(sdata, changed); | 1489 | ieee80211_bss_info_change_notify(sdata, changed); |
1490 | 1490 | ||
1491 | /* disassociated - set to defaults now */ | ||
1492 | ieee80211_set_wmm_default(sdata, false); | ||
1493 | |||
1491 | del_timer_sync(&sdata->u.mgd.conn_mon_timer); | 1494 | del_timer_sync(&sdata->u.mgd.conn_mon_timer); |
1492 | del_timer_sync(&sdata->u.mgd.bcn_mon_timer); | 1495 | del_timer_sync(&sdata->u.mgd.bcn_mon_timer); |
1493 | del_timer_sync(&sdata->u.mgd.timer); | 1496 | del_timer_sync(&sdata->u.mgd.timer); |
@@ -2155,7 +2158,8 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, | |||
2155 | ieee80211_sta_wmm_params(local, sdata, elems.wmm_param, | 2158 | ieee80211_sta_wmm_params(local, sdata, elems.wmm_param, |
2156 | elems.wmm_param_len); | 2159 | elems.wmm_param_len); |
2157 | else | 2160 | else |
2158 | ieee80211_set_wmm_default(sdata); | 2161 | ieee80211_set_wmm_default(sdata, false); |
2162 | changed |= BSS_CHANGED_QOS; | ||
2159 | 2163 | ||
2160 | if (elems.ht_info_elem && elems.wmm_param && | 2164 | if (elems.ht_info_elem && elems.wmm_param && |
2161 | (sdata->local->hw.queues >= 4) && | 2165 | (sdata->local->hw.queues >= 4) && |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index f6e4cef92021..0a5ad95ac8b0 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -737,7 +737,8 @@ void ieee802_11_parse_elems(u8 *start, size_t len, | |||
737 | ieee802_11_parse_elems_crc(start, len, elems, 0, 0); | 737 | ieee802_11_parse_elems_crc(start, len, elems, 0, 0); |
738 | } | 738 | } |
739 | 739 | ||
740 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata) | 740 | void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata, |
741 | bool bss_notify) | ||
741 | { | 742 | { |
742 | struct ieee80211_local *local = sdata->local; | 743 | struct ieee80211_local *local = sdata->local; |
743 | struct ieee80211_tx_queue_params qparam; | 744 | struct ieee80211_tx_queue_params qparam; |
@@ -807,7 +808,9 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata) | |||
807 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { | 808 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { |
808 | sdata->vif.bss_conf.qos = | 809 | sdata->vif.bss_conf.qos = |
809 | sdata->vif.type != NL80211_IFTYPE_STATION; | 810 | sdata->vif.type != NL80211_IFTYPE_STATION; |
810 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_QOS); | 811 | if (bss_notify) |
812 | ieee80211_bss_info_change_notify(sdata, | ||
813 | BSS_CHANGED_QOS); | ||
811 | } | 814 | } |
812 | } | 815 | } |
813 | 816 | ||
@@ -829,7 +832,7 @@ void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, | |||
829 | else | 832 | else |
830 | sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; | 833 | sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; |
831 | 834 | ||
832 | ieee80211_set_wmm_default(sdata); | 835 | ieee80211_set_wmm_default(sdata, true); |
833 | } | 836 | } |
834 | 837 | ||
835 | u32 ieee80211_mandatory_rates(struct ieee80211_local *local, | 838 | u32 ieee80211_mandatory_rates(struct ieee80211_local *local, |