aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/wme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r--net/mac80211/wme.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 34e6d02da779..28bc084dbfb9 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -21,7 +21,16 @@
21/* Default mapping in classifier to work with default 21/* Default mapping in classifier to work with default
22 * queue setup. 22 * queue setup.
23 */ 23 */
24const int ieee802_1d_to_ac[8] = { 2, 3, 3, 2, 1, 1, 0, 0 }; 24const int ieee802_1d_to_ac[8] = {
25 IEEE80211_AC_BE,
26 IEEE80211_AC_BK,
27 IEEE80211_AC_BK,
28 IEEE80211_AC_BE,
29 IEEE80211_AC_VI,
30 IEEE80211_AC_VI,
31 IEEE80211_AC_VO,
32 IEEE80211_AC_VO
33};
25 34
26static int wme_downgrade_ac(struct sk_buff *skb) 35static int wme_downgrade_ac(struct sk_buff *skb)
27{ 36{
@@ -50,26 +59,22 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
50{ 59{
51 struct ieee80211_local *local = sdata->local; 60 struct ieee80211_local *local = sdata->local;
52 struct sta_info *sta = NULL; 61 struct sta_info *sta = NULL;
53 u32 sta_flags = 0;
54 const u8 *ra = NULL; 62 const u8 *ra = NULL;
55 bool qos = false; 63 bool qos = false;
56 64
57 if (local->hw.queues < 4 || skb->len < 6) { 65 if (local->hw.queues < 4 || skb->len < 6) {
58 skb->priority = 0; /* required for correct WPA/11i MIC */ 66 skb->priority = 0; /* required for correct WPA/11i MIC */
59 return min_t(u16, local->hw.queues - 1, 67 return min_t(u16, local->hw.queues - 1, IEEE80211_AC_BE);
60 ieee802_1d_to_ac[skb->priority]);
61 } 68 }
62 69
63 rcu_read_lock(); 70 rcu_read_lock();
64 switch (sdata->vif.type) { 71 switch (sdata->vif.type) {
65 case NL80211_IFTYPE_AP_VLAN: 72 case NL80211_IFTYPE_AP_VLAN:
66 rcu_read_lock();
67 sta = rcu_dereference(sdata->u.vlan.sta); 73 sta = rcu_dereference(sdata->u.vlan.sta);
68 if (sta) 74 if (sta) {
69 sta_flags = get_sta_flags(sta); 75 qos = get_sta_flags(sta) & WLAN_STA_WME;
70 rcu_read_unlock();
71 if (sta)
72 break; 76 break;
77 }
73 case NL80211_IFTYPE_AP: 78 case NL80211_IFTYPE_AP:
74 ra = skb->data; 79 ra = skb->data;
75 break; 80 break;
@@ -98,17 +103,13 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
98 if (!sta && ra && !is_multicast_ether_addr(ra)) { 103 if (!sta && ra && !is_multicast_ether_addr(ra)) {
99 sta = sta_info_get(sdata, ra); 104 sta = sta_info_get(sdata, ra);
100 if (sta) 105 if (sta)
101 sta_flags = get_sta_flags(sta); 106 qos = get_sta_flags(sta) & WLAN_STA_WME;
102 } 107 }
103
104 if (sta_flags & WLAN_STA_WME)
105 qos = true;
106
107 rcu_read_unlock(); 108 rcu_read_unlock();
108 109
109 if (!qos) { 110 if (!qos) {
110 skb->priority = 0; /* required for correct WPA/11i MIC */ 111 skb->priority = 0; /* required for correct WPA/11i MIC */
111 return ieee802_1d_to_ac[skb->priority]; 112 return IEEE80211_AC_BE;
112 } 113 }
113 114
114 /* use the data classifier to determine what 802.1d tag the 115 /* use the data classifier to determine what 802.1d tag the