aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c117
1 files changed, 76 insertions, 41 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 8dd4712620ff..1df4019f294b 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -804,7 +804,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
804 struct ieee80211_local *local = sdata->local; 804 struct ieee80211_local *local = sdata->local;
805 struct ieee80211_tx_queue_params qparam; 805 struct ieee80211_tx_queue_params qparam;
806 int ac; 806 int ac;
807 bool use_11b; 807 bool use_11b, enable_qos;
808 int aCWmin, aCWmax; 808 int aCWmin, aCWmax;
809 809
810 if (!local->ops->conf_tx) 810 if (!local->ops->conf_tx)
@@ -818,6 +818,13 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
818 use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) && 818 use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) &&
819 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE); 819 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE);
820 820
821 /*
822 * By default disable QoS in STA mode for old access points, which do
823 * not support 802.11e. New APs will provide proper queue parameters,
824 * that we will configure later.
825 */
826 enable_qos = (sdata->vif.type != NL80211_IFTYPE_STATION);
827
821 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { 828 for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
822 /* Set defaults according to 802.11-2007 Table 7-37 */ 829 /* Set defaults according to 802.11-2007 Table 7-37 */
823 aCWmax = 1023; 830 aCWmax = 1023;
@@ -826,38 +833,47 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
826 else 833 else
827 aCWmin = 15; 834 aCWmin = 15;
828 835
829 switch (ac) { 836 if (enable_qos) {
830 case IEEE80211_AC_BK: 837 switch (ac) {
831 qparam.cw_max = aCWmax; 838 case IEEE80211_AC_BK:
832 qparam.cw_min = aCWmin; 839 qparam.cw_max = aCWmax;
833 qparam.txop = 0; 840 qparam.cw_min = aCWmin;
834 qparam.aifs = 7; 841 qparam.txop = 0;
835 break; 842 qparam.aifs = 7;
836 default: /* never happens but let's not leave undefined */ 843 break;
837 case IEEE80211_AC_BE: 844 /* never happens but let's not leave undefined */
845 default:
846 case IEEE80211_AC_BE:
847 qparam.cw_max = aCWmax;
848 qparam.cw_min = aCWmin;
849 qparam.txop = 0;
850 qparam.aifs = 3;
851 break;
852 case IEEE80211_AC_VI:
853 qparam.cw_max = aCWmin;
854 qparam.cw_min = (aCWmin + 1) / 2 - 1;
855 if (use_11b)
856 qparam.txop = 6016/32;
857 else
858 qparam.txop = 3008/32;
859 qparam.aifs = 2;
860 break;
861 case IEEE80211_AC_VO:
862 qparam.cw_max = (aCWmin + 1) / 2 - 1;
863 qparam.cw_min = (aCWmin + 1) / 4 - 1;
864 if (use_11b)
865 qparam.txop = 3264/32;
866 else
867 qparam.txop = 1504/32;
868 qparam.aifs = 2;
869 break;
870 }
871 } else {
872 /* Confiure old 802.11b/g medium access rules. */
838 qparam.cw_max = aCWmax; 873 qparam.cw_max = aCWmax;
839 qparam.cw_min = aCWmin; 874 qparam.cw_min = aCWmin;
840 qparam.txop = 0; 875 qparam.txop = 0;
841 qparam.aifs = 3;
842 break;
843 case IEEE80211_AC_VI:
844 qparam.cw_max = aCWmin;
845 qparam.cw_min = (aCWmin + 1) / 2 - 1;
846 if (use_11b)
847 qparam.txop = 6016/32;
848 else
849 qparam.txop = 3008/32;
850 qparam.aifs = 2;
851 break;
852 case IEEE80211_AC_VO:
853 qparam.cw_max = (aCWmin + 1) / 2 - 1;
854 qparam.cw_min = (aCWmin + 1) / 4 - 1;
855 if (use_11b)
856 qparam.txop = 3264/32;
857 else
858 qparam.txop = 1504/32;
859 qparam.aifs = 2; 876 qparam.aifs = 2;
860 break;
861 } 877 }
862 878
863 qparam.uapsd = false; 879 qparam.uapsd = false;
@@ -866,12 +882,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
866 drv_conf_tx(local, sdata, ac, &qparam); 882 drv_conf_tx(local, sdata, ac, &qparam);
867 } 883 }
868 884
869 /* after reinitialize QoS TX queues setting to default,
870 * disable QoS at all */
871
872 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { 885 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
873 sdata->vif.bss_conf.qos = 886 sdata->vif.bss_conf.qos = enable_qos;
874 sdata->vif.type != NL80211_IFTYPE_STATION;
875 if (bss_notify) 887 if (bss_notify)
876 ieee80211_bss_info_change_notify(sdata, 888 ieee80211_bss_info_change_notify(sdata,
877 BSS_CHANGED_QOS); 889 BSS_CHANGED_QOS);
@@ -1267,14 +1279,19 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1267 /* add STAs back */ 1279 /* add STAs back */
1268 mutex_lock(&local->sta_mtx); 1280 mutex_lock(&local->sta_mtx);
1269 list_for_each_entry(sta, &local->sta_list, list) { 1281 list_for_each_entry(sta, &local->sta_list, list) {
1270 if (sta->uploaded) { 1282 enum ieee80211_sta_state state;
1271 enum ieee80211_sta_state state;
1272 1283
1273 for (state = IEEE80211_STA_NOTEXIST; 1284 if (!sta->uploaded)
1274 state < sta->sta_state; state++) 1285 continue;
1275 WARN_ON(drv_sta_state(local, sta->sdata, sta, 1286
1276 state, state + 1)); 1287 /* AP-mode stations will be added later */
1277 } 1288 if (sta->sdata->vif.type == NL80211_IFTYPE_AP)
1289 continue;
1290
1291 for (state = IEEE80211_STA_NOTEXIST;
1292 state < sta->sta_state; state++)
1293 WARN_ON(drv_sta_state(local, sta->sdata, sta, state,
1294 state + 1));
1278 } 1295 }
1279 mutex_unlock(&local->sta_mtx); 1296 mutex_unlock(&local->sta_mtx);
1280 1297
@@ -1371,6 +1388,24 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1371 } 1388 }
1372 } 1389 }
1373 1390
1391 /* APs are now beaconing, add back stations */
1392 mutex_lock(&local->sta_mtx);
1393 list_for_each_entry(sta, &local->sta_list, list) {
1394 enum ieee80211_sta_state state;
1395
1396 if (!sta->uploaded)
1397 continue;
1398
1399 if (sta->sdata->vif.type != NL80211_IFTYPE_AP)
1400 continue;
1401
1402 for (state = IEEE80211_STA_NOTEXIST;
1403 state < sta->sta_state; state++)
1404 WARN_ON(drv_sta_state(local, sta->sdata, sta, state,
1405 state + 1));
1406 }
1407 mutex_unlock(&local->sta_mtx);
1408
1374 /* add back keys */ 1409 /* add back keys */
1375 list_for_each_entry(sdata, &local->interfaces, list) 1410 list_for_each_entry(sdata, &local->interfaces, list)
1376 if (ieee80211_sdata_running(sdata)) 1411 if (ieee80211_sdata_running(sdata))