2 * Marvell Wireless LAN device driver: WMM
4 * Copyright (C) 2011-2014, Marvell International Ltd.
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in
9 * accordance with the terms and conditions of the License, a copy of which
10 * is available by writing to the Free Software Foundation, Inc.,
11 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
12 * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
14 * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
16 * ARE EXPRESSLY DISCLAIMED. The License provides additional details about
17 * this warranty disclaimer.
29 /* Maximum value FW can accept for driver delay in packet transmission */
30 #define DRV_PKT_DELAY_TO_FW_MAX 512
33 #define WMM_QUEUED_PACKET_LOWER_LIMIT 180
35 #define WMM_QUEUED_PACKET_UPPER_LIMIT 200
37 /* Offset for TOS field in the IP header */
38 #define IPTOS_OFFSET 5
40 static bool disable_tx_amsdu
;
41 module_param(disable_tx_amsdu
, bool, 0644);
43 /* WMM information IE */
44 static const u8 wmm_info_ie
[] = { WLAN_EID_VENDOR_SPECIFIC
, 0x07,
45 0x00, 0x50, 0xf2, 0x02,
49 static const u8 wmm_aci_to_qidx_map
[] = { WMM_AC_BE
,
55 static u8 tos_to_tid
[] = {
56 /* TID DSCP_P2 DSCP_P1 DSCP_P0 WMM_AC */
57 0x01, /* 0 1 0 AC_BK */
58 0x02, /* 0 0 0 AC_BK */
59 0x00, /* 0 0 1 AC_BE */
60 0x03, /* 0 1 1 AC_BE */
61 0x04, /* 1 0 0 AC_VI */
62 0x05, /* 1 0 1 AC_VI */
63 0x06, /* 1 1 0 AC_VO */
64 0x07 /* 1 1 1 AC_VO */
67 static u8 ac_to_tid
[4][2] = { {1, 2}, {0, 3}, {4, 5}, {6, 7} };
70 * This function debug prints the priority parameters for a WMM AC.
73 mwifiex_wmm_ac_debug_print(const struct ieee_types_wmm_ac_parameters
*ac_param
)
75 const char *ac_str
[] = { "BK", "BE", "VI", "VO" };
77 pr_debug("info: WMM AC_%s: ACI=%d, ACM=%d, Aifsn=%d, "
78 "EcwMin=%d, EcwMax=%d, TxopLimit=%d\n",
79 ac_str
[wmm_aci_to_qidx_map
[(ac_param
->aci_aifsn_bitmap
80 & MWIFIEX_ACI
) >> 5]],
81 (ac_param
->aci_aifsn_bitmap
& MWIFIEX_ACI
) >> 5,
82 (ac_param
->aci_aifsn_bitmap
& MWIFIEX_ACM
) >> 4,
83 ac_param
->aci_aifsn_bitmap
& MWIFIEX_AIFSN
,
84 ac_param
->ecw_bitmap
& MWIFIEX_ECW_MIN
,
85 (ac_param
->ecw_bitmap
& MWIFIEX_ECW_MAX
) >> 4,
86 le16_to_cpu(ac_param
->tx_op_limit
));
90 * This function allocates a route address list.
92 * The function also initializes the list with the provided RA.
94 static struct mwifiex_ra_list_tbl
*
95 mwifiex_wmm_allocate_ralist_node(struct mwifiex_adapter
*adapter
, const u8
*ra
)
97 struct mwifiex_ra_list_tbl
*ra_list
;
99 ra_list
= kzalloc(sizeof(struct mwifiex_ra_list_tbl
), GFP_ATOMIC
);
103 INIT_LIST_HEAD(&ra_list
->list
);
104 skb_queue_head_init(&ra_list
->skb_head
);
106 memcpy(ra_list
->ra
, ra
, ETH_ALEN
);
108 ra_list
->total_pkt_count
= 0;
110 dev_dbg(adapter
->dev
, "info: allocated ra_list %p\n", ra_list
);
115 /* This function returns random no between 16 and 32 to be used as threshold
116 * for no of packets after which BA setup is initiated.
118 static u8
mwifiex_get_random_ba_threshold(void)
121 struct timeval ba_tstamp
;
124 /* setup ba_packet_threshold here random number between
125 * [BA_SETUP_PACKET_OFFSET,
126 * BA_SETUP_PACKET_OFFSET+BA_SETUP_MAX_PACKET_THRESHOLD-1]
129 do_gettimeofday(&ba_tstamp
);
130 sec
= (ba_tstamp
.tv_sec
& 0xFFFF) + (ba_tstamp
.tv_sec
>> 16);
131 usec
= (ba_tstamp
.tv_usec
& 0xFFFF) + (ba_tstamp
.tv_usec
>> 16);
132 ba_threshold
= (((sec
<< 16) + usec
) % BA_SETUP_MAX_PACKET_THRESHOLD
)
133 + BA_SETUP_PACKET_OFFSET
;
139 * This function allocates and adds a RA list for all TIDs
142 void mwifiex_ralist_add(struct mwifiex_private
*priv
, const u8
*ra
)
145 struct mwifiex_ra_list_tbl
*ra_list
;
146 struct mwifiex_adapter
*adapter
= priv
->adapter
;
147 struct mwifiex_sta_node
*node
;
151 for (i
= 0; i
< MAX_NUM_TID
; ++i
) {
152 ra_list
= mwifiex_wmm_allocate_ralist_node(adapter
, ra
);
153 dev_dbg(adapter
->dev
, "info: created ra_list %p\n", ra_list
);
158 ra_list
->is_11n_enabled
= 0;
159 ra_list
->tdls_link
= false;
160 ra_list
->ba_status
= BA_SETUP_NONE
;
161 ra_list
->amsdu_in_ampdu
= false;
162 if (!mwifiex_queuing_ra_based(priv
)) {
163 if (mwifiex_get_tdls_link_status(priv
, ra
) ==
164 TDLS_SETUP_COMPLETE
) {
165 ra_list
->tdls_link
= true;
166 ra_list
->is_11n_enabled
=
167 mwifiex_tdls_peer_11n_enabled(priv
, ra
);
169 ra_list
->is_11n_enabled
= IS_11N_ENABLED(priv
);
172 spin_lock_irqsave(&priv
->sta_list_spinlock
, flags
);
173 node
= mwifiex_get_sta_entry(priv
, ra
);
174 ra_list
->is_11n_enabled
=
175 mwifiex_is_sta_11n_enabled(priv
, node
);
176 if (ra_list
->is_11n_enabled
)
177 ra_list
->max_amsdu
= node
->max_amsdu
;
178 spin_unlock_irqrestore(&priv
->sta_list_spinlock
, flags
);
181 dev_dbg(adapter
->dev
, "data: ralist %p: is_11n_enabled=%d\n",
182 ra_list
, ra_list
->is_11n_enabled
);
184 if (ra_list
->is_11n_enabled
) {
185 ra_list
->ba_pkt_count
= 0;
186 ra_list
->ba_packet_thr
=
187 mwifiex_get_random_ba_threshold();
189 list_add_tail(&ra_list
->list
,
190 &priv
->wmm
.tid_tbl_ptr
[i
].ra_list
);
195 * This function sets the WMM queue priorities to their default values.
197 static void mwifiex_wmm_default_queue_priorities(struct mwifiex_private
*priv
)
199 /* Default queue priorities: VO->VI->BE->BK */
200 priv
->wmm
.queue_priority
[0] = WMM_AC_VO
;
201 priv
->wmm
.queue_priority
[1] = WMM_AC_VI
;
202 priv
->wmm
.queue_priority
[2] = WMM_AC_BE
;
203 priv
->wmm
.queue_priority
[3] = WMM_AC_BK
;
207 * This function map ACs to TIDs.
210 mwifiex_wmm_queue_priorities_tid(struct mwifiex_private
*priv
)
212 struct mwifiex_wmm_desc
*wmm
= &priv
->wmm
;
213 u8
*queue_priority
= wmm
->queue_priority
;
216 for (i
= 0; i
< 4; ++i
) {
217 tos_to_tid
[7 - (i
* 2)] = ac_to_tid
[queue_priority
[i
]][1];
218 tos_to_tid
[6 - (i
* 2)] = ac_to_tid
[queue_priority
[i
]][0];
221 for (i
= 0; i
< MAX_NUM_TID
; ++i
)
222 priv
->tos_to_tid_inv
[tos_to_tid
[i
]] = (u8
)i
;
224 atomic_set(&wmm
->highest_queued_prio
, HIGH_PRIO_TID
);
228 * This function initializes WMM priority queues.
231 mwifiex_wmm_setup_queue_priorities(struct mwifiex_private
*priv
,
232 struct ieee_types_wmm_parameter
*wmm_ie
)
234 u16 cw_min
, avg_back_off
, tmp
[4];
238 if (!wmm_ie
|| !priv
->wmm_enabled
) {
239 /* WMM is not enabled, just set the defaults and return */
240 mwifiex_wmm_default_queue_priorities(priv
);
244 dev_dbg(priv
->adapter
->dev
, "info: WMM Parameter IE: version=%d, "
245 "qos_info Parameter Set Count=%d, Reserved=%#x\n",
246 wmm_ie
->vend_hdr
.version
, wmm_ie
->qos_info_bitmap
&
247 IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK
,
250 for (num_ac
= 0; num_ac
< ARRAY_SIZE(wmm_ie
->ac_params
); num_ac
++) {
251 u8 ecw
= wmm_ie
->ac_params
[num_ac
].ecw_bitmap
;
252 u8 aci_aifsn
= wmm_ie
->ac_params
[num_ac
].aci_aifsn_bitmap
;
253 cw_min
= (1 << (ecw
& MWIFIEX_ECW_MIN
)) - 1;
254 avg_back_off
= (cw_min
>> 1) + (aci_aifsn
& MWIFIEX_AIFSN
);
256 ac_idx
= wmm_aci_to_qidx_map
[(aci_aifsn
& MWIFIEX_ACI
) >> 5];
257 priv
->wmm
.queue_priority
[ac_idx
] = ac_idx
;
258 tmp
[ac_idx
] = avg_back_off
;
260 dev_dbg(priv
->adapter
->dev
,
261 "info: WMM: CWmax=%d CWmin=%d Avg Back-off=%d\n",
262 (1 << ((ecw
& MWIFIEX_ECW_MAX
) >> 4)) - 1,
263 cw_min
, avg_back_off
);
264 mwifiex_wmm_ac_debug_print(&wmm_ie
->ac_params
[num_ac
]);
268 for (i
= 0; i
< num_ac
; i
++) {
269 for (j
= 1; j
< num_ac
- i
; j
++) {
270 if (tmp
[j
- 1] > tmp
[j
]) {
271 swap(tmp
[j
- 1], tmp
[j
]);
272 swap(priv
->wmm
.queue_priority
[j
- 1],
273 priv
->wmm
.queue_priority
[j
]);
274 } else if (tmp
[j
- 1] == tmp
[j
]) {
275 if (priv
->wmm
.queue_priority
[j
- 1]
276 < priv
->wmm
.queue_priority
[j
])
277 swap(priv
->wmm
.queue_priority
[j
- 1],
278 priv
->wmm
.queue_priority
[j
]);
283 mwifiex_wmm_queue_priorities_tid(priv
);
287 * This function evaluates whether or not an AC is to be downgraded.
289 * In case the AC is not enabled, the highest AC is returned that is
290 * enabled and does not require admission control.
292 static enum mwifiex_wmm_ac_e
293 mwifiex_wmm_eval_downgrade_ac(struct mwifiex_private
*priv
,
294 enum mwifiex_wmm_ac_e eval_ac
)
297 enum mwifiex_wmm_ac_e ret_ac
;
298 struct mwifiex_wmm_ac_status
*ac_status
;
300 ac_status
= &priv
->wmm
.ac_status
[eval_ac
];
302 if (!ac_status
->disabled
)
303 /* Okay to use this AC, its enabled */
306 /* Setup a default return value of the lowest priority */
310 * Find the highest AC that is enabled and does not require
311 * admission control. The spec disallows downgrading to an AC,
312 * which is enabled due to a completed admission control.
313 * Unadmitted traffic is not to be sent on an AC with admitted
316 for (down_ac
= WMM_AC_BK
; down_ac
< eval_ac
; down_ac
++) {
317 ac_status
= &priv
->wmm
.ac_status
[down_ac
];
319 if (!ac_status
->disabled
&& !ac_status
->flow_required
)
320 /* AC is enabled and does not require admission
322 ret_ac
= (enum mwifiex_wmm_ac_e
) down_ac
;
329 * This function downgrades WMM priority queue.
332 mwifiex_wmm_setup_ac_downgrade(struct mwifiex_private
*priv
)
336 dev_dbg(priv
->adapter
->dev
, "info: WMM: AC Priorities:"
337 "BK(0), BE(1), VI(2), VO(3)\n");
339 if (!priv
->wmm_enabled
) {
340 /* WMM is not enabled, default priorities */
341 for (ac_val
= WMM_AC_BK
; ac_val
<= WMM_AC_VO
; ac_val
++)
342 priv
->wmm
.ac_down_graded_vals
[ac_val
] =
343 (enum mwifiex_wmm_ac_e
) ac_val
;
345 for (ac_val
= WMM_AC_BK
; ac_val
<= WMM_AC_VO
; ac_val
++) {
346 priv
->wmm
.ac_down_graded_vals
[ac_val
]
347 = mwifiex_wmm_eval_downgrade_ac(priv
,
348 (enum mwifiex_wmm_ac_e
) ac_val
);
349 dev_dbg(priv
->adapter
->dev
,
350 "info: WMM: AC PRIO %d maps to %d\n",
351 ac_val
, priv
->wmm
.ac_down_graded_vals
[ac_val
]);
357 * This function converts the IP TOS field to an WMM AC
360 static enum mwifiex_wmm_ac_e
361 mwifiex_wmm_convert_tos_to_ac(struct mwifiex_adapter
*adapter
, u32 tos
)
363 /* Map of TOS UP values to WMM AC */
364 const enum mwifiex_wmm_ac_e tos_to_ac
[] = { WMM_AC_BE
,
374 if (tos
>= ARRAY_SIZE(tos_to_ac
))
377 return tos_to_ac
[tos
];
381 * This function evaluates a given TID and downgrades it to a lower
382 * TID if the WMM Parameter IE received from the AP indicates that the
383 * AP is disabled (due to call admission control (ACM bit). Mapping
384 * of TID to AC is taken care of internally.
386 u8
mwifiex_wmm_downgrade_tid(struct mwifiex_private
*priv
, u32 tid
)
388 enum mwifiex_wmm_ac_e ac
, ac_down
;
391 ac
= mwifiex_wmm_convert_tos_to_ac(priv
->adapter
, tid
);
392 ac_down
= priv
->wmm
.ac_down_graded_vals
[ac
];
394 /* Send the index to tid array, picking from the array will be
395 * taken care by dequeuing function
397 new_tid
= ac_to_tid
[ac_down
][tid
% 2];
403 * This function initializes the WMM state information and the
404 * WMM data path queues.
407 mwifiex_wmm_init(struct mwifiex_adapter
*adapter
)
410 struct mwifiex_private
*priv
;
412 for (j
= 0; j
< adapter
->priv_num
; ++j
) {
413 priv
= adapter
->priv
[j
];
417 for (i
= 0; i
< MAX_NUM_TID
; ++i
) {
418 if (!disable_tx_amsdu
&&
419 adapter
->tx_buf_size
> MWIFIEX_TX_DATA_BUF_SIZE_2K
)
420 priv
->aggr_prio_tbl
[i
].amsdu
=
421 priv
->tos_to_tid_inv
[i
];
423 priv
->aggr_prio_tbl
[i
].amsdu
=
424 BA_STREAM_NOT_ALLOWED
;
425 priv
->aggr_prio_tbl
[i
].ampdu_ap
=
426 priv
->tos_to_tid_inv
[i
];
427 priv
->aggr_prio_tbl
[i
].ampdu_user
=
428 priv
->tos_to_tid_inv
[i
];
431 priv
->aggr_prio_tbl
[6].amsdu
432 = priv
->aggr_prio_tbl
[6].ampdu_ap
433 = priv
->aggr_prio_tbl
[6].ampdu_user
434 = BA_STREAM_NOT_ALLOWED
;
436 priv
->aggr_prio_tbl
[7].amsdu
= priv
->aggr_prio_tbl
[7].ampdu_ap
437 = priv
->aggr_prio_tbl
[7].ampdu_user
438 = BA_STREAM_NOT_ALLOWED
;
440 mwifiex_set_ba_params(priv
);
441 mwifiex_reset_11n_rx_seq_num(priv
);
443 atomic_set(&priv
->wmm
.tx_pkts_queued
, 0);
444 atomic_set(&priv
->wmm
.highest_queued_prio
, HIGH_PRIO_TID
);
449 * This function checks if WMM Tx queue is empty.
452 mwifiex_wmm_lists_empty(struct mwifiex_adapter
*adapter
)
455 struct mwifiex_private
*priv
;
457 for (i
= 0; i
< adapter
->priv_num
; ++i
) {
458 priv
= adapter
->priv
[i
];
459 if (priv
&& atomic_read(&priv
->wmm
.tx_pkts_queued
))
467 * This function deletes all packets in an RA list node.
469 * The packet sent completion callback handler are called with
470 * status failure, after they are dequeued to ensure proper
471 * cleanup. The RA list node itself is freed at the end.
474 mwifiex_wmm_del_pkts_in_ralist_node(struct mwifiex_private
*priv
,
475 struct mwifiex_ra_list_tbl
*ra_list
)
477 struct mwifiex_adapter
*adapter
= priv
->adapter
;
478 struct sk_buff
*skb
, *tmp
;
480 skb_queue_walk_safe(&ra_list
->skb_head
, skb
, tmp
)
481 mwifiex_write_data_complete(adapter
, skb
, 0, -1);
485 * This function deletes all packets in an RA list.
487 * Each nodes in the RA list are freed individually first, and then
488 * the RA list itself is freed.
491 mwifiex_wmm_del_pkts_in_ralist(struct mwifiex_private
*priv
,
492 struct list_head
*ra_list_head
)
494 struct mwifiex_ra_list_tbl
*ra_list
;
496 list_for_each_entry(ra_list
, ra_list_head
, list
)
497 mwifiex_wmm_del_pkts_in_ralist_node(priv
, ra_list
);
501 * This function deletes all packets in all RA lists.
503 static void mwifiex_wmm_cleanup_queues(struct mwifiex_private
*priv
)
507 for (i
= 0; i
< MAX_NUM_TID
; i
++)
508 mwifiex_wmm_del_pkts_in_ralist(priv
, &priv
->wmm
.tid_tbl_ptr
[i
].
511 atomic_set(&priv
->wmm
.tx_pkts_queued
, 0);
512 atomic_set(&priv
->wmm
.highest_queued_prio
, HIGH_PRIO_TID
);
516 * This function deletes all route addresses from all RA lists.
518 static void mwifiex_wmm_delete_all_ralist(struct mwifiex_private
*priv
)
520 struct mwifiex_ra_list_tbl
*ra_list
, *tmp_node
;
523 for (i
= 0; i
< MAX_NUM_TID
; ++i
) {
524 dev_dbg(priv
->adapter
->dev
,
525 "info: ra_list: freeing buf for tid %d\n", i
);
526 list_for_each_entry_safe(ra_list
, tmp_node
,
527 &priv
->wmm
.tid_tbl_ptr
[i
].ra_list
,
529 list_del(&ra_list
->list
);
533 INIT_LIST_HEAD(&priv
->wmm
.tid_tbl_ptr
[i
].ra_list
);
537 static int mwifiex_free_ack_frame(int id
, void *p
, void *data
)
539 pr_warn("Have pending ack frames!\n");
545 * This function cleans up the Tx and Rx queues.
548 * - All packets in RA lists
549 * - All entries in Rx reorder table
550 * - All entries in Tx BA stream table
551 * - MPA buffer (if required)
555 mwifiex_clean_txrx(struct mwifiex_private
*priv
)
558 struct sk_buff
*skb
, *tmp
;
560 mwifiex_11n_cleanup_reorder_tbl(priv
);
561 spin_lock_irqsave(&priv
->wmm
.ra_list_spinlock
, flags
);
563 mwifiex_wmm_cleanup_queues(priv
);
564 mwifiex_11n_delete_all_tx_ba_stream_tbl(priv
);
566 if (priv
->adapter
->if_ops
.cleanup_mpa_buf
)
567 priv
->adapter
->if_ops
.cleanup_mpa_buf(priv
->adapter
);
569 mwifiex_wmm_delete_all_ralist(priv
);
570 memcpy(tos_to_tid
, ac_to_tid
, sizeof(tos_to_tid
));
572 if (priv
->adapter
->if_ops
.clean_pcie_ring
&&
573 !priv
->adapter
->surprise_removed
)
574 priv
->adapter
->if_ops
.clean_pcie_ring(priv
->adapter
);
575 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
, flags
);
577 skb_queue_walk_safe(&priv
->tdls_txq
, skb
, tmp
)
578 mwifiex_write_data_complete(priv
->adapter
, skb
, 0, -1);
580 idr_for_each(&priv
->ack_status_frames
, mwifiex_free_ack_frame
, NULL
);
581 idr_destroy(&priv
->ack_status_frames
);
585 * This function retrieves a particular RA list node, matching with the
586 * given TID and RA address.
588 struct mwifiex_ra_list_tbl
*
589 mwifiex_wmm_get_ralist_node(struct mwifiex_private
*priv
, u8 tid
,
592 struct mwifiex_ra_list_tbl
*ra_list
;
594 list_for_each_entry(ra_list
, &priv
->wmm
.tid_tbl_ptr
[tid
].ra_list
,
596 if (!memcmp(ra_list
->ra
, ra_addr
, ETH_ALEN
))
604 * This function retrieves an RA list node for a given TID and
607 * If no such node is found, a new node is added first and then
610 struct mwifiex_ra_list_tbl
*
611 mwifiex_wmm_get_queue_raptr(struct mwifiex_private
*priv
, u8 tid
,
614 struct mwifiex_ra_list_tbl
*ra_list
;
616 ra_list
= mwifiex_wmm_get_ralist_node(priv
, tid
, ra_addr
);
619 mwifiex_ralist_add(priv
, ra_addr
);
621 return mwifiex_wmm_get_ralist_node(priv
, tid
, ra_addr
);
625 * This function deletes RA list nodes for given mac for all TIDs.
626 * Function also decrements TX pending count accordingly.
629 mwifiex_wmm_del_peer_ra_list(struct mwifiex_private
*priv
, const u8
*ra_addr
)
631 struct mwifiex_ra_list_tbl
*ra_list
;
635 spin_lock_irqsave(&priv
->wmm
.ra_list_spinlock
, flags
);
637 for (i
= 0; i
< MAX_NUM_TID
; ++i
) {
638 ra_list
= mwifiex_wmm_get_ralist_node(priv
, i
, ra_addr
);
642 mwifiex_wmm_del_pkts_in_ralist_node(priv
, ra_list
);
643 atomic_sub(ra_list
->total_pkt_count
, &priv
->wmm
.tx_pkts_queued
);
644 list_del(&ra_list
->list
);
647 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
, flags
);
651 * This function checks if a particular RA list node exists in a given TID
655 mwifiex_is_ralist_valid(struct mwifiex_private
*priv
,
656 struct mwifiex_ra_list_tbl
*ra_list
, int ptr_index
)
658 struct mwifiex_ra_list_tbl
*rlist
;
660 list_for_each_entry(rlist
, &priv
->wmm
.tid_tbl_ptr
[ptr_index
].ra_list
,
662 if (rlist
== ra_list
)
670 * This function adds a packet to WMM queue.
672 * In disconnected state the packet is immediately dropped and the
673 * packet send completion callback is called with status failure.
675 * Otherwise, the correct RA list node is located and the packet
676 * is queued at the list tail.
679 mwifiex_wmm_add_buf_txqueue(struct mwifiex_private
*priv
,
682 struct mwifiex_adapter
*adapter
= priv
->adapter
;
684 struct mwifiex_ra_list_tbl
*ra_list
;
685 u8 ra
[ETH_ALEN
], tid_down
;
687 struct list_head list_head
;
688 int tdls_status
= TDLS_NOT_SETUP
;
689 struct ethhdr
*eth_hdr
= (struct ethhdr
*)skb
->data
;
690 struct mwifiex_txinfo
*tx_info
= MWIFIEX_SKB_TXCB(skb
);
692 memcpy(ra
, eth_hdr
->h_dest
, ETH_ALEN
);
694 if (GET_BSS_ROLE(priv
) == MWIFIEX_BSS_ROLE_STA
&&
695 ISSUPP_TDLS_ENABLED(adapter
->fw_cap_info
)) {
696 if (ntohs(eth_hdr
->h_proto
) == ETH_P_TDLS
)
697 dev_dbg(adapter
->dev
,
698 "TDLS setup packet for %pM. Don't block\n", ra
);
699 else if (memcmp(priv
->cfg_bssid
, ra
, ETH_ALEN
))
700 tdls_status
= mwifiex_get_tdls_link_status(priv
, ra
);
703 if (!priv
->media_connected
&& !mwifiex_is_skb_mgmt_frame(skb
)) {
704 dev_dbg(adapter
->dev
, "data: drop packet in disconnect\n");
705 mwifiex_write_data_complete(adapter
, skb
, 0, -1);
711 spin_lock_irqsave(&priv
->wmm
.ra_list_spinlock
, flags
);
713 tid_down
= mwifiex_wmm_downgrade_tid(priv
, tid
);
715 /* In case of infra as we have already created the list during
716 association we just don't have to call get_queue_raptr, we will
717 have only 1 raptr for a tid in case of infra */
718 if (!mwifiex_queuing_ra_based(priv
) &&
719 !mwifiex_is_skb_mgmt_frame(skb
)) {
720 switch (tdls_status
) {
721 case TDLS_SETUP_COMPLETE
:
722 ra_list
= mwifiex_wmm_get_queue_raptr(priv
, tid_down
,
724 tx_info
->flags
|= MWIFIEX_BUF_FLAG_TDLS_PKT
;
726 case TDLS_SETUP_INPROGRESS
:
727 skb_queue_tail(&priv
->tdls_txq
, skb
);
728 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
,
732 list_head
= priv
->wmm
.tid_tbl_ptr
[tid_down
].ra_list
;
733 if (!list_empty(&list_head
))
734 ra_list
= list_first_entry(
735 &list_head
, struct mwifiex_ra_list_tbl
,
742 memcpy(ra
, skb
->data
, ETH_ALEN
);
743 if (ra
[0] & 0x01 || mwifiex_is_skb_mgmt_frame(skb
))
744 eth_broadcast_addr(ra
);
745 ra_list
= mwifiex_wmm_get_queue_raptr(priv
, tid_down
, ra
);
749 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
, flags
);
750 mwifiex_write_data_complete(adapter
, skb
, 0, -1);
754 skb_queue_tail(&ra_list
->skb_head
, skb
);
756 ra_list
->ba_pkt_count
++;
757 ra_list
->total_pkt_count
++;
759 if (atomic_read(&priv
->wmm
.highest_queued_prio
) <
760 priv
->tos_to_tid_inv
[tid_down
])
761 atomic_set(&priv
->wmm
.highest_queued_prio
,
762 priv
->tos_to_tid_inv
[tid_down
]);
764 atomic_inc(&priv
->wmm
.tx_pkts_queued
);
766 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
, flags
);
770 * This function processes the get WMM status command response from firmware.
772 * The response may contain multiple TLVs -
773 * - AC Queue status TLVs
774 * - Current WMM Parameter IE TLV
775 * - Admission Control action frame TLVs
777 * This function parses the TLVs and then calls further specific functions
778 * to process any changes in the queue prioritize or state.
780 int mwifiex_ret_wmm_get_status(struct mwifiex_private
*priv
,
781 const struct host_cmd_ds_command
*resp
)
783 u8
*curr
= (u8
*) &resp
->params
.get_wmm_status
;
784 uint16_t resp_len
= le16_to_cpu(resp
->size
), tlv_len
;
787 struct mwifiex_ie_types_data
*tlv_hdr
;
788 struct mwifiex_ie_types_wmm_queue_status
*tlv_wmm_qstatus
;
789 struct ieee_types_wmm_parameter
*wmm_param_ie
= NULL
;
790 struct mwifiex_wmm_ac_status
*ac_status
;
792 dev_dbg(priv
->adapter
->dev
, "info: WMM: WMM_GET_STATUS cmdresp received: %d\n",
795 while ((resp_len
>= sizeof(tlv_hdr
->header
)) && valid
) {
796 tlv_hdr
= (struct mwifiex_ie_types_data
*) curr
;
797 tlv_len
= le16_to_cpu(tlv_hdr
->header
.len
);
799 if (resp_len
< tlv_len
+ sizeof(tlv_hdr
->header
))
802 switch (le16_to_cpu(tlv_hdr
->header
.type
)) {
803 case TLV_TYPE_WMMQSTATUS
:
805 (struct mwifiex_ie_types_wmm_queue_status
*)
807 dev_dbg(priv
->adapter
->dev
,
808 "info: CMD_RESP: WMM_GET_STATUS:"
809 " QSTATUS TLV: %d, %d, %d\n",
810 tlv_wmm_qstatus
->queue_index
,
811 tlv_wmm_qstatus
->flow_required
,
812 tlv_wmm_qstatus
->disabled
);
814 ac_status
= &priv
->wmm
.ac_status
[tlv_wmm_qstatus
->
816 ac_status
->disabled
= tlv_wmm_qstatus
->disabled
;
817 ac_status
->flow_required
=
818 tlv_wmm_qstatus
->flow_required
;
819 ac_status
->flow_created
= tlv_wmm_qstatus
->flow_created
;
822 case WLAN_EID_VENDOR_SPECIFIC
:
824 * Point the regular IEEE IE 2 bytes into the Marvell IE
825 * and setup the IEEE IE type and length byte fields
829 (struct ieee_types_wmm_parameter
*) (curr
+
831 wmm_param_ie
->vend_hdr
.len
= (u8
) tlv_len
;
832 wmm_param_ie
->vend_hdr
.element_id
=
833 WLAN_EID_VENDOR_SPECIFIC
;
835 dev_dbg(priv
->adapter
->dev
,
836 "info: CMD_RESP: WMM_GET_STATUS:"
837 " WMM Parameter Set Count: %d\n",
838 wmm_param_ie
->qos_info_bitmap
&
839 IEEE80211_WMM_IE_AP_QOSINFO_PARAM_SET_CNT_MASK
);
841 memcpy((u8
*) &priv
->curr_bss_params
.bss_descriptor
.
842 wmm_ie
, wmm_param_ie
,
843 wmm_param_ie
->vend_hdr
.len
+ 2);
852 curr
+= (tlv_len
+ sizeof(tlv_hdr
->header
));
853 resp_len
-= (tlv_len
+ sizeof(tlv_hdr
->header
));
856 mwifiex_wmm_setup_queue_priorities(priv
, wmm_param_ie
);
857 mwifiex_wmm_setup_ac_downgrade(priv
);
863 * Callback handler from the command module to allow insertion of a WMM TLV.
865 * If the BSS we are associating to supports WMM, this function adds the
866 * required WMM Information IE to the association request command buffer in
867 * the form of a Marvell extended IEEE IE.
870 mwifiex_wmm_process_association_req(struct mwifiex_private
*priv
,
872 struct ieee_types_wmm_parameter
*wmm_ie
,
873 struct ieee80211_ht_cap
*ht_cap
)
875 struct mwifiex_ie_types_wmm_param_set
*wmm_tlv
;
887 dev_dbg(priv
->adapter
->dev
,
888 "info: WMM: process assoc req: bss->wmm_ie=%#x\n",
889 wmm_ie
->vend_hdr
.element_id
);
891 if ((priv
->wmm_required
||
892 (ht_cap
&& (priv
->adapter
->config_bands
& BAND_GN
||
893 priv
->adapter
->config_bands
& BAND_AN
))) &&
894 wmm_ie
->vend_hdr
.element_id
== WLAN_EID_VENDOR_SPECIFIC
) {
895 wmm_tlv
= (struct mwifiex_ie_types_wmm_param_set
*) *assoc_buf
;
896 wmm_tlv
->header
.type
= cpu_to_le16((u16
) wmm_info_ie
[0]);
897 wmm_tlv
->header
.len
= cpu_to_le16((u16
) wmm_info_ie
[1]);
898 memcpy(wmm_tlv
->wmm_ie
, &wmm_info_ie
[2],
899 le16_to_cpu(wmm_tlv
->header
.len
));
900 if (wmm_ie
->qos_info_bitmap
& IEEE80211_WMM_IE_AP_QOSINFO_UAPSD
)
901 memcpy((u8
*) (wmm_tlv
->wmm_ie
902 + le16_to_cpu(wmm_tlv
->header
.len
)
903 - sizeof(priv
->wmm_qosinfo
)),
904 &priv
->wmm_qosinfo
, sizeof(priv
->wmm_qosinfo
));
906 ret_len
= sizeof(wmm_tlv
->header
)
907 + le16_to_cpu(wmm_tlv
->header
.len
);
909 *assoc_buf
+= ret_len
;
916 * This function computes the time delay in the driver queues for a
919 * When the packet is received at the OS/Driver interface, the current
920 * time is set in the packet structure. The difference between the present
921 * time and that received time is computed in this function and limited
922 * based on pre-compiled limits in the driver.
925 mwifiex_wmm_compute_drv_pkt_delay(struct mwifiex_private
*priv
,
926 const struct sk_buff
*skb
)
928 u32 queue_delay
= ktime_to_ms(net_timedelta(skb
->tstamp
));
932 * Queue delay is passed as a uint8 in units of 2ms (ms shifted
933 * by 1). Min value (other than 0) is therefore 2ms, max is 510ms.
935 * Pass max value if queue_delay is beyond the uint8 range
937 ret_val
= (u8
) (min(queue_delay
, priv
->wmm
.drv_pkt_delay_max
) >> 1);
939 dev_dbg(priv
->adapter
->dev
, "data: WMM: Pkt Delay: %d ms,"
940 " %d ms sent to FW\n", queue_delay
, ret_val
);
946 * This function retrieves the highest priority RA list table pointer.
948 static struct mwifiex_ra_list_tbl
*
949 mwifiex_wmm_get_highest_priolist_ptr(struct mwifiex_adapter
*adapter
,
950 struct mwifiex_private
**priv
, int *tid
)
952 struct mwifiex_private
*priv_tmp
;
953 struct mwifiex_ra_list_tbl
*ptr
;
954 struct mwifiex_tid_tbl
*tid_ptr
;
956 unsigned long flags_ra
;
959 /* check the BSS with highest priority first */
960 for (j
= adapter
->priv_num
- 1; j
>= 0; --j
) {
961 /* iterate over BSS with the equal priority */
962 list_for_each_entry(adapter
->bss_prio_tbl
[j
].bss_prio_cur
,
963 &adapter
->bss_prio_tbl
[j
].bss_prio_head
,
966 priv_tmp
= adapter
->bss_prio_tbl
[j
].bss_prio_cur
->priv
;
968 if (atomic_read(&priv_tmp
->wmm
.tx_pkts_queued
) == 0)
971 /* iterate over the WMM queues of the BSS */
972 hqp
= &priv_tmp
->wmm
.highest_queued_prio
;
973 for (i
= atomic_read(hqp
); i
>= LOW_PRIO_TID
; --i
) {
975 spin_lock_irqsave(&priv_tmp
->wmm
.
976 ra_list_spinlock
, flags_ra
);
978 tid_ptr
= &(priv_tmp
)->wmm
.
979 tid_tbl_ptr
[tos_to_tid
[i
]];
981 /* iterate over receiver addresses */
982 list_for_each_entry(ptr
, &tid_ptr
->ra_list
,
985 if (!skb_queue_empty(&ptr
->skb_head
))
986 /* holds both locks */
990 spin_unlock_irqrestore(&priv_tmp
->wmm
.
1001 /* holds ra_list_spinlock */
1002 if (atomic_read(hqp
) > i
)
1004 spin_unlock_irqrestore(&priv_tmp
->wmm
.ra_list_spinlock
, flags_ra
);
1007 *tid
= tos_to_tid
[i
];
1012 /* This functions rotates ra and bss lists so packets are picked round robin.
1014 * After a packet is successfully transmitted, rotate the ra list, so the ra
1015 * next to the one transmitted, will come first in the list. This way we pick
1016 * the ra' in a round robin fashion. Same applies to bss nodes of equal
1019 * Function also increments wmm.packets_out counter.
1021 void mwifiex_rotate_priolists(struct mwifiex_private
*priv
,
1022 struct mwifiex_ra_list_tbl
*ra
,
1025 struct mwifiex_adapter
*adapter
= priv
->adapter
;
1026 struct mwifiex_bss_prio_tbl
*tbl
= adapter
->bss_prio_tbl
;
1027 struct mwifiex_tid_tbl
*tid_ptr
= &priv
->wmm
.tid_tbl_ptr
[tid
];
1028 unsigned long flags
;
1030 spin_lock_irqsave(&tbl
[priv
->bss_priority
].bss_prio_lock
, flags
);
1032 * dirty trick: we remove 'head' temporarily and reinsert it after
1033 * curr bss node. imagine list to stay fixed while head is moved
1035 list_move(&tbl
[priv
->bss_priority
].bss_prio_head
,
1036 &tbl
[priv
->bss_priority
].bss_prio_cur
->list
);
1037 spin_unlock_irqrestore(&tbl
[priv
->bss_priority
].bss_prio_lock
, flags
);
1039 spin_lock_irqsave(&priv
->wmm
.ra_list_spinlock
, flags
);
1040 if (mwifiex_is_ralist_valid(priv
, ra
, tid
)) {
1041 priv
->wmm
.packets_out
[tid
]++;
1043 list_move(&tid_ptr
->ra_list
, &ra
->list
);
1045 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
, flags
);
1049 * This function checks if 11n aggregation is possible.
1052 mwifiex_is_11n_aggragation_possible(struct mwifiex_private
*priv
,
1053 struct mwifiex_ra_list_tbl
*ptr
,
1056 int count
= 0, total_size
= 0;
1057 struct sk_buff
*skb
, *tmp
;
1060 if (priv
->bss_role
== MWIFIEX_BSS_ROLE_UAP
&& priv
->ap_11n_enabled
&&
1061 ptr
->is_11n_enabled
)
1062 max_amsdu_size
= min_t(int, ptr
->max_amsdu
, max_buf_size
);
1064 max_amsdu_size
= max_buf_size
;
1066 skb_queue_walk_safe(&ptr
->skb_head
, skb
, tmp
) {
1067 total_size
+= skb
->len
;
1068 if (total_size
>= max_amsdu_size
)
1070 if (++count
>= MIN_NUM_AMSDU
)
1078 * This function sends a single packet to firmware for transmission.
1081 mwifiex_send_single_packet(struct mwifiex_private
*priv
,
1082 struct mwifiex_ra_list_tbl
*ptr
, int ptr_index
,
1083 unsigned long ra_list_flags
)
1084 __releases(&priv
->wmm
.ra_list_spinlock
)
1086 struct sk_buff
*skb
, *skb_next
;
1087 struct mwifiex_tx_param tx_param
;
1088 struct mwifiex_adapter
*adapter
= priv
->adapter
;
1089 struct mwifiex_txinfo
*tx_info
;
1091 if (skb_queue_empty(&ptr
->skb_head
)) {
1092 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
,
1094 dev_dbg(adapter
->dev
, "data: nothing to send\n");
1098 skb
= skb_dequeue(&ptr
->skb_head
);
1100 tx_info
= MWIFIEX_SKB_TXCB(skb
);
1101 dev_dbg(adapter
->dev
, "data: dequeuing the packet %p %p\n", ptr
, skb
);
1103 ptr
->total_pkt_count
--;
1105 if (!skb_queue_empty(&ptr
->skb_head
))
1106 skb_next
= skb_peek(&ptr
->skb_head
);
1110 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
, ra_list_flags
);
1112 tx_param
.next_pkt_len
= ((skb_next
) ? skb_next
->len
+
1113 sizeof(struct txpd
) : 0);
1115 if (mwifiex_process_tx(priv
, skb
, &tx_param
) == -EBUSY
) {
1116 /* Queue the packet back at the head */
1117 spin_lock_irqsave(&priv
->wmm
.ra_list_spinlock
, ra_list_flags
);
1119 if (!mwifiex_is_ralist_valid(priv
, ptr
, ptr_index
)) {
1120 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
,
1122 mwifiex_write_data_complete(adapter
, skb
, 0, -1);
1126 skb_queue_tail(&ptr
->skb_head
, skb
);
1128 ptr
->total_pkt_count
++;
1129 ptr
->ba_pkt_count
++;
1130 tx_info
->flags
|= MWIFIEX_BUF_FLAG_REQUEUED_PKT
;
1131 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
,
1134 mwifiex_rotate_priolists(priv
, ptr
, ptr_index
);
1135 atomic_dec(&priv
->wmm
.tx_pkts_queued
);
1140 * This function checks if the first packet in the given RA list
1141 * is already processed or not.
1144 mwifiex_is_ptr_processed(struct mwifiex_private
*priv
,
1145 struct mwifiex_ra_list_tbl
*ptr
)
1147 struct sk_buff
*skb
;
1148 struct mwifiex_txinfo
*tx_info
;
1150 if (skb_queue_empty(&ptr
->skb_head
))
1153 skb
= skb_peek(&ptr
->skb_head
);
1155 tx_info
= MWIFIEX_SKB_TXCB(skb
);
1156 if (tx_info
->flags
& MWIFIEX_BUF_FLAG_REQUEUED_PKT
)
1163 * This function sends a single processed packet to firmware for
1167 mwifiex_send_processed_packet(struct mwifiex_private
*priv
,
1168 struct mwifiex_ra_list_tbl
*ptr
, int ptr_index
,
1169 unsigned long ra_list_flags
)
1170 __releases(&priv
->wmm
.ra_list_spinlock
)
1172 struct mwifiex_tx_param tx_param
;
1173 struct mwifiex_adapter
*adapter
= priv
->adapter
;
1175 struct sk_buff
*skb
, *skb_next
;
1176 struct mwifiex_txinfo
*tx_info
;
1178 if (skb_queue_empty(&ptr
->skb_head
)) {
1179 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
,
1184 skb
= skb_dequeue(&ptr
->skb_head
);
1186 if (adapter
->data_sent
|| adapter
->tx_lock_flag
) {
1187 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
,
1189 skb_queue_tail(&adapter
->tx_data_q
, skb
);
1190 atomic_inc(&adapter
->tx_queued
);
1194 if (!skb_queue_empty(&ptr
->skb_head
))
1195 skb_next
= skb_peek(&ptr
->skb_head
);
1199 tx_info
= MWIFIEX_SKB_TXCB(skb
);
1201 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
, ra_list_flags
);
1203 if (adapter
->iface_type
== MWIFIEX_USB
) {
1204 adapter
->data_sent
= true;
1205 ret
= adapter
->if_ops
.host_to_card(adapter
, MWIFIEX_USB_EP_DATA
,
1208 tx_param
.next_pkt_len
=
1209 ((skb_next
) ? skb_next
->len
+
1210 sizeof(struct txpd
) : 0);
1211 ret
= adapter
->if_ops
.host_to_card(adapter
, MWIFIEX_TYPE_DATA
,
1217 dev_dbg(adapter
->dev
, "data: -EBUSY is returned\n");
1218 spin_lock_irqsave(&priv
->wmm
.ra_list_spinlock
, ra_list_flags
);
1220 if (!mwifiex_is_ralist_valid(priv
, ptr
, ptr_index
)) {
1221 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
,
1223 mwifiex_write_data_complete(adapter
, skb
, 0, -1);
1227 skb_queue_tail(&ptr
->skb_head
, skb
);
1229 tx_info
->flags
|= MWIFIEX_BUF_FLAG_REQUEUED_PKT
;
1230 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
,
1234 if (adapter
->iface_type
!= MWIFIEX_PCIE
)
1235 adapter
->data_sent
= false;
1236 dev_err(adapter
->dev
, "host_to_card failed: %#x\n", ret
);
1237 adapter
->dbg
.num_tx_host_to_card_failure
++;
1238 mwifiex_write_data_complete(adapter
, skb
, 0, ret
);
1241 if (adapter
->iface_type
!= MWIFIEX_PCIE
)
1242 adapter
->data_sent
= false;
1245 mwifiex_write_data_complete(adapter
, skb
, 0, ret
);
1249 if (ret
!= -EBUSY
) {
1250 mwifiex_rotate_priolists(priv
, ptr
, ptr_index
);
1251 atomic_dec(&priv
->wmm
.tx_pkts_queued
);
1256 * This function dequeues a packet from the highest priority list
1260 mwifiex_dequeue_tx_packet(struct mwifiex_adapter
*adapter
)
1262 struct mwifiex_ra_list_tbl
*ptr
;
1263 struct mwifiex_private
*priv
= NULL
;
1266 int tid_del
= 0, tid
= 0;
1267 unsigned long flags
;
1269 ptr
= mwifiex_wmm_get_highest_priolist_ptr(adapter
, &priv
, &ptr_index
);
1273 tid
= mwifiex_get_tid(ptr
);
1275 dev_dbg(adapter
->dev
, "data: tid=%d\n", tid
);
1277 spin_lock_irqsave(&priv
->wmm
.ra_list_spinlock
, flags
);
1278 if (!mwifiex_is_ralist_valid(priv
, ptr
, ptr_index
)) {
1279 spin_unlock_irqrestore(&priv
->wmm
.ra_list_spinlock
, flags
);
1283 if (mwifiex_is_ptr_processed(priv
, ptr
)) {
1284 mwifiex_send_processed_packet(priv
, ptr
, ptr_index
, flags
);
1285 /* ra_list_spinlock has been freed in
1286 mwifiex_send_processed_packet() */
1290 if (!ptr
->is_11n_enabled
||
1292 priv
->wps
.session_enable
) {
1293 if (ptr
->is_11n_enabled
&&
1295 ptr
->amsdu_in_ampdu
&&
1296 mwifiex_is_amsdu_allowed(priv
, tid
) &&
1297 mwifiex_is_11n_aggragation_possible(priv
, ptr
,
1298 adapter
->tx_buf_size
))
1299 mwifiex_11n_aggregate_pkt(priv
, ptr
, ptr_index
, flags
);
1300 /* ra_list_spinlock has been freed in
1301 * mwifiex_11n_aggregate_pkt()
1304 mwifiex_send_single_packet(priv
, ptr
, ptr_index
, flags
);
1305 /* ra_list_spinlock has been freed in
1306 * mwifiex_send_single_packet()
1309 if (mwifiex_is_ampdu_allowed(priv
, ptr
, tid
) &&
1310 ptr
->ba_pkt_count
> ptr
->ba_packet_thr
) {
1311 if (mwifiex_space_avail_for_new_ba_stream(adapter
)) {
1312 mwifiex_create_ba_tbl(priv
, ptr
->ra
, tid
,
1313 BA_SETUP_INPROGRESS
);
1314 mwifiex_send_addba(priv
, tid
, ptr
->ra
);
1315 } else if (mwifiex_find_stream_to_delete
1316 (priv
, tid
, &tid_del
, ra
)) {
1317 mwifiex_create_ba_tbl(priv
, ptr
->ra
, tid
,
1318 BA_SETUP_INPROGRESS
);
1319 mwifiex_send_delba(priv
, tid_del
, ra
, 1);
1322 if (mwifiex_is_amsdu_allowed(priv
, tid
) &&
1323 mwifiex_is_11n_aggragation_possible(priv
, ptr
,
1324 adapter
->tx_buf_size
))
1325 mwifiex_11n_aggregate_pkt(priv
, ptr
, ptr_index
, flags
);
1326 /* ra_list_spinlock has been freed in
1327 mwifiex_11n_aggregate_pkt() */
1329 mwifiex_send_single_packet(priv
, ptr
, ptr_index
, flags
);
1330 /* ra_list_spinlock has been freed in
1331 mwifiex_send_single_packet() */
1337 * This function transmits the highest priority packet awaiting in the
1341 mwifiex_wmm_process_tx(struct mwifiex_adapter
*adapter
)
1344 if (mwifiex_dequeue_tx_packet(adapter
))
1346 if (adapter
->iface_type
!= MWIFIEX_SDIO
) {
1347 if (adapter
->data_sent
||
1348 adapter
->tx_lock_flag
)
1351 if (atomic_read(&adapter
->tx_queued
) >=
1352 MWIFIEX_MAX_PKTS_TXQ
)
1355 } while (!mwifiex_wmm_lists_empty(adapter
));