diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-05-30 04:56:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-06-06 15:19:00 -0400 |
commit | a8ce85442e8ed7ae3c05e7e3b7e42adb32a371ec (patch) | |
tree | d820c5295cea9fa934f732c612ebe1c91b0c52c6 | |
parent | d202caff28d69f4ec6cf56568f79b0916294cade (diff) |
mac80211: configure 11b/g channel access rules for legacy APs
For each EDCA TX queue change default settings (in STA mode) to conform
old 802.11b/g channel access rules. This is needed for drivers that do
not have QoS enable/disable "switch" (like rt2x00) to make them work
properly with legacy APs.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/util.c | 80 |
1 files changed, 46 insertions, 34 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 8dd4712620ff..b007c6861032 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); |