diff options
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r-- | net/mac80211/wme.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 89511be3111e..c3d643a6536c 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -52,6 +52,26 @@ static int wme_downgrade_ac(struct sk_buff *skb) | |||
52 | } | 52 | } |
53 | } | 53 | } |
54 | 54 | ||
55 | static u16 ieee80211_downgrade_queue(struct ieee80211_local *local, | ||
56 | struct sk_buff *skb) | ||
57 | { | ||
58 | /* in case we are a client verify acm is not set for this ac */ | ||
59 | while (unlikely(local->wmm_acm & BIT(skb->priority))) { | ||
60 | if (wme_downgrade_ac(skb)) { | ||
61 | /* | ||
62 | * This should not really happen. The AP has marked all | ||
63 | * lower ACs to require admission control which is not | ||
64 | * a reasonable configuration. Allow the frame to be | ||
65 | * transmitted using AC_BK as a workaround. | ||
66 | */ | ||
67 | break; | ||
68 | } | ||
69 | } | ||
70 | |||
71 | /* look up which queue to use for frames with this 1d tag */ | ||
72 | return ieee802_1d_to_ac[skb->priority]; | ||
73 | } | ||
74 | |||
55 | /* Indicate which queue to use for this fully formed 802.11 frame */ | 75 | /* Indicate which queue to use for this fully formed 802.11 frame */ |
56 | u16 ieee80211_select_queue_80211(struct ieee80211_local *local, | 76 | u16 ieee80211_select_queue_80211(struct ieee80211_local *local, |
57 | struct sk_buff *skb, | 77 | struct sk_buff *skb, |
@@ -59,7 +79,7 @@ u16 ieee80211_select_queue_80211(struct ieee80211_local *local, | |||
59 | { | 79 | { |
60 | u8 *p; | 80 | u8 *p; |
61 | 81 | ||
62 | if (local->hw.queues < 4) | 82 | if (local->hw.queues < IEEE80211_NUM_ACS) |
63 | return 0; | 83 | return 0; |
64 | 84 | ||
65 | if (!ieee80211_is_data(hdr->frame_control)) { | 85 | if (!ieee80211_is_data(hdr->frame_control)) { |
@@ -86,9 +106,9 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, | |||
86 | const u8 *ra = NULL; | 106 | const u8 *ra = NULL; |
87 | bool qos = false; | 107 | bool qos = false; |
88 | 108 | ||
89 | if (local->hw.queues < 4 || skb->len < 6) { | 109 | if (local->hw.queues < IEEE80211_NUM_ACS || skb->len < 6) { |
90 | skb->priority = 0; /* required for correct WPA/11i MIC */ | 110 | skb->priority = 0; /* required for correct WPA/11i MIC */ |
91 | return min_t(u16, local->hw.queues - 1, IEEE80211_AC_BE); | 111 | return 0; |
92 | } | 112 | } |
93 | 113 | ||
94 | rcu_read_lock(); | 114 | rcu_read_lock(); |
@@ -139,26 +159,6 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata, | |||
139 | return ieee80211_downgrade_queue(local, skb); | 159 | return ieee80211_downgrade_queue(local, skb); |
140 | } | 160 | } |
141 | 161 | ||
142 | u16 ieee80211_downgrade_queue(struct ieee80211_local *local, | ||
143 | struct sk_buff *skb) | ||
144 | { | ||
145 | /* in case we are a client verify acm is not set for this ac */ | ||
146 | while (unlikely(local->wmm_acm & BIT(skb->priority))) { | ||
147 | if (wme_downgrade_ac(skb)) { | ||
148 | /* | ||
149 | * This should not really happen. The AP has marked all | ||
150 | * lower ACs to require admission control which is not | ||
151 | * a reasonable configuration. Allow the frame to be | ||
152 | * transmitted using AC_BK as a workaround. | ||
153 | */ | ||
154 | break; | ||
155 | } | ||
156 | } | ||
157 | |||
158 | /* look up which queue to use for frames with this 1d tag */ | ||
159 | return ieee802_1d_to_ac[skb->priority]; | ||
160 | } | ||
161 | |||
162 | void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata, | 162 | void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata, |
163 | struct sk_buff *skb) | 163 | struct sk_buff *skb) |
164 | { | 164 | { |