18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * NXP Wireless LAN device driver: 802.11n Aggregation
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright 2011-2020 NXP
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This software file (the "File") is distributed by NXP
78c2ecf20Sopenharmony_ci * under the terms of the GNU General Public License Version 2, June 1991
88c2ecf20Sopenharmony_ci * (the "License").  You may use, redistribute and/or modify this File in
98c2ecf20Sopenharmony_ci * accordance with the terms and conditions of the License, a copy of which
108c2ecf20Sopenharmony_ci * is available by writing to the Free Software Foundation, Inc.,
118c2ecf20Sopenharmony_ci * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
128c2ecf20Sopenharmony_ci * worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
158c2ecf20Sopenharmony_ci * IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
168c2ecf20Sopenharmony_ci * ARE EXPRESSLY DISCLAIMED.  The License provides additional details about
178c2ecf20Sopenharmony_ci * this warranty disclaimer.
188c2ecf20Sopenharmony_ci */
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#include "decl.h"
218c2ecf20Sopenharmony_ci#include "ioctl.h"
228c2ecf20Sopenharmony_ci#include "util.h"
238c2ecf20Sopenharmony_ci#include "fw.h"
248c2ecf20Sopenharmony_ci#include "main.h"
258c2ecf20Sopenharmony_ci#include "wmm.h"
268c2ecf20Sopenharmony_ci#include "11n.h"
278c2ecf20Sopenharmony_ci#include "11n_aggr.h"
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/*
308c2ecf20Sopenharmony_ci * Creates an AMSDU subframe for aggregation into one AMSDU packet.
318c2ecf20Sopenharmony_ci *
328c2ecf20Sopenharmony_ci * The resultant AMSDU subframe format is -
338c2ecf20Sopenharmony_ci *
348c2ecf20Sopenharmony_ci * +---- ~ -----+---- ~ ------+---- ~ -----+----- ~ -----+---- ~ -----+
358c2ecf20Sopenharmony_ci * |     DA     |     SA      |   Length   | SNAP header |   MSDU     |
368c2ecf20Sopenharmony_ci * | data[0..5] | data[6..11] |            |             | data[14..] |
378c2ecf20Sopenharmony_ci * +---- ~ -----+---- ~ ------+---- ~ -----+----- ~ -----+---- ~ -----+
388c2ecf20Sopenharmony_ci * <--6-bytes--> <--6-bytes--> <--2-bytes--><--8-bytes--> <--n-bytes-->
398c2ecf20Sopenharmony_ci *
408c2ecf20Sopenharmony_ci * This function also computes the amount of padding required to make the
418c2ecf20Sopenharmony_ci * buffer length multiple of 4 bytes.
428c2ecf20Sopenharmony_ci *
438c2ecf20Sopenharmony_ci * Data => |DA|SA|SNAP-TYPE|........    .|
448c2ecf20Sopenharmony_ci * MSDU => |DA|SA|Length|SNAP|......   ..|
458c2ecf20Sopenharmony_ci */
468c2ecf20Sopenharmony_cistatic int
478c2ecf20Sopenharmony_cimwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr,
488c2ecf20Sopenharmony_ci			   struct sk_buff *skb_src, int *pad)
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci{
518c2ecf20Sopenharmony_ci	int dt_offset;
528c2ecf20Sopenharmony_ci	struct rfc_1042_hdr snap = {
538c2ecf20Sopenharmony_ci		0xaa,		/* LLC DSAP */
548c2ecf20Sopenharmony_ci		0xaa,		/* LLC SSAP */
558c2ecf20Sopenharmony_ci		0x03,		/* LLC CTRL */
568c2ecf20Sopenharmony_ci		{0x00, 0x00, 0x00},	/* SNAP OUI */
578c2ecf20Sopenharmony_ci		0x0000		/* SNAP type */
588c2ecf20Sopenharmony_ci			/*
598c2ecf20Sopenharmony_ci			 * This field will be overwritten
608c2ecf20Sopenharmony_ci			 * later with ethertype
618c2ecf20Sopenharmony_ci			 */
628c2ecf20Sopenharmony_ci	};
638c2ecf20Sopenharmony_ci	struct tx_packet_hdr *tx_header;
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci	tx_header = skb_put(skb_aggr, sizeof(*tx_header));
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci	/* Copy DA and SA */
688c2ecf20Sopenharmony_ci	dt_offset = 2 * ETH_ALEN;
698c2ecf20Sopenharmony_ci	memcpy(&tx_header->eth803_hdr, skb_src->data, dt_offset);
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci	/* Copy SNAP header */
728c2ecf20Sopenharmony_ci	snap.snap_type = ((struct ethhdr *)skb_src->data)->h_proto;
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci	dt_offset += sizeof(__be16);
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci	memcpy(&tx_header->rfc1042_hdr, &snap, sizeof(struct rfc_1042_hdr));
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci	skb_pull(skb_src, dt_offset);
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci	/* Update Length field */
818c2ecf20Sopenharmony_ci	tx_header->eth803_hdr.h_proto = htons(skb_src->len + LLC_SNAP_LEN);
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci	/* Add payload */
848c2ecf20Sopenharmony_ci	skb_put_data(skb_aggr, skb_src->data, skb_src->len);
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci	/* Add padding for new MSDU to start from 4 byte boundary */
878c2ecf20Sopenharmony_ci	*pad = (4 - ((unsigned long)skb_aggr->tail & 0x3)) % 4;
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci	return skb_aggr->len + *pad;
908c2ecf20Sopenharmony_ci}
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci/*
938c2ecf20Sopenharmony_ci * Adds TxPD to AMSDU header.
948c2ecf20Sopenharmony_ci *
958c2ecf20Sopenharmony_ci * Each AMSDU packet will contain one TxPD at the beginning,
968c2ecf20Sopenharmony_ci * followed by multiple AMSDU subframes.
978c2ecf20Sopenharmony_ci */
988c2ecf20Sopenharmony_cistatic void
998c2ecf20Sopenharmony_cimwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv,
1008c2ecf20Sopenharmony_ci			    struct sk_buff *skb)
1018c2ecf20Sopenharmony_ci{
1028c2ecf20Sopenharmony_ci	struct txpd *local_tx_pd;
1038c2ecf20Sopenharmony_ci	struct mwifiex_txinfo *tx_info = MWIFIEX_SKB_TXCB(skb);
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci	skb_push(skb, sizeof(*local_tx_pd));
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci	local_tx_pd = (struct txpd *) skb->data;
1088c2ecf20Sopenharmony_ci	memset(local_tx_pd, 0, sizeof(struct txpd));
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci	/* Original priority has been overwritten */
1118c2ecf20Sopenharmony_ci	local_tx_pd->priority = (u8) skb->priority;
1128c2ecf20Sopenharmony_ci	local_tx_pd->pkt_delay_2ms =
1138c2ecf20Sopenharmony_ci		mwifiex_wmm_compute_drv_pkt_delay(priv, skb);
1148c2ecf20Sopenharmony_ci	local_tx_pd->bss_num = priv->bss_num;
1158c2ecf20Sopenharmony_ci	local_tx_pd->bss_type = priv->bss_type;
1168c2ecf20Sopenharmony_ci	/* Always zero as the data is followed by struct txpd */
1178c2ecf20Sopenharmony_ci	local_tx_pd->tx_pkt_offset = cpu_to_le16(sizeof(struct txpd));
1188c2ecf20Sopenharmony_ci	local_tx_pd->tx_pkt_type = cpu_to_le16(PKT_TYPE_AMSDU);
1198c2ecf20Sopenharmony_ci	local_tx_pd->tx_pkt_length = cpu_to_le16(skb->len -
1208c2ecf20Sopenharmony_ci						 sizeof(*local_tx_pd));
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci	if (tx_info->flags & MWIFIEX_BUF_FLAG_TDLS_PKT)
1238c2ecf20Sopenharmony_ci		local_tx_pd->flags |= MWIFIEX_TXPD_FLAGS_TDLS_PACKET;
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci	if (local_tx_pd->tx_control == 0)
1268c2ecf20Sopenharmony_ci		/* TxCtrl set by user or default */
1278c2ecf20Sopenharmony_ci		local_tx_pd->tx_control = cpu_to_le32(priv->pkt_tx_ctrl);
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci	if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA &&
1308c2ecf20Sopenharmony_ci	    priv->adapter->pps_uapsd_mode) {
1318c2ecf20Sopenharmony_ci		if (true == mwifiex_check_last_packet_indication(priv)) {
1328c2ecf20Sopenharmony_ci			priv->adapter->tx_lock_flag = true;
1338c2ecf20Sopenharmony_ci			local_tx_pd->flags =
1348c2ecf20Sopenharmony_ci				MWIFIEX_TxPD_POWER_MGMT_LAST_PACKET;
1358c2ecf20Sopenharmony_ci		}
1368c2ecf20Sopenharmony_ci	}
1378c2ecf20Sopenharmony_ci}
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci/*
1408c2ecf20Sopenharmony_ci * Create aggregated packet.
1418c2ecf20Sopenharmony_ci *
1428c2ecf20Sopenharmony_ci * This function creates an aggregated MSDU packet, by combining buffers
1438c2ecf20Sopenharmony_ci * from the RA list. Each individual buffer is encapsulated as an AMSDU
1448c2ecf20Sopenharmony_ci * subframe and all such subframes are concatenated together to form the
1458c2ecf20Sopenharmony_ci * AMSDU packet.
1468c2ecf20Sopenharmony_ci *
1478c2ecf20Sopenharmony_ci * A TxPD is also added to the front of the resultant AMSDU packets for
1488c2ecf20Sopenharmony_ci * transmission. The resultant packets format is -
1498c2ecf20Sopenharmony_ci *
1508c2ecf20Sopenharmony_ci * +---- ~ ----+------ ~ ------+------ ~ ------+-..-+------ ~ ------+
1518c2ecf20Sopenharmony_ci * |    TxPD   |AMSDU sub-frame|AMSDU sub-frame| .. |AMSDU sub-frame|
1528c2ecf20Sopenharmony_ci * |           |       1       |       2       | .. |       n       |
1538c2ecf20Sopenharmony_ci * +---- ~ ----+------ ~ ------+------ ~ ------+ .. +------ ~ ------+
1548c2ecf20Sopenharmony_ci */
1558c2ecf20Sopenharmony_ciint
1568c2ecf20Sopenharmony_cimwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
1578c2ecf20Sopenharmony_ci			  struct mwifiex_ra_list_tbl *pra_list,
1588c2ecf20Sopenharmony_ci			  int ptrindex)
1598c2ecf20Sopenharmony_ci			  __releases(&priv->wmm.ra_list_spinlock)
1608c2ecf20Sopenharmony_ci{
1618c2ecf20Sopenharmony_ci	struct mwifiex_adapter *adapter = priv->adapter;
1628c2ecf20Sopenharmony_ci	struct sk_buff *skb_aggr, *skb_src;
1638c2ecf20Sopenharmony_ci	struct mwifiex_txinfo *tx_info_aggr, *tx_info_src;
1648c2ecf20Sopenharmony_ci	int pad = 0, aggr_num = 0, ret;
1658c2ecf20Sopenharmony_ci	struct mwifiex_tx_param tx_param;
1668c2ecf20Sopenharmony_ci	struct txpd *ptx_pd = NULL;
1678c2ecf20Sopenharmony_ci	int headroom = adapter->intf_hdr_len;
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci	skb_src = skb_peek(&pra_list->skb_head);
1708c2ecf20Sopenharmony_ci	if (!skb_src) {
1718c2ecf20Sopenharmony_ci		spin_unlock_bh(&priv->wmm.ra_list_spinlock);
1728c2ecf20Sopenharmony_ci		return 0;
1738c2ecf20Sopenharmony_ci	}
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci	tx_info_src = MWIFIEX_SKB_TXCB(skb_src);
1768c2ecf20Sopenharmony_ci	skb_aggr = mwifiex_alloc_dma_align_buf(adapter->tx_buf_size,
1778c2ecf20Sopenharmony_ci					       GFP_ATOMIC);
1788c2ecf20Sopenharmony_ci	if (!skb_aggr) {
1798c2ecf20Sopenharmony_ci		spin_unlock_bh(&priv->wmm.ra_list_spinlock);
1808c2ecf20Sopenharmony_ci		return -1;
1818c2ecf20Sopenharmony_ci	}
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci	/* skb_aggr->data already 64 byte align, just reserve bus interface
1848c2ecf20Sopenharmony_ci	 * header and txpd.
1858c2ecf20Sopenharmony_ci	 */
1868c2ecf20Sopenharmony_ci	skb_reserve(skb_aggr, headroom + sizeof(struct txpd));
1878c2ecf20Sopenharmony_ci	tx_info_aggr =  MWIFIEX_SKB_TXCB(skb_aggr);
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci	memset(tx_info_aggr, 0, sizeof(*tx_info_aggr));
1908c2ecf20Sopenharmony_ci	tx_info_aggr->bss_type = tx_info_src->bss_type;
1918c2ecf20Sopenharmony_ci	tx_info_aggr->bss_num = tx_info_src->bss_num;
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci	if (tx_info_src->flags & MWIFIEX_BUF_FLAG_TDLS_PKT)
1948c2ecf20Sopenharmony_ci		tx_info_aggr->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT;
1958c2ecf20Sopenharmony_ci	tx_info_aggr->flags |= MWIFIEX_BUF_FLAG_AGGR_PKT;
1968c2ecf20Sopenharmony_ci	skb_aggr->priority = skb_src->priority;
1978c2ecf20Sopenharmony_ci	skb_aggr->tstamp = skb_src->tstamp;
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci	do {
2008c2ecf20Sopenharmony_ci		/* Check if AMSDU can accommodate this MSDU */
2018c2ecf20Sopenharmony_ci		if ((skb_aggr->len + skb_src->len + LLC_SNAP_LEN) >
2028c2ecf20Sopenharmony_ci		    adapter->tx_buf_size)
2038c2ecf20Sopenharmony_ci			break;
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci		skb_src = skb_dequeue(&pra_list->skb_head);
2068c2ecf20Sopenharmony_ci		pra_list->total_pkt_count--;
2078c2ecf20Sopenharmony_ci		atomic_dec(&priv->wmm.tx_pkts_queued);
2088c2ecf20Sopenharmony_ci		aggr_num++;
2098c2ecf20Sopenharmony_ci		spin_unlock_bh(&priv->wmm.ra_list_spinlock);
2108c2ecf20Sopenharmony_ci		mwifiex_11n_form_amsdu_pkt(skb_aggr, skb_src, &pad);
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci		mwifiex_write_data_complete(adapter, skb_src, 0, 0);
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci		spin_lock_bh(&priv->wmm.ra_list_spinlock);
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci		if (!mwifiex_is_ralist_valid(priv, pra_list, ptrindex)) {
2178c2ecf20Sopenharmony_ci			spin_unlock_bh(&priv->wmm.ra_list_spinlock);
2188c2ecf20Sopenharmony_ci			return -1;
2198c2ecf20Sopenharmony_ci		}
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci		if (skb_tailroom(skb_aggr) < pad) {
2228c2ecf20Sopenharmony_ci			pad = 0;
2238c2ecf20Sopenharmony_ci			break;
2248c2ecf20Sopenharmony_ci		}
2258c2ecf20Sopenharmony_ci		skb_put(skb_aggr, pad);
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci		skb_src = skb_peek(&pra_list->skb_head);
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci	} while (skb_src);
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci	spin_unlock_bh(&priv->wmm.ra_list_spinlock);
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci	/* Last AMSDU packet does not need padding */
2348c2ecf20Sopenharmony_ci	skb_trim(skb_aggr, skb_aggr->len - pad);
2358c2ecf20Sopenharmony_ci
2368c2ecf20Sopenharmony_ci	/* Form AMSDU */
2378c2ecf20Sopenharmony_ci	mwifiex_11n_form_amsdu_txpd(priv, skb_aggr);
2388c2ecf20Sopenharmony_ci	if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA)
2398c2ecf20Sopenharmony_ci		ptx_pd = (struct txpd *)skb_aggr->data;
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci	skb_push(skb_aggr, headroom);
2428c2ecf20Sopenharmony_ci	tx_info_aggr->aggr_num = aggr_num * 2;
2438c2ecf20Sopenharmony_ci	if (adapter->data_sent || adapter->tx_lock_flag) {
2448c2ecf20Sopenharmony_ci		atomic_add(aggr_num * 2, &adapter->tx_queued);
2458c2ecf20Sopenharmony_ci		skb_queue_tail(&adapter->tx_data_q, skb_aggr);
2468c2ecf20Sopenharmony_ci		return 0;
2478c2ecf20Sopenharmony_ci	}
2488c2ecf20Sopenharmony_ci
2498c2ecf20Sopenharmony_ci	if (skb_src)
2508c2ecf20Sopenharmony_ci		tx_param.next_pkt_len = skb_src->len + sizeof(struct txpd);
2518c2ecf20Sopenharmony_ci	else
2528c2ecf20Sopenharmony_ci		tx_param.next_pkt_len = 0;
2538c2ecf20Sopenharmony_ci
2548c2ecf20Sopenharmony_ci	if (adapter->iface_type == MWIFIEX_USB) {
2558c2ecf20Sopenharmony_ci		ret = adapter->if_ops.host_to_card(adapter, priv->usb_port,
2568c2ecf20Sopenharmony_ci						   skb_aggr, &tx_param);
2578c2ecf20Sopenharmony_ci	} else {
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci		ret = adapter->if_ops.host_to_card(adapter, MWIFIEX_TYPE_DATA,
2608c2ecf20Sopenharmony_ci						   skb_aggr, &tx_param);
2618c2ecf20Sopenharmony_ci	}
2628c2ecf20Sopenharmony_ci	switch (ret) {
2638c2ecf20Sopenharmony_ci	case -EBUSY:
2648c2ecf20Sopenharmony_ci		spin_lock_bh(&priv->wmm.ra_list_spinlock);
2658c2ecf20Sopenharmony_ci		if (!mwifiex_is_ralist_valid(priv, pra_list, ptrindex)) {
2668c2ecf20Sopenharmony_ci			spin_unlock_bh(&priv->wmm.ra_list_spinlock);
2678c2ecf20Sopenharmony_ci			mwifiex_write_data_complete(adapter, skb_aggr, 1, -1);
2688c2ecf20Sopenharmony_ci			return -1;
2698c2ecf20Sopenharmony_ci		}
2708c2ecf20Sopenharmony_ci		if (GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA &&
2718c2ecf20Sopenharmony_ci		    adapter->pps_uapsd_mode && adapter->tx_lock_flag) {
2728c2ecf20Sopenharmony_ci				priv->adapter->tx_lock_flag = false;
2738c2ecf20Sopenharmony_ci				if (ptx_pd)
2748c2ecf20Sopenharmony_ci					ptx_pd->flags = 0;
2758c2ecf20Sopenharmony_ci		}
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci		skb_queue_tail(&pra_list->skb_head, skb_aggr);
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci		pra_list->total_pkt_count++;
2808c2ecf20Sopenharmony_ci
2818c2ecf20Sopenharmony_ci		atomic_inc(&priv->wmm.tx_pkts_queued);
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci		tx_info_aggr->flags |= MWIFIEX_BUF_FLAG_REQUEUED_PKT;
2848c2ecf20Sopenharmony_ci		spin_unlock_bh(&priv->wmm.ra_list_spinlock);
2858c2ecf20Sopenharmony_ci		mwifiex_dbg(adapter, ERROR, "data: -EBUSY is returned\n");
2868c2ecf20Sopenharmony_ci		break;
2878c2ecf20Sopenharmony_ci	case -1:
2888c2ecf20Sopenharmony_ci		mwifiex_dbg(adapter, ERROR, "%s: host_to_card failed: %#x\n",
2898c2ecf20Sopenharmony_ci			    __func__, ret);
2908c2ecf20Sopenharmony_ci		adapter->dbg.num_tx_host_to_card_failure++;
2918c2ecf20Sopenharmony_ci		mwifiex_write_data_complete(adapter, skb_aggr, 1, ret);
2928c2ecf20Sopenharmony_ci		return 0;
2938c2ecf20Sopenharmony_ci	case -EINPROGRESS:
2948c2ecf20Sopenharmony_ci		break;
2958c2ecf20Sopenharmony_ci	case 0:
2968c2ecf20Sopenharmony_ci		mwifiex_write_data_complete(adapter, skb_aggr, 1, ret);
2978c2ecf20Sopenharmony_ci		break;
2988c2ecf20Sopenharmony_ci	default:
2998c2ecf20Sopenharmony_ci		break;
3008c2ecf20Sopenharmony_ci	}
3018c2ecf20Sopenharmony_ci	if (ret != -EBUSY) {
3028c2ecf20Sopenharmony_ci		mwifiex_rotate_priolists(priv, pra_list, ptrindex);
3038c2ecf20Sopenharmony_ci	}
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci	return 0;
3068c2ecf20Sopenharmony_ci}
307