diff options
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r-- | net/mac80211/wme.c | 165 |
1 files changed, 65 insertions, 100 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 635b996c8c35..cfa8fbb0736a 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c | |||
@@ -19,16 +19,22 @@ | |||
19 | #include "wme.h" | 19 | #include "wme.h" |
20 | 20 | ||
21 | /* maximum number of hardware queues we support. */ | 21 | /* maximum number of hardware queues we support. */ |
22 | #define TC_80211_MAX_QUEUES 16 | 22 | #define QD_MAX_QUEUES (IEEE80211_MAX_AMPDU_QUEUES + IEEE80211_MAX_QUEUES) |
23 | /* current number of hardware queues we support. */ | ||
24 | #define QD_NUM(hw) ((hw)->queues + (hw)->ampdu_queues) | ||
23 | 25 | ||
26 | /* | ||
27 | * Default mapping in classifier to work with default | ||
28 | * queue setup. | ||
29 | */ | ||
24 | const int ieee802_1d_to_ac[8] = { 2, 3, 3, 2, 1, 1, 0, 0 }; | 30 | const int ieee802_1d_to_ac[8] = { 2, 3, 3, 2, 1, 1, 0, 0 }; |
25 | 31 | ||
26 | struct ieee80211_sched_data | 32 | struct ieee80211_sched_data |
27 | { | 33 | { |
28 | unsigned long qdisc_pool[BITS_TO_LONGS(TC_80211_MAX_QUEUES)]; | 34 | unsigned long qdisc_pool[BITS_TO_LONGS(QD_MAX_QUEUES)]; |
29 | struct tcf_proto *filter_list; | 35 | struct tcf_proto *filter_list; |
30 | struct Qdisc *queues[TC_80211_MAX_QUEUES]; | 36 | struct Qdisc *queues[QD_MAX_QUEUES]; |
31 | struct sk_buff_head requeued[TC_80211_MAX_QUEUES]; | 37 | struct sk_buff_head requeued[QD_MAX_QUEUES]; |
32 | }; | 38 | }; |
33 | 39 | ||
34 | static const char llc_ip_hdr[8] = {0xAA, 0xAA, 0x3, 0, 0, 0, 0x08, 0}; | 40 | static const char llc_ip_hdr[8] = {0xAA, 0xAA, 0x3, 0, 0, 0, 0x08, 0}; |
@@ -95,28 +101,22 @@ static inline int wme_downgrade_ac(struct sk_buff *skb) | |||
95 | 101 | ||
96 | /* positive return value indicates which queue to use | 102 | /* positive return value indicates which queue to use |
97 | * negative return value indicates to drop the frame */ | 103 | * negative return value indicates to drop the frame */ |
98 | static inline int classify80211(struct sk_buff *skb, struct Qdisc *qd) | 104 | static int classify80211(struct sk_buff *skb, struct Qdisc *qd) |
99 | { | 105 | { |
100 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 106 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
101 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 107 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
102 | unsigned short fc = le16_to_cpu(hdr->frame_control); | ||
103 | int qos; | ||
104 | 108 | ||
105 | /* see if frame is data or non data frame */ | 109 | if (!ieee80211_is_data(hdr->frame_control)) { |
106 | if (unlikely((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA)) { | ||
107 | /* management frames go on AC_VO queue, but are sent | 110 | /* management frames go on AC_VO queue, but are sent |
108 | * without QoS control fields */ | 111 | * without QoS control fields */ |
109 | return IEEE80211_TX_QUEUE_DATA0; | 112 | return 0; |
110 | } | 113 | } |
111 | 114 | ||
112 | if (0 /* injected */) { | 115 | if (0 /* injected */) { |
113 | /* use AC from radiotap */ | 116 | /* use AC from radiotap */ |
114 | } | 117 | } |
115 | 118 | ||
116 | /* is this a QoS frame? */ | 119 | if (!ieee80211_is_data_qos(hdr->frame_control)) { |
117 | qos = fc & IEEE80211_STYPE_QOS_DATA; | ||
118 | |||
119 | if (!qos) { | ||
120 | skb->priority = 0; /* required for correct WPA/11i MIC */ | 120 | skb->priority = 0; /* required for correct WPA/11i MIC */ |
121 | return ieee802_1d_to_ac[skb->priority]; | 121 | return ieee802_1d_to_ac[skb->priority]; |
122 | } | 122 | } |
@@ -141,29 +141,28 @@ static inline int classify80211(struct sk_buff *skb, struct Qdisc *qd) | |||
141 | static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | 141 | static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) |
142 | { | 142 | { |
143 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 143 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
144 | struct ieee80211_hw *hw = &local->hw; | ||
144 | struct ieee80211_sched_data *q = qdisc_priv(qd); | 145 | struct ieee80211_sched_data *q = qdisc_priv(qd); |
145 | struct ieee80211_tx_packet_data *pkt_data = | 146 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
146 | (struct ieee80211_tx_packet_data *) skb->cb; | ||
147 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 147 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
148 | unsigned short fc = le16_to_cpu(hdr->frame_control); | ||
149 | struct Qdisc *qdisc; | 148 | struct Qdisc *qdisc; |
150 | int err, queue; | ||
151 | struct sta_info *sta; | 149 | struct sta_info *sta; |
150 | int err, queue; | ||
152 | u8 tid; | 151 | u8 tid; |
153 | 152 | ||
154 | if (pkt_data->flags & IEEE80211_TXPD_REQUEUE) { | 153 | if (info->flags & IEEE80211_TX_CTL_REQUEUE) { |
155 | queue = pkt_data->queue; | 154 | queue = skb_get_queue_mapping(skb); |
156 | rcu_read_lock(); | 155 | rcu_read_lock(); |
157 | sta = sta_info_get(local, hdr->addr1); | 156 | sta = sta_info_get(local, hdr->addr1); |
158 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; | 157 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; |
159 | if (sta) { | 158 | if (sta) { |
160 | int ampdu_queue = sta->tid_to_tx_q[tid]; | 159 | int ampdu_queue = sta->tid_to_tx_q[tid]; |
161 | if ((ampdu_queue < local->hw.queues) && | 160 | if ((ampdu_queue < QD_NUM(hw)) && |
162 | test_bit(ampdu_queue, q->qdisc_pool)) { | 161 | test_bit(ampdu_queue, q->qdisc_pool)) { |
163 | queue = ampdu_queue; | 162 | queue = ampdu_queue; |
164 | pkt_data->flags |= IEEE80211_TXPD_AMPDU; | 163 | info->flags |= IEEE80211_TX_CTL_AMPDU; |
165 | } else { | 164 | } else { |
166 | pkt_data->flags &= ~IEEE80211_TXPD_AMPDU; | 165 | info->flags &= ~IEEE80211_TX_CTL_AMPDU; |
167 | } | 166 | } |
168 | } | 167 | } |
169 | rcu_read_unlock(); | 168 | rcu_read_unlock(); |
@@ -174,18 +173,20 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
174 | 173 | ||
175 | queue = classify80211(skb, qd); | 174 | queue = classify80211(skb, qd); |
176 | 175 | ||
176 | if (unlikely(queue >= local->hw.queues)) | ||
177 | queue = local->hw.queues - 1; | ||
178 | |||
177 | /* now we know the 1d priority, fill in the QoS header if there is one | 179 | /* now we know the 1d priority, fill in the QoS header if there is one |
178 | */ | 180 | */ |
179 | if (WLAN_FC_IS_QOS_DATA(fc)) { | 181 | if (ieee80211_is_data_qos(hdr->frame_control)) { |
180 | u8 *p = skb->data + ieee80211_get_hdrlen(fc) - 2; | 182 | u8 *p = ieee80211_get_qos_ctl(hdr); |
181 | u8 ack_policy = 0; | 183 | u8 ack_policy = 0; |
182 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; | 184 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; |
183 | if (local->wifi_wme_noack_test) | 185 | if (local->wifi_wme_noack_test) |
184 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << | 186 | ack_policy |= QOS_CONTROL_ACK_POLICY_NOACK << |
185 | QOS_CONTROL_ACK_POLICY_SHIFT; | 187 | QOS_CONTROL_ACK_POLICY_SHIFT; |
186 | /* qos header is 2 bytes, second reserved */ | 188 | /* qos header is 2 bytes, second reserved */ |
187 | *p = ack_policy | tid; | 189 | *p++ = ack_policy | tid; |
188 | p++; | ||
189 | *p = 0; | 190 | *p = 0; |
190 | 191 | ||
191 | rcu_read_lock(); | 192 | rcu_read_lock(); |
@@ -193,35 +194,24 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
193 | sta = sta_info_get(local, hdr->addr1); | 194 | sta = sta_info_get(local, hdr->addr1); |
194 | if (sta) { | 195 | if (sta) { |
195 | int ampdu_queue = sta->tid_to_tx_q[tid]; | 196 | int ampdu_queue = sta->tid_to_tx_q[tid]; |
196 | if ((ampdu_queue < local->hw.queues) && | 197 | if ((ampdu_queue < QD_NUM(hw)) && |
197 | test_bit(ampdu_queue, q->qdisc_pool)) { | 198 | test_bit(ampdu_queue, q->qdisc_pool)) { |
198 | queue = ampdu_queue; | 199 | queue = ampdu_queue; |
199 | pkt_data->flags |= IEEE80211_TXPD_AMPDU; | 200 | info->flags |= IEEE80211_TX_CTL_AMPDU; |
200 | } else { | 201 | } else { |
201 | pkt_data->flags &= ~IEEE80211_TXPD_AMPDU; | 202 | info->flags &= ~IEEE80211_TX_CTL_AMPDU; |
202 | } | 203 | } |
203 | } | 204 | } |
204 | 205 | ||
205 | rcu_read_unlock(); | 206 | rcu_read_unlock(); |
206 | } | 207 | } |
207 | 208 | ||
208 | if (unlikely(queue >= local->hw.queues)) { | ||
209 | #if 0 | ||
210 | if (net_ratelimit()) { | ||
211 | printk(KERN_DEBUG "%s - queue=%d (hw does not " | ||
212 | "support) -> %d\n", | ||
213 | __func__, queue, local->hw.queues - 1); | ||
214 | } | ||
215 | #endif | ||
216 | queue = local->hw.queues - 1; | ||
217 | } | ||
218 | |||
219 | if (unlikely(queue < 0)) { | 209 | if (unlikely(queue < 0)) { |
220 | kfree_skb(skb); | 210 | kfree_skb(skb); |
221 | err = NET_XMIT_DROP; | 211 | err = NET_XMIT_DROP; |
222 | } else { | 212 | } else { |
223 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; | 213 | tid = skb->priority & QOS_CONTROL_TAG1D_MASK; |
224 | pkt_data->queue = (unsigned int) queue; | 214 | skb_set_queue_mapping(skb, queue); |
225 | qdisc = q->queues[queue]; | 215 | qdisc = q->queues[queue]; |
226 | err = qdisc->enqueue(skb, qdisc); | 216 | err = qdisc->enqueue(skb, qdisc); |
227 | if (err == NET_XMIT_SUCCESS) { | 217 | if (err == NET_XMIT_SUCCESS) { |
@@ -242,13 +232,11 @@ static int wme_qdiscop_enqueue(struct sk_buff *skb, struct Qdisc* qd) | |||
242 | static int wme_qdiscop_requeue(struct sk_buff *skb, struct Qdisc* qd) | 232 | static int wme_qdiscop_requeue(struct sk_buff *skb, struct Qdisc* qd) |
243 | { | 233 | { |
244 | struct ieee80211_sched_data *q = qdisc_priv(qd); | 234 | struct ieee80211_sched_data *q = qdisc_priv(qd); |
245 | struct ieee80211_tx_packet_data *pkt_data = | ||
246 | (struct ieee80211_tx_packet_data *) skb->cb; | ||
247 | struct Qdisc *qdisc; | 235 | struct Qdisc *qdisc; |
248 | int err; | 236 | int err; |
249 | 237 | ||
250 | /* we recorded which queue to use earlier! */ | 238 | /* we recorded which queue to use earlier! */ |
251 | qdisc = q->queues[pkt_data->queue]; | 239 | qdisc = q->queues[skb_get_queue_mapping(skb)]; |
252 | 240 | ||
253 | if ((err = qdisc->ops->requeue(skb, qdisc)) == 0) { | 241 | if ((err = qdisc->ops->requeue(skb, qdisc)) == 0) { |
254 | qd->q.qlen++; | 242 | qd->q.qlen++; |
@@ -270,13 +258,10 @@ static struct sk_buff *wme_qdiscop_dequeue(struct Qdisc* qd) | |||
270 | int queue; | 258 | int queue; |
271 | 259 | ||
272 | /* check all the h/w queues in numeric/priority order */ | 260 | /* check all the h/w queues in numeric/priority order */ |
273 | for (queue = 0; queue < hw->queues; queue++) { | 261 | for (queue = 0; queue < QD_NUM(hw); queue++) { |
274 | /* see if there is room in this hardware queue */ | 262 | /* see if there is room in this hardware queue */ |
275 | if ((test_bit(IEEE80211_LINK_STATE_XOFF, | 263 | if (__netif_subqueue_stopped(local->mdev, queue) || |
276 | &local->state[queue])) || | 264 | !test_bit(queue, q->qdisc_pool)) |
277 | (test_bit(IEEE80211_LINK_STATE_PENDING, | ||
278 | &local->state[queue])) || | ||
279 | (!test_bit(queue, q->qdisc_pool))) | ||
280 | continue; | 265 | continue; |
281 | 266 | ||
282 | /* there is space - try and get a frame */ | 267 | /* there is space - try and get a frame */ |
@@ -308,7 +293,7 @@ static void wme_qdiscop_reset(struct Qdisc* qd) | |||
308 | 293 | ||
309 | /* QUESTION: should we have some hardware flush functionality here? */ | 294 | /* QUESTION: should we have some hardware flush functionality here? */ |
310 | 295 | ||
311 | for (queue = 0; queue < hw->queues; queue++) { | 296 | for (queue = 0; queue < QD_NUM(hw); queue++) { |
312 | skb_queue_purge(&q->requeued[queue]); | 297 | skb_queue_purge(&q->requeued[queue]); |
313 | qdisc_reset(q->queues[queue]); | 298 | qdisc_reset(q->queues[queue]); |
314 | } | 299 | } |
@@ -326,7 +311,7 @@ static void wme_qdiscop_destroy(struct Qdisc* qd) | |||
326 | tcf_destroy_chain(q->filter_list); | 311 | tcf_destroy_chain(q->filter_list); |
327 | q->filter_list = NULL; | 312 | q->filter_list = NULL; |
328 | 313 | ||
329 | for (queue=0; queue < hw->queues; queue++) { | 314 | for (queue = 0; queue < QD_NUM(hw); queue++) { |
330 | skb_queue_purge(&q->requeued[queue]); | 315 | skb_queue_purge(&q->requeued[queue]); |
331 | qdisc_destroy(q->queues[queue]); | 316 | qdisc_destroy(q->queues[queue]); |
332 | q->queues[queue] = &noop_qdisc; | 317 | q->queues[queue] = &noop_qdisc; |
@@ -337,17 +322,6 @@ static void wme_qdiscop_destroy(struct Qdisc* qd) | |||
337 | /* called whenever parameters are updated on existing qdisc */ | 322 | /* called whenever parameters are updated on existing qdisc */ |
338 | static int wme_qdiscop_tune(struct Qdisc *qd, struct nlattr *opt) | 323 | static int wme_qdiscop_tune(struct Qdisc *qd, struct nlattr *opt) |
339 | { | 324 | { |
340 | /* struct ieee80211_sched_data *q = qdisc_priv(qd); | ||
341 | */ | ||
342 | /* check our options block is the right size */ | ||
343 | /* copy any options to our local structure */ | ||
344 | /* Ignore options block for now - always use static mapping | ||
345 | struct tc_ieee80211_qopt *qopt = nla_data(opt); | ||
346 | |||
347 | if (opt->nla_len < nla_attr_size(sizeof(*qopt))) | ||
348 | return -EINVAL; | ||
349 | memcpy(q->tag2queue, qopt->tag2queue, sizeof(qopt->tag2queue)); | ||
350 | */ | ||
351 | return 0; | 325 | return 0; |
352 | } | 326 | } |
353 | 327 | ||
@@ -358,7 +332,7 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt) | |||
358 | struct ieee80211_sched_data *q = qdisc_priv(qd); | 332 | struct ieee80211_sched_data *q = qdisc_priv(qd); |
359 | struct net_device *dev = qd->dev; | 333 | struct net_device *dev = qd->dev; |
360 | struct ieee80211_local *local; | 334 | struct ieee80211_local *local; |
361 | int queues; | 335 | struct ieee80211_hw *hw; |
362 | int err = 0, i; | 336 | int err = 0, i; |
363 | 337 | ||
364 | /* check that device is a mac80211 device */ | 338 | /* check that device is a mac80211 device */ |
@@ -366,29 +340,26 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt) | |||
366 | dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid) | 340 | dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid) |
367 | return -EINVAL; | 341 | return -EINVAL; |
368 | 342 | ||
369 | /* check this device is an ieee80211 master type device */ | 343 | local = wdev_priv(dev->ieee80211_ptr); |
370 | if (dev->type != ARPHRD_IEEE80211) | 344 | hw = &local->hw; |
345 | |||
346 | /* only allow on master dev */ | ||
347 | if (dev != local->mdev) | ||
371 | return -EINVAL; | 348 | return -EINVAL; |
372 | 349 | ||
373 | /* check that there is no qdisc currently attached to device | 350 | /* ensure that we are root qdisc */ |
374 | * this ensures that we will be the root qdisc. (I can't find a better | 351 | if (qd->parent != TC_H_ROOT) |
375 | * way to test this explicitly) */ | ||
376 | if (dev->qdisc_sleeping != &noop_qdisc) | ||
377 | return -EINVAL; | 352 | return -EINVAL; |
378 | 353 | ||
379 | if (qd->flags & TCQ_F_INGRESS) | 354 | if (qd->flags & TCQ_F_INGRESS) |
380 | return -EINVAL; | 355 | return -EINVAL; |
381 | 356 | ||
382 | local = wdev_priv(dev->ieee80211_ptr); | ||
383 | queues = local->hw.queues; | ||
384 | |||
385 | /* if options were passed in, set them */ | 357 | /* if options were passed in, set them */ |
386 | if (opt) { | 358 | if (opt) |
387 | err = wme_qdiscop_tune(qd, opt); | 359 | err = wme_qdiscop_tune(qd, opt); |
388 | } | ||
389 | 360 | ||
390 | /* create child queues */ | 361 | /* create child queues */ |
391 | for (i = 0; i < queues; i++) { | 362 | for (i = 0; i < QD_NUM(hw); i++) { |
392 | skb_queue_head_init(&q->requeued[i]); | 363 | skb_queue_head_init(&q->requeued[i]); |
393 | q->queues[i] = qdisc_create_dflt(qd->dev, &pfifo_qdisc_ops, | 364 | q->queues[i] = qdisc_create_dflt(qd->dev, &pfifo_qdisc_ops, |
394 | qd->handle); | 365 | qd->handle); |
@@ -399,8 +370,8 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt) | |||
399 | } | 370 | } |
400 | } | 371 | } |
401 | 372 | ||
402 | /* reserve all legacy QoS queues */ | 373 | /* non-aggregation queues: reserve/mark as used */ |
403 | for (i = 0; i < min(IEEE80211_TX_QUEUE_DATA4, queues); i++) | 374 | for (i = 0; i < local->hw.queues; i++) |
404 | set_bit(i, q->qdisc_pool); | 375 | set_bit(i, q->qdisc_pool); |
405 | 376 | ||
406 | return err; | 377 | return err; |
@@ -408,16 +379,6 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt) | |||
408 | 379 | ||
409 | static int wme_qdiscop_dump(struct Qdisc *qd, struct sk_buff *skb) | 380 | static int wme_qdiscop_dump(struct Qdisc *qd, struct sk_buff *skb) |
410 | { | 381 | { |
411 | /* struct ieee80211_sched_data *q = qdisc_priv(qd); | ||
412 | unsigned char *p = skb->tail; | ||
413 | struct tc_ieee80211_qopt opt; | ||
414 | |||
415 | memcpy(&opt.tag2queue, q->tag2queue, TC_80211_MAX_TAG + 1); | ||
416 | NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt); | ||
417 | */ return skb->len; | ||
418 | /* | ||
419 | nla_put_failure: | ||
420 | skb_trim(skb, p - skb->data);*/ | ||
421 | return -1; | 382 | return -1; |
422 | } | 383 | } |
423 | 384 | ||
@@ -430,7 +391,7 @@ static int wme_classop_graft(struct Qdisc *qd, unsigned long arg, | |||
430 | struct ieee80211_hw *hw = &local->hw; | 391 | struct ieee80211_hw *hw = &local->hw; |
431 | unsigned long queue = arg - 1; | 392 | unsigned long queue = arg - 1; |
432 | 393 | ||
433 | if (queue >= hw->queues) | 394 | if (queue >= QD_NUM(hw)) |
434 | return -EINVAL; | 395 | return -EINVAL; |
435 | 396 | ||
436 | if (!new) | 397 | if (!new) |
@@ -454,7 +415,7 @@ wme_classop_leaf(struct Qdisc *qd, unsigned long arg) | |||
454 | struct ieee80211_hw *hw = &local->hw; | 415 | struct ieee80211_hw *hw = &local->hw; |
455 | unsigned long queue = arg - 1; | 416 | unsigned long queue = arg - 1; |
456 | 417 | ||
457 | if (queue >= hw->queues) | 418 | if (queue >= QD_NUM(hw)) |
458 | return NULL; | 419 | return NULL; |
459 | 420 | ||
460 | return q->queues[queue]; | 421 | return q->queues[queue]; |
@@ -467,7 +428,7 @@ static unsigned long wme_classop_get(struct Qdisc *qd, u32 classid) | |||
467 | struct ieee80211_hw *hw = &local->hw; | 428 | struct ieee80211_hw *hw = &local->hw; |
468 | unsigned long queue = TC_H_MIN(classid); | 429 | unsigned long queue = TC_H_MIN(classid); |
469 | 430 | ||
470 | if (queue - 1 >= hw->queues) | 431 | if (queue - 1 >= QD_NUM(hw)) |
471 | return 0; | 432 | return 0; |
472 | 433 | ||
473 | return queue; | 434 | return queue; |
@@ -493,7 +454,7 @@ static int wme_classop_change(struct Qdisc *qd, u32 handle, u32 parent, | |||
493 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 454 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
494 | struct ieee80211_hw *hw = &local->hw; | 455 | struct ieee80211_hw *hw = &local->hw; |
495 | 456 | ||
496 | if (cl - 1 > hw->queues) | 457 | if (cl - 1 > QD_NUM(hw)) |
497 | return -ENOENT; | 458 | return -ENOENT; |
498 | 459 | ||
499 | /* TODO: put code to program hardware queue parameters here, | 460 | /* TODO: put code to program hardware queue parameters here, |
@@ -510,7 +471,7 @@ static int wme_classop_delete(struct Qdisc *qd, unsigned long cl) | |||
510 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 471 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
511 | struct ieee80211_hw *hw = &local->hw; | 472 | struct ieee80211_hw *hw = &local->hw; |
512 | 473 | ||
513 | if (cl - 1 > hw->queues) | 474 | if (cl - 1 > QD_NUM(hw)) |
514 | return -ENOENT; | 475 | return -ENOENT; |
515 | return 0; | 476 | return 0; |
516 | } | 477 | } |
@@ -523,7 +484,7 @@ static int wme_classop_dump_class(struct Qdisc *qd, unsigned long cl, | |||
523 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 484 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
524 | struct ieee80211_hw *hw = &local->hw; | 485 | struct ieee80211_hw *hw = &local->hw; |
525 | 486 | ||
526 | if (cl - 1 > hw->queues) | 487 | if (cl - 1 > QD_NUM(hw)) |
527 | return -ENOENT; | 488 | return -ENOENT; |
528 | tcm->tcm_handle = TC_H_MIN(cl); | 489 | tcm->tcm_handle = TC_H_MIN(cl); |
529 | tcm->tcm_parent = qd->handle; | 490 | tcm->tcm_parent = qd->handle; |
@@ -541,7 +502,7 @@ static void wme_classop_walk(struct Qdisc *qd, struct qdisc_walker *arg) | |||
541 | if (arg->stop) | 502 | if (arg->stop) |
542 | return; | 503 | return; |
543 | 504 | ||
544 | for (queue = 0; queue < hw->queues; queue++) { | 505 | for (queue = 0; queue < QD_NUM(hw); queue++) { |
545 | if (arg->count < arg->skip) { | 506 | if (arg->count < arg->skip) { |
546 | arg->count++; | 507 | arg->count++; |
547 | continue; | 508 | continue; |
@@ -658,10 +619,13 @@ int ieee80211_ht_agg_queue_add(struct ieee80211_local *local, | |||
658 | DECLARE_MAC_BUF(mac); | 619 | DECLARE_MAC_BUF(mac); |
659 | 620 | ||
660 | /* prepare the filter and save it for the SW queue | 621 | /* prepare the filter and save it for the SW queue |
661 | * matching the recieved HW queue */ | 622 | * matching the received HW queue */ |
623 | |||
624 | if (!local->hw.ampdu_queues) | ||
625 | return -EPERM; | ||
662 | 626 | ||
663 | /* try to get a Qdisc from the pool */ | 627 | /* try to get a Qdisc from the pool */ |
664 | for (i = IEEE80211_TX_QUEUE_BEACON; i < local->hw.queues; i++) | 628 | for (i = local->hw.queues; i < QD_NUM(&local->hw); i++) |
665 | if (!test_and_set_bit(i, q->qdisc_pool)) { | 629 | if (!test_and_set_bit(i, q->qdisc_pool)) { |
666 | ieee80211_stop_queue(local_to_hw(local), i); | 630 | ieee80211_stop_queue(local_to_hw(local), i); |
667 | sta->tid_to_tx_q[tid] = i; | 631 | sta->tid_to_tx_q[tid] = i; |
@@ -690,13 +654,14 @@ void ieee80211_ht_agg_queue_remove(struct ieee80211_local *local, | |||
690 | struct sta_info *sta, u16 tid, | 654 | struct sta_info *sta, u16 tid, |
691 | u8 requeue) | 655 | u8 requeue) |
692 | { | 656 | { |
657 | struct ieee80211_hw *hw = &local->hw; | ||
693 | struct ieee80211_sched_data *q = | 658 | struct ieee80211_sched_data *q = |
694 | qdisc_priv(local->mdev->qdisc_sleeping); | 659 | qdisc_priv(local->mdev->qdisc_sleeping); |
695 | int agg_queue = sta->tid_to_tx_q[tid]; | 660 | int agg_queue = sta->tid_to_tx_q[tid]; |
696 | 661 | ||
697 | /* return the qdisc to the pool */ | 662 | /* return the qdisc to the pool */ |
698 | clear_bit(agg_queue, q->qdisc_pool); | 663 | clear_bit(agg_queue, q->qdisc_pool); |
699 | sta->tid_to_tx_q[tid] = local->hw.queues; | 664 | sta->tid_to_tx_q[tid] = QD_NUM(hw); |
700 | 665 | ||
701 | if (requeue) | 666 | if (requeue) |
702 | ieee80211_requeue(local, agg_queue); | 667 | ieee80211_requeue(local, agg_queue); |