xref: /wlan-dirver/qca-wifi-host-cmn/qdf/inc/qdf_nbuf.h (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
1 /*
2  * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
3  *
4  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5  *
6  *
7  * Permission to use, copy, modify, and/or distribute this software for
8  * any purpose with or without fee is hereby granted, provided that the
9  * above copyright notice and this permission notice appear in all
10  * copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19  * PERFORMANCE OF THIS SOFTWARE.
20  */
21 
22 /*
23  * This file was originally distributed by Qualcomm Atheros, Inc.
24  * under proprietary terms before Copyright ownership was assigned
25  * to the Linux Foundation.
26  */
27 
28 /**
29  * DOC: qdf_nbuf_public network buffer API
30  * This file defines the network buffer abstraction.
31  */
32 
33 #ifndef _QDF_NBUF_H
34 #define _QDF_NBUF_H
35 
36 #include <qdf_util.h>
37 #include <qdf_types.h>
38 #include <qdf_lock.h>
39 #include <i_qdf_trace.h>
40 #include <i_qdf_nbuf.h>
41 #include <qdf_net_types.h>
42 
43 #define IPA_NBUF_OWNER_ID			0xaa55aa55
44 #define QDF_NBUF_PKT_TRAC_TYPE_EAPOL		0x02
45 #define QDF_NBUF_PKT_TRAC_TYPE_DHCP		0x04
46 #define QDF_NBUF_PKT_TRAC_TYPE_MGMT_ACTION	0x08
47 #define QDF_NBUF_PKT_TRAC_TYPE_ARP		0x10
48 #define QDF_NBUF_PKT_TRAC_TYPE_ICMP		0x20
49 #define QDF_NBUF_PKT_TRAC_TYPE_ICMPv6		0x40
50 
51 #define QDF_NBUF_PKT_TRAC_MAX_STRING		12
52 #define QDF_NBUF_PKT_TRAC_PROTO_STRING		4
53 #define QDF_NBUF_PKT_ERROR			1
54 
55 #define QDF_NBUF_TRAC_IPV4_OFFSET		14
56 #define QDF_NBUF_TRAC_IPV4_HEADER_SIZE		20
57 #define QDF_NBUF_TRAC_DHCP_SRV_PORT		67
58 #define QDF_NBUF_TRAC_DHCP_CLI_PORT		68
59 #define QDF_NBUF_TRAC_ETH_TYPE_OFFSET		12
60 #define QDF_NBUF_TRAC_EAPOL_ETH_TYPE		0x888E
61 #define QDF_NBUF_TRAC_WAPI_ETH_TYPE		0x88b4
62 #define QDF_NBUF_TRAC_ARP_ETH_TYPE		0x0806
63 #define QDF_NBUF_TRAC_TDLS_ETH_TYPE		0x890D
64 #define QDF_NBUF_TRAC_IPV4_ETH_TYPE     0x0800
65 #define QDF_NBUF_TRAC_IPV6_ETH_TYPE     0x86dd
66 #define QDF_NBUF_DEST_MAC_OFFSET		0
67 #define QDF_NBUF_SRC_MAC_OFFSET			6
68 #define QDF_NBUF_TRAC_IPV4_PROTO_TYPE_OFFSET  23
69 #define QDF_NBUF_TRAC_IPV4_DEST_ADDR_OFFSET   30
70 #define QDF_NBUF_TRAC_IPV6_PROTO_TYPE_OFFSET  20
71 #define QDF_NBUF_TRAC_IPV4_ADDR_MCAST_MASK    0xE0000000
72 #define QDF_NBUF_TRAC_IPV4_ADDR_BCAST_MASK    0xF0000000
73 #define QDF_NBUF_TRAC_IPV6_DEST_ADDR_OFFSET   38
74 #define QDF_NBUF_TRAC_IPV6_DEST_ADDR          0xFF00
75 #define QDF_NBUF_TRAC_IPV6_OFFSET		14
76 #define QDF_NBUF_TRAC_IPV6_HEADER_SIZE   40
77 #define QDF_NBUF_TRAC_ICMP_TYPE         1
78 #define QDF_NBUF_TRAC_TCP_TYPE          6
79 #define QDF_NBUF_TRAC_UDP_TYPE          17
80 #define QDF_NBUF_TRAC_ICMPV6_TYPE       0x3a
81 #define QDF_NBUF_TRAC_DHCP6_SRV_PORT		547
82 #define QDF_NBUF_TRAC_DHCP6_CLI_PORT		546
83 
84 /* EAPOL Related MASK */
85 #define EAPOL_PACKET_TYPE_OFFSET		15
86 #define EAPOL_KEY_INFO_OFFSET			19
87 #define EAPOL_PKT_LEN_OFFSET            16
88 #define EAPOL_KEY_LEN_OFFSET            21
89 #define EAPOL_MASK				0x8013
90 #define EAPOL_M1_BIT_MASK			0x8000
91 #define EAPOL_M2_BIT_MASK			0x0001
92 #define EAPOL_M3_BIT_MASK			0x8013
93 #define EAPOL_M4_BIT_MASK			0x0003
94 
95 /* ARP Related MASK */
96 #define QDF_NBUF_PKT_ARP_OPCODE_OFFSET	20
97 #define QDF_NBUF_PKT_ARPOP_REQ		1
98 #define QDF_NBUF_PKT_ARPOP_REPLY	2
99 #define QDF_NBUF_PKT_ARP_SRC_IP_OFFSET	28
100 #define QDF_NBUF_PKT_ARP_TGT_IP_OFFSET	38
101 
102 /* ICMPv4 Related MASK */
103 #define QDF_NBUF_PKT_ICMPv4_OPCODE_OFFSET	34
104 #define QDF_NBUF_PKT_ICMPv4OP_REQ		0x08
105 #define QDF_NBUF_PKT_ICMPv4OP_REPLY		0x00
106 #define QDF_NBUF_PKT_ICMPv4_SRC_IP_OFFSET	26
107 #define QDF_NBUF_PKT_ICMPv4_TGT_IP_OFFSET	30
108 
109 /* TCP Related MASK */
110 #define QDF_NBUF_PKT_TCP_OPCODE_OFFSET		47
111 #define QDF_NBUF_PKT_TCPOP_SYN			0x02
112 #define QDF_NBUF_PKT_TCPOP_SYN_ACK		0x12
113 #define QDF_NBUF_PKT_TCPOP_ACK			0x10
114 #define QDF_NBUF_PKT_TCP_SRC_PORT_OFFSET	34
115 #define QDF_NBUF_PKT_TCP_DST_PORT_OFFSET	36
116 
117 /* DNS Related MASK */
118 #define QDF_NBUF_PKT_DNS_OVER_UDP_OPCODE_OFFSET	44
119 #define QDF_NBUF_PKT_DNSOP_BITMAP		0xF800
120 #define QDF_NBUF_PKT_DNSOP_STANDARD_QUERY	0x0000
121 #define QDF_NBUF_PKT_DNSOP_STANDARD_RESPONSE	0x8000
122 #define QDF_NBUF_PKT_DNS_SRC_PORT_OFFSET	34
123 #define QDF_NBUF_PKT_DNS_DST_PORT_OFFSET	36
124 #define QDF_NBUF_PKT_DNS_NAME_OVER_UDP_OFFSET	54
125 #define QDF_NBUF_PKT_DNS_STANDARD_PORT		53
126 
127 /* Tracked Packet types */
128 #define QDF_NBUF_TX_PKT_INVALID              0
129 #define QDF_NBUF_TX_PKT_DATA_TRACK           1
130 #define QDF_NBUF_TX_PKT_MGMT_TRACK           2
131 
132 /* Different Packet states */
133 #define QDF_NBUF_TX_PKT_HDD                  1
134 #define QDF_NBUF_TX_PKT_TXRX_ENQUEUE         2
135 #define QDF_NBUF_TX_PKT_TXRX_DEQUEUE         3
136 #define QDF_NBUF_TX_PKT_TXRX                 4
137 #define QDF_NBUF_TX_PKT_HTT                  5
138 #define QDF_NBUF_TX_PKT_HTC                  6
139 #define QDF_NBUF_TX_PKT_HIF                  7
140 #define QDF_NBUF_TX_PKT_CE                   8
141 #define QDF_NBUF_TX_PKT_FREE                 9
142 #define QDF_NBUF_TX_PKT_STATE_MAX            10
143 #define QDF_NBUF_TX_PKT_LI_DP                11
144 
145 /* qdf_nbuf allocate and map max retry threshold when failed */
146 #define QDF_NBUF_ALLOC_MAP_RETRY_THRESHOLD      20
147 
148 /* Enable flag to print TSO specific prints in datapath */
149 #ifdef TSO_DEBUG_LOG_ENABLE
150 #define TSO_DEBUG(fmt, args ...) \
151 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_NONE, \
152 		fmt, ## args)
153 #else
154 #define TSO_DEBUG(fmt, args ...)
155 #endif
156 
157 #define IEEE80211_AMPDU_FLAG    0x01
158 
159 #ifdef GET_MSDU_AGGREGATION
160 #define IEEE80211_AMSDU_FLAG    0x02
161 #endif
162 
163 /**
164  * struct mon_rx_status - This will have monitor mode rx_status extracted from
165  * htt_rx_desc used later to update radiotap information.
166  * @tsft: Time Synchronization Function timer
167  * @preamble_type: Preamble type in radio header
168  * @chan_freq: Capture channel frequency
169  * @chan_num: Capture channel number
170  * @chan_flags: Bitmap of Channel flags, IEEE80211_CHAN_TURBO,
171  *              IEEE80211_CHAN_CCK...
172  * @ht_flags: HT flags, only present for HT frames.
173  * @vht_flags: VHT flags, only present for VHT frames.
174  * @vht_flag_values1-5: Contains corresponding data for flags field
175  * @he_flags: HE (11ax) flags, only present in HE frames
176  * @he_mu_flags: HE-MU (11ax) flags, only present in HE frames
177  * @he_mu_other_flags: HE-MU-OTHER (11ax) flags, only present in HE frames
178  * @he_sig_A1_known: HE (11ax) sig A1 known field
179  * @he_sig_A2_known: HE (11ax) sig A2 known field
180  * @he_sig_b_common: HE (11ax) sig B common field
181  * @he_sig_b_common_known: HE (11ax) sig B common known field
182  * @rate: Rate in terms 500Kbps
183  * @rtap_flags: Bit map of available fields in the radiotap
184  * @ant_signal_db: Rx packet RSSI
185  * @nr_ant: Number of Antennas used for streaming
186  * @mcs: MCS index of Rx frame
187  * @nss: Number of spatial streams
188  * @bw: bandwidth of rx frame
189  * @is_stbc: Is STBC enabled
190  * @sgi: Rx frame short guard interval
191  * @he_re: HE range extension
192  * @ldpc: ldpc enabled
193  * @beamformed: Is frame beamformed.
194  * @he_sig_b_common_RU[4]: HE (11ax) common RU assignment index
195  * @rssi_comb: Combined RSSI
196  * @duration: 802.11 Duration
197  * @first_data_seq_ctrl: Sequence ctrl field of first data frame
198  * @ast_index: AST table hash index
199  * @tid: QoS traffic tid number
200  * @rs_fcs_err: FCS error flag
201  * @rs_flags: Flags to indicate AMPDU or AMSDU aggregation
202  * @cck_flag: Flag to indicate CCK modulation
203  * @ofdm_flag: Flag to indicate OFDM modulation
204  * @he_per_user_1: HE per user info1
205  * @he_per_user_2: HE per user info2
206  * @he_per_user_position: HE per user position info
207  * @he_per_user_known: HE per user known info
208  * @he_flags1: HE flags
209  * @he_flags2: HE flags
210  * @he_RU[4]: HE RU assignment index
211  * @he_data1: HE property of received frame
212  * @he_data2: HE property of received frame
213  * @he_data3: HE property of received frame
214  * @he_data4: HE property of received frame
215  * @he_data5: HE property of received frame
216  * @prev_ppdu_id: ppdu_id in previously received message
217  * @ppdu_id: Id of the PLCP protocol data unit
218  */
219 struct mon_rx_status {
220 	uint64_t tsft;
221 	uint32_t preamble_type;
222 	uint16_t chan_freq;
223 	uint16_t chan_num;
224 	uint16_t chan_flags;
225 	uint16_t ht_flags;
226 	uint16_t vht_flags;
227 	uint16_t vht_flag_values6;
228 	uint16_t he_flags;
229 	uint16_t he_mu_flags;
230 	uint16_t he_mu_other_flags;
231 	uint16_t he_sig_A1_known;
232 	uint16_t he_sig_A2_known;
233 	uint16_t he_sig_b_common;
234 	uint16_t he_sig_b_common_known;
235 	uint8_t  rate;
236 	uint8_t  rtap_flags;
237 	uint8_t  ant_signal_db;
238 	uint8_t  nr_ant;
239 	uint8_t  mcs;
240 	uint8_t  nss;
241 	uint16_t  tcp_msdu_count;
242 	uint16_t  udp_msdu_count;
243 	uint16_t  other_msdu_count;
244 	uint8_t  bw;
245 	uint8_t  vht_flag_values1;
246 	uint8_t  vht_flag_values2;
247 	uint8_t  vht_flag_values3[4];
248 	uint8_t  vht_flag_values4;
249 	uint8_t  vht_flag_values5;
250 	uint8_t  is_stbc;
251 	uint8_t  sgi;
252 	uint8_t  he_re;
253 	uint8_t  ldpc;
254 	uint8_t  beamformed;
255 	uint8_t  he_sig_b_common_RU[4];
256 	int8_t   rssi_comb;
257 	uint8_t  reception_type;
258 	uint16_t duration;
259 	uint8_t frame_control_info_valid;
260 	int16_t first_data_seq_ctrl;
261 	uint32_t ast_index;
262 	uint32_t tid;
263 	uint8_t  rs_fcs_err;
264 	uint8_t      rs_flags;
265 	uint8_t cck_flag;
266 	uint8_t ofdm_flag;
267 	/* New HE radiotap fields */
268 	uint16_t he_per_user_1;
269 	uint16_t he_per_user_2;
270 	uint8_t he_per_user_position;
271 	uint8_t he_per_user_known;
272 	uint16_t he_flags1;
273 	uint16_t he_flags2;
274 	uint8_t he_RU[4];
275 	uint16_t he_data1;
276 	uint16_t he_data2;
277 	uint16_t he_data3;
278 	uint16_t he_data4;
279 	uint16_t he_data5;
280 	uint16_t he_data6;
281 	uint32_t ppdu_len;
282 	uint32_t prev_ppdu_id;
283 	uint32_t ppdu_id;
284 };
285 
286 /* Masks for HE SIG known fields in mon_rx_status structure */
287 #define QDF_MON_STATUS_HE_SIG_B_COMMON_KNOWN_RU0	0x00000001
288 #define QDF_MON_STATUS_HE_SIG_B_COMMON_KNOWN_RU1	0x00000002
289 #define QDF_MON_STATUS_HE_SIG_B_COMMON_KNOWN_RU2	0x00000004
290 #define QDF_MON_STATUS_HE_SIG_B_COMMON_KNOWN_RU3	0x00000008
291 #define QDF_MON_STATUS_HE_SIG_B_USER_KNOWN_SIG_B_ALL   0x00fe0000
292 #define QDF_MON_STATUS_HE_SIG_A1_HE_FORMAT_SU		0x00000000
293 #define QDF_MON_STATUS_HE_SIG_A1_HE_FORMAT_EXT_SU	0x40000000
294 #define QDF_MON_STATUS_HE_SIG_A1_HE_FORMAT_TRIG		0xc0000000
295 
296 /* DHCP Related Mask */
297 #define QDF_DHCP_OPTION53			(0x35)
298 #define QDF_DHCP_OPTION53_LENGTH		(1)
299 #define QDF_DHCP_OPTION53_OFFSET		(0x11A)
300 #define QDF_DHCP_OPTION53_LENGTH_OFFSET	(0x11B)
301 #define QDF_DHCP_OPTION53_STATUS_OFFSET	(0x11C)
302 #define DHCP_PKT_LEN_OFFSET           16
303 #define DHCP_TRANSACTION_ID_OFFSET    46
304 #define QDF_DHCP_DISCOVER			(1)
305 #define QDF_DHCP_OFFER				(2)
306 #define QDF_DHCP_REQUEST			(3)
307 #define QDF_DHCP_DECLINE			(4)
308 #define QDF_DHCP_ACK				(5)
309 #define QDF_DHCP_NAK				(6)
310 #define QDF_DHCP_RELEASE			(7)
311 #define QDF_DHCP_INFORM				(8)
312 
313 /* ARP Related Mask */
314 #define ARP_SUB_TYPE_OFFSET  20
315 #define ARP_REQUEST			(1)
316 #define ARP_RESPONSE		(2)
317 
318 /* IPV4 header fields offset values */
319 #define IPV4_PKT_LEN_OFFSET           16
320 #define IPV4_TCP_SEQ_NUM_OFFSET       38
321 #define IPV4_SRC_ADDR_OFFSET          26
322 #define IPV4_DST_ADDR_OFFSET          30
323 #define IPV4_SRC_PORT_OFFSET          34
324 #define IPV4_DST_PORT_OFFSET          36
325 
326 /* IPV4 ICMP Related Mask */
327 #define ICMP_SEQ_NUM_OFFSET           40
328 #define ICMP_SUBTYPE_OFFSET           34
329 #define ICMP_REQUEST                  0x08
330 #define ICMP_RESPONSE                 0x00
331 
332 #define IPV6_ADDR_STR "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:"\
333 			"%02x%02x:%02x%02x"
334 
335 /* IPV6 header fields offset values */
336 #define IPV6_PKT_LEN_OFFSET           18
337 #define IPV6_TCP_SEQ_NUM_OFFSET       58
338 #define IPV6_SRC_ADDR_OFFSET          22
339 #define IPV6_DST_ADDR_OFFSET          38
340 #define IPV6_SRC_PORT_OFFSET          54
341 #define IPV6_DST_PORT_OFFSET          56
342 
343 /* IPV6 ICMPV6 Related Mask */
344 #define ICMPV6_SEQ_NUM_OFFSET         60
345 #define ICMPV6_SUBTYPE_OFFSET         54
346 #define ICMPV6_REQUEST                0x80
347 #define ICMPV6_RESPONSE               0x81
348 #define ICMPV6_RS                     0x85
349 #define ICMPV6_RA                     0x86
350 #define ICMPV6_NS                     0x87
351 #define ICMPV6_NA                     0x88
352 
353 #define QDF_NBUF_IPA_CHECK_MASK		0x80000000
354 
355 /* HE Radiotap data1 Mask */
356 #define QDF_MON_STATUS_HE_SU_FORMAT_TYPE 0x0000
357 #define QDF_MON_STATUS_HE_EXT_SU_FORMAT_TYPE 0x0001
358 #define QDF_MON_STATUS_HE_MU_FORMAT_TYPE 0x0002
359 #define QDF_MON_STATUS_HE_TRIG_FORMAT_TYPE 0x0003
360 
361 
362 #define QDF_MON_STATUS_HE_BEAM_CHANGE_KNOWN 0x0008
363 #define QDF_MON_STATUS_HE_DL_UL_KNOWN 0x0010
364 #define QDF_MON_STATUS_HE_MCS_KNOWN 0x0020
365 #define QDF_MON_STATUS_HE_DCM_KNOWN 0x0040
366 #define QDF_MON_STATUS_HE_CODING_KNOWN 0x0080
367 #define QDF_MON_STATUS_HE_LDPC_EXTRA_SYMBOL_KNOWN 0x0100
368 #define QDF_MON_STATUS_HE_STBC_KNOWN 0x0200
369 #define QDF_MON_STATUS_HE_DATA_BW_RU_KNOWN 0x4000
370 #define QDF_MON_STATUS_HE_DOPPLER_KNOWN 0x8000
371 #define QDF_MON_STATUS_HE_BSS_COLOR_KNOWN 0x0004
372 
373 /* HE Radiotap data2 Mask */
374 #define QDF_MON_STATUS_HE_GI_KNOWN 0x0002
375 #define QDF_MON_STATUS_TXBF_KNOWN 0x0010
376 #define QDF_MON_STATUS_PE_DISAMBIGUITY_KNOWN 0x0020
377 #define QDF_MON_STATUS_TXOP_KNOWN 0x0040
378 #define QDF_MON_STATUS_LTF_SYMBOLS_KNOWN 0x0004
379 #define QDF_MON_STATUS_PRE_FEC_PADDING_KNOWN 0x0008
380 #define QDF_MON_STATUS_MIDABLE_PERIODICITY_KNOWN 0x0080
381 
382 /* HE radiotap data3 shift values */
383 #define QDF_MON_STATUS_BEAM_CHANGE_SHIFT 6
384 #define QDF_MON_STATUS_DL_UL_SHIFT 7
385 #define QDF_MON_STATUS_TRANSMIT_MCS_SHIFT 8
386 #define QDF_MON_STATUS_DCM_SHIFT 12
387 #define QDF_MON_STATUS_CODING_SHIFT 13
388 #define QDF_MON_STATUS_LDPC_EXTRA_SYMBOL_SHIFT 14
389 #define QDF_MON_STATUS_STBC_SHIFT 15
390 
391 /* HE radiotap data4 shift values */
392 #define QDF_MON_STATUS_STA_ID_SHIFT 4
393 
394 /* HE radiotap data5 */
395 #define QDF_MON_STATUS_GI_SHIFT 4
396 #define QDF_MON_STATUS_HE_LTF_SHIFT 8
397 #define QDF_MON_STATUS_TXBF_SHIFT 14
398 #define QDF_MON_STATUS_PE_DISAMBIGUITY_SHIFT 15
399 #define QDF_MON_STATUS_PRE_FEC_PAD_SHIFT 12
400 
401 /* HE radiotap data6 */
402 #define QDF_MON_STATUS_DOPPLER_SHIFT 4
403 #define QDF_MON_STATUS_TXOP_SHIFT 8
404 
405 /* HE radiotap HE-MU flags1 */
406 #define QDF_MON_STATUS_SIG_B_MCS_KNOWN 0x0010
407 #define QDF_MON_STATUS_SIG_B_DCM_KNOWN 0x0040
408 #define QDF_MON_STATUS_SIG_B_SYM_NUM_KNOWN 0x8000
409 #define QDF_MON_STATUS_RU_0_KNOWN 0x0100
410 #define QDF_MON_STATUS_RU_1_KNOWN 0x0200
411 #define QDF_MON_STATUS_RU_2_KNOWN 0x0400
412 #define QDF_MON_STATUS_RU_3_KNOWN 0x0800
413 #define QDF_MON_STATUS_DCM_FLAG_1_SHIFT 5
414 #define QDF_MON_STATUS_SPATIAL_REUSE_MU_KNOWN 0x0100
415 #define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_1_KNOWN 0x4000
416 
417 /* HE radiotap HE-MU flags2 */
418 #define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_2_SHIFT 3
419 #define QDF_MON_STATUS_BW_KNOWN 0x0004
420 #define QDF_MON_STATUS_NUM_SIG_B_SYMBOLS_SHIFT 4
421 #define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_2_KNOWN 0x0100
422 #define QDF_MON_STATUS_NUM_SIG_B_FLAG_2_SHIFT 9
423 #define QDF_MON_STATUS_LTF_FLAG_2_SYMBOLS_SHIFT 12
424 #define QDF_MON_STATUS_LTF_KNOWN 0x8000
425 
426 /* HE radiotap per_user_1 */
427 #define QDF_MON_STATUS_STA_SPATIAL_SHIFT 11
428 #define QDF_MON_STATUS_TXBF_SHIFT 14
429 #define QDF_MON_STATUS_RESERVED_SET_TO_1_SHIFT 19
430 #define QDF_MON_STATUS_STA_CODING_SHIFT 20
431 
432 /* HE radiotap per_user_2 */
433 #define QDF_MON_STATUS_STA_MCS_SHIFT 4
434 #define QDF_MON_STATUS_STA_DCM_SHIFT 5
435 
436 /* HE radiotap per user known */
437 #define QDF_MON_STATUS_USER_FIELD_POSITION_KNOWN 0x01
438 #define QDF_MON_STATUS_STA_ID_PER_USER_KNOWN 0x02
439 #define QDF_MON_STATUS_STA_NSTS_KNOWN 0x04
440 #define QDF_MON_STATUS_STA_TX_BF_KNOWN 0x08
441 #define QDF_MON_STATUS_STA_SPATIAL_CONFIG_KNOWN 0x10
442 #define QDF_MON_STATUS_STA_MCS_KNOWN 0x20
443 #define QDF_MON_STATUS_STA_DCM_KNOWN 0x40
444 #define QDF_MON_STATUS_STA_CODING_KNOWN 0x80
445 
446 /**
447  * qdf_proto_type - protocol type
448  * @QDF_PROTO_TYPE_DHCP - DHCP
449  * @QDF_PROTO_TYPE_EAPOL - EAPOL
450  * @QDF_PROTO_TYPE_ARP - ARP
451  * @QDF_PROTO_TYPE_MGMT - MGMT
452  * @QDF_PROTO_TYPE_ICMP - ICMP
453  * @QDF_PROTO_TYPE_ICMPv6 - ICMPv6
454  * QDF_PROTO_TYPE_EVENT - EVENT
455  */
456 enum qdf_proto_type {
457 	QDF_PROTO_TYPE_DHCP,
458 	QDF_PROTO_TYPE_EAPOL,
459 	QDF_PROTO_TYPE_ARP,
460 	QDF_PROTO_TYPE_MGMT,
461 	QDF_PROTO_TYPE_ICMP,
462 	QDF_PROTO_TYPE_ICMPv6,
463 	QDF_PROTO_TYPE_EVENT,
464 	QDF_PROTO_TYPE_MAX
465 };
466 
467 /**
468  * qdf_proto_subtype - subtype of packet
469  * @QDF_PROTO_EAPOL_M1 - EAPOL 1/4
470  * @QDF_PROTO_EAPOL_M2 - EAPOL 2/4
471  * @QDF_PROTO_EAPOL_M3 - EAPOL 3/4
472  * @QDF_PROTO_EAPOL_M4 - EAPOL 4/4
473  * @QDF_PROTO_DHCP_DISCOVER - discover
474  * @QDF_PROTO_DHCP_REQUEST - request
475  * @QDF_PROTO_DHCP_OFFER - offer
476  * @QDF_PROTO_DHCP_ACK - ACK
477  * @QDF_PROTO_DHCP_NACK - NACK
478  * @QDF_PROTO_DHCP_RELEASE - release
479  * @QDF_PROTO_DHCP_INFORM - inform
480  * @QDF_PROTO_DHCP_DECLINE - decline
481  * @QDF_PROTO_ARP_REQ - arp request
482  * @QDF_PROTO_ARP_RES - arp response
483  * @QDF_PROTO_ICMP_REQ - icmp request
484  * @QDF_PROTO_ICMP_RES - icmp response
485  * @QDF_PROTO_ICMPV6_REQ - icmpv6 request
486  * @QDF_PROTO_ICMPV6_RES - icmpv6 response
487  * @QDF_PROTO_ICMPV6_RS - icmpv6 rs packet
488  * @QDF_PROTO_ICMPV6_RA - icmpv6 ra packet
489  * @QDF_PROTO_ICMPV6_NS - icmpv6 ns packet
490  * @QDF_PROTO_ICMPV6_NA - icmpv6 na packet
491  * @QDF_PROTO_IPV4_UDP - ipv4 udp
492  * @QDF_PROTO_IPV4_TCP - ipv4 tcp
493  * @QDF_PROTO_IPV6_UDP - ipv6 udp
494  * @QDF_PROTO_IPV6_TCP - ipv6 tcp
495  * @QDF_PROTO_MGMT_ASSOC -assoc
496  * @QDF_PROTO_MGMT_DISASSOC - disassoc
497  * @QDF_PROTO_MGMT_AUTH - auth
498  * @QDF_PROTO_MGMT_DEAUTH - deauth
499  * QDF_ROAM_SYNCH - roam synch indication from fw
500  * QDF_ROAM_COMPLETE - roam complete cmd to fw
501  * QDF_ROAM_EVENTID - roam eventid from fw
502  */
503 enum qdf_proto_subtype {
504 	QDF_PROTO_INVALID,
505 	QDF_PROTO_EAPOL_M1,
506 	QDF_PROTO_EAPOL_M2,
507 	QDF_PROTO_EAPOL_M3,
508 	QDF_PROTO_EAPOL_M4,
509 	QDF_PROTO_DHCP_DISCOVER,
510 	QDF_PROTO_DHCP_REQUEST,
511 	QDF_PROTO_DHCP_OFFER,
512 	QDF_PROTO_DHCP_ACK,
513 	QDF_PROTO_DHCP_NACK,
514 	QDF_PROTO_DHCP_RELEASE,
515 	QDF_PROTO_DHCP_INFORM,
516 	QDF_PROTO_DHCP_DECLINE,
517 	QDF_PROTO_ARP_REQ,
518 	QDF_PROTO_ARP_RES,
519 	QDF_PROTO_ICMP_REQ,
520 	QDF_PROTO_ICMP_RES,
521 	QDF_PROTO_ICMPV6_REQ,
522 	QDF_PROTO_ICMPV6_RES,
523 	QDF_PROTO_ICMPV6_RS,
524 	QDF_PROTO_ICMPV6_RA,
525 	QDF_PROTO_ICMPV6_NS,
526 	QDF_PROTO_ICMPV6_NA,
527 	QDF_PROTO_IPV4_UDP,
528 	QDF_PROTO_IPV4_TCP,
529 	QDF_PROTO_IPV6_UDP,
530 	QDF_PROTO_IPV6_TCP,
531 	QDF_PROTO_MGMT_ASSOC,
532 	QDF_PROTO_MGMT_DISASSOC,
533 	QDF_PROTO_MGMT_AUTH,
534 	QDF_PROTO_MGMT_DEAUTH,
535 	QDF_ROAM_SYNCH,
536 	QDF_ROAM_COMPLETE,
537 	QDF_ROAM_EVENTID,
538 	QDF_PROTO_SUBTYPE_MAX
539 };
540 
541 /**
542  * @qdf_nbuf_t - Platform indepedent packet abstraction
543  */
544 typedef __qdf_nbuf_t qdf_nbuf_t;
545 
546 /**
547  * @qdf_dma_map_cb_t - Dma map callback prototype
548  */
549 typedef void (*qdf_dma_map_cb_t)(void *arg, qdf_nbuf_t buf,
550 				 qdf_dma_map_t dmap);
551 
552 /**
553  * @qdf_nbuf_queue_t - Platform independent packet queue abstraction
554  */
555 typedef __qdf_nbuf_queue_t qdf_nbuf_queue_t;
556 
557 /* BUS/DMA mapping routines */
558 
559 static inline QDF_STATUS
560 qdf_nbuf_dmamap_create(qdf_device_t osdev, qdf_dma_map_t *dmap)
561 {
562 	return __qdf_nbuf_dmamap_create(osdev, dmap);
563 }
564 
565 static inline void
566 qdf_nbuf_dmamap_destroy(qdf_device_t osdev, qdf_dma_map_t dmap)
567 {
568 	__qdf_nbuf_dmamap_destroy(osdev, dmap);
569 }
570 
571 static inline void
572 qdf_nbuf_dmamap_set_cb(qdf_dma_map_t dmap, qdf_dma_map_cb_t cb, void *arg)
573 {
574 	__qdf_nbuf_dmamap_set_cb(dmap, cb, arg);
575 }
576 
577 static inline void
578 qdf_nbuf_set_send_complete_flag(qdf_nbuf_t buf, bool flag)
579 {
580 	__qdf_nbuf_set_send_complete_flag(buf, flag);
581 }
582 
583 #ifdef NBUF_MEMORY_DEBUG
584 /**
585  * qdf_nbuf_map_check_for_leaks() - check for nbut map leaks
586  *
587  * Check for net buffers that have been mapped, but never unmapped.
588  *
589  * Returns: None
590  */
591 void qdf_nbuf_map_check_for_leaks(void);
592 
593 QDF_STATUS qdf_nbuf_map_debug(qdf_device_t osdev,
594 			      qdf_nbuf_t buf,
595 			      qdf_dma_dir_t dir,
596 			      const char *file,
597 			      uint32_t line);
598 
599 #define qdf_nbuf_map(osdev, buf, dir) \
600 	qdf_nbuf_map_debug(osdev, buf, dir, __FILE__, __LINE__)
601 
602 void qdf_nbuf_unmap_debug(qdf_device_t osdev,
603 			  qdf_nbuf_t buf,
604 			  qdf_dma_dir_t dir,
605 			  const char *file,
606 			  uint32_t line);
607 
608 #define qdf_nbuf_unmap(osdev, buf, dir) \
609 	qdf_nbuf_unmap_debug(osdev, buf, dir, __FILE__, __LINE__)
610 
611 QDF_STATUS qdf_nbuf_map_single_debug(qdf_device_t osdev,
612 				     qdf_nbuf_t buf,
613 				     qdf_dma_dir_t dir,
614 				     const char *file,
615 				     uint32_t line);
616 
617 #define qdf_nbuf_map_single(osdev, buf, dir) \
618 	qdf_nbuf_map_single_debug(osdev, buf, dir, __FILE__, __LINE__)
619 
620 void qdf_nbuf_unmap_single_debug(qdf_device_t osdev,
621 				 qdf_nbuf_t buf,
622 				 qdf_dma_dir_t dir,
623 				 const char *file,
624 				 uint32_t line);
625 
626 #define qdf_nbuf_unmap_single(osdev, buf, dir) \
627 	qdf_nbuf_unmap_single_debug(osdev, buf, dir, __FILE__, __LINE__)
628 
629 QDF_STATUS qdf_nbuf_map_nbytes_debug(qdf_device_t osdev,
630 				     qdf_nbuf_t buf,
631 				     qdf_dma_dir_t dir,
632 				     int nbytes,
633 				     const char *file,
634 				     uint32_t line);
635 
636 #define qdf_nbuf_map_nbytes(osdev, buf, dir, nbytes) \
637 	qdf_nbuf_map_nbytes_debug(osdev, buf, dir, nbytes, __FILE__, __LINE__)
638 
639 void qdf_nbuf_unmap_nbytes_debug(qdf_device_t osdev,
640 				 qdf_nbuf_t buf,
641 				 qdf_dma_dir_t dir,
642 				 int nbytes,
643 				 const char *file,
644 				 uint32_t line);
645 
646 #define qdf_nbuf_unmap_nbytes(osdev, buf, dir, nbytes) \
647 	qdf_nbuf_unmap_nbytes_debug(osdev, buf, dir, nbytes, __FILE__, __LINE__)
648 
649 QDF_STATUS qdf_nbuf_map_nbytes_single_debug(qdf_device_t osdev,
650 					    qdf_nbuf_t buf,
651 					    qdf_dma_dir_t dir,
652 					    int nbytes,
653 					    const char *file,
654 					    uint32_t line);
655 
656 #define qdf_nbuf_map_nbytes_single(osdev, buf, dir, nbytes) \
657 	qdf_nbuf_map_nbytes_single_debug(osdev, buf, dir, nbytes, \
658 					 __FILE__, __LINE__)
659 
660 void qdf_nbuf_unmap_nbytes_single_debug(qdf_device_t osdev,
661 					qdf_nbuf_t buf,
662 					qdf_dma_dir_t dir,
663 					int nbytes,
664 					const char *file,
665 					uint32_t line);
666 
667 #define qdf_nbuf_unmap_nbytes_single(osdev, buf, dir, nbytes) \
668 	qdf_nbuf_unmap_nbytes_single_debug(osdev, buf, dir, nbytes, \
669 					   __FILE__, __LINE__)
670 
671 #else /* NBUF_MEMORY_DEBUG */
672 
673 static inline QDF_STATUS
674 qdf_nbuf_map(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
675 {
676 	return __qdf_nbuf_map(osdev, buf, dir);
677 }
678 
679 static inline void
680 qdf_nbuf_unmap(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
681 {
682 	__qdf_nbuf_unmap(osdev, buf, dir);
683 }
684 
685 static inline QDF_STATUS
686 qdf_nbuf_map_single(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
687 {
688 	return __qdf_nbuf_map_single(osdev, buf, dir);
689 }
690 
691 static inline void
692 qdf_nbuf_unmap_single(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
693 {
694 	__qdf_nbuf_unmap_single(osdev, buf, dir);
695 }
696 
697 static inline QDF_STATUS
698 qdf_nbuf_map_nbytes(qdf_device_t osdev, qdf_nbuf_t buf,
699 		qdf_dma_dir_t dir, int nbytes)
700 {
701 	return __qdf_nbuf_map_nbytes(osdev, buf, dir, nbytes);
702 }
703 
704 static inline void
705 qdf_nbuf_unmap_nbytes(qdf_device_t osdev,
706 	qdf_nbuf_t buf, qdf_dma_dir_t dir, int nbytes)
707 {
708 	__qdf_nbuf_unmap_nbytes(osdev, buf, dir, nbytes);
709 }
710 
711 static inline QDF_STATUS
712 qdf_nbuf_map_nbytes_single(
713 	qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir, int nbytes)
714 {
715 	return __qdf_nbuf_map_nbytes_single(osdev, buf, dir, nbytes);
716 }
717 
718 static inline void
719 qdf_nbuf_unmap_nbytes_single(
720 	qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir, int nbytes)
721 {
722 	return __qdf_nbuf_unmap_nbytes_single(osdev, buf, dir, nbytes);
723 }
724 #endif /* NBUF_MEMORY_DEBUG */
725 
726 static inline void
727 qdf_nbuf_sync_for_cpu(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
728 {
729 	__qdf_nbuf_sync_for_cpu(osdev, buf, dir);
730 }
731 
732 static inline int qdf_nbuf_get_num_frags(qdf_nbuf_t buf)
733 {
734 	return __qdf_nbuf_get_num_frags(buf);
735 }
736 
737 /**
738  * qdf_nbuf_get_frag_len() - get fragment length
739  * @buf: Network buffer
740  * @frag_num: Fragment number
741  *
742  * Return: Fragment length
743  */
744 static inline int qdf_nbuf_get_frag_len(qdf_nbuf_t buf, int frag_num)
745 {
746 	QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
747 	return __qdf_nbuf_get_frag_len(buf, frag_num);
748 }
749 
750 /**
751  * qdf_nbuf_get_frag_vaddr() - get fragment virtual address
752  * @buf: Network buffer
753  * @frag_num: Fragment number
754  *
755  * Return: Fragment virtual address
756  */
757 static inline unsigned char *qdf_nbuf_get_frag_vaddr(qdf_nbuf_t buf,
758 			int frag_num)
759 {
760 	QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
761 	return __qdf_nbuf_get_frag_vaddr(buf, frag_num);
762 }
763 
764 /**
765  * qdf_nbuf_get_frag_vaddr_always() - get fragment virtual address
766  * @buf: Network buffer
767  *
768  * Return: Fragment virtual address
769  */
770 static inline unsigned char *
771 qdf_nbuf_get_frag_vaddr_always(qdf_nbuf_t buf)
772 {
773 	return __qdf_nbuf_get_frag_vaddr_always(buf);
774 }
775 
776 /**
777  * qdf_nbuf_get_frag_paddr() - get physical address for skb linear buffer
778  *                              or skb fragment, based on frag_num passed
779  * @buf: Network buffer
780  * @frag_num: Fragment number
781  *
782  * Return: Fragment physical address
783  */
784 static inline qdf_dma_addr_t qdf_nbuf_get_frag_paddr(qdf_nbuf_t buf,
785 			unsigned int frag_num)
786 {
787 	QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
788 	return __qdf_nbuf_get_frag_paddr(buf, frag_num);
789 }
790 
791 /**
792  * qdf_nbuf_get_tx_frag_paddr() - get physical address for skb fragments only
793  * @buf: Network buffer
794  *
795  * Return: Fragment physical address
796  * Usage guideline: Use “qdf_nbuf_frag_map()” to dma map the specific
797  *                  skb fragment , followed by “qdf_nbuf_get_tx_frag_paddr”
798  */
799 static inline qdf_dma_addr_t qdf_nbuf_get_tx_frag_paddr(qdf_nbuf_t buf)
800 {
801 	return __qdf_nbuf_get_tx_frag_paddr(buf);
802 }
803 
804 /**
805  * qdf_nbuf_get_frag_is_wordstream() - is fragment wordstream
806  * @buf: Network buffer
807  * @frag_num: Fragment number
808  *
809  * Return: Fragment wordstream or not
810  */
811 static inline int qdf_nbuf_get_frag_is_wordstream(qdf_nbuf_t buf, int frag_num)
812 {
813 	QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
814 	return __qdf_nbuf_get_frag_is_wordstream(buf, frag_num);
815 }
816 
817 /**
818  * qdf_nbuf_set_frag_is_wordstream() - set fragment wordstream
819  * @buf: Network buffer
820  * @frag_num: Fragment number
821  * @is_wordstream: Wordstream
822  *
823  * Return: none
824  */
825 static inline void
826 qdf_nbuf_set_frag_is_wordstream(qdf_nbuf_t buf,
827 		 int frag_num, int is_wordstream)
828 {
829 	QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
830 	__qdf_nbuf_set_frag_is_wordstream(buf, frag_num, is_wordstream);
831 }
832 
833 static inline void
834 qdf_nbuf_set_vdev_ctx(qdf_nbuf_t buf, uint8_t vdev_id)
835 {
836 	__qdf_nbuf_set_vdev_ctx(buf, vdev_id);
837 }
838 
839 static inline void
840 qdf_nbuf_set_tx_ftype(qdf_nbuf_t buf, uint8_t type)
841 {
842 	__qdf_nbuf_set_tx_ftype(buf, type);
843 }
844 
845 static inline void
846 qdf_nbuf_set_rx_ftype(qdf_nbuf_t buf, uint8_t type)
847 {
848 	__qdf_nbuf_set_rx_ftype(buf, type);
849 }
850 
851 
852 
853 static inline uint8_t
854 qdf_nbuf_get_vdev_ctx(qdf_nbuf_t buf)
855 {
856 	return  __qdf_nbuf_get_vdev_ctx(buf);
857 }
858 
859 static inline uint8_t qdf_nbuf_get_tx_ftype(qdf_nbuf_t buf)
860 {
861 	return  __qdf_nbuf_get_tx_ftype(buf);
862 }
863 
864 static inline uint8_t qdf_nbuf_get_rx_ftype(qdf_nbuf_t buf)
865 {
866 	return  __qdf_nbuf_get_rx_ftype(buf);
867 }
868 
869 
870 static inline qdf_dma_addr_t
871 qdf_nbuf_mapped_paddr_get(qdf_nbuf_t buf)
872 {
873 	return __qdf_nbuf_mapped_paddr_get(buf);
874 }
875 
876 static inline void
877 qdf_nbuf_mapped_paddr_set(qdf_nbuf_t buf, qdf_dma_addr_t paddr)
878 {
879 	__qdf_nbuf_mapped_paddr_set(buf, paddr);
880 }
881 
882 static inline void
883 qdf_nbuf_frag_push_head(qdf_nbuf_t buf,
884 			int frag_len, char *frag_vaddr,
885 			qdf_dma_addr_t frag_paddr)
886 {
887 	__qdf_nbuf_frag_push_head(buf, frag_len, frag_vaddr, frag_paddr);
888 }
889 
890 #define qdf_nbuf_num_frags_init(_nbuf) __qdf_nbuf_num_frags_init((_nbuf))
891 
892 /**
893  * qdf_nbuf_set_rx_chfrag_start() - set msdu start bit
894  * @buf: Network buffer
895  * @val: 0/1
896  *
897  * Return: void
898  */
899 static inline void
900 qdf_nbuf_set_rx_chfrag_start(qdf_nbuf_t buf, uint8_t val)
901 {
902 	__qdf_nbuf_set_rx_chfrag_start(buf, val);
903 }
904 
905 /**
906  * qdf_nbuf_is_rx_chfrag_start() - get msdu start bit
907  * @buf: Network buffer
908  *
909  * Return: integer value - 0/1
910  */
911 static inline int qdf_nbuf_is_rx_chfrag_start(qdf_nbuf_t buf)
912 {
913 	return __qdf_nbuf_is_rx_chfrag_start(buf);
914 }
915 
916 /**
917  * qdf_nbuf_set_rx_chfrag_cont() - set msdu continuation bit
918  * @buf: Network buffer
919  * @val: 0/1
920  *
921  * Return: void
922  */
923 static inline void
924 qdf_nbuf_set_rx_chfrag_cont(qdf_nbuf_t buf, uint8_t val)
925 {
926 	__qdf_nbuf_set_rx_chfrag_cont(buf, val);
927 }
928 
929 /**
930  * qdf_nbuf_is_rx_chfrag_cont() - get msdu continuation bit
931  * @buf: Network buffer
932  *
933  * Return: integer value - 0/1
934  */
935 static inline int qdf_nbuf_is_rx_chfrag_cont(qdf_nbuf_t buf)
936 {
937 	return __qdf_nbuf_is_rx_chfrag_cont(buf);
938 }
939 
940 /**
941  * qdf_nbuf_set_rx_chfrag_end() - set msdu end bit
942  * @buf: Network buffer
943  * @val: 0/1
944  *
945  * Return: void
946  */
947 static inline void qdf_nbuf_set_rx_chfrag_end(qdf_nbuf_t buf, uint8_t val)
948 {
949 	__qdf_nbuf_set_rx_chfrag_end(buf, val);
950 }
951 
952 /**
953  * qdf_nbuf_is_rx_chfrag_end() - set msdu end bit
954  * @buf: Network buffer
955  *
956  * Return: integer value - 0/1
957  */
958 static inline int qdf_nbuf_is_rx_chfrag_end(qdf_nbuf_t buf)
959 {
960 	return __qdf_nbuf_is_rx_chfrag_end(buf);
961 }
962 
963 /**
964  * qdf_nbuf_set_tx_chfrag_start() - set msdu start bit
965  * @buf: Network buffer
966  * @val: 0/1
967  *
968  * Return: void
969  */
970 static inline void
971 qdf_nbuf_set_tx_chfrag_start(qdf_nbuf_t buf, uint8_t val)
972 {
973 	__qdf_nbuf_set_tx_chfrag_start(buf, val);
974 }
975 
976 /**
977  * qdf_nbuf_is_tx_chfrag_start() - get msdu start bit
978  * @buf: Network buffer
979  *
980  * Return: integer value - 0/1
981  */
982 static inline int qdf_nbuf_is_tx_chfrag_start(qdf_nbuf_t buf)
983 {
984 	return __qdf_nbuf_is_tx_chfrag_start(buf);
985 }
986 
987 /**
988  * qdf_nbuf_set_tx_chfrag_cont() - set msdu continuation bit
989  * @buf: Network buffer
990  * @val: 0/1
991  *
992  * Return: void
993  */
994 static inline void
995 qdf_nbuf_set_tx_chfrag_cont(qdf_nbuf_t buf, uint8_t val)
996 {
997 	__qdf_nbuf_set_tx_chfrag_cont(buf, val);
998 }
999 
1000 /**
1001  * qdf_nbuf_is_tx_chfrag_cont() - get msdu continuation bit
1002  * @buf: Network buffer
1003  *
1004  * Return: integer value - 0/1
1005  */
1006 static inline int qdf_nbuf_is_tx_chfrag_cont(qdf_nbuf_t buf)
1007 {
1008 	return __qdf_nbuf_is_tx_chfrag_cont(buf);
1009 }
1010 
1011 /**
1012  * qdf_nbuf_set_tx_chfrag_end() - set msdu end bit
1013  * @buf: Network buffer
1014  * @val: 0/1
1015  *
1016  * Return: void
1017  */
1018 static inline void qdf_nbuf_set_tx_chfrag_end(qdf_nbuf_t buf, uint8_t val)
1019 {
1020 	__qdf_nbuf_set_tx_chfrag_end(buf, val);
1021 }
1022 
1023 /**
1024  * qdf_nbuf_is_tx_chfrag_end() - set msdu end bit
1025  * @buf: Network buffer
1026  *
1027  * Return: integer value - 0/1
1028  */
1029 static inline int qdf_nbuf_is_tx_chfrag_end(qdf_nbuf_t buf)
1030 {
1031 	return __qdf_nbuf_is_tx_chfrag_end(buf);
1032 }
1033 
1034 static inline void
1035 qdf_nbuf_dma_map_info(qdf_dma_map_t bmap, qdf_dmamap_info_t *sg)
1036 {
1037 	__qdf_nbuf_dma_map_info(bmap, sg);
1038 }
1039 
1040 /**
1041  * qdf_nbuf_is_tso() - is the network buffer a jumbo packet?
1042  * @buf: Network buffer
1043  *
1044  * Return: 1 - this is a jumbo packet 0 - not a jumbo packet
1045  */
1046 static inline uint8_t qdf_nbuf_is_tso(qdf_nbuf_t nbuf)
1047 {
1048 	return __qdf_nbuf_is_tso(nbuf);
1049 }
1050 
1051 /**
1052  * qdf_nbuf_get_users() - function to get the number of users referencing this
1053  * network buffer
1054  *
1055  * @nbuf:   network buffer
1056  *
1057  * Return: number of user references to nbuf.
1058  */
1059 static inline int qdf_nbuf_get_users(qdf_nbuf_t nbuf)
1060 {
1061 	return __qdf_nbuf_get_users(nbuf);
1062 }
1063 
1064 /**
1065  * qdf_nbuf_next() - get the next packet in the linked list
1066  * @buf: Network buffer
1067  *
1068  * This function can be used when nbufs are directly linked into a list,
1069  * rather than using a separate network buffer queue object.
1070  *
1071  * Return: next network buffer in the linked list
1072  */
1073 static inline qdf_nbuf_t qdf_nbuf_next(qdf_nbuf_t buf)
1074 {
1075 	return __qdf_nbuf_next(buf);
1076 }
1077 
1078 #ifdef NBUF_MEMORY_DEBUG
1079 void qdf_net_buf_debug_init(void);
1080 void qdf_net_buf_debug_exit(void);
1081 void qdf_net_buf_debug_clean(void);
1082 void qdf_net_buf_debug_add_node(qdf_nbuf_t net_buf, size_t size,
1083 			uint8_t *file_name, uint32_t line_num);
1084 void qdf_net_buf_debug_delete_node(qdf_nbuf_t net_buf);
1085 
1086 /**
1087  * qdf_net_buf_debug_acquire_skb() - acquire skb to avoid memory leak
1088  * @net_buf: Network buf holding head segment (single)
1089  * @file_name: pointer to file name
1090  * @line_num: line number
1091  *
1092  * WLAN driver module's SKB which are allocated by network stack are
1093  * suppose to call this API before freeing it such that the SKB
1094  * is not reported as memory leak.
1095  *
1096  * Return: none
1097  */
1098 void qdf_net_buf_debug_acquire_skb(qdf_nbuf_t net_buf,
1099 			uint8_t *file_name, uint32_t line_num);
1100 void qdf_net_buf_debug_release_skb(qdf_nbuf_t net_buf);
1101 
1102 /* nbuf allocation rouines */
1103 
1104 #define qdf_nbuf_alloc(d, s, r, a, p) \
1105 	qdf_nbuf_alloc_debug(d, s, r, a, p, __FILE__, __LINE__)
1106 
1107 qdf_nbuf_t qdf_nbuf_alloc_debug(qdf_device_t osdev, qdf_size_t size,
1108 				int reserve, int align, int prio,
1109 				uint8_t *file, uint32_t line);
1110 
1111 #define qdf_nbuf_free(d) \
1112 	qdf_nbuf_free_debug(d, __FILE__, __LINE__)
1113 
1114 void qdf_nbuf_free_debug(qdf_nbuf_t nbuf, uint8_t *file, uint32_t line);
1115 
1116 #define qdf_nbuf_clone(buf)     \
1117 	qdf_nbuf_clone_debug(buf, __FILE__, __LINE__)
1118 
1119 /**
1120  * qdf_nbuf_clone_debug() - clone the nbuf (copy is readonly)
1121  * @buf: nbuf to clone from
1122  * @file_name: pointer to file name
1123  * @line_num: line number
1124  *
1125  * This function clones the nbuf and creates a memory tracking
1126  * node corresponding to that cloned skbuff structure.
1127  *
1128  * Return: cloned buffer
1129  */
1130 static inline qdf_nbuf_t
1131 qdf_nbuf_clone_debug(qdf_nbuf_t buf, uint8_t *file_name,
1132 			uint32_t line_num)
1133 {
1134 	qdf_nbuf_t cloned_buf;
1135 
1136 	cloned_buf = __qdf_nbuf_clone(buf);
1137 
1138 	/* Store SKB in internal QDF tracking table */
1139 	if (qdf_likely(cloned_buf))
1140 		qdf_net_buf_debug_add_node(cloned_buf, 0, file_name, line_num);
1141 
1142 	return cloned_buf;
1143 }
1144 
1145 #define qdf_nbuf_copy(buf)     \
1146 	qdf_nbuf_copy_debug(buf, __FILE__, __LINE__)
1147 
1148 /**
1149  * qdf_nbuf_copy_debug() - returns a private copy of the buf
1150  * @buf: nbuf to copy from
1151  * @file_name: pointer to file name
1152  * @line_num: line number
1153  *
1154  * This API returns a private copy of the buf, the buf returned is completely
1155  * modifiable by callers. It also creates a memory tracking node corresponding
1156  * to that new skbuff structure.
1157  *
1158  * Return: copied buffer
1159  */
1160 static inline qdf_nbuf_t
1161 qdf_nbuf_copy_debug(qdf_nbuf_t buf, uint8_t *file_name,
1162 			uint32_t line_num)
1163 {
1164 	qdf_nbuf_t copied_buf;
1165 
1166 	copied_buf = __qdf_nbuf_copy(buf);
1167 
1168 	/* Store SKB in internal QDF tracking table */
1169 	if (qdf_likely(copied_buf))
1170 		qdf_net_buf_debug_add_node(copied_buf, 0, file_name, line_num);
1171 
1172 	return copied_buf;
1173 }
1174 
1175 #else /* NBUF_MEMORY_DEBUG */
1176 
1177 static inline void qdf_net_buf_debug_init(void) {}
1178 static inline void qdf_net_buf_debug_exit(void) {}
1179 
1180 static inline void qdf_net_buf_debug_acquire_skb(qdf_nbuf_t net_buf,
1181 			uint8_t *file_name, uint32_t line_num)
1182 {
1183 }
1184 
1185 static inline void qdf_net_buf_debug_release_skb(qdf_nbuf_t net_buf)
1186 {
1187 }
1188 
1189 /* Nbuf allocation rouines */
1190 
1191 static inline qdf_nbuf_t
1192 qdf_nbuf_alloc(qdf_device_t osdev,
1193 		qdf_size_t size, int reserve, int align, int prio)
1194 {
1195 	return __qdf_nbuf_alloc(osdev, size, reserve, align, prio);
1196 }
1197 
1198 static inline void qdf_nbuf_free(qdf_nbuf_t buf)
1199 {
1200 	__qdf_nbuf_free(buf);
1201 }
1202 
1203 /**
1204  * qdf_nbuf_clone() - clone the nbuf (copy is readonly)
1205  * @buf: Pointer to network buffer
1206  *
1207  * This function clones the nbuf and returns new sk_buff
1208  * structure.
1209  *
1210  * Return: cloned skb
1211  */
1212 static inline qdf_nbuf_t qdf_nbuf_clone(qdf_nbuf_t buf)
1213 {
1214 	return __qdf_nbuf_clone(buf);
1215 }
1216 
1217 /**
1218  * qdf_nbuf_copy() - returns a private copy of the buf
1219  * @buf: Pointer to network buffer
1220  *
1221  * This API returns a private copy of the buf, the buf returned is completely
1222  *  modifiable by callers
1223  *
1224  * Return: skb or NULL
1225  */
1226 static inline qdf_nbuf_t qdf_nbuf_copy(qdf_nbuf_t buf)
1227 {
1228 	return __qdf_nbuf_copy(buf);
1229 }
1230 
1231 #endif /* NBUF_MEMORY_DEBUG */
1232 
1233 #ifdef WLAN_FEATURE_FASTPATH
1234 /**
1235  * qdf_nbuf_init_fast() - before put buf into pool,turn it to init state
1236  *
1237  * @buf: buf instance
1238  * Return: data pointer of this buf where new data has to be
1239  *         put, or NULL if there is not enough room in this buf.
1240  */
1241 void qdf_nbuf_init_fast(qdf_nbuf_t nbuf);
1242 #endif /* WLAN_FEATURE_FASTPATH */
1243 
1244 static inline void qdf_nbuf_tx_free(qdf_nbuf_t buf_list, int tx_err)
1245 {
1246 	while (buf_list) {
1247 		qdf_nbuf_t next = qdf_nbuf_next(buf_list);
1248 
1249 		qdf_nbuf_free(buf_list);
1250 		buf_list = next;
1251 	}
1252 }
1253 
1254 static inline void qdf_nbuf_ref(qdf_nbuf_t buf)
1255 {
1256 	__qdf_nbuf_ref(buf);
1257 }
1258 
1259 static inline int qdf_nbuf_shared(qdf_nbuf_t buf)
1260 {
1261 	return __qdf_nbuf_shared(buf);
1262 }
1263 
1264 static inline QDF_STATUS qdf_nbuf_cat(qdf_nbuf_t dst, qdf_nbuf_t src)
1265 {
1266 	return __qdf_nbuf_cat(dst, src);
1267 }
1268 
1269 /**
1270  * @qdf_nbuf_copy_bits() - return the length of the copy bits for skb
1271  * @skb: SKB pointer
1272  * @offset: offset
1273  * @len: Length
1274  * @to: To
1275  *
1276  * Return: int32_t
1277  */
1278 static inline int32_t
1279 qdf_nbuf_copy_bits(qdf_nbuf_t nbuf, uint32_t offset, uint32_t len, void *to)
1280 {
1281 	return __qdf_nbuf_copy_bits(nbuf, offset, len, to);
1282 }
1283 
1284 
1285 /* nbuf manipulation routines */
1286 
1287 /**
1288  * @qdf_nbuf_head() - return the address of an nbuf's buffer
1289  * @buf: netbuf
1290  *
1291  * Return: head address
1292  */
1293 static inline uint8_t *qdf_nbuf_head(qdf_nbuf_t buf)
1294 {
1295 	return __qdf_nbuf_head(buf);
1296 }
1297 
1298 /**
1299  * qdf_nbuf_data() - Return the address of the start of data within an nbuf
1300  * @buf: Network buffer
1301  *
1302  * Return: Data address
1303  */
1304 static inline uint8_t *qdf_nbuf_data(qdf_nbuf_t buf)
1305 {
1306 	return __qdf_nbuf_data(buf);
1307 }
1308 
1309 /**
1310  * qdf_nbuf_data_addr() - Return the address of skb->data
1311  * @buf: Network buffer
1312  *
1313  * Return: Data address
1314  */
1315 static inline uint8_t *qdf_nbuf_data_addr(qdf_nbuf_t buf)
1316 {
1317 	return __qdf_nbuf_data_addr(buf);
1318 }
1319 
1320 /**
1321  * qdf_nbuf_headroom() - amount of headroom int the current nbuf
1322  * @buf: Network buffer
1323  *
1324  * Return: Amount of head room
1325  */
1326 static inline uint32_t qdf_nbuf_headroom(qdf_nbuf_t buf)
1327 {
1328 	return __qdf_nbuf_headroom(buf);
1329 }
1330 
1331 /**
1332  * qdf_nbuf_tailroom() - amount of tail space available
1333  * @buf: Network buffer
1334  *
1335  * Return: amount of tail room
1336  */
1337 static inline uint32_t qdf_nbuf_tailroom(qdf_nbuf_t buf)
1338 {
1339 	return __qdf_nbuf_tailroom(buf);
1340 }
1341 
1342 /**
1343  * qdf_nbuf_push_head() - push data in the front
1344  * @buf: Network buf instance
1345  * @size: Size to be pushed
1346  *
1347  * Return: New data pointer of this buf after data has been pushed,
1348  *	or NULL if there is not enough room in this buf.
1349  */
1350 static inline uint8_t *qdf_nbuf_push_head(qdf_nbuf_t buf, qdf_size_t size)
1351 {
1352 	return __qdf_nbuf_push_head(buf, size);
1353 }
1354 
1355 /**
1356  * qdf_nbuf_put_tail() - puts data in the end
1357  * @buf: Network buf instance
1358  * @size: Size to be pushed
1359  *
1360  * Return: Data pointer of this buf where new data has to be
1361  *	put, or NULL if there is not enough room in this buf.
1362  */
1363 static inline uint8_t *qdf_nbuf_put_tail(qdf_nbuf_t buf, qdf_size_t size)
1364 {
1365 	return __qdf_nbuf_put_tail(buf, size);
1366 }
1367 
1368 /**
1369  * qdf_nbuf_pull_head() - pull data out from the front
1370  * @buf: Network buf instance
1371  * @size: Size to be popped
1372  *
1373  * Return: New data pointer of this buf after data has been popped,
1374  *	or NULL if there is not sufficient data to pull.
1375  */
1376 static inline uint8_t *qdf_nbuf_pull_head(qdf_nbuf_t buf, qdf_size_t size)
1377 {
1378 	return __qdf_nbuf_pull_head(buf, size);
1379 }
1380 
1381 /**
1382  * qdf_nbuf_trim_tail() - trim data out from the end
1383  * @buf: Network buf instance
1384  * @size: Size to be popped
1385  *
1386  * Return: none
1387  */
1388 static inline void qdf_nbuf_trim_tail(qdf_nbuf_t buf, qdf_size_t size)
1389 {
1390 	__qdf_nbuf_trim_tail(buf, size);
1391 }
1392 
1393 /**
1394  * qdf_nbuf_len() - get the length of the buf
1395  * @buf: Network buf instance
1396  *
1397  * Return: total length of this buf.
1398  */
1399 static inline qdf_size_t qdf_nbuf_len(qdf_nbuf_t buf)
1400 {
1401 	return __qdf_nbuf_len(buf);
1402 }
1403 
1404 /**
1405  * qdf_nbuf_set_pktlen() - set the length of the buf
1406  * @buf: Network buf instance
1407  * @size: Size to be set
1408  *
1409  * Return: none
1410  */
1411 static inline void qdf_nbuf_set_pktlen(qdf_nbuf_t buf, uint32_t len)
1412 {
1413 	__qdf_nbuf_set_pktlen(buf, len);
1414 }
1415 
1416 /**
1417  * qdf_nbuf_reserve() - trim data out from the end
1418  * @buf: Network buf instance
1419  * @size: Size to be popped
1420  *
1421  * Return: none
1422  */
1423 static inline void qdf_nbuf_reserve(qdf_nbuf_t buf, qdf_size_t size)
1424 {
1425 	__qdf_nbuf_reserve(buf, size);
1426 }
1427 
1428 /**
1429  * qdf_nbuf_peek_header() - return the data pointer & length of the header
1430  * @buf: Network nbuf
1431  * @addr: Data pointer
1432  * @len: Length of the data
1433  *
1434  * Return: none
1435  */
1436 static inline void
1437 qdf_nbuf_peek_header(qdf_nbuf_t buf, uint8_t **addr, uint32_t *len)
1438 {
1439 	__qdf_nbuf_peek_header(buf, addr, len);
1440 }
1441 
1442 /* nbuf queue routines */
1443 
1444 /**
1445  * qdf_nbuf_queue_init() - initialize buf queue
1446  * @head: Network buf queue head
1447  *
1448  * Return: none
1449  */
1450 static inline void qdf_nbuf_queue_init(qdf_nbuf_queue_t *head)
1451 {
1452 	__qdf_nbuf_queue_init(head);
1453 }
1454 
1455 /**
1456  * qdf_nbuf_queue_add() - append a nbuf to the tail of the buf queue
1457  * @head: Network buf queue head
1458  * @buf: Network buf
1459  *
1460  * Return: none
1461  */
1462 static inline void qdf_nbuf_queue_add(qdf_nbuf_queue_t *head, qdf_nbuf_t buf)
1463 {
1464 	__qdf_nbuf_queue_add(head, buf);
1465 }
1466 
1467 /**
1468  * qdf_nbuf_queue_insert_head() - insert nbuf at the head of queue
1469  * @head: Network buf queue head
1470  * @buf: Network buf
1471  *
1472  * Return: none
1473  */
1474 static inline void
1475 qdf_nbuf_queue_insert_head(qdf_nbuf_queue_t *head, qdf_nbuf_t buf)
1476 {
1477 	__qdf_nbuf_queue_insert_head(head, buf);
1478 }
1479 
1480 /**
1481  * qdf_nbuf_queue_remove() - retrieve a buf from the head of the buf queue
1482  * @head: Network buf queue head
1483  *
1484  * Return: The head buf in the buf queue.
1485  */
1486 static inline qdf_nbuf_t qdf_nbuf_queue_remove(qdf_nbuf_queue_t *head)
1487 {
1488 	return __qdf_nbuf_queue_remove(head);
1489 }
1490 
1491 /**
1492  * qdf_nbuf_queue_len() - get the length of the queue
1493  * @head: Network buf queue head
1494  *
1495  * Return: length of the queue
1496  */
1497 static inline uint32_t qdf_nbuf_queue_len(qdf_nbuf_queue_t *head)
1498 {
1499 	return __qdf_nbuf_queue_len(head);
1500 }
1501 
1502 /**
1503  * qdf_nbuf_queue_next() - get the next guy/packet of the given buffer
1504  * @buf: Network buffer
1505  *
1506  * Return: next buffer/packet
1507  */
1508 static inline qdf_nbuf_t qdf_nbuf_queue_next(qdf_nbuf_t buf)
1509 {
1510 	return __qdf_nbuf_queue_next(buf);
1511 }
1512 
1513 /**
1514  * @qdf_nbuf_is_queue_empty() - check if the buf queue is empty
1515  * @nbq: Network buf queue handle
1516  *
1517  * Return: true  if queue is empty
1518  *	   false if queue is not emty
1519  */
1520 static inline bool qdf_nbuf_is_queue_empty(qdf_nbuf_queue_t *nbq)
1521 {
1522 	return __qdf_nbuf_is_queue_empty(nbq);
1523 }
1524 
1525 static inline qdf_nbuf_queue_t *
1526 qdf_nbuf_queue_append(qdf_nbuf_queue_t *dest, qdf_nbuf_queue_t *src)
1527 {
1528 	return __qdf_nbuf_queue_append(dest, src);
1529 }
1530 
1531 static inline void
1532 qdf_nbuf_queue_free(qdf_nbuf_queue_t *head)
1533 {
1534 	__qdf_nbuf_queue_free(head);
1535 }
1536 
1537 static inline qdf_nbuf_t
1538 qdf_nbuf_queue_first(qdf_nbuf_queue_t *head)
1539 {
1540 	return __qdf_nbuf_queue_first(head);
1541 }
1542 
1543 /**
1544  * qdf_nbuf_get_protocol() - return the protocol value of the skb
1545  * @skb: Pointer to network buffer
1546  *
1547  * Return: skb protocol
1548  */
1549 static inline uint16_t qdf_nbuf_get_protocol(struct sk_buff *skb)
1550 {
1551 	return __qdf_nbuf_get_protocol(skb);
1552 }
1553 
1554 /**
1555  * qdf_nbuf_get_ip_summed() - return the ip checksum value of the skb
1556  * @skb: Pointer to network buffer
1557  *
1558  * Return: skb ip_summed
1559  */
1560 static inline uint8_t qdf_nbuf_get_ip_summed(struct sk_buff *skb)
1561 {
1562 	return __qdf_nbuf_get_ip_summed(skb);
1563 }
1564 
1565 /**
1566  * qdf_nbuf_set_ip_summed() - sets the ip_summed value of the skb
1567  * @skb: Pointer to network buffer
1568  * @ip_summed: ip checksum
1569  *
1570  * Return: none
1571  */
1572 static inline void qdf_nbuf_set_ip_summed(struct sk_buff *skb,
1573 	uint8_t ip_summed)
1574 {
1575 	__qdf_nbuf_set_ip_summed(skb, ip_summed);
1576 }
1577 
1578 /**
1579  * qdf_nbuf_set_next() - add a packet to a linked list
1580  * @this_buf: Predecessor buffer
1581  * @next_buf: Successor buffer
1582  *
1583  * This function can be used to directly link nbufs, rather than using
1584  * a separate network buffer queue object.
1585  *
1586  * Return: none
1587  */
1588 static inline void qdf_nbuf_set_next(qdf_nbuf_t this_buf, qdf_nbuf_t next_buf)
1589 {
1590 	__qdf_nbuf_set_next(this_buf, next_buf);
1591 }
1592 
1593 /* nbuf extension routines */
1594 
1595 /**
1596  * qdf_nbuf_set_next_ext() - link extension of this packet contained in a new
1597  *			nbuf
1598  * @this_buf: predecessor buffer
1599  * @next_buf: successor buffer
1600  *
1601  * This function is used to link up many nbufs containing a single logical
1602  * packet - not a collection of packets. Do not use for linking the first
1603  * extension to the head
1604  *
1605  * Return: none
1606  */
1607 static inline void
1608 qdf_nbuf_set_next_ext(qdf_nbuf_t this_buf, qdf_nbuf_t next_buf)
1609 {
1610 	__qdf_nbuf_set_next_ext(this_buf, next_buf);
1611 }
1612 
1613 /**
1614  * qdf_nbuf_next_ext() - get the next packet extension in the linked list
1615  * @buf: Network buffer
1616  *
1617  * Return: Next network buffer in the linked list
1618  */
1619 static inline qdf_nbuf_t qdf_nbuf_next_ext(qdf_nbuf_t buf)
1620 {
1621 	return __qdf_nbuf_next_ext(buf);
1622 }
1623 
1624 /**
1625  * qdf_nbuf_append_ext_list() - link list of packet extensions to the head
1626  *				segment
1627  * @head_buf: Network buf holding head segment (single)
1628  * @ext_list: Network buf list holding linked extensions to the head
1629  * @ext_len: Total length of all buffers in the extension list
1630  *
1631  * This function is used to link up a list of packet extensions (seg1, 2,
1632  * ...) to the nbuf holding the head segment (seg0)
1633  *
1634  * Return: none
1635  */
1636 static inline void
1637 qdf_nbuf_append_ext_list(qdf_nbuf_t head_buf, qdf_nbuf_t ext_list,
1638 			qdf_size_t ext_len)
1639 {
1640 	__qdf_nbuf_append_ext_list(head_buf, ext_list, ext_len);
1641 }
1642 
1643 /**
1644  * qdf_nbuf_get_ext_list() - Get the link to extended nbuf list.
1645  * @head_buf: Network buf holding head segment (single)
1646  *
1647  * This ext_list is populated when we have Jumbo packet, for example in case of
1648  * monitor mode amsdu packet reception, and are stiched using frags_list.
1649  *
1650  * Return: Network buf list holding linked extensions from head buf.
1651  */
1652 static inline qdf_nbuf_t qdf_nbuf_get_ext_list(qdf_nbuf_t head_buf)
1653 {
1654 	return (qdf_nbuf_t)__qdf_nbuf_get_ext_list(head_buf);
1655 }
1656 
1657 /**
1658  * qdf_nbuf_get_tx_cksum() - gets the tx checksum offload demand
1659  * @buf: Network buffer
1660  *
1661  * Return: qdf_nbuf_tx_cksum_t checksum offload demand for the frame
1662  */
1663 static inline qdf_nbuf_tx_cksum_t qdf_nbuf_get_tx_cksum(qdf_nbuf_t buf)
1664 {
1665 	return __qdf_nbuf_get_tx_cksum(buf);
1666 }
1667 
1668 /**
1669  * qdf_nbuf_set_rx_cksum() - drivers that support hw checksumming use this to
1670  *			indicate checksum info to the stack.
1671  * @buf: Network buffer
1672  * @cksum: Checksum
1673  *
1674  * Return: none
1675  */
1676 static inline void
1677 qdf_nbuf_set_rx_cksum(qdf_nbuf_t buf, qdf_nbuf_rx_cksum_t *cksum)
1678 {
1679 	__qdf_nbuf_set_rx_cksum(buf, cksum);
1680 }
1681 
1682 /**
1683  * qdf_nbuf_get_tid() - this function extracts the TID value from nbuf
1684  * @buf: Network buffer
1685  *
1686  * Return: TID value
1687  */
1688 static inline uint8_t qdf_nbuf_get_tid(qdf_nbuf_t buf)
1689 {
1690 	return __qdf_nbuf_get_tid(buf);
1691 }
1692 
1693 /**
1694  * qdf_nbuf_set_tid() - this function sets the TID value in nbuf
1695  * @buf: Network buffer
1696  * @tid: TID value
1697  *
1698  * Return: none
1699  */
1700 static inline void qdf_nbuf_set_tid(qdf_nbuf_t buf, uint8_t tid)
1701 {
1702 	__qdf_nbuf_set_tid(buf, tid);
1703 }
1704 
1705 /**
1706  * qdf_nbuf_get_exemption_type() - this function extracts the exemption type
1707  *				from nbuf
1708  * @buf: Network buffer
1709  *
1710  * Return: Exemption type
1711  */
1712 static inline uint8_t qdf_nbuf_get_exemption_type(qdf_nbuf_t buf)
1713 {
1714 	return __qdf_nbuf_get_exemption_type(buf);
1715 }
1716 
1717 /**
1718  * qdf_nbuf_set_protocol() - this function peeks data into the buffer at given
1719  *			offset
1720  * @buf: Network buffer
1721  * @proto: Protocol
1722  *
1723  * Return: none
1724  */
1725 static inline void qdf_nbuf_set_protocol(qdf_nbuf_t buf, uint16_t proto)
1726 {
1727 	__qdf_nbuf_set_protocol(buf, proto);
1728 }
1729 
1730 /**
1731  * qdf_nbuf_trace_get_proto_type() - this function return packet proto type
1732  * @buf: Network buffer
1733  *
1734  * Return: Packet protocol type
1735  */
1736 static inline uint8_t qdf_nbuf_trace_get_proto_type(qdf_nbuf_t buf)
1737 {
1738 	return __qdf_nbuf_trace_get_proto_type(buf);
1739 }
1740 
1741 /**
1742  * qdf_nbuf_reg_trace_cb() - this function registers protocol trace callback
1743  * @cb_func_ptr: Callback pointer
1744  *
1745  * Return: none
1746  */
1747 static inline void qdf_nbuf_reg_trace_cb(qdf_nbuf_trace_update_t cb_func_ptr)
1748 {
1749 	__qdf_nbuf_reg_trace_cb(cb_func_ptr);
1750 }
1751 
1752 
1753 /**
1754  * qdf_nbuf_set_tx_parallel_dnload_frm() - set tx parallel download
1755  * @buf: Network buffer
1756  * @candi: Candidate of parallel download frame
1757  *
1758  * This function stores a flag specifying this TX frame is suitable for
1759  * downloading though a 2nd TX data pipe that is used for short frames for
1760  * protocols that can accept out-of-order delivery.
1761  *
1762  * Return: none
1763  */
1764 static inline void
1765 qdf_nbuf_set_tx_parallel_dnload_frm(qdf_nbuf_t buf, uint8_t candi)
1766 {
1767 	__qdf_nbuf_set_tx_htt2_frm(buf, candi);
1768 }
1769 
1770 /**
1771  * qdf_nbuf_get_tx_parallel_dnload_frm() - get tx parallel download
1772  * @buf: Network buffer
1773  *
1774  * This function return whether this TX frame is allow to download though a 2nd
1775  * TX data pipe or not.
1776  *
1777  * Return: none
1778  */
1779 static inline uint8_t qdf_nbuf_get_tx_parallel_dnload_frm(qdf_nbuf_t buf)
1780 {
1781 	return __qdf_nbuf_get_tx_htt2_frm(buf);
1782 }
1783 
1784 /**
1785  * qdf_nbuf_get_dhcp_subtype() - get the subtype
1786  *              of DHCP packet.
1787  * @buf: Pointer to DHCP packet buffer
1788  *
1789  * This func. returns the subtype of DHCP packet.
1790  *
1791  * Return: subtype of the DHCP packet.
1792  */
1793 static inline enum qdf_proto_subtype
1794 qdf_nbuf_get_dhcp_subtype(qdf_nbuf_t buf)
1795 {
1796 	return __qdf_nbuf_data_get_dhcp_subtype(qdf_nbuf_data(buf));
1797 }
1798 
1799 /**
1800  * qdf_nbuf_data_get_dhcp_subtype() - get the subtype
1801  *              of DHCP packet.
1802  * @buf: Pointer to DHCP packet data buffer
1803  *
1804  * This func. returns the subtype of DHCP packet.
1805  *
1806  * Return: subtype of the DHCP packet.
1807  */
1808 static inline enum qdf_proto_subtype
1809 qdf_nbuf_data_get_dhcp_subtype(uint8_t *data)
1810 {
1811 	return __qdf_nbuf_data_get_dhcp_subtype(data);
1812 }
1813 
1814 /**
1815  * qdf_nbuf_get_eapol_subtype() - get the subtype
1816  *            of EAPOL packet.
1817  * @buf: Pointer to EAPOL packet buffer
1818  *
1819  * This func. returns the subtype of EAPOL packet.
1820  *
1821  * Return: subtype of the EAPOL packet.
1822  */
1823 static inline enum qdf_proto_subtype
1824 qdf_nbuf_get_eapol_subtype(qdf_nbuf_t buf)
1825 {
1826 	return __qdf_nbuf_data_get_eapol_subtype(qdf_nbuf_data(buf));
1827 }
1828 
1829 /**
1830  * qdf_nbuf_data_get_eapol_subtype() - get the subtype
1831  *            of EAPOL packet.
1832  * @data: Pointer to EAPOL packet data buffer
1833  *
1834  * This func. returns the subtype of EAPOL packet.
1835  *
1836  * Return: subtype of the EAPOL packet.
1837  */
1838 static inline enum qdf_proto_subtype
1839 qdf_nbuf_data_get_eapol_subtype(uint8_t *data)
1840 {
1841 	return __qdf_nbuf_data_get_eapol_subtype(data);
1842 }
1843 
1844 /**
1845  * qdf_nbuf_get_arp_subtype() - get the subtype
1846  *            of ARP packet.
1847  * @buf: Pointer to ARP packet buffer
1848  *
1849  * This func. returns the subtype of ARP packet.
1850  *
1851  * Return: subtype of the ARP packet.
1852  */
1853 static inline enum qdf_proto_subtype
1854 qdf_nbuf_get_arp_subtype(qdf_nbuf_t buf)
1855 {
1856 	return __qdf_nbuf_data_get_arp_subtype(qdf_nbuf_data(buf));
1857 }
1858 
1859 /**
1860  * qdf_nbuf_data_get_arp_subtype() - get the subtype
1861  *            of ARP packet.
1862  * @data: Pointer to ARP packet data buffer
1863  *
1864  * This func. returns the subtype of ARP packet.
1865  *
1866  * Return: subtype of the ARP packet.
1867  */
1868 static inline enum qdf_proto_subtype
1869 qdf_nbuf_data_get_arp_subtype(uint8_t *data)
1870 {
1871 	return __qdf_nbuf_data_get_arp_subtype(data);
1872 }
1873 
1874 /**
1875  * qdf_nbuf_get_icmp_subtype() - get the subtype
1876  *            of IPV4 ICMP packet.
1877  * @buf: Pointer to IPV4 ICMP packet buffer
1878  *
1879  * This func. returns the subtype of ICMP packet.
1880  *
1881  * Return: subtype of the ICMP packet.
1882  */
1883 static inline enum qdf_proto_subtype
1884 qdf_nbuf_get_icmp_subtype(qdf_nbuf_t buf)
1885 {
1886 	return __qdf_nbuf_data_get_icmp_subtype(qdf_nbuf_data(buf));
1887 }
1888 
1889 /**
1890  * qdf_nbuf_data_get_icmp_subtype() - get the subtype
1891  *            of IPV4 ICMP packet.
1892  * @data: Pointer to IPV4 ICMP packet data buffer
1893  *
1894  * This func. returns the subtype of ICMP packet.
1895  *
1896  * Return: subtype of the ICMP packet.
1897  */
1898 static inline enum qdf_proto_subtype
1899 qdf_nbuf_data_get_icmp_subtype(uint8_t *data)
1900 {
1901 	return __qdf_nbuf_data_get_icmp_subtype(data);
1902 }
1903 
1904 /**
1905  * qdf_nbuf_get_icmpv6_subtype() - get the subtype
1906  *            of IPV6 ICMPV6 packet.
1907  * @buf: Pointer to IPV6 ICMPV6 packet buffer
1908  *
1909  * This func. returns the subtype of ICMPV6 packet.
1910  *
1911  * Return: subtype of the ICMPV6 packet.
1912  */
1913 static inline enum qdf_proto_subtype
1914 qdf_nbuf_get_icmpv6_subtype(qdf_nbuf_t buf)
1915 {
1916 	return __qdf_nbuf_data_get_icmpv6_subtype(qdf_nbuf_data(buf));
1917 }
1918 
1919 /**
1920  * qdf_nbuf_data_get_icmpv6_subtype() - get the subtype
1921  *            of IPV6 ICMPV6 packet.
1922  * @data: Pointer to IPV6 ICMPV6 packet data buffer
1923  *
1924  * This func. returns the subtype of ICMPV6 packet.
1925  *
1926  * Return: subtype of the ICMPV6 packet.
1927  */
1928 static inline enum qdf_proto_subtype
1929 qdf_nbuf_data_get_icmpv6_subtype(uint8_t *data)
1930 {
1931 	return __qdf_nbuf_data_get_icmpv6_subtype(data);
1932 }
1933 
1934 /**
1935  * qdf_nbuf_data_get_ipv4_proto() - get the proto type
1936  *            of IPV4 packet.
1937  * @data: Pointer to IPV4 packet data buffer
1938  *
1939  * This func. returns the proto type of IPV4 packet.
1940  *
1941  * Return: proto type of IPV4 packet.
1942  */
1943 static inline uint8_t
1944 qdf_nbuf_data_get_ipv4_proto(uint8_t *data)
1945 {
1946 	return __qdf_nbuf_data_get_ipv4_proto(data);
1947 }
1948 
1949 /**
1950  * qdf_nbuf_data_get_ipv6_proto() - get the proto type
1951  *            of IPV6 packet.
1952  * @data: Pointer to IPV6 packet data buffer
1953  *
1954  * This func. returns the proto type of IPV6 packet.
1955  *
1956  * Return: proto type of IPV6 packet.
1957  */
1958 static inline uint8_t
1959 qdf_nbuf_data_get_ipv6_proto(uint8_t *data)
1960 {
1961 	return __qdf_nbuf_data_get_ipv6_proto(data);
1962 }
1963 
1964 /**
1965  * qdf_nbuf_is_ipv4_pkt() - check if packet is a ipv4 packet or not
1966  * @buf:  buffer
1967  *
1968  * This api is for Tx packets.
1969  *
1970  * Return: true if packet is ipv4 packet
1971  */
1972 static inline
1973 bool qdf_nbuf_is_ipv4_pkt(qdf_nbuf_t buf)
1974 {
1975 	return __qdf_nbuf_data_is_ipv4_pkt(qdf_nbuf_data(buf));
1976 }
1977 
1978 /**
1979  * qdf_nbuf_data_is_ipv4_pkt() - check if packet is a ipv4 packet or not
1980  * @data:  data
1981  *
1982  * This api is for Tx packets.
1983  *
1984  * Return: true if packet is ipv4 packet
1985  */
1986 static inline
1987 bool qdf_nbuf_data_is_ipv4_pkt(uint8_t *data)
1988 {
1989 	return __qdf_nbuf_data_is_ipv4_pkt(data);
1990 }
1991 
1992 /**
1993  * qdf_nbuf_is_ipv4_dhcp_pkt() - check if packet is a dhcp packet or not
1994  * @buf:  buffer
1995  *
1996  * This api is for ipv4 packet.
1997  *
1998  * Return: true if packet is DHCP packet
1999  */
2000 static inline
2001 bool qdf_nbuf_is_ipv4_dhcp_pkt(qdf_nbuf_t buf)
2002 {
2003 	return __qdf_nbuf_data_is_ipv4_dhcp_pkt(qdf_nbuf_data(buf));
2004 }
2005 
2006 /**
2007  * qdf_nbuf_data_is_ipv4_dhcp_pkt() - check if it is DHCP packet.
2008  * @data: Pointer to DHCP packet data buffer
2009  *
2010  * This func. checks whether it is a DHCP packet or not.
2011  *
2012  * Return: true if it is a DHCP packet
2013  *         false if not
2014  */
2015 static inline
2016 bool qdf_nbuf_data_is_ipv4_dhcp_pkt(uint8_t *data)
2017 {
2018 	return __qdf_nbuf_data_is_ipv4_dhcp_pkt(data);
2019 }
2020 
2021 /**
2022  * qdf_nbuf_data_is_ipv6_dhcp_pkt() - check if it is DHCP packet.
2023  * @data: Pointer to DHCP packet data buffer
2024  *
2025  * This func. checks whether it is a DHCP packet or not.
2026  *
2027  * Return: true if it is a DHCP packet
2028  *         false if not
2029  */
2030 static inline
2031 bool qdf_nbuf_is_ipv6_dhcp_pkt(qdf_nbuf_t buf)
2032 {
2033 	return __qdf_nbuf_data_is_ipv6_dhcp_pkt(qdf_nbuf_data(buf));
2034 }
2035 
2036 /**
2037  * qdf_nbuf_is_ipv4_eapol_pkt() - check if packet is a eapol packet or not
2038  * @buf:  buffer
2039  *
2040  * This api is for ipv4 packet.
2041  *
2042  * Return: true if packet is EAPOL packet
2043  */
2044 static inline
2045 bool qdf_nbuf_is_ipv4_eapol_pkt(qdf_nbuf_t buf)
2046 {
2047 	return __qdf_nbuf_data_is_ipv4_eapol_pkt(qdf_nbuf_data(buf));
2048 }
2049 
2050 /**
2051  * qdf_nbuf_data_is_ipv4_eapol_pkt() - check if it is EAPOL packet.
2052  * @data: Pointer to EAPOL packet data buffer
2053  *
2054  * This func. checks whether it is a EAPOL packet or not.
2055  *
2056  * Return: true if it is a EAPOL packet
2057  *         false if not
2058  */
2059 static inline
2060 bool qdf_nbuf_data_is_ipv4_eapol_pkt(uint8_t *data)
2061 {
2062 	return __qdf_nbuf_data_is_ipv4_eapol_pkt(data);
2063 }
2064 
2065 /**
2066  * qdf_nbuf_is_ipv4_wapi_pkt() - check if packet is a wapi packet or not
2067  * @buf:  buffer
2068  *
2069  * This api is for ipv4 packet.
2070  *
2071  * Return: true if packet is WAPI packet
2072  */
2073 static inline
2074 bool qdf_nbuf_is_ipv4_wapi_pkt(qdf_nbuf_t buf)
2075 {
2076 	return __qdf_nbuf_is_ipv4_wapi_pkt(buf);
2077 }
2078 
2079 /**
2080  * qdf_nbuf_is_ipv4_tdls_pkt() - check if packet is a tdls packet or not
2081  * @buf:  buffer
2082  *
2083  * This api is for ipv4 packet.
2084  *
2085  * Return: true if packet is TDLS packet
2086  */
2087 static inline
2088 bool qdf_nbuf_is_ipv4_tdls_pkt(qdf_nbuf_t buf)
2089 {
2090 	return __qdf_nbuf_is_ipv4_tdls_pkt(buf);
2091 }
2092 
2093 /**
2094  * qdf_nbuf_is_ipv4_arp_pkt() - check if packet is a arp packet or not
2095  * @buf:  buffer
2096  *
2097  * This api is for ipv4 packet.
2098  *
2099  * Return: true if packet is ARP packet
2100  */
2101 static inline
2102 bool qdf_nbuf_is_ipv4_arp_pkt(qdf_nbuf_t buf)
2103 {
2104 	return __qdf_nbuf_data_is_ipv4_arp_pkt(qdf_nbuf_data(buf));
2105 }
2106 
2107 /**
2108  * qdf_nbuf_data_is_ipv4_arp_pkt() - check if it is ARP packet.
2109  * @data: Pointer to ARP packet data buffer
2110  *
2111  * This func. checks whether it is a ARP packet or not.
2112  *
2113  * Return: TRUE if it is a ARP packet
2114  *         FALSE if not
2115  */
2116 static inline
2117 bool qdf_nbuf_data_is_ipv4_arp_pkt(uint8_t *data)
2118 {
2119 	return __qdf_nbuf_data_is_ipv4_arp_pkt(data);
2120 }
2121 
2122 /**
2123  * qdf_nbuf_data_is_arp_req() - check if ARP packet is request.
2124  * @buf:  buffer
2125  *
2126  * This func. checks whether it is a ARP request or not.
2127  *
2128  * Return: true if it is a ARP request or FALSE if not
2129  */
2130 static inline
2131 bool qdf_nbuf_data_is_arp_req(qdf_nbuf_t buf)
2132 {
2133 	return __qdf_nbuf_data_is_arp_req(qdf_nbuf_data(buf));
2134 }
2135 
2136 /**
2137  * qdf_nbuf_data_is_arp_rsp() - check if ARP packet is response.
2138  * @buf:  buffer
2139  *
2140  * This func. checks whether it is a ARP response or not.
2141  *
2142  * Return: true if it is a ARP response or FALSE if not
2143  */
2144 static inline
2145 bool qdf_nbuf_data_is_arp_rsp(qdf_nbuf_t buf)
2146 {
2147 	return __qdf_nbuf_data_is_arp_rsp(qdf_nbuf_data(buf));
2148 }
2149 
2150 /**
2151  * qdf_nbuf_data_get_arp_src_ip() - get ARP packet source IP gateway.
2152  * @buf:  buffer
2153  *
2154  * Return: ARP packet source IP value.
2155  */
2156 static inline
2157 uint32_t qdf_nbuf_get_arp_src_ip(qdf_nbuf_t buf)
2158 {
2159 	return __qdf_nbuf_get_arp_src_ip(qdf_nbuf_data(buf));
2160 }
2161 
2162 /**
2163  * qdf_nbuf_data_get_arp_tgt_ip() - get ARP packet target IP gateway.
2164  * @buf:  buffer
2165  *
2166  * Return: ARP packet target IP value.
2167  */
2168 static inline
2169 uint32_t qdf_nbuf_get_arp_tgt_ip(qdf_nbuf_t buf)
2170 {
2171 	return __qdf_nbuf_get_arp_tgt_ip(qdf_nbuf_data(buf));
2172 }
2173 
2174 /**
2175  * qdf_nbuf_get_dns_domain_name() - get dns domain name of required length
2176  * @buf: buffer
2177  * @len: length to copy
2178  *
2179  * Return: dns domain name
2180  */
2181 static inline
2182 uint8_t *qdf_nbuf_get_dns_domain_name(qdf_nbuf_t buf, uint32_t len)
2183 {
2184 	return __qdf_nbuf_get_dns_domain_name(qdf_nbuf_data(buf), len);
2185 }
2186 
2187 /**
2188  * qdf_nbuf_data_is_dns_query() - check if skb data is a dns query
2189  * @buf: buffer
2190  *
2191  * Return: true if packet is dns query packet.
2192  *	   false otherwise.
2193  */
2194 static inline
2195 bool qdf_nbuf_data_is_dns_query(qdf_nbuf_t buf)
2196 {
2197 	return __qdf_nbuf_data_is_dns_query(qdf_nbuf_data(buf));
2198 }
2199 
2200 /**
2201  * qdf_nbuf_data_is_dns_response() - check if skb data is a dns response
2202  * @buf:  buffer
2203  *
2204  * Return: true if packet is dns response packet.
2205  *	   false otherwise.
2206  */
2207 static inline
2208 bool qdf_nbuf_data_is_dns_response(qdf_nbuf_t buf)
2209 {
2210 	return __qdf_nbuf_data_is_dns_response(qdf_nbuf_data(buf));
2211 }
2212 
2213 /**
2214  * qdf_nbuf_data_is_tcp_syn() - check if skb data is a tcp syn
2215  * @buf:  buffer
2216  *
2217  * Return: true if packet is tcp syn packet.
2218  *	   false otherwise.
2219  */
2220 static inline
2221 bool qdf_nbuf_data_is_tcp_syn(qdf_nbuf_t buf)
2222 {
2223 	return __qdf_nbuf_data_is_tcp_syn(qdf_nbuf_data(buf));
2224 }
2225 
2226 /**
2227  * qdf_nbuf_data_is_tcp_syn_ack() - check if skb data is a tcp syn ack
2228  * @buf:  buffer
2229  *
2230  * Return: true if packet is tcp syn ack packet.
2231  *	   false otherwise.
2232  */
2233 static inline
2234 bool qdf_nbuf_data_is_tcp_syn_ack(qdf_nbuf_t buf)
2235 {
2236 	return __qdf_nbuf_data_is_tcp_syn_ack(qdf_nbuf_data(buf));
2237 }
2238 
2239 /**
2240  * qdf_nbuf_data_is_tcp_ack() - check if skb data is a tcp ack
2241  * @buf:  buffer
2242  *
2243  * Return: true if packet is tcp ack packet.
2244  *	   false otherwise.
2245  */
2246 static inline
2247 bool qdf_nbuf_data_is_tcp_ack(qdf_nbuf_t buf)
2248 {
2249 	return __qdf_nbuf_data_is_tcp_ack(qdf_nbuf_data(buf));
2250 }
2251 
2252 /**
2253  * qdf_nbuf_data_get_tcp_src_port() - get tcp src port
2254  * @buf:  buffer
2255  *
2256  * Return: tcp source port value.
2257  */
2258 static inline
2259 uint16_t qdf_nbuf_data_get_tcp_src_port(qdf_nbuf_t buf)
2260 {
2261 	return __qdf_nbuf_data_get_tcp_src_port(qdf_nbuf_data(buf));
2262 }
2263 
2264 /**
2265  * qdf_nbuf_data_get_tcp_dst_port() - get tcp dst port
2266  * @buf:  buffer
2267  *
2268  * Return: tcp destination port value.
2269  */
2270 static inline
2271 uint16_t qdf_nbuf_data_get_tcp_dst_port(qdf_nbuf_t buf)
2272 {
2273 	return __qdf_nbuf_data_get_tcp_dst_port(qdf_nbuf_data(buf));
2274 }
2275 
2276 /**
2277  * qdf_nbuf_data_is_icmpv4_req() - check if ICMPv4 packet is request.
2278  * @buf:  buffer
2279  *
2280  * This func. checks whether it is a ICMPv4 request or not.
2281  *
2282  * Return: true if it is a ICMPv4 request or fALSE if not
2283  */
2284 static inline
2285 bool qdf_nbuf_data_is_icmpv4_req(qdf_nbuf_t buf)
2286 {
2287 	return __qdf_nbuf_data_is_icmpv4_req(qdf_nbuf_data(buf));
2288 }
2289 
2290 /**
2291  * qdf_nbuf_data_is_icmpv4_rsp() - check if ICMPv4 packet is res
2292  * @buf:  buffer
2293  *
2294  * Return: true if packet is icmpv4 response
2295  *	   false otherwise.
2296  */
2297 static inline
2298 bool qdf_nbuf_data_is_icmpv4_rsp(qdf_nbuf_t buf)
2299 {
2300 	return __qdf_nbuf_data_is_icmpv4_rsp(qdf_nbuf_data(buf));
2301 }
2302 
2303 /**
2304  * qdf_nbuf_get_icmpv4_src_ip() - get icmpv4 src IP
2305  * @buf:  buffer
2306  *
2307  * Return: icmpv4 packet source IP value.
2308  */
2309 static inline
2310 uint32_t qdf_nbuf_get_icmpv4_src_ip(qdf_nbuf_t buf)
2311 {
2312 	return __qdf_nbuf_get_icmpv4_src_ip(qdf_nbuf_data(buf));
2313 }
2314 
2315 /**
2316  * qdf_nbuf_data_get_icmpv4_tgt_ip() - get icmpv4 target IP
2317  * @buf:  buffer
2318  *
2319  * Return: icmpv4 packet target IP value.
2320  */
2321 static inline
2322 uint32_t qdf_nbuf_get_icmpv4_tgt_ip(qdf_nbuf_t buf)
2323 {
2324 	return __qdf_nbuf_get_icmpv4_tgt_ip(qdf_nbuf_data(buf));
2325 }
2326 
2327 /**
2328  * qdf_nbuf_is_ipv6_pkt() - check if it is IPV6 packet.
2329  * @buf: Pointer to IPV6 packet buffer
2330  *
2331  * This func. checks whether it is a IPV6 packet or not.
2332  *
2333  * Return: TRUE if it is a IPV6 packet
2334  *         FALSE if not
2335  */
2336 static inline
2337 bool qdf_nbuf_is_ipv6_pkt(qdf_nbuf_t buf)
2338 {
2339 	return __qdf_nbuf_data_is_ipv6_pkt(qdf_nbuf_data(buf));
2340 }
2341 
2342 /**
2343  * qdf_nbuf_data_is_ipv6_pkt() - check if it is IPV6 packet.
2344  * @data: Pointer to IPV6 packet data buffer
2345  *
2346  * This func. checks whether it is a IPV6 packet or not.
2347  *
2348  * Return: TRUE if it is a IPV6 packet
2349  *         FALSE if not
2350  */
2351 static inline
2352 bool qdf_nbuf_data_is_ipv6_pkt(uint8_t *data)
2353 {
2354 	return __qdf_nbuf_data_is_ipv6_pkt(data);
2355 }
2356 
2357 /**
2358  * qdf_nbuf_data_is_ipv4_mcast_pkt() - check if it is IPV4 multicast packet.
2359  * @data: Pointer to IPV4 packet data buffer
2360  *
2361  * This func. checks whether it is a IPV4 multicast packet or not.
2362  *
2363  * Return: TRUE if it is a IPV4 multicast packet
2364  *         FALSE if not
2365  */
2366 static inline
2367 bool qdf_nbuf_data_is_ipv4_mcast_pkt(uint8_t *data)
2368 {
2369 	return __qdf_nbuf_data_is_ipv4_mcast_pkt(data);
2370 }
2371 
2372 /**
2373  * qdf_nbuf_data_is_ipv6_mcast_pkt() - check if it is IPV6 multicast packet.
2374  * @data: Pointer to IPV6 packet data buffer
2375  *
2376  * This func. checks whether it is a IPV6 multicast packet or not.
2377  *
2378  * Return: TRUE if it is a IPV6 multicast packet
2379  *         FALSE if not
2380  */
2381 static inline
2382 bool qdf_nbuf_data_is_ipv6_mcast_pkt(uint8_t *data)
2383 {
2384 	return __qdf_nbuf_data_is_ipv6_mcast_pkt(data);
2385 }
2386 
2387 /**
2388  * qdf_nbuf_is_icmp_pkt() - check if it is IPV4 ICMP packet.
2389  * @buf: Pointer to IPV4 ICMP packet buffer
2390  *
2391  * This func. checks whether it is a ICMP packet or not.
2392  *
2393  * Return: TRUE if it is a ICMP packet
2394  *         FALSE if not
2395  */
2396 static inline
2397 bool qdf_nbuf_is_icmp_pkt(qdf_nbuf_t buf)
2398 {
2399 	return __qdf_nbuf_data_is_icmp_pkt(qdf_nbuf_data(buf));
2400 }
2401 
2402 /**
2403  * qdf_nbuf_data_is_icmp_pkt() - check if it is IPV4 ICMP packet.
2404  * @data: Pointer to IPV4 ICMP packet data buffer
2405  *
2406  * This func. checks whether it is a ICMP packet or not.
2407  *
2408  * Return: TRUE if it is a ICMP packet
2409  *         FALSE if not
2410  */
2411 static inline
2412 bool qdf_nbuf_data_is_icmp_pkt(uint8_t *data)
2413 {
2414 	return __qdf_nbuf_data_is_icmp_pkt(data);
2415 }
2416 
2417 /**
2418  * qdf_nbuf_is_icmpv6_pkt() - check if it is IPV6 ICMPV6 packet.
2419  * @buf: Pointer to IPV6 ICMPV6 packet buffer
2420  *
2421  * This func. checks whether it is a ICMPV6 packet or not.
2422  *
2423  * Return: TRUE if it is a ICMPV6 packet
2424  *         FALSE if not
2425  */
2426 static inline
2427 bool qdf_nbuf_is_icmpv6_pkt(qdf_nbuf_t buf)
2428 {
2429 	return __qdf_nbuf_data_is_icmpv6_pkt(qdf_nbuf_data(buf));
2430 }
2431 
2432 /**
2433  * qdf_nbuf_data_is_icmpv6_pkt() - check if it is IPV6 ICMPV6 packet.
2434  * @data: Pointer to IPV6 ICMPV6 packet data buffer
2435  *
2436  * This func. checks whether it is a ICMPV6 packet or not.
2437  *
2438  * Return: TRUE if it is a ICMPV6 packet
2439  *         FALSE if not
2440  */
2441 static inline
2442 bool qdf_nbuf_data_is_icmpv6_pkt(uint8_t *data)
2443 {
2444 	return __qdf_nbuf_data_is_icmpv6_pkt(data);
2445 }
2446 
2447 /**
2448  * qdf_nbuf_is_ipv4_udp_pkt() - check if it is IPV4 UDP packet.
2449  * @buf: Pointer to IPV4 UDP packet buffer
2450  *
2451  * This func. checks whether it is a IPV4 UDP packet or not.
2452  *
2453  * Return: TRUE if it is a IPV4 UDP packet
2454  *         FALSE if not
2455  */
2456 static inline
2457 bool qdf_nbuf_is_ipv4_udp_pkt(qdf_nbuf_t buf)
2458 {
2459 	return __qdf_nbuf_data_is_ipv4_udp_pkt(qdf_nbuf_data(buf));
2460 }
2461 
2462 /**
2463  * qdf_nbuf_data_is_ipv4_udp_pkt() - check if it is IPV4 UDP packet.
2464  * @data: Pointer to IPV4 UDP packet data buffer
2465  *
2466  * This func. checks whether it is a IPV4 UDP packet or not.
2467  *
2468  * Return: TRUE if it is a IPV4 UDP packet
2469  *         FALSE if not
2470  */
2471 static inline
2472 bool qdf_nbuf_data_is_ipv4_udp_pkt(uint8_t *data)
2473 {
2474 	return __qdf_nbuf_data_is_ipv4_udp_pkt(data);
2475 }
2476 
2477 /**
2478  * qdf_nbuf_is_ipv4_tcp_pkt() - check if it is IPV4 TCP packet.
2479  * @buf: Pointer to IPV4 TCP packet buffer
2480  *
2481  * This func. checks whether it is a IPV4 TCP packet or not.
2482  *
2483  * Return: TRUE if it is a IPV4 TCP packet
2484  *         FALSE if not
2485  */
2486 static inline
2487 bool qdf_nbuf_is_ipv4_tcp_pkt(qdf_nbuf_t buf)
2488 {
2489 	return __qdf_nbuf_data_is_ipv4_tcp_pkt(qdf_nbuf_data(buf));
2490 }
2491 
2492 /**
2493  * qdf_nbuf_data_is_ipv4_tcp_pkt() - check if it is IPV4 TCP packet.
2494  * @data: Pointer to IPV4 TCP packet data buffer
2495  *
2496  * This func. checks whether it is a IPV4 TCP packet or not.
2497  *
2498  * Return: TRUE if it is a IPV4 TCP packet
2499  *         FALSE if not
2500  */
2501 static inline
2502 bool qdf_nbuf_data_is_ipv4_tcp_pkt(uint8_t *data)
2503 {
2504 	return __qdf_nbuf_data_is_ipv4_tcp_pkt(data);
2505 }
2506 
2507 /**
2508  * qdf_nbuf_is_ipv6_udp_pkt() - check if it is IPV6 UDP packet.
2509  * @buf: Pointer to IPV6 UDP packet buffer
2510  *
2511  * This func. checks whether it is a IPV6 UDP packet or not.
2512  *
2513  * Return: TRUE if it is a IPV6 UDP packet
2514  *         FALSE if not
2515  */
2516 static inline
2517 bool qdf_nbuf_is_ipv6_udp_pkt(qdf_nbuf_t buf)
2518 {
2519 	return __qdf_nbuf_data_is_ipv6_udp_pkt(qdf_nbuf_data(buf));
2520 }
2521 
2522 /**
2523  * qdf_nbuf_data_is_ipv6_udp_pkt() - check if it is IPV6 UDP packet.
2524  * @data: Pointer to IPV6 UDP packet data buffer
2525  *
2526  * This func. checks whether it is a IPV6 UDP packet or not.
2527  *
2528  * Return: TRUE if it is a IPV6 UDP packet
2529  *         FALSE if not
2530  */
2531 static inline
2532 bool qdf_nbuf_data_is_ipv6_udp_pkt(uint8_t *data)
2533 {
2534 	return __qdf_nbuf_data_is_ipv6_udp_pkt(data);
2535 }
2536 
2537 /**
2538  * qdf_nbuf_is_ipv6_tcp_pkt() - check if it is IPV6 TCP packet.
2539  * @buf: Pointer to IPV6 TCP packet buffer
2540  *
2541  * This func. checks whether it is a IPV6 TCP packet or not.
2542  *
2543  * Return: TRUE if it is a IPV6 TCP packet
2544  *         FALSE if not
2545  */
2546 static inline
2547 bool qdf_nbuf_is_ipv6_tcp_pkt(qdf_nbuf_t buf)
2548 {
2549 	return __qdf_nbuf_data_is_ipv6_tcp_pkt(qdf_nbuf_data(buf));
2550 }
2551 
2552 /**
2553  * qdf_nbuf_data_is_ipv6_tcp_pkt() - check if it is IPV6 TCP packet.
2554  * @data: Pointer to IPV6 TCP packet data buffer
2555  *
2556  * This func. checks whether it is a IPV6 TCP packet or not.
2557  *
2558  * Return: TRUE if it is a IPV6 TCP packet
2559  *         FALSE if not
2560  */
2561 static inline
2562 bool qdf_nbuf_data_is_ipv6_tcp_pkt(uint8_t *data)
2563 {
2564 	return __qdf_nbuf_data_is_ipv6_tcp_pkt(data);
2565 }
2566 
2567 /**
2568  * qdf_nbuf_is_bcast_pkt() - check if it is broadcast packet.
2569  * @buf: Network buffer
2570  *
2571  * This func. checks whether packet is broadcast or not.
2572  *
2573  * Return: TRUE if it is broadcast packet
2574  *         FALSE if not
2575  */
2576 static inline
2577 bool qdf_nbuf_is_bcast_pkt(qdf_nbuf_t buf)
2578 {
2579 	return __qdf_nbuf_is_bcast_pkt(buf);
2580 }
2581 
2582 /**
2583  * qdf_nbuf_reset_num_frags() - decrement the number of fragments
2584  * @buf: Network buffer
2585  *
2586  * Return: Number of fragments
2587  */
2588 static inline void qdf_nbuf_reset_num_frags(qdf_nbuf_t buf)
2589 {
2590 	__qdf_nbuf_reset_num_frags(buf);
2591 }
2592 
2593 /**
2594  * qdf_dmaaddr_to_32s - return high and low parts of dma_addr
2595  *
2596  * Returns the high and low 32-bits of the DMA addr in the provided ptrs
2597  *
2598  * Return: N/A
2599  */
2600 static inline void qdf_dmaaddr_to_32s(qdf_dma_addr_t dmaaddr,
2601 				      uint32_t *lo, uint32_t *hi)
2602 {
2603 	return __qdf_dmaaddr_to_32s(dmaaddr, lo, hi);
2604 }
2605 
2606 /**
2607  * qdf_nbuf_get_tso_info() - function to divide a jumbo TSO
2608  * network buffer into segments
2609  * @nbuf:   network buffer to be segmented
2610  * @tso_info:  This is the output. The information about the
2611  *      TSO segments will be populated within this.
2612  *
2613  * This function fragments a TCP jumbo packet into smaller
2614  * segments to be transmitted by the driver. It chains the TSO
2615  * segments created into a list.
2616  *
2617  * Return: number of TSO segments
2618  */
2619 static inline uint32_t qdf_nbuf_get_tso_info(qdf_device_t osdev,
2620 		 qdf_nbuf_t nbuf, struct qdf_tso_info_t *tso_info)
2621 {
2622 	return __qdf_nbuf_get_tso_info(osdev, nbuf, tso_info);
2623 }
2624 
2625 /**
2626  * qdf_nbuf_unmap_tso_segment() - function to dma unmap TSO segment element
2627  *
2628  * @osdev: qdf device handle
2629  * @tso_seg: TSO segment element to be unmapped
2630  * @is_last_seg: whether this is last tso seg or not
2631  *
2632  * Return: none
2633  */
2634 static inline void qdf_nbuf_unmap_tso_segment(qdf_device_t osdev,
2635 			  struct qdf_tso_seg_elem_t *tso_seg,
2636 			  bool is_last_seg)
2637 {
2638 	return __qdf_nbuf_unmap_tso_segment(osdev, tso_seg, is_last_seg);
2639 }
2640 
2641 /**
2642  * qdf_nbuf_get_tso_num_seg() - function to calculate the number
2643  * of TCP segments within the TSO jumbo packet
2644  * @nbuf:   TSO jumbo network buffer to be segmented
2645  *
2646  * This function calculates the number of TCP segments that the
2647    network buffer can be divided into.
2648  *
2649  * Return: number of TCP segments
2650  */
2651 static inline uint32_t qdf_nbuf_get_tso_num_seg(qdf_nbuf_t nbuf)
2652 {
2653 	return __qdf_nbuf_get_tso_num_seg(nbuf);
2654 }
2655 
2656 /**
2657  * qdf_nbuf_inc_users() - function to increment the number of
2658  * users referencing this network buffer
2659  *
2660  * @nbuf:   network buffer
2661  *
2662  * This function increments the number of users referencing this
2663  * network buffer
2664  *
2665  * Return: the network buffer
2666  */
2667 static inline qdf_nbuf_t qdf_nbuf_inc_users(qdf_nbuf_t nbuf)
2668 {
2669 	return __qdf_nbuf_inc_users(nbuf);
2670 }
2671 
2672 /**
2673  * qdf_nbuf_data_attr_get() - Get data_attr field from cvg_nbuf_cb
2674  *
2675  * @nbuf: Network buffer (skb on linux)
2676  *
2677  * This function returns the values of data_attr field
2678  * in struct cvg_nbuf_cb{}, to which skb->cb is typecast.
2679  * This value is actually the value programmed in CE descriptor.
2680  *
2681  * Return: Value of data_attr
2682  */
2683 static inline uint32_t qdf_nbuf_data_attr_get(qdf_nbuf_t buf)
2684 {
2685 	return __qdf_nbuf_data_attr_get(buf);
2686 }
2687 
2688 /**
2689  * qdf_nbuf_data_attr_set() - Sets data_attr field in cvg_nbuf_cb
2690  *
2691  * @nbuf: Network buffer (skb on linux)
2692  * @data_attr: Value to be stored cvg_nbuf_cb->data_attr
2693  *
2694  * This function stores the value to be programmed in CE
2695  * descriptor as part skb->cb which is typecast to struct cvg_nbuf_cb{}
2696  *
2697  * Return: void
2698  */
2699 static inline
2700 void qdf_nbuf_data_attr_set(qdf_nbuf_t buf, uint32_t data_attr)
2701 {
2702 	__qdf_nbuf_data_attr_set(buf, data_attr);
2703 }
2704 
2705 /**
2706  * qdf_nbuf_tx_info_get() - Parse skb and get Tx metadata
2707  *
2708  * @nbuf: Network buffer (skb on linux)
2709  *
2710  * This function parses the payload to figure out relevant
2711  * Tx meta-data e.g. whether to enable tx_classify bit
2712  * in CE.
2713  *
2714  * Return:     void
2715  */
2716 #define qdf_nbuf_tx_info_get __qdf_nbuf_tx_info_get
2717 
2718 void qdf_nbuf_set_state(qdf_nbuf_t nbuf, uint8_t current_state);
2719 void qdf_nbuf_tx_desc_count_display(void);
2720 void qdf_nbuf_tx_desc_count_clear(void);
2721 
2722 static inline qdf_nbuf_t
2723 qdf_nbuf_realloc_headroom(qdf_nbuf_t buf, uint32_t headroom)
2724 {
2725 	return __qdf_nbuf_realloc_headroom(buf, headroom);
2726 }
2727 
2728 static inline qdf_nbuf_t
2729 qdf_nbuf_realloc_tailroom(qdf_nbuf_t buf, uint32_t tailroom)
2730 {
2731 	return __qdf_nbuf_realloc_tailroom(buf, tailroom);
2732 }
2733 
2734 static inline qdf_nbuf_t
2735 qdf_nbuf_expand(qdf_nbuf_t buf, uint32_t headroom, uint32_t tailroom)
2736 {
2737 	return __qdf_nbuf_expand(buf, headroom, tailroom);
2738 }
2739 
2740 static inline int
2741 qdf_nbuf_linearize(qdf_nbuf_t buf)
2742 {
2743 	return __qdf_nbuf_linearize(buf);
2744 }
2745 
2746 static inline qdf_nbuf_t
2747 qdf_nbuf_unshare(qdf_nbuf_t buf)
2748 {
2749 	return __qdf_nbuf_unshare(buf);
2750 }
2751 
2752 static inline bool
2753 qdf_nbuf_is_cloned(qdf_nbuf_t buf)
2754 {
2755 	return __qdf_nbuf_is_cloned(buf);
2756 }
2757 
2758 static inline void
2759 qdf_nbuf_frag_info(qdf_nbuf_t buf, qdf_sglist_t *sg)
2760 {
2761 	__qdf_nbuf_frag_info(buf, sg);
2762 }
2763 
2764 static inline qdf_nbuf_tx_cksum_t
2765 qdf_nbuf_tx_cksum_info(qdf_nbuf_t buf, uint8_t **hdr_off, uint8_t **where)
2766 {
2767 	return __qdf_nbuf_tx_cksum_info(buf, hdr_off, where);
2768 }
2769 
2770 static inline void qdf_nbuf_reset_ctxt(__qdf_nbuf_t nbuf)
2771 {
2772 	__qdf_nbuf_reset_ctxt(nbuf);
2773 }
2774 
2775 static inline void
2776 qdf_nbuf_set_rx_info(__qdf_nbuf_t nbuf, void *info, uint32_t len)
2777 {
2778 	__qdf_nbuf_set_rx_info(nbuf, info, len);
2779 }
2780 
2781 static inline void *qdf_nbuf_get_rx_info(__qdf_nbuf_t nbuf)
2782 {
2783 	return __qdf_nbuf_get_rx_info(nbuf);
2784 }
2785 
2786 static inline void qdf_nbuf_init(qdf_nbuf_t buf)
2787 {
2788 	__qdf_nbuf_init(buf);
2789 }
2790 
2791 static inline void *qdf_nbuf_network_header(qdf_nbuf_t buf)
2792 {
2793 	return __qdf_nbuf_network_header(buf);
2794 }
2795 
2796 static inline void *qdf_nbuf_transport_header(qdf_nbuf_t buf)
2797 {
2798 	return __qdf_nbuf_transport_header(buf);
2799 }
2800 
2801 static inline qdf_size_t qdf_nbuf_tcp_tso_size(qdf_nbuf_t buf)
2802 {
2803 	return __qdf_nbuf_tcp_tso_size(buf);
2804 }
2805 
2806 static inline void *qdf_nbuf_get_cb(qdf_nbuf_t nbuf)
2807 {
2808 	return __qdf_nbuf_get_cb(nbuf);
2809 }
2810 
2811 static inline uint32_t qdf_nbuf_get_nr_frags(qdf_nbuf_t nbuf)
2812 {
2813 	return __qdf_nbuf_get_nr_frags(nbuf);
2814 }
2815 
2816 static inline qdf_size_t qdf_nbuf_headlen(qdf_nbuf_t buf)
2817 {
2818 	return __qdf_nbuf_headlen(buf);
2819 }
2820 
2821 static inline QDF_STATUS qdf_nbuf_frag_map(qdf_device_t osdev,
2822 	qdf_nbuf_t buf, int offset,
2823 	qdf_dma_dir_t dir, int cur_frag)
2824 {
2825 	return __qdf_nbuf_frag_map(osdev, buf, offset, dir, cur_frag);
2826 }
2827 
2828 static inline bool qdf_nbuf_tso_tcp_v4(qdf_nbuf_t buf)
2829 {
2830 	return __qdf_nbuf_tso_tcp_v4(buf);
2831 }
2832 
2833 static inline bool qdf_nbuf_tso_tcp_v6(qdf_nbuf_t buf)
2834 {
2835 	return __qdf_nbuf_tso_tcp_v6(buf);
2836 }
2837 
2838 static inline uint32_t qdf_nbuf_tcp_seq(qdf_nbuf_t buf)
2839 {
2840 	return __qdf_nbuf_tcp_seq(buf);
2841 }
2842 
2843 static inline qdf_size_t qdf_nbuf_l2l3l4_hdr_len(qdf_nbuf_t buf)
2844 {
2845 	return __qdf_nbuf_l2l3l4_hdr_len(buf);
2846 }
2847 
2848 static inline bool qdf_nbuf_is_nonlinear(qdf_nbuf_t buf)
2849 {
2850 	return __qdf_nbuf_is_nonlinear(buf);
2851 }
2852 
2853 static inline uint32_t
2854 qdf_nbuf_get_frag_size(qdf_nbuf_t buf, uint32_t frag_num)
2855 {
2856 	return __qdf_nbuf_get_frag_size(buf, frag_num);
2857 }
2858 
2859 static inline uint32_t qdf_nbuf_get_priority(qdf_nbuf_t buf)
2860 {
2861 	return __qdf_nbuf_get_priority(buf);
2862 }
2863 
2864 static inline void qdf_nbuf_set_priority(qdf_nbuf_t buf, uint32_t p)
2865 {
2866 	__qdf_nbuf_set_priority(buf, p);
2867 }
2868 
2869 static inline uint16_t
2870 qdf_nbuf_get_queue_mapping(qdf_nbuf_t buf)
2871 {
2872 	return __qdf_nbuf_get_queue_mapping(buf);
2873 }
2874 
2875 static inline uint8_t *
2876 qdf_nbuf_get_priv_ptr(qdf_nbuf_t buf)
2877 {
2878 	return __qdf_nbuf_get_priv_ptr(buf);
2879 }
2880 
2881 /**
2882  * qdf_nbuf_update_radiotap() - update radiotap at head of nbuf.
2883  * @rx_status: rx_status containing required info to update radiotap
2884  * @nbuf: Pointer to nbuf
2885  * @headroom_sz: Available headroom size
2886  *
2887  * Return: radiotap length.
2888  */
2889 unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
2890 				      qdf_nbuf_t nbuf, uint32_t headroom_sz);
2891 
2892 /**
2893  * qdf_nbuf_mark_wakeup_frame() - mark wakeup frame.
2894  * @buf: Pointer to nbuf
2895  *
2896  * Return: None
2897  */
2898 static inline void
2899 qdf_nbuf_mark_wakeup_frame(qdf_nbuf_t buf)
2900 {
2901 	 __qdf_nbuf_mark_wakeup_frame(buf);
2902 }
2903 
2904 /**
2905  * qdf_nbuf_reg_free_cb - Registers nbuf free callback
2906  * @cb_func_ptr: Callback pointer
2907  *
2908  * This function registers nbuf free callback
2909  *
2910  * Return: void
2911  */
2912 static inline void
2913 qdf_nbuf_reg_free_cb(qdf_nbuf_free_t cb_func_ptr)
2914 {
2915 	 __qdf_nbuf_reg_free_cb(cb_func_ptr);
2916 }
2917 
2918 /**
2919  * qdf_nbuf_set_timestamp() - set the timestamp for frame
2920  *
2921  * @buf: sk buff
2922  *
2923  * Return: void
2924  */
2925 static inline void
2926 qdf_nbuf_set_timestamp(struct sk_buff *skb)
2927 {
2928 	__qdf_nbuf_set_timestamp(skb);
2929 }
2930 
2931 /**
2932  * qdf_nbuf_get_timedelta_ms() - get time difference in ms
2933  *
2934  * @buf: sk buff
2935  *
2936  * Return: time difference ms
2937  */
2938 static inline uint64_t
2939 qdf_nbuf_get_timedelta_ms(struct sk_buff *skb)
2940 {
2941 	return __qdf_nbuf_get_timedelta_ms(skb);
2942 }
2943 
2944 /**
2945  * qdf_nbuf_get_timedelta_us() - get time difference in micro seconds
2946  *
2947  * @buf: sk buff
2948  *
2949  * Return: time difference in micro seconds
2950  */
2951 static inline uint64_t
2952 qdf_nbuf_get_timedelta_us(struct sk_buff *skb)
2953 {
2954 	return __qdf_nbuf_get_timedelta_us(skb);
2955 }
2956 
2957 /**
2958  * qdf_nbuf_count_get() - get global nbuf gauge
2959  *
2960  * Return: global nbuf gauge
2961  */
2962 static inline int qdf_nbuf_count_get(void)
2963 {
2964 	return __qdf_nbuf_count_get();
2965 }
2966 
2967 /**
2968  * qdf_nbuf_count_inc() - increment nbuf global count
2969  *
2970  * @buf: sk buff
2971  *
2972  * Return: void
2973  */
2974 static inline void qdf_nbuf_count_inc(qdf_nbuf_t buf)
2975 {
2976 	return __qdf_nbuf_count_inc(buf);
2977 }
2978 
2979 /**
2980  * qdf_nbuf_count_dec() - decrement nbuf global count
2981  *
2982  * @buf: sk buff
2983  *
2984  * Return: void
2985  */
2986 static inline void qdf_nbuf_count_dec(qdf_nbuf_t buf)
2987 {
2988 	return __qdf_nbuf_count_dec(buf);
2989 }
2990 
2991 /**
2992  * qdf_nbuf_mod_init() - Intialization routine for qdf_nbuf
2993  *
2994  * Return void
2995  */
2996 static inline void qdf_nbuf_mod_init(void)
2997 {
2998 	return __qdf_nbuf_mod_init();
2999 }
3000 
3001 /**
3002  * qdf_nbuf_mod_init() - Unintialization routine for qdf_nbuf
3003  *
3004  * Return void
3005  */
3006 static inline void qdf_nbuf_mod_exit(void)
3007 {
3008 	return __qdf_nbuf_mod_exit();
3009 }
3010 #ifdef CONFIG_WIN
3011 #include <i_qdf_nbuf_api_w.h>
3012 #else
3013 #include <i_qdf_nbuf_api_m.h>
3014 #endif
3015 #endif /* _QDF_NBUF_H */
3016