// SPDX-License-Identifier: GPL-2.0-only /* * NXP Wireless LAN device driver: 802.11n Aggregation * * Copyright 2011-2020 NXP */ #include "decl.h" #include "ioctl.h" #include "util.h" #include "fw.h" #include "main.h" #include "wmm.h" #include "11n.h" #include "11n_aggr.h" /* * Creates an AMSDU subframe for aggregation into one AMSDU packet. * * The resultant AMSDU subframe format is - * * +---- ~ -----+---- ~ ------+---- ~ -----+----- ~ -----+---- ~ -----+ * | DA | SA | Length | SNAP header | MSDU | * | data[0..5] | data[6..11] | | | data[14..] | * +---- ~ -----+---- ~ ------+---- ~ -----+----- ~ -----+---- ~ -----+ * <--6-bytes--> <--6-bytes--> <--2-bytes--><--8-bytes--> <--n-bytes--> * * This function also computes the amount of padding required to make the * buffer length multiple of 4 bytes. * * Data => |DA|SA|SNAP-TYPE|........ .| * MSDU => |DA|SA|Length|SNAP|...... ..| */ static int mwifiex_11n_form_amsdu_pkt(struct sk_buff *skb_aggr, struct sk_buff *skb_src, int *pad) { … } /* * Adds TxPD to AMSDU header. * * Each AMSDU packet will contain one TxPD at the beginning, * followed by multiple AMSDU subframes. */ static void mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv, struct sk_buff *skb) { … } /* * Create aggregated packet. * * This function creates an aggregated MSDU packet, by combining buffers * from the RA list. Each individual buffer is encapsulated as an AMSDU * subframe and all such subframes are concatenated together to form the * AMSDU packet. * * A TxPD is also added to the front of the resultant AMSDU packets for * transmission. The resultant packets format is - * * +---- ~ ----+------ ~ ------+------ ~ ------+-..-+------ ~ ------+ * | TxPD |AMSDU sub-frame|AMSDU sub-frame| .. |AMSDU sub-frame| * | | 1 | 2 | .. | n | * +---- ~ ----+------ ~ ------+------ ~ ------+ .. +------ ~ ------+ */ int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, struct mwifiex_ra_list_tbl *pra_list, int ptrindex) __releases(&priv->wmm.ra_list_spinlock) { … }