diff options
Diffstat (limited to 'net/mac80211/wme.c')
-rw-r--r-- | net/mac80211/wme.c | 166 |
1 files changed, 65 insertions, 101 deletions
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 5d09e8698b5..ffe1af82fa4 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 | } |
@@ -325,7 +310,7 @@ static void wme_qdiscop_destroy(struct Qdisc* qd) | |||
325 | 310 | ||
326 | tcf_destroy_chain(&q->filter_list); | 311 | tcf_destroy_chain(&q->filter_list); |
327 | 312 | ||
328 | for (queue=0; queue < hw->queues; queue++) { | 313 | for (queue = 0; queue < QD_NUM(hw); queue++) { |
329 | skb_queue_purge(&q->requeued[queue]); | 314 | skb_queue_purge(&q->requeued[queue]); |
330 | qdisc_destroy(q->queues[queue]); | 315 | qdisc_destroy(q->queues[queue]); |
331 | q->queues[queue] = &noop_qdisc; | 316 | q->queues[queue] = &noop_qdisc; |
@@ -336,17 +321,6 @@ static void wme_qdiscop_destroy(struct Qdisc* qd) | |||
336 | /* called whenever parameters are updated on existing qdisc */ | 321 | /* called whenever parameters are updated on existing qdisc */ |
337 | static int wme_qdiscop_tune(struct Qdisc *qd, struct nlattr *opt) | 322 | static int wme_qdiscop_tune(struct Qdisc *qd, struct nlattr *opt) |
338 | { | 323 | { |
339 | /* struct ieee80211_sched_data *q = qdisc_priv(qd); | ||
340 | */ | ||
341 | /* check our options block is the right size */ | ||
342 | /* copy any options to our local structure */ | ||
343 | /* Ignore options block for now - always use static mapping | ||
344 | struct tc_ieee80211_qopt *qopt = nla_data(opt); | ||
345 | |||
346 | if (opt->nla_len < nla_attr_size(sizeof(*qopt))) | ||
347 | return -EINVAL; | ||
348 | memcpy(q->tag2queue, qopt->tag2queue, sizeof(qopt->tag2queue)); | ||
349 | */ | ||
350 | return 0; | 324 | return 0; |
351 | } | 325 | } |
352 | 326 | ||
@@ -357,7 +331,7 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt) | |||
357 | struct ieee80211_sched_data *q = qdisc_priv(qd); | 331 | struct ieee80211_sched_data *q = qdisc_priv(qd); |
358 | struct net_device *dev = qd->dev; | 332 | struct net_device *dev = qd->dev; |
359 | struct ieee80211_local *local; | 333 | struct ieee80211_local *local; |
360 | int queues; | 334 | struct ieee80211_hw *hw; |
361 | int err = 0, i; | 335 | int err = 0, i; |
362 | 336 | ||
363 | /* check that device is a mac80211 device */ | 337 | /* check that device is a mac80211 device */ |
@@ -365,29 +339,26 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt) | |||
365 | dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid) | 339 | dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid) |
366 | return -EINVAL; | 340 | return -EINVAL; |
367 | 341 | ||
368 | /* check this device is an ieee80211 master type device */ | 342 | local = wdev_priv(dev->ieee80211_ptr); |
369 | if (dev->type != ARPHRD_IEEE80211) | 343 | hw = &local->hw; |
344 | |||
345 | /* only allow on master dev */ | ||
346 | if (dev != local->mdev) | ||
370 | return -EINVAL; | 347 | return -EINVAL; |
371 | 348 | ||
372 | /* check that there is no qdisc currently attached to device | 349 | /* ensure that we are root qdisc */ |
373 | * this ensures that we will be the root qdisc. (I can't find a better | 350 | if (qd->parent != TC_H_ROOT) |
374 | * way to test this explicitly) */ | ||
375 | if (dev->qdisc_sleeping != &noop_qdisc) | ||
376 | return -EINVAL; | 351 | return -EINVAL; |
377 | 352 | ||
378 | if (qd->flags & TCQ_F_INGRESS) | 353 | if (qd->flags & TCQ_F_INGRESS) |
379 | return -EINVAL; | 354 | return -EINVAL; |
380 | 355 | ||
381 | local = wdev_priv(dev->ieee80211_ptr); | ||
382 | queues = local->hw.queues; | ||
383 | |||
384 | /* if options were passed in, set them */ | 356 | /* if options were passed in, set them */ |
385 | if (opt) { | 357 | if (opt) |
386 | err = wme_qdiscop_tune(qd, opt); | 358 | err = wme_qdiscop_tune(qd, opt); |
387 | } | ||
388 | 359 | ||
389 | /* create child queues */ | 360 | /* create child queues */ |
390 | for (i = 0; i < queues; i++) { | 361 | for (i = 0; i < QD_NUM(hw); i++) { |
391 | skb_queue_head_init(&q->requeued[i]); | 362 | skb_queue_head_init(&q->requeued[i]); |
392 | q->queues[i] = qdisc_create_dflt(qd->dev, &pfifo_qdisc_ops, | 363 | q->queues[i] = qdisc_create_dflt(qd->dev, &pfifo_qdisc_ops, |
393 | qd->handle); | 364 | qd->handle); |
@@ -398,8 +369,8 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt) | |||
398 | } | 369 | } |
399 | } | 370 | } |
400 | 371 | ||
401 | /* reserve all legacy QoS queues */ | 372 | /* non-aggregation queues: reserve/mark as used */ |
402 | for (i = 0; i < min(IEEE80211_TX_QUEUE_DATA4, queues); i++) | 373 | for (i = 0; i < local->hw.queues; i++) |
403 | set_bit(i, q->qdisc_pool); | 374 | set_bit(i, q->qdisc_pool); |
404 | 375 | ||
405 | return err; | 376 | return err; |
@@ -407,16 +378,6 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt) | |||
407 | 378 | ||
408 | static int wme_qdiscop_dump(struct Qdisc *qd, struct sk_buff *skb) | 379 | static int wme_qdiscop_dump(struct Qdisc *qd, struct sk_buff *skb) |
409 | { | 380 | { |
410 | /* struct ieee80211_sched_data *q = qdisc_priv(qd); | ||
411 | unsigned char *p = skb->tail; | ||
412 | struct tc_ieee80211_qopt opt; | ||
413 | |||
414 | memcpy(&opt.tag2queue, q->tag2queue, TC_80211_MAX_TAG + 1); | ||
415 | NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt); | ||
416 | */ return skb->len; | ||
417 | /* | ||
418 | nla_put_failure: | ||
419 | skb_trim(skb, p - skb->data);*/ | ||
420 | return -1; | 381 | return -1; |
421 | } | 382 | } |
422 | 383 | ||
@@ -429,7 +390,7 @@ static int wme_classop_graft(struct Qdisc *qd, unsigned long arg, | |||
429 | struct ieee80211_hw *hw = &local->hw; | 390 | struct ieee80211_hw *hw = &local->hw; |
430 | unsigned long queue = arg - 1; | 391 | unsigned long queue = arg - 1; |
431 | 392 | ||
432 | if (queue >= hw->queues) | 393 | if (queue >= QD_NUM(hw)) |
433 | return -EINVAL; | 394 | return -EINVAL; |
434 | 395 | ||
435 | if (!new) | 396 | if (!new) |
@@ -453,7 +414,7 @@ wme_classop_leaf(struct Qdisc *qd, unsigned long arg) | |||
453 | struct ieee80211_hw *hw = &local->hw; | 414 | struct ieee80211_hw *hw = &local->hw; |
454 | unsigned long queue = arg - 1; | 415 | unsigned long queue = arg - 1; |
455 | 416 | ||
456 | if (queue >= hw->queues) | 417 | if (queue >= QD_NUM(hw)) |
457 | return NULL; | 418 | return NULL; |
458 | 419 | ||
459 | return q->queues[queue]; | 420 | return q->queues[queue]; |
@@ -466,7 +427,7 @@ static unsigned long wme_classop_get(struct Qdisc *qd, u32 classid) | |||
466 | struct ieee80211_hw *hw = &local->hw; | 427 | struct ieee80211_hw *hw = &local->hw; |
467 | unsigned long queue = TC_H_MIN(classid); | 428 | unsigned long queue = TC_H_MIN(classid); |
468 | 429 | ||
469 | if (queue - 1 >= hw->queues) | 430 | if (queue - 1 >= QD_NUM(hw)) |
470 | return 0; | 431 | return 0; |
471 | 432 | ||
472 | return queue; | 433 | return queue; |
@@ -492,7 +453,7 @@ static int wme_classop_change(struct Qdisc *qd, u32 handle, u32 parent, | |||
492 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 453 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
493 | struct ieee80211_hw *hw = &local->hw; | 454 | struct ieee80211_hw *hw = &local->hw; |
494 | 455 | ||
495 | if (cl - 1 > hw->queues) | 456 | if (cl - 1 > QD_NUM(hw)) |
496 | return -ENOENT; | 457 | return -ENOENT; |
497 | 458 | ||
498 | /* TODO: put code to program hardware queue parameters here, | 459 | /* TODO: put code to program hardware queue parameters here, |
@@ -509,7 +470,7 @@ static int wme_classop_delete(struct Qdisc *qd, unsigned long cl) | |||
509 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 470 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
510 | struct ieee80211_hw *hw = &local->hw; | 471 | struct ieee80211_hw *hw = &local->hw; |
511 | 472 | ||
512 | if (cl - 1 > hw->queues) | 473 | if (cl - 1 > QD_NUM(hw)) |
513 | return -ENOENT; | 474 | return -ENOENT; |
514 | return 0; | 475 | return 0; |
515 | } | 476 | } |
@@ -522,7 +483,7 @@ static int wme_classop_dump_class(struct Qdisc *qd, unsigned long cl, | |||
522 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); | 483 | struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr); |
523 | struct ieee80211_hw *hw = &local->hw; | 484 | struct ieee80211_hw *hw = &local->hw; |
524 | 485 | ||
525 | if (cl - 1 > hw->queues) | 486 | if (cl - 1 > QD_NUM(hw)) |
526 | return -ENOENT; | 487 | return -ENOENT; |
527 | tcm->tcm_handle = TC_H_MIN(cl); | 488 | tcm->tcm_handle = TC_H_MIN(cl); |
528 | tcm->tcm_parent = qd->handle; | 489 | tcm->tcm_parent = qd->handle; |
@@ -540,7 +501,7 @@ static void wme_classop_walk(struct Qdisc *qd, struct qdisc_walker *arg) | |||
540 | if (arg->stop) | 501 | if (arg->stop) |
541 | return; | 502 | return; |
542 | 503 | ||
543 | for (queue = 0; queue < hw->queues; queue++) { | 504 | for (queue = 0; queue < QD_NUM(hw); queue++) { |
544 | if (arg->count < arg->skip) { | 505 | if (arg->count < arg->skip) { |
545 | arg->count++; | 506 | arg->count++; |
546 | continue; | 507 | continue; |
@@ -657,10 +618,13 @@ int ieee80211_ht_agg_queue_add(struct ieee80211_local *local, | |||
657 | DECLARE_MAC_BUF(mac); | 618 | DECLARE_MAC_BUF(mac); |
658 | 619 | ||
659 | /* prepare the filter and save it for the SW queue | 620 | /* prepare the filter and save it for the SW queue |
660 | * matching the recieved HW queue */ | 621 | * matching the received HW queue */ |
622 | |||
623 | if (!local->hw.ampdu_queues) | ||
624 | return -EPERM; | ||
661 | 625 | ||
662 | /* try to get a Qdisc from the pool */ | 626 | /* try to get a Qdisc from the pool */ |
663 | for (i = IEEE80211_TX_QUEUE_BEACON; i < local->hw.queues; i++) | 627 | for (i = local->hw.queues; i < QD_NUM(&local->hw); i++) |
664 | if (!test_and_set_bit(i, q->qdisc_pool)) { | 628 | if (!test_and_set_bit(i, q->qdisc_pool)) { |
665 | ieee80211_stop_queue(local_to_hw(local), i); | 629 | ieee80211_stop_queue(local_to_hw(local), i); |
666 | sta->tid_to_tx_q[tid] = i; | 630 | sta->tid_to_tx_q[tid] = i; |
@@ -689,13 +653,14 @@ void ieee80211_ht_agg_queue_remove(struct ieee80211_local *local, | |||
689 | struct sta_info *sta, u16 tid, | 653 | struct sta_info *sta, u16 tid, |
690 | u8 requeue) | 654 | u8 requeue) |
691 | { | 655 | { |
656 | struct ieee80211_hw *hw = &local->hw; | ||
692 | struct ieee80211_sched_data *q = | 657 | struct ieee80211_sched_data *q = |
693 | qdisc_priv(local->mdev->qdisc_sleeping); | 658 | qdisc_priv(local->mdev->qdisc_sleeping); |
694 | int agg_queue = sta->tid_to_tx_q[tid]; | 659 | int agg_queue = sta->tid_to_tx_q[tid]; |
695 | 660 | ||
696 | /* return the qdisc to the pool */ | 661 | /* return the qdisc to the pool */ |
697 | clear_bit(agg_queue, q->qdisc_pool); | 662 | clear_bit(agg_queue, q->qdisc_pool); |
698 | sta->tid_to_tx_q[tid] = local->hw.queues; | 663 | sta->tid_to_tx_q[tid] = QD_NUM(hw); |
699 | 664 | ||
700 | if (requeue) | 665 | if (requeue) |
701 | ieee80211_requeue(local, agg_queue); | 666 | ieee80211_requeue(local, agg_queue); |
@@ -714,7 +679,6 @@ void ieee80211_requeue(struct ieee80211_local *local, int queue) | |||
714 | if (!qdisc || !qdisc->dequeue) | 679 | if (!qdisc || !qdisc->dequeue) |
715 | return; | 680 | return; |
716 | 681 | ||
717 | printk(KERN_DEBUG "requeue: qlen = %d\n", qdisc->q.qlen); | ||
718 | for (len = qdisc->q.qlen; len > 0; len--) { | 682 | for (len = qdisc->q.qlen; len > 0; len--) { |
719 | skb = qdisc->dequeue(qdisc); | 683 | skb = qdisc->dequeue(qdisc); |
720 | root_qd->q.qlen--; | 684 | root_qd->q.qlen--; |