1*5113495bSYour Name /*
2*5113495bSYour Name * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
3*5113495bSYour Name * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name *
5*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name * above copyright notice and this permission notice appear in all
8*5113495bSYour Name * copies.
9*5113495bSYour Name *
10*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name */
19*5113495bSYour Name
20*5113495bSYour Name /**
21*5113495bSYour Name * DOC: qdf_nbuf_public network buffer API
22*5113495bSYour Name * This file defines the network buffer abstraction.
23*5113495bSYour Name */
24*5113495bSYour Name
25*5113495bSYour Name #ifndef _QDF_NBUF_H
26*5113495bSYour Name #define _QDF_NBUF_H
27*5113495bSYour Name
28*5113495bSYour Name #include <qdf_util.h>
29*5113495bSYour Name #include <qdf_types.h>
30*5113495bSYour Name #include <qdf_lock.h>
31*5113495bSYour Name #include <i_qdf_trace.h>
32*5113495bSYour Name #include <i_qdf_nbuf.h>
33*5113495bSYour Name #include <qdf_net_types.h>
34*5113495bSYour Name
35*5113495bSYour Name #define IPA_NBUF_OWNER_ID 0xaa55aa55
36*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_TYPE_DNS 0x01
37*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_TYPE_EAPOL 0x02
38*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_TYPE_DHCP 0x04
39*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_TYPE_MGMT_ACTION 0x08
40*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_TYPE_ARP 0x10
41*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_TYPE_ICMP 0x20
42*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_TYPE_ICMPv6 0x40
43*5113495bSYour Name #define QDF_HL_CREDIT_TRACKING 0x80
44*5113495bSYour Name
45*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_MAX_STRING 12
46*5113495bSYour Name #define QDF_NBUF_PKT_TRAC_PROTO_STRING 4
47*5113495bSYour Name #define QDF_NBUF_PKT_ERROR 1
48*5113495bSYour Name
49*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_OFFSET 14
50*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_HEADER_MASK 0xF
51*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_HEADER_SIZE 20
52*5113495bSYour Name #define QDF_NBUF_TRAC_DHCP_SRV_PORT 67
53*5113495bSYour Name #define QDF_NBUF_TRAC_DHCP_CLI_PORT 68
54*5113495bSYour Name #define QDF_NBUF_TRAC_ETH_TYPE_OFFSET 12
55*5113495bSYour Name #define QDF_NBUF_TRAC_VLAN_ETH_TYPE_OFFSET 16
56*5113495bSYour Name #define QDF_NBUF_TRAC_DOUBLE_VLAN_ETH_TYPE_OFFSET 20
57*5113495bSYour Name #define QDF_NBUF_TRAC_EAPOL_ETH_TYPE 0x888E
58*5113495bSYour Name #define QDF_NBUF_TRAC_WAPI_ETH_TYPE 0x88b4
59*5113495bSYour Name #define QDF_NBUF_TRAC_ARP_ETH_TYPE 0x0806
60*5113495bSYour Name #define QDF_NBUF_PKT_IPV4_DSCP_MASK 0xFC
61*5113495bSYour Name #define QDF_NBUF_PKT_IPV4_DSCP_SHIFT 0x02
62*5113495bSYour Name #define QDF_NBUF_TRAC_TDLS_ETH_TYPE 0x890D
63*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_ETH_TYPE 0x0800
64*5113495bSYour Name #define QDF_NBUF_TRAC_IPV6_ETH_TYPE 0x86dd
65*5113495bSYour Name #define QDF_NBUF_DEST_MAC_OFFSET 0
66*5113495bSYour Name #define QDF_NBUF_SRC_MAC_OFFSET 6
67*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_TOS_OFFSET 15
68*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_PROTO_TYPE_OFFSET 23
69*5113495bSYour Name #define QDF_NBUF_TRAC_VLAN_IPV4_PROTO_TYPE_OFFSET 27
70*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_DEST_ADDR_OFFSET 30
71*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_SRC_ADDR_OFFSET 26
72*5113495bSYour Name #define QDF_NBUF_TRAC_IPV6_PROTO_TYPE_OFFSET 20
73*5113495bSYour Name #define QDF_NBUF_TRAC_VLAN_IPV6_PROTO_TYPE_OFFSET 24
74*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_ADDR_MCAST_MASK 0xE0000000
75*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_ADDR_BCAST_MASK 0xF0000000
76*5113495bSYour Name #define QDF_NBUF_TRAC_IPV6_DEST_ADDR_OFFSET 38
77*5113495bSYour Name #define QDF_NBUF_TRAC_IPV6_DEST_ADDR 0xFF00
78*5113495bSYour Name #define QDF_NBUF_TRAC_IPV6_OFFSET 14
79*5113495bSYour Name #define QDF_NBUF_TRAC_VLAN_IPV6_OFFSET 18
80*5113495bSYour Name #define QDF_NBUF_TRAC_IPV6_HEADER_SIZE 40
81*5113495bSYour Name #define QDF_NBUF_TRAC_ICMP_TYPE 1
82*5113495bSYour Name #define QDF_NBUF_TRAC_IGMP_TYPE 2
83*5113495bSYour Name #define QDF_NBUF_TRAC_TCP_TYPE 6
84*5113495bSYour Name #define QDF_NBUF_TRAC_TCP_FLAGS_OFFSET (47 - 34)
85*5113495bSYour Name #define QDF_NBUF_TRAC_TCP_ACK_OFFSET (42 - 34)
86*5113495bSYour Name #define QDF_NBUF_TRAC_TCP_HEADER_LEN_OFFSET (46 - 34)
87*5113495bSYour Name #define QDF_NBUF_TRAC_TCP_ACK_MASK 0x10
88*5113495bSYour Name #define QDF_NBUF_TRAC_TCP_SPORT_OFFSET (34 - 34)
89*5113495bSYour Name #define QDF_NBUF_TRAC_TCP_DPORT_OFFSET (36 - 34)
90*5113495bSYour Name #define QDF_NBUF_TRAC_UDP_TYPE 17
91*5113495bSYour Name #define QDF_NBUF_TRAC_ICMPV6_TYPE 0x3a
92*5113495bSYour Name #define QDF_NBUF_TRAC_HOPOPTS_TYPE 0
93*5113495bSYour Name #define QDF_NBUF_TRAC_DHCP6_SRV_PORT 547
94*5113495bSYour Name #define QDF_NBUF_TRAC_DHCP6_CLI_PORT 546
95*5113495bSYour Name #define QDF_NBUF_TRAC_MDNS_SRC_N_DST_PORT 5353
96*5113495bSYour Name #define QDF_NBUF_TRAC_IP_OFFSET 14
97*5113495bSYour Name #define QDF_NBUF_TRAC_VLAN_IP_OFFSET 18
98*5113495bSYour Name #define QDF_NBUF_TRAC_DOUBLE_VLAN_IP_OFFSET 22
99*5113495bSYour Name /* One dword for IPv4 header size unit */
100*5113495bSYour Name #define QDF_NBUF_IPV4_HDR_SIZE_UNIT 4
101*5113495bSYour Name #define QDF_NBUF_TRAC_IPV4_TOTAL_LEN_OFFSET 16
102*5113495bSYour Name #define QDF_NBUF_TRAC_IPV6_PAYLOAD_LEN_OFFSET 18
103*5113495bSYour Name
104*5113495bSYour Name /* EAPOL Related MASK */
105*5113495bSYour Name #define EAPOL_PACKET_TYPE_OFFSET 15
106*5113495bSYour Name #define EAPOL_KEY_INFO_OFFSET 19
107*5113495bSYour Name #define EAPOL_PKT_LEN_OFFSET 16
108*5113495bSYour Name #define EAPOL_KEY_LEN_OFFSET 21
109*5113495bSYour Name #define EAPOL_KEY_DATA_LENGTH_OFFSET 111
110*5113495bSYour Name #define EAPOL_WPA_KEY_NONCE_OFFSET 31
111*5113495bSYour Name
112*5113495bSYour Name #define EAPOL_PACKET_TYPE_EAP 0
113*5113495bSYour Name #define EAPOL_PACKET_TYPE_START 1
114*5113495bSYour Name #define EAPOL_PACKET_TYPE_LOGOFF 2
115*5113495bSYour Name #define EAPOL_PACKET_TYPE_KEY 3
116*5113495bSYour Name #define EAPOL_PACKET_TYPE_ASF 4
117*5113495bSYour Name
118*5113495bSYour Name #define EAPOL_KEY_TYPE_MASK 0x0800
119*5113495bSYour Name #define EAPOL_KEY_ENCRYPTED_MASK 0x0010
120*5113495bSYour Name
121*5113495bSYour Name /* EAP Related Mask */
122*5113495bSYour Name
123*5113495bSYour Name #define EAP_CODE_OFFSET 18
124*5113495bSYour Name #define EAP_LENGTH_OFFSET 20
125*5113495bSYour Name #define EAP_TYPE_OFFSET 22
126*5113495bSYour Name #define QDF_EAP_REQUEST 1
127*5113495bSYour Name #define QDF_EAP_RESPONSE 2
128*5113495bSYour Name #define QDF_EAP_SUCCESS 3
129*5113495bSYour Name #define QDF_EAP_FAILURE 4
130*5113495bSYour Name #define QDF_EAP_INITIATE 5
131*5113495bSYour Name #define QDF_EAP_FINISH 6
132*5113495bSYour Name
133*5113495bSYour Name #define EAP_PACKET_TYPE_ID 0x01
134*5113495bSYour Name #define EAP_PACKET_TYPE_EXP 0xFE
135*5113495bSYour Name
136*5113495bSYour Name #define EAP_EXP_TYPE_WSC_START 0x01
137*5113495bSYour Name #define EAP_EXP_TYPE_M1 0x04
138*5113495bSYour Name #define EAP_EXP_TYPE_M2 0x05
139*5113495bSYour Name #define EAP_EXP_TYPE_M3 0x07
140*5113495bSYour Name #define EAP_EXP_TYPE_M4 0x08
141*5113495bSYour Name #define EAP_EXP_TYPE_M5 0x09
142*5113495bSYour Name #define EAP_EXP_TYPE_M6 0x0A
143*5113495bSYour Name #define EAP_EXP_TYPE_M7 0x0B
144*5113495bSYour Name #define EAP_EXP_TYPE_M8 0x0C
145*5113495bSYour Name #define EAP_EXP_TYPE_WSC_DONE 0x0F
146*5113495bSYour Name
147*5113495bSYour Name #define EAP_EXP_MSG_OPCODE_OFFSET 0x1E
148*5113495bSYour Name #define EAP_EXP_MSG_TYPE_OFFSET 0x29
149*5113495bSYour Name
150*5113495bSYour Name enum wsc_op_code {
151*5113495bSYour Name WSC_UPNP = 0, /* No OP Code in UPnP transport */
152*5113495bSYour Name WSC_START = 0x01,
153*5113495bSYour Name WSC_ACK = 0x02,
154*5113495bSYour Name WSC_NACK = 0x03,
155*5113495bSYour Name WSC_MSG = 0x04,
156*5113495bSYour Name WSC_DONE = 0x05,
157*5113495bSYour Name WSC_FRAG_ACK = 0x06
158*5113495bSYour Name };
159*5113495bSYour Name
160*5113495bSYour Name /* ARP Related MASK */
161*5113495bSYour Name #define QDF_NBUF_PKT_ARP_OPCODE_OFFSET 20
162*5113495bSYour Name #define QDF_NBUF_PKT_ARPOP_REQ 1
163*5113495bSYour Name #define QDF_NBUF_PKT_ARPOP_REPLY 2
164*5113495bSYour Name #define QDF_NBUF_PKT_ARP_SRC_IP_OFFSET 28
165*5113495bSYour Name #define QDF_NBUF_PKT_ARP_TGT_IP_OFFSET 38
166*5113495bSYour Name
167*5113495bSYour Name /* ICMPv4 Related MASK */
168*5113495bSYour Name #define QDF_NBUF_PKT_ICMPv4_OPCODE_OFFSET 34
169*5113495bSYour Name #define QDF_NBUF_PKT_ICMPv4OP_REQ 0x08
170*5113495bSYour Name #define QDF_NBUF_PKT_ICMPv4OP_REPLY 0x00
171*5113495bSYour Name #define QDF_NBUF_PKT_ICMPv4_SRC_IP_OFFSET 26
172*5113495bSYour Name #define QDF_NBUF_PKT_ICMPv4_TGT_IP_OFFSET 30
173*5113495bSYour Name #define QDF_NBUF_PKT_ICMPV4_REDIRECT 0x05
174*5113495bSYour Name
175*5113495bSYour Name /* TCP Related MASK */
176*5113495bSYour Name #define QDF_NBUF_PKT_TCP_OPCODE_OFFSET 47
177*5113495bSYour Name #define QDF_NBUF_PKT_TCPOP_SYN 0x02
178*5113495bSYour Name #define QDF_NBUF_PKT_TCPOP_SYN_ACK 0x12
179*5113495bSYour Name #define QDF_NBUF_PKT_TCPOP_ACK 0x10
180*5113495bSYour Name #define QDF_NBUF_PKT_TCP_SRC_PORT_OFFSET 34
181*5113495bSYour Name #define QDF_NBUF_PKT_TCP_DST_PORT_OFFSET 36
182*5113495bSYour Name #define QDF_NBUF_PKT_IPV4_TCP_HDR_LEN_OFFSET 46
183*5113495bSYour Name #define QDF_NBUF_PKT_IPV4_TCP_OPCODE_OFFSET 47
184*5113495bSYour Name #define QDF_NBUF_PKT_IPV6_TCP_HDR_LEN_OFFSET 66
185*5113495bSYour Name #define QDF_NBUF_PKT_IPV6_TCP_OPCODE_OFFSET 67
186*5113495bSYour Name #define QDF_NBUF_PKT_TCP_HDR_LEN_MASK 0xF0
187*5113495bSYour Name #define QDF_NBUF_PKT_TCP_HDR_LEN_LSB 4
188*5113495bSYour Name #define QDF_NBUF_PKT_TCP_HDR_LEN_UNIT 4
189*5113495bSYour Name #define QDF_NBUF_PKT_TCP_ACK_MAX_LEN 100
190*5113495bSYour Name
191*5113495bSYour Name /* DNS Related MASK */
192*5113495bSYour Name #define QDF_NBUF_PKT_DNS_OVER_UDP_OPCODE_OFFSET 44
193*5113495bSYour Name #define QDF_NBUF_PKT_DNSOP_BITMAP 0xF800
194*5113495bSYour Name #define QDF_NBUF_PKT_DNSOP_STANDARD_QUERY 0x0000
195*5113495bSYour Name #define QDF_NBUF_PKT_DNSOP_STANDARD_RESPONSE 0x8000
196*5113495bSYour Name #define QDF_NBUF_PKT_DNS_SRC_PORT_OFFSET 34
197*5113495bSYour Name #define QDF_NBUF_PKT_DNS_DST_PORT_OFFSET 36
198*5113495bSYour Name #define QDF_NBUF_PKT_DNS_NAME_OVER_UDP_OFFSET 54
199*5113495bSYour Name #define QDF_NBUF_PKT_DNS_STANDARD_PORT 53
200*5113495bSYour Name
201*5113495bSYour Name /* Tracked Packet types */
202*5113495bSYour Name #define QDF_NBUF_TX_PKT_INVALID 0
203*5113495bSYour Name #define QDF_NBUF_TX_PKT_DATA_TRACK 1
204*5113495bSYour Name #define QDF_NBUF_TX_PKT_MGMT_TRACK 2
205*5113495bSYour Name #define QDF_NBUF_RX_PKT_DATA_TRACK 3
206*5113495bSYour Name
207*5113495bSYour Name /* Different Packet states */
208*5113495bSYour Name #define QDF_NBUF_TX_PKT_HDD 1
209*5113495bSYour Name #define QDF_NBUF_TX_PKT_TXRX_ENQUEUE 2
210*5113495bSYour Name #define QDF_NBUF_TX_PKT_TXRX_DEQUEUE 3
211*5113495bSYour Name #define QDF_NBUF_TX_PKT_TXRX 4
212*5113495bSYour Name #define QDF_NBUF_TX_PKT_HTT 5
213*5113495bSYour Name #define QDF_NBUF_TX_PKT_HTC 6
214*5113495bSYour Name #define QDF_NBUF_TX_PKT_HIF 7
215*5113495bSYour Name #define QDF_NBUF_TX_PKT_CE 8
216*5113495bSYour Name #define QDF_NBUF_TX_PKT_FREE 9
217*5113495bSYour Name #define QDF_NBUF_TX_PKT_LI_DP 10
218*5113495bSYour Name #define QDF_NBUF_TX_PKT_DP 11
219*5113495bSYour Name #define QDF_NBUF_TX_PKT_STATE_MAX 12
220*5113495bSYour Name
221*5113495bSYour Name /* nbuf allocations only come from one domain */
222*5113495bSYour Name #define QDF_DEBUG_NBUF_DOMAIN 0
223*5113495bSYour Name
224*5113495bSYour Name /* qdf_nbuf allocate and map max retry threshold when failed */
225*5113495bSYour Name #define QDF_NBUF_ALLOC_MAP_RETRY_THRESHOLD 20
226*5113495bSYour Name
227*5113495bSYour Name /* Enable flag to print TSO specific prints in datapath */
228*5113495bSYour Name #ifdef TSO_DEBUG_LOG_ENABLE
229*5113495bSYour Name #define TSO_DEBUG(fmt, args ...) \
230*5113495bSYour Name QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_NONE, \
231*5113495bSYour Name fmt, ## args)
232*5113495bSYour Name #else
233*5113495bSYour Name #define TSO_DEBUG(fmt, args ...)
234*5113495bSYour Name #endif
235*5113495bSYour Name
236*5113495bSYour Name #define IEEE80211_AMPDU_FLAG 0x01
237*5113495bSYour Name
238*5113495bSYour Name #ifdef GET_MSDU_AGGREGATION
239*5113495bSYour Name #define IEEE80211_AMSDU_FLAG 0x02
240*5113495bSYour Name #endif
241*5113495bSYour Name
242*5113495bSYour Name #define MAX_CHAIN 8
243*5113495bSYour Name #define QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS 8
244*5113495bSYour Name
245*5113495bSYour Name #define EHT_USER_INFO_LEN 4
246*5113495bSYour Name
247*5113495bSYour Name /**
248*5113495bSYour Name * typedef qdf_nbuf_queue_t - Platform independent packet queue abstraction
249*5113495bSYour Name */
250*5113495bSYour Name typedef __qdf_nbuf_queue_t qdf_nbuf_queue_t;
251*5113495bSYour Name
252*5113495bSYour Name /*
253*5113495bSYour Name * This is the length for radiotap, combined length
254*5113495bSYour Name * (Mandatory part struct ieee80211_radiotap_header + RADIOTAP_HEADER_LEN)
255*5113495bSYour Name * cannot be more than available headroom_sz.
256*5113495bSYour Name * increase this when we add more radiotap elements.
257*5113495bSYour Name * Number after '+' indicates maximum possible increase due to alignment
258*5113495bSYour Name */
259*5113495bSYour Name #define RADIOTAP_TX_FLAGS_LEN (2 + 1)
260*5113495bSYour Name #define RADIOTAP_VHT_FLAGS_LEN (12 + 1)
261*5113495bSYour Name #define RADIOTAP_HE_FLAGS_LEN (12 + 1)
262*5113495bSYour Name #define RADIOTAP_HE_MU_FLAGS_LEN (8 + 1)
263*5113495bSYour Name #define RADIOTAP_HE_MU_OTHER_FLAGS_LEN (18 + 1)
264*5113495bSYour Name #define RADIOTAP_U_SIG_FLAGS_LEN (12 + 3)
265*5113495bSYour Name #define RADIOTAP_EHT_FLAGS_LEN (58 + 3)
266*5113495bSYour Name #define RADIOTAP_FIXED_HEADER_LEN 17
267*5113495bSYour Name #define RADIOTAP_HT_FLAGS_LEN 3
268*5113495bSYour Name #define RADIOTAP_AMPDU_STATUS_LEN (8 + 3)
269*5113495bSYour Name #define RADIOTAP_VENDOR_NS_LEN \
270*5113495bSYour Name (sizeof(struct qdf_radiotap_vendor_ns_ath) + 1)
271*5113495bSYour Name /* This is Radio Tap Header Extension Length.
272*5113495bSYour Name * 4 Bytes for Extended it_present bit map +
273*5113495bSYour Name * 4 bytes padding for alignment
274*5113495bSYour Name */
275*5113495bSYour Name #define RADIOTAP_HEADER_EXT_LEN (2 * sizeof(uint32_t))
276*5113495bSYour Name #define RADIOTAP_HEADER_EXT2_LEN \
277*5113495bSYour Name (sizeof(struct qdf_radiotap_ext2))
278*5113495bSYour Name #define RADIOTAP_HEADER_LEN (RADIOTAP_BASE_HEADER_LEN + \
279*5113495bSYour Name RADIOTAP_FIXED_HEADER_LEN + \
280*5113495bSYour Name RADIOTAP_TX_FLAGS_LEN + \
281*5113495bSYour Name RADIOTAP_HT_FLAGS_LEN + \
282*5113495bSYour Name RADIOTAP_VHT_FLAGS_LEN + \
283*5113495bSYour Name RADIOTAP_AMPDU_STATUS_LEN + \
284*5113495bSYour Name RADIOTAP_HE_FLAGS_LEN + \
285*5113495bSYour Name RADIOTAP_HE_MU_FLAGS_LEN + \
286*5113495bSYour Name RADIOTAP_HE_MU_OTHER_FLAGS_LEN + \
287*5113495bSYour Name RADIOTAP_VENDOR_NS_LEN + \
288*5113495bSYour Name RADIOTAP_HEADER_EXT_LEN + \
289*5113495bSYour Name RADIOTAP_HEADER_EXT2_LEN + \
290*5113495bSYour Name RADIOTAP_U_SIG_FLAGS_LEN + \
291*5113495bSYour Name RADIOTAP_EHT_FLAGS_LEN)
292*5113495bSYour Name
293*5113495bSYour Name /**
294*5113495bSYour Name * struct mon_rx_status - This will have monitor mode rx_status extracted from
295*5113495bSYour Name * htt_rx_desc used later to update radiotap information.
296*5113495bSYour Name * @tsft: Time Synchronization Function timer
297*5113495bSYour Name * @ppdu_timestamp: Timestamp in the PPDU_START TLV
298*5113495bSYour Name * @chan_freq: Capture channel frequency
299*5113495bSYour Name * @chan_num: Capture channel number
300*5113495bSYour Name * @chan_flags: Bitmap of Channel flags, IEEE80211_CHAN_TURBO,
301*5113495bSYour Name * IEEE80211_CHAN_CCK...
302*5113495bSYour Name * @ht_flags: HT flags, only present for HT frames.
303*5113495bSYour Name * @vht_flags: VHT flags, only present for VHT frames.
304*5113495bSYour Name * @vht_flag_values1-5: Contains corresponding data for flags field
305*5113495bSYour Name * @he_flags: HE (11ax) flags, only present in HE frames
306*5113495bSYour Name * @he_mu_flags: HE-MU (11ax) flags, only present in HE frames
307*5113495bSYour Name * @he_mu_other_flags: HE-MU-OTHER (11ax) flags, only present in HE frames
308*5113495bSYour Name * @usig_flags: USIG flags, only present in 802.11BE and subsequent protocol
309*5113495bSYour Name * @eht_flags: EHT (11be) flags, only present in EHT frames
310*5113495bSYour Name * @nr_ant: Number of Antennas used for streaming
311*5113495bSYour Name * @mcs: MCS index of Rx frame
312*5113495bSYour Name * @nss: Number of spatial streams
313*5113495bSYour Name * @bw: bandwidth of rx frame
314*5113495bSYour Name * @is_stbc: Is STBC enabled
315*5113495bSYour Name * @sgi: Rx frame short guard interval
316*5113495bSYour Name * @he_re: HE range extension
317*5113495bSYour Name * @ldpc: ldpc enabled
318*5113495bSYour Name * @beamformed: Is frame beamformed.
319*5113495bSYour Name * @dcm: dcm
320*5113495bSYour Name * @preamble_type: Preamble type in radio header
321*5113495bSYour Name * @tid: QoS traffic tid number
322*5113495bSYour Name * @rs_fcs_err: FCS error flag
323*5113495bSYour Name * @cck_flag: Flag to indicate CCK modulation
324*5113495bSYour Name * @ofdm_flag: Flag to indicate OFDM modulation
325*5113495bSYour Name * @ulofdma_flag: Flag to indicate UL OFDMA PPDU
326*5113495bSYour Name * @monitor_direct_used: monitor direct mode
327*5113495bSYour Name * @data_sequence_control_info_valid: field to indicate validity of seq control
328*5113495bSYour Name * @rxpcu_filter_pass: Flag which indicates whether RX packets are received in
329*5113495bSYour Name * BSS mode(not in promisc mode)
330*5113495bSYour Name * @add_rtap_ext: add radio tap extension
331*5113495bSYour Name * @frame_control_info_valid: field indicates if fc value is valid
332*5113495bSYour Name * @add_rtap_ext2: add radiotap extension2
333*5113495bSYour Name * @reception_type: PPDU reception type
334*5113495bSYour Name * @ltf_size: ltf size
335*5113495bSYour Name * @tx_status: packet tx status
336*5113495bSYour Name * @mu_dl_ul: MU down or up link, 0 downlink, 1 uplink
337*5113495bSYour Name * @ul_mu_type: MU type
338*5113495bSYour Name * @user_info_skip: user information skip
339*5113495bSYour Name * @rx_antenna: rx antenna
340*5113495bSYour Name * @vht_flag_values6: VHT flag value6
341*5113495bSYour Name * @he_mu_other_flags: HE MU other flag
342*5113495bSYour Name * @he_sig_b_common: HE (11ax) sig B common field
343*5113495bSYour Name * @he_sig_b_common_known: HE (11ax) sig B common known field
344*5113495bSYour Name * @l_sig_a_info: L_SIG_A value coming in Rx descriptor
345*5113495bSYour Name * @l_sig_b_info: L_SIG_B value coming in Rx descriptor
346*5113495bSYour Name * @num_eht_user_info_valid: Number of valid EHT user info
347*5113495bSYour Name * @num_eht_all_user_info_valid: Number of all valid EHT user info
348*5113495bSYour Name * @rate: Rate in terms 500Kbps
349*5113495bSYour Name * @rtap_flags: Bit map of available fields in the radiotap
350*5113495bSYour Name * @ant_signal_db: Rx packet RSSI
351*5113495bSYour Name * @ht_mcs: MCS index for HT RX frames
352*5113495bSYour Name * @tcp_msdu_count: TCP MSDU Count
353*5113495bSYour Name * @udp_msdu_count: UDP MSDU Count
354*5113495bSYour Name * @other_msdu_count: Other MSDU Count
355*5113495bSYour Name * @vht_flag_values1: VHT flag value 1
356*5113495bSYour Name * @vht_flag_values2: VHT flag value 2
357*5113495bSYour Name * @vht_flag_values3: VHT flag value 3
358*5113495bSYour Name * @vht_flag_values4: VHT flag value 4
359*5113495bSYour Name * @vht_flag_values5: VHT flag value 5
360*5113495bSYour Name * @he_sig_b_common_RU: HE (11ax) common RU assignment index
361*5113495bSYour Name * @rssi_comb: Combined RSSI
362*5113495bSYour Name * @rssi: 8 bits RSSI per 20 MHz per chain
363*5113495bSYour Name * @duration: 802.11 Duration
364*5113495bSYour Name * @frame_control: frame control field
365*5113495bSYour Name * @ast_index: AST table hash index
366*5113495bSYour Name * @rs_flags: Flags to indicate AMPDU or AMSDU aggregation
367*5113495bSYour Name * @he_per_user_1: HE per user info1
368*5113495bSYour Name * @he_per_user_2: HE per user info2
369*5113495bSYour Name * @he_per_user_position: HE per user position info
370*5113495bSYour Name * @he_per_user_known: HE per user known info
371*5113495bSYour Name * @he_flags1: HE flags
372*5113495bSYour Name * @he_flags2: HE flags
373*5113495bSYour Name * @he_RU: HE RU assignment index
374*5113495bSYour Name * @he_data1: HE property of received frame
375*5113495bSYour Name * @he_data2: HE property of received frame
376*5113495bSYour Name * @he_data3: HE property of received frame
377*5113495bSYour Name * @he_data4: HE property of received frame
378*5113495bSYour Name * @he_data5: HE property of received frame
379*5113495bSYour Name * @he_data6: HE property of received frame
380*5113495bSYour Name * @ppdu_len: PPDU length
381*5113495bSYour Name * @prev_ppdu_id: ppdu_id in previously received message
382*5113495bSYour Name * @ppdu_id: Id of the PLCP protocol data unit
383*5113495bSYour Name *
384*5113495bSYour Name * The following variables are not coming from the TLVs.
385*5113495bSYour Name * These variables are placeholders for passing information to update_radiotap
386*5113495bSYour Name * function.
387*5113495bSYour Name * @device_id: Device ID coming from sub-system (PCI, AHB etc..)
388*5113495bSYour Name * @chan_noise_floor: Channel Noise Floor for the pdev
389*5113495bSYour Name * @first_data_seq_ctrl: Sequence ctrl field of first data frame
390*5113495bSYour Name * @rssi_chain: Rssi chain per nss per bw
391*5113495bSYour Name * @tx_retry_cnt: tx retry count
392*5113495bSYour Name * @start_seq: starting sequence number
393*5113495bSYour Name * @ba_bitmap: 256 bit block ack bitmap
394*5113495bSYour Name * @mpdu_retry_cnt: Rx mpdu retry count
395*5113495bSYour Name * @punctured_pattern: punctured pattern (0 means the band is punctured)
396*5113495bSYour Name * @usig_common: U-SIG property of received frame
397*5113495bSYour Name * @usig_value: U-SIG property of received frame
398*5113495bSYour Name * @usig_mask: U-SIG property of received frame
399*5113495bSYour Name * @eht_known: EHT property of received frame
400*5113495bSYour Name * @eht_data: EHT property of received frame
401*5113495bSYour Name * @eht_all_user_num: EHT all user number
402*5113495bSYour Name * @eht_user_info: EHT USER property of received frame
403*5113495bSYour Name * @phyrx_abort: phy aborted undecoded frame indication
404*5113495bSYour Name * @phyrx_abort_reason: abort reason in phyrx_abort_request_info
405*5113495bSYour Name * @vht_crc: vht crc
406*5113495bSYour Name * @vht_no_txop_ps: TXOP power save mode
407*5113495bSYour Name * @he_crc: he crc
408*5113495bSYour Name * @l_sig_length: L SIG A length
409*5113495bSYour Name * @l_sig_a_parity: L SIG A parity
410*5113495bSYour Name * @l_sig_a_pkt_type: L SIG A info pkt type
411*5113495bSYour Name * @l_sig_a_implicit_sounding: L SIG A info captured implicit sounding
412*5113495bSYour Name * @ht_length: num of bytes in PSDU
413*5113495bSYour Name * @smoothing: Indicate smoothing
414*5113495bSYour Name * @not_sounding: Indicate sounding
415*5113495bSYour Name * @aggregation: Indicate A-MPDU format
416*5113495bSYour Name * @ht_stbc: Indicate stbc
417*5113495bSYour Name * @ht_crc: ht crc
418*5113495bSYour Name * @rx_user_status: pointer to mon_rx_user_status, when set update
419*5113495bSYour Name * @rssi_offset: This offset value will use for RSSI db to dbm conversion
420*5113495bSYour Name * @rssi_dbm_conv_support: Rssi dbm conversion support param
421*5113495bSYour Name * radiotap header will use userinfo from this structure.
422*5113495bSYour Name */
423*5113495bSYour Name struct mon_rx_status {
424*5113495bSYour Name uint64_t tsft;
425*5113495bSYour Name uint32_t ppdu_timestamp;
426*5113495bSYour Name qdf_freq_t chan_freq;
427*5113495bSYour Name uint16_t chan_num;
428*5113495bSYour Name uint16_t chan_flags;
429*5113495bSYour Name uint32_t ht_flags : 1,
430*5113495bSYour Name vht_flags : 1,
431*5113495bSYour Name he_flags : 1,
432*5113495bSYour Name he_mu_flags : 1,
433*5113495bSYour Name usig_flags : 1,
434*5113495bSYour Name eht_flags : 1,
435*5113495bSYour Name nr_ant : 3,
436*5113495bSYour Name mcs : 4,
437*5113495bSYour Name nss : 3,
438*5113495bSYour Name bw : 4,
439*5113495bSYour Name is_stbc : 1,
440*5113495bSYour Name sgi : 2,
441*5113495bSYour Name he_re : 1,
442*5113495bSYour Name ldpc : 1,
443*5113495bSYour Name beamformed : 1,
444*5113495bSYour Name dcm : 1,
445*5113495bSYour Name preamble_type : 4;
446*5113495bSYour Name uint32_t tid : 5,
447*5113495bSYour Name rs_fcs_err : 1,
448*5113495bSYour Name cck_flag : 1,
449*5113495bSYour Name ofdm_flag : 1,
450*5113495bSYour Name ulofdma_flag : 1,
451*5113495bSYour Name monitor_direct_used : 1,
452*5113495bSYour Name data_sequence_control_info_valid : 1,
453*5113495bSYour Name rxpcu_filter_pass : 1,
454*5113495bSYour Name add_rtap_ext : 1,
455*5113495bSYour Name frame_control_info_valid : 1,
456*5113495bSYour Name add_rtap_ext2 : 1,
457*5113495bSYour Name reception_type : 4,
458*5113495bSYour Name ltf_size : 2,
459*5113495bSYour Name tx_status : 4,
460*5113495bSYour Name mu_dl_ul : 1,
461*5113495bSYour Name ul_mu_type : 4,
462*5113495bSYour Name user_info_skip : 1;
463*5113495bSYour Name uint32_t rx_antenna : 24;
464*5113495bSYour Name uint16_t vht_flag_values6;
465*5113495bSYour Name uint16_t he_mu_other_flags;
466*5113495bSYour Name uint16_t he_sig_b_common;
467*5113495bSYour Name uint16_t he_sig_b_common_known;
468*5113495bSYour Name uint32_t l_sig_a_info;
469*5113495bSYour Name uint32_t l_sig_b_info;
470*5113495bSYour Name uint8_t num_eht_user_info_valid;
471*5113495bSYour Name uint8_t num_eht_all_user_info_valid;
472*5113495bSYour Name uint8_t rate;
473*5113495bSYour Name uint8_t rtap_flags;
474*5113495bSYour Name uint8_t ant_signal_db;
475*5113495bSYour Name uint8_t ht_mcs;
476*5113495bSYour Name uint16_t tcp_msdu_count;
477*5113495bSYour Name uint16_t udp_msdu_count;
478*5113495bSYour Name uint16_t other_msdu_count;
479*5113495bSYour Name uint8_t vht_flag_values1;
480*5113495bSYour Name uint8_t vht_flag_values2;
481*5113495bSYour Name uint8_t vht_flag_values3[4];
482*5113495bSYour Name uint8_t vht_flag_values4;
483*5113495bSYour Name uint8_t vht_flag_values5;
484*5113495bSYour Name uint8_t he_sig_b_common_RU[4];
485*5113495bSYour Name int8_t rssi_comb;
486*5113495bSYour Name int8_t rssi[MAX_CHAIN];
487*5113495bSYour Name uint16_t duration;
488*5113495bSYour Name uint16_t frame_control;
489*5113495bSYour Name uint16_t ast_index;
490*5113495bSYour Name uint8_t rs_flags;
491*5113495bSYour Name /* New HE radiotap fields */
492*5113495bSYour Name uint16_t he_per_user_1;
493*5113495bSYour Name uint16_t he_per_user_2;
494*5113495bSYour Name uint8_t he_per_user_position;
495*5113495bSYour Name uint8_t he_per_user_known;
496*5113495bSYour Name uint16_t he_flags1;
497*5113495bSYour Name uint16_t he_flags2;
498*5113495bSYour Name uint8_t he_RU[8];
499*5113495bSYour Name uint16_t he_data1;
500*5113495bSYour Name uint16_t he_data2;
501*5113495bSYour Name uint16_t he_data3;
502*5113495bSYour Name uint16_t he_data4;
503*5113495bSYour Name uint16_t he_data5;
504*5113495bSYour Name uint16_t he_data6;
505*5113495bSYour Name uint32_t ppdu_len;
506*5113495bSYour Name uint16_t prev_ppdu_id;
507*5113495bSYour Name uint16_t ppdu_id;
508*5113495bSYour Name uint16_t device_id;
509*5113495bSYour Name int16_t chan_noise_floor;
510*5113495bSYour Name uint16_t first_data_seq_ctrl;
511*5113495bSYour Name int8_t rssi_chain[8][8];
512*5113495bSYour Name uint8_t tx_retry_cnt;
513*5113495bSYour Name uint16_t start_seq;
514*5113495bSYour Name uint32_t ba_bitmap[8];
515*5113495bSYour Name uint16_t mpdu_retry_cnt;
516*5113495bSYour Name #ifdef WLAN_FEATURE_11BE
517*5113495bSYour Name uint16_t punctured_pattern;
518*5113495bSYour Name #endif
519*5113495bSYour Name uint32_t usig_common;
520*5113495bSYour Name uint32_t usig_value;
521*5113495bSYour Name uint32_t usig_mask;
522*5113495bSYour Name uint32_t eht_known;
523*5113495bSYour Name uint32_t eht_data[9];
524*5113495bSYour Name uint32_t eht_all_user_num;
525*5113495bSYour Name uint32_t eht_user_info[EHT_USER_INFO_LEN];
526*5113495bSYour Name #ifdef QCA_UNDECODED_METADATA_SUPPORT
527*5113495bSYour Name uint32_t phyrx_abort:1,
528*5113495bSYour Name phyrx_abort_reason:8,
529*5113495bSYour Name vht_crc:8,
530*5113495bSYour Name vht_no_txop_ps:1,
531*5113495bSYour Name he_crc:4;
532*5113495bSYour Name uint32_t l_sig_length:12,
533*5113495bSYour Name l_sig_a_parity:1,
534*5113495bSYour Name l_sig_a_pkt_type:4,
535*5113495bSYour Name l_sig_a_implicit_sounding:1;
536*5113495bSYour Name uint32_t ht_length:16,
537*5113495bSYour Name smoothing:1,
538*5113495bSYour Name not_sounding:1,
539*5113495bSYour Name aggregation:1,
540*5113495bSYour Name ht_stbc:2,
541*5113495bSYour Name ht_crc:8;
542*5113495bSYour Name #endif
543*5113495bSYour Name struct mon_rx_user_status *rx_user_status;
544*5113495bSYour Name int32_t rssi_offset;
545*5113495bSYour Name bool rssi_dbm_conv_support;
546*5113495bSYour Name };
547*5113495bSYour Name
548*5113495bSYour Name /**
549*5113495bSYour Name * struct mon_rx_user_status - This will have monitor mode per user rx_status
550*5113495bSYour Name * extracted from hardware TLV.
551*5113495bSYour Name * @mcs: MCS index of Rx frame
552*5113495bSYour Name * @nss: Number of spatial streams
553*5113495bSYour Name * @mu_ul_info_valid: MU UL info below is valid
554*5113495bSYour Name * @ofdma_ru_start_index: OFDMA RU start index
555*5113495bSYour Name * @ofdma_ru_width: OFDMA total RU width
556*5113495bSYour Name * @ofdma_ru_size: OFDMA RU size index
557*5113495bSYour Name * @is_ampdu: AMPDU flag
558*5113495bSYour Name * @sta_id: STA id
559*5113495bSYour Name * @ldpc: LDPC
560*5113495bSYour Name * @dcm: DCM
561*5113495bSYour Name * @is_stbc: STBC
562*5113495bSYour Name * @beamformed: Beamformed
563*5113495bSYour Name * @mu_ul_user_v0_word0: MU UL user info word 0
564*5113495bSYour Name * @mu_ul_user_v0_word1: MU UL user info word 1
565*5113495bSYour Name * @ast_index: AST table hash index
566*5113495bSYour Name * @sw_peer_id: software peer id
567*5113495bSYour Name * @tid: QoS traffic tid number
568*5113495bSYour Name * @preamble_type: Preamble type in radio header
569*5113495bSYour Name * @ht_flags: HT flags, only present for HT frames.
570*5113495bSYour Name * @vht_flags: VHT flags, only present for VHT frames.
571*5113495bSYour Name * @he_flags: HE (11ax) flags, only present in HE frames
572*5113495bSYour Name * @frame_control_info_valid: field indicates if fc value is valid
573*5113495bSYour Name * @frame_control: frame control field
574*5113495bSYour Name * @data_sequence_control_info_valid: field to indicate validity of seq control
575*5113495bSYour Name * @ba_bitmap_sz: blockack bitmap size
576*5113495bSYour Name * @filter_category: mpdu filter category
577*5113495bSYour Name * @tcp_msdu_count: tcp protocol msdu count
578*5113495bSYour Name * @udp_msdu_count: udp protocol msdu count
579*5113495bSYour Name * @other_msdu_count: other protocol msdu count
580*5113495bSYour Name * @first_data_seq_ctrl: Sequence ctrl field of first data frame
581*5113495bSYour Name * @duration: 802.11 Duration
582*5113495bSYour Name * @vht_flag_values2: Contains corresponding data for flags field
583*5113495bSYour Name * @vht_flag_values3: Contains corresponding data for flags field
584*5113495bSYour Name * @vht_flag_values4: Contains corresponding data for flags field
585*5113495bSYour Name * @vht_flag_values5: Contains corresponding data for flags field
586*5113495bSYour Name * @vht_flag_values6: Contains corresponding data for flags field
587*5113495bSYour Name * @he_flags1: HE flags
588*5113495bSYour Name * @he_flags2: HE flags
589*5113495bSYour Name * @he_RU: HE RU assignment index
590*5113495bSYour Name * @he_data1: HE property of received frame
591*5113495bSYour Name * @he_data2: HE property of received frame
592*5113495bSYour Name * @he_data3: HE property of received frame
593*5113495bSYour Name * @he_data4: HE property of received frame
594*5113495bSYour Name * @he_data5: HE property of received frame
595*5113495bSYour Name * @he_data6: HE property of received frame
596*5113495bSYour Name * @he_per_user_1: HE per user info1
597*5113495bSYour Name * @he_per_user_2: HE per user info2
598*5113495bSYour Name * @he_per_user_position: HE per user position info
599*5113495bSYour Name * @he_per_user_known: HE per user known info
600*5113495bSYour Name * @eht_known: EHT known
601*5113495bSYour Name * @eht_data: EHT data
602*5113495bSYour Name * @eht_user_info: EHT user info
603*5113495bSYour Name * @rtap_flags: Bit map of available fields in the radiotap
604*5113495bSYour Name * @rs_flags: Flags to indicate AMPDU or AMSDU aggregation
605*5113495bSYour Name * @mpdu_cnt_fcs_ok: mpdu count received with fcs ok
606*5113495bSYour Name * @mpdu_cnt_fcs_err: mpdu count received with fcs ok bitmap
607*5113495bSYour Name * @mpdu_fcs_ok_bitmap: mpdu with fcs ok bitmap
608*5113495bSYour Name * @mpdu_ok_byte_count: mpdu byte count with fcs ok
609*5113495bSYour Name * @mpdu_err_byte_count: mpdu byte count with fcs err
610*5113495bSYour Name * @retry_mpdu: mpdu retry count
611*5113495bSYour Name * @start_seq: starting sequence number
612*5113495bSYour Name * @ba_control: Block ack control
613*5113495bSYour Name * @ba_bitmap: 256 bit block ack bitmap
614*5113495bSYour Name * @aid: Association ID
615*5113495bSYour Name * @mpdu_q: user mpdu_queue used for monitor
616*5113495bSYour Name */
617*5113495bSYour Name struct mon_rx_user_status {
618*5113495bSYour Name uint32_t mcs:4,
619*5113495bSYour Name nss:3,
620*5113495bSYour Name mu_ul_info_valid:1,
621*5113495bSYour Name ofdma_ru_start_index:7,
622*5113495bSYour Name ofdma_ru_width:7,
623*5113495bSYour Name ofdma_ru_size:8,
624*5113495bSYour Name is_ampdu:1;
625*5113495bSYour Name uint32_t sta_id : 12,
626*5113495bSYour Name ldpc : 1,
627*5113495bSYour Name dcm : 1,
628*5113495bSYour Name is_stbc : 1,
629*5113495bSYour Name beamformed : 1;
630*5113495bSYour Name uint32_t mu_ul_user_v0_word0;
631*5113495bSYour Name uint32_t mu_ul_user_v0_word1;
632*5113495bSYour Name uint32_t ast_index : 16,
633*5113495bSYour Name sw_peer_id : 16;
634*5113495bSYour Name uint32_t tid : 4,
635*5113495bSYour Name preamble_type : 4,
636*5113495bSYour Name ht_flags : 1,
637*5113495bSYour Name vht_flags : 1,
638*5113495bSYour Name he_flags : 1,
639*5113495bSYour Name frame_control_info_valid : 1,
640*5113495bSYour Name frame_control : 16,
641*5113495bSYour Name data_sequence_control_info_valid : 1,
642*5113495bSYour Name ba_bitmap_sz : 2,
643*5113495bSYour Name filter_category : 2;
644*5113495bSYour Name uint16_t tcp_msdu_count;
645*5113495bSYour Name uint16_t udp_msdu_count;
646*5113495bSYour Name uint16_t other_msdu_count;
647*5113495bSYour Name uint16_t first_data_seq_ctrl;
648*5113495bSYour Name uint16_t duration;
649*5113495bSYour Name uint8_t vht_flag_values2;
650*5113495bSYour Name uint8_t vht_flag_values3[4];
651*5113495bSYour Name uint8_t vht_flag_values4;
652*5113495bSYour Name uint8_t vht_flag_values5;
653*5113495bSYour Name uint16_t vht_flag_values6;
654*5113495bSYour Name uint16_t he_flags1;
655*5113495bSYour Name uint16_t he_flags2;
656*5113495bSYour Name uint8_t he_RU[8];
657*5113495bSYour Name uint16_t he_data1;
658*5113495bSYour Name uint16_t he_data2;
659*5113495bSYour Name uint16_t he_data3;
660*5113495bSYour Name uint16_t he_data4;
661*5113495bSYour Name uint16_t he_data5;
662*5113495bSYour Name uint16_t he_data6;
663*5113495bSYour Name uint8_t he_per_user_1;
664*5113495bSYour Name uint8_t he_per_user_2;
665*5113495bSYour Name uint8_t he_per_user_position;
666*5113495bSYour Name uint8_t he_per_user_known;
667*5113495bSYour Name uint32_t eht_known;
668*5113495bSYour Name uint32_t eht_data[9];
669*5113495bSYour Name uint32_t eht_user_info;
670*5113495bSYour Name uint8_t rtap_flags;
671*5113495bSYour Name uint8_t rs_flags;
672*5113495bSYour Name uint16_t mpdu_cnt_fcs_ok;
673*5113495bSYour Name uint8_t mpdu_cnt_fcs_err;
674*5113495bSYour Name uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
675*5113495bSYour Name uint32_t mpdu_ok_byte_count;
676*5113495bSYour Name uint32_t mpdu_err_byte_count;
677*5113495bSYour Name uint16_t retry_mpdu;
678*5113495bSYour Name uint16_t start_seq;
679*5113495bSYour Name uint16_t ba_control;
680*5113495bSYour Name uint32_t ba_bitmap[8];
681*5113495bSYour Name uint16_t aid;
682*5113495bSYour Name qdf_nbuf_queue_t mpdu_q;
683*5113495bSYour Name };
684*5113495bSYour Name
685*5113495bSYour Name /**
686*5113495bSYour Name * struct qdf_radiotap_vendor_ns - Vendor Namespace header as per
687*5113495bSYour Name * Radiotap spec: https://www.radiotap.org/fields/Vendor%20Namespace.html
688*5113495bSYour Name * @oui: Vendor OUI
689*5113495bSYour Name * @selector: sub_namespace selector
690*5113495bSYour Name * @skip_length: How many bytes of Vendor Namespace data that follows
691*5113495bSYour Name */
692*5113495bSYour Name struct qdf_radiotap_vendor_ns {
693*5113495bSYour Name uint8_t oui[3];
694*5113495bSYour Name uint8_t selector;
695*5113495bSYour Name uint16_t skip_length;
696*5113495bSYour Name } __attribute__((__packed__));
697*5113495bSYour Name
698*5113495bSYour Name /**
699*5113495bSYour Name * struct qdf_radiotap_vendor_ns_ath - Combined QTI Vendor NS
700*5113495bSYour Name * including the Radiotap specified Vendor Namespace header and
701*5113495bSYour Name * QTI specific Vendor Namespace data
702*5113495bSYour Name * @hdr: radiotap vendor namespace header
703*5113495bSYour Name * @lsig: L_SIG_A (or L_SIG)
704*5113495bSYour Name * @device_id: Device Identification
705*5113495bSYour Name * @lsig_b: L_SIG_B
706*5113495bSYour Name * @ppdu_start_timestamp: Timestamp from RX_PPDU_START TLV
707*5113495bSYour Name */
708*5113495bSYour Name struct qdf_radiotap_vendor_ns_ath {
709*5113495bSYour Name struct qdf_radiotap_vendor_ns hdr;
710*5113495bSYour Name /* QTI specific data follows */
711*5113495bSYour Name uint32_t lsig;
712*5113495bSYour Name uint32_t device_id;
713*5113495bSYour Name uint32_t lsig_b;
714*5113495bSYour Name uint32_t ppdu_start_timestamp;
715*5113495bSYour Name } __attribute__((__packed__));
716*5113495bSYour Name
717*5113495bSYour Name /**
718*5113495bSYour Name * struct qdf_radiotap_ext2 - radiotap ext2 fields
719*5113495bSYour Name * @ppdu_id: ppdu_id of current msdu
720*5113495bSYour Name * @prev_ppdu_id: ppdu_id of previous msdu
721*5113495bSYour Name * @tid: tid number of previous msdu
722*5113495bSYour Name * @reserved: reserved bits
723*5113495bSYour Name * @start_seq: start sequence of previous msdu
724*5113495bSYour Name * @ba_bitmap: block ack bitmap of previous msdu
725*5113495bSYour Name */
726*5113495bSYour Name struct qdf_radiotap_ext2 {
727*5113495bSYour Name uint32_t ppdu_id;
728*5113495bSYour Name uint32_t prev_ppdu_id;
729*5113495bSYour Name uint16_t tid:8,
730*5113495bSYour Name reserved:8;
731*5113495bSYour Name uint16_t start_seq;
732*5113495bSYour Name uint32_t ba_bitmap[8];
733*5113495bSYour Name } __attribute__((__packed__));
734*5113495bSYour Name
735*5113495bSYour Name #define QDF_MEM_FUNC_NAME_SIZE 48
736*5113495bSYour Name
737*5113495bSYour Name /* Masks for HE SIG known fields in mon_rx_status structure */
738*5113495bSYour Name #define QDF_MON_STATUS_HE_SIG_B_COMMON_KNOWN_RU0 0x00000001
739*5113495bSYour Name #define QDF_MON_STATUS_HE_SIG_B_COMMON_KNOWN_RU1 0x00000002
740*5113495bSYour Name #define QDF_MON_STATUS_HE_SIG_B_COMMON_KNOWN_RU2 0x00000004
741*5113495bSYour Name #define QDF_MON_STATUS_HE_SIG_B_COMMON_KNOWN_RU3 0x00000008
742*5113495bSYour Name #define QDF_MON_STATUS_HE_SIG_B_USER_KNOWN_SIG_B_ALL 0x00fe0000
743*5113495bSYour Name #define QDF_MON_STATUS_HE_SIG_A1_HE_FORMAT_SU 0x00000000
744*5113495bSYour Name #define QDF_MON_STATUS_HE_SIG_A1_HE_FORMAT_EXT_SU 0x40000000
745*5113495bSYour Name #define QDF_MON_STATUS_HE_SIG_A1_HE_FORMAT_TRIG 0xc0000000
746*5113495bSYour Name
747*5113495bSYour Name /* DHCP Related Mask */
748*5113495bSYour Name #define QDF_DHCP_OPTION53 (0x35)
749*5113495bSYour Name #define QDF_DHCP_OPTION53_LENGTH (1)
750*5113495bSYour Name #define QDF_DHCP_OPTION53_OFFSET (0x11A)
751*5113495bSYour Name #define QDF_DHCP_OPTION53_LENGTH_OFFSET (0x11B)
752*5113495bSYour Name #define QDF_DHCP_OPTION53_STATUS_OFFSET (0x11C)
753*5113495bSYour Name #define DHCP_PKT_LEN_OFFSET 16
754*5113495bSYour Name #define DHCP_TRANSACTION_ID_OFFSET 46
755*5113495bSYour Name #define QDF_DHCP_DISCOVER (1)
756*5113495bSYour Name #define QDF_DHCP_OFFER (2)
757*5113495bSYour Name #define QDF_DHCP_REQUEST (3)
758*5113495bSYour Name #define QDF_DHCP_DECLINE (4)
759*5113495bSYour Name #define QDF_DHCP_ACK (5)
760*5113495bSYour Name #define QDF_DHCP_NAK (6)
761*5113495bSYour Name #define QDF_DHCP_RELEASE (7)
762*5113495bSYour Name #define QDF_DHCP_INFORM (8)
763*5113495bSYour Name
764*5113495bSYour Name /* ARP Related Mask */
765*5113495bSYour Name #define ARP_SUB_TYPE_OFFSET 20
766*5113495bSYour Name #define ARP_REQUEST (1)
767*5113495bSYour Name #define ARP_RESPONSE (2)
768*5113495bSYour Name
769*5113495bSYour Name /* IPV4 header fields offset values */
770*5113495bSYour Name #define IPV4_PKT_LEN_OFFSET 16
771*5113495bSYour Name #define IPV4_TCP_SEQ_NUM_OFFSET 38
772*5113495bSYour Name #define IPV4_SRC_ADDR_OFFSET 26
773*5113495bSYour Name #define IPV4_DST_ADDR_OFFSET 30
774*5113495bSYour Name #define IPV4_SRC_PORT_OFFSET 34
775*5113495bSYour Name #define IPV4_DST_PORT_OFFSET 36
776*5113495bSYour Name
777*5113495bSYour Name /* IPV4 ICMP Related Mask */
778*5113495bSYour Name #define ICMP_ID_OFFSET 38
779*5113495bSYour Name #define ICMP_SEQ_NUM_OFFSET 40
780*5113495bSYour Name #define ICMP_SUBTYPE_OFFSET 34
781*5113495bSYour Name #define ICMP_REQUEST 0x08
782*5113495bSYour Name #define ICMP_RESPONSE 0x00
783*5113495bSYour Name
784*5113495bSYour Name #define IPV6_ADDR_STR "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:"\
785*5113495bSYour Name "%02x%02x:%02x%02x"
786*5113495bSYour Name
787*5113495bSYour Name /* IPV6 header fields offset values */
788*5113495bSYour Name #define IPV6_PKT_LEN_OFFSET 18
789*5113495bSYour Name #define IPV6_TCP_SEQ_NUM_OFFSET 58
790*5113495bSYour Name #define IPV6_SRC_ADDR_OFFSET 22
791*5113495bSYour Name #define IPV6_DST_ADDR_OFFSET 38
792*5113495bSYour Name #define IPV6_SRC_PORT_OFFSET 54
793*5113495bSYour Name #define IPV6_DST_PORT_OFFSET 56
794*5113495bSYour Name
795*5113495bSYour Name /* IPV6 ICMPV6 Related Mask */
796*5113495bSYour Name #define ICMPV6_REDIRECT 137
797*5113495bSYour Name #define ICMPV6_SEQ_NUM_OFFSET 60
798*5113495bSYour Name #define ICMPV6_SUBTYPE_OFFSET 54
799*5113495bSYour Name #define ICMPV6_REQUEST 0x80
800*5113495bSYour Name #define ICMPV6_RESPONSE 0x81
801*5113495bSYour Name #define ICMPV6_RS 0x85
802*5113495bSYour Name #define ICMPV6_RA 0x86
803*5113495bSYour Name #define ICMPV6_NS 0x87
804*5113495bSYour Name #define ICMPV6_NA 0x88
805*5113495bSYour Name
806*5113495bSYour Name #define QDF_NBUF_IPA_CHECK_MASK 0x80000000
807*5113495bSYour Name
808*5113495bSYour Name /* HE Radiotap data1 Mask */
809*5113495bSYour Name #define QDF_MON_STATUS_HE_SU_FORMAT_TYPE 0x0000
810*5113495bSYour Name #define QDF_MON_STATUS_HE_EXT_SU_FORMAT_TYPE 0x0001
811*5113495bSYour Name #define QDF_MON_STATUS_HE_MU_FORMAT_TYPE 0x0002
812*5113495bSYour Name #define QDF_MON_STATUS_HE_TRIG_FORMAT_TYPE 0x0003
813*5113495bSYour Name
814*5113495bSYour Name
815*5113495bSYour Name #define QDF_MON_STATUS_HE_BEAM_CHANGE_KNOWN 0x0008
816*5113495bSYour Name #define QDF_MON_STATUS_HE_DL_UL_KNOWN 0x0010
817*5113495bSYour Name #define QDF_MON_STATUS_HE_MCS_KNOWN 0x0020
818*5113495bSYour Name #define QDF_MON_STATUS_HE_DCM_KNOWN 0x0040
819*5113495bSYour Name #define QDF_MON_STATUS_HE_CODING_KNOWN 0x0080
820*5113495bSYour Name #define QDF_MON_STATUS_HE_LDPC_EXTRA_SYMBOL_KNOWN 0x0100
821*5113495bSYour Name #define QDF_MON_STATUS_HE_STBC_KNOWN 0x0200
822*5113495bSYour Name #define QDF_MON_STATUS_HE_SPATIAL_REUSE_1_KNOWN 0x0400
823*5113495bSYour Name #define QDF_MON_STATUS_HE_SPATIAL_REUSE_2_KNOWN 0x0800
824*5113495bSYour Name #define QDF_MON_STATUS_HE_SPATIAL_REUSE_3_KNOWN 0x1000
825*5113495bSYour Name #define QDF_MON_STATUS_HE_SPATIAL_REUSE_4_KNOWN 0x2000
826*5113495bSYour Name #define QDF_MON_STATUS_HE_DATA_BW_RU_KNOWN 0x4000
827*5113495bSYour Name #define QDF_MON_STATUS_HE_DOPPLER_KNOWN 0x8000
828*5113495bSYour Name #define QDF_MON_STATUS_HE_BSS_COLOR_KNOWN 0x0004
829*5113495bSYour Name
830*5113495bSYour Name /* HE Radiotap data2 Mask */
831*5113495bSYour Name #define QDF_MON_STATUS_HE_GI_KNOWN 0x0002
832*5113495bSYour Name #define QDF_MON_STATUS_TXBF_KNOWN 0x0010
833*5113495bSYour Name #define QDF_MON_STATUS_PE_DISAMBIGUITY_KNOWN 0x0020
834*5113495bSYour Name #define QDF_MON_STATUS_TXOP_KNOWN 0x0040
835*5113495bSYour Name #define QDF_MON_STATUS_LTF_SYMBOLS_KNOWN 0x0004
836*5113495bSYour Name #define QDF_MON_STATUS_PRE_FEC_PADDING_KNOWN 0x0008
837*5113495bSYour Name #define QDF_MON_STATUS_MIDABLE_PERIODICITY_KNOWN 0x0080
838*5113495bSYour Name #define QDF_MON_STATUS_RU_ALLOCATION_OFFSET_KNOWN 0x4000
839*5113495bSYour Name #define QDF_MON_STATUS_RU_ALLOCATION_SHIFT 8
840*5113495bSYour Name
841*5113495bSYour Name /* HE radiotap data3 shift values */
842*5113495bSYour Name #define QDF_MON_STATUS_BEAM_CHANGE_SHIFT 6
843*5113495bSYour Name #define QDF_MON_STATUS_DL_UL_SHIFT 7
844*5113495bSYour Name #define QDF_MON_STATUS_TRANSMIT_MCS_SHIFT 8
845*5113495bSYour Name #define QDF_MON_STATUS_DCM_SHIFT 12
846*5113495bSYour Name #define QDF_MON_STATUS_CODING_SHIFT 13
847*5113495bSYour Name #define QDF_MON_STATUS_LDPC_EXTRA_SYMBOL_SHIFT 14
848*5113495bSYour Name #define QDF_MON_STATUS_STBC_SHIFT 15
849*5113495bSYour Name
850*5113495bSYour Name /* HE radiotap data4 shift values */
851*5113495bSYour Name #define QDF_MON_STATUS_STA_ID_SHIFT 4
852*5113495bSYour Name
853*5113495bSYour Name /* HE radiotap data5 */
854*5113495bSYour Name #define QDF_MON_STATUS_GI_SHIFT 4
855*5113495bSYour Name #define QDF_MON_STATUS_HE_LTF_SIZE_SHIFT 6
856*5113495bSYour Name #define QDF_MON_STATUS_HE_LTF_SYM_SHIFT 8
857*5113495bSYour Name #define QDF_MON_STATUS_TXBF_SHIFT 14
858*5113495bSYour Name #define QDF_MON_STATUS_PE_DISAMBIGUITY_SHIFT 15
859*5113495bSYour Name #define QDF_MON_STATUS_PRE_FEC_PAD_SHIFT 12
860*5113495bSYour Name
861*5113495bSYour Name /* HE radiotap data6 */
862*5113495bSYour Name #define QDF_MON_STATUS_HE_DATA_6_NSS_SHIFT 0
863*5113495bSYour Name #define QDF_MON_STATUS_DOPPLER_SHIFT 4
864*5113495bSYour Name #define QDF_MON_STATUS_TXOP_SHIFT 8
865*5113495bSYour Name
866*5113495bSYour Name /* HE radiotap HE-MU flags1 */
867*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_MCS_SHIFT 0x0000
868*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_MCS_KNOWN 0x0010
869*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_DCM_SHIFT 5
870*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_DCM_KNOWN 0x0040
871*5113495bSYour Name #define QDF_MON_STATUS_CHANNEL_2_CENTER_26_RU_KNOWN 0x0080
872*5113495bSYour Name #define QDF_MON_STATUS_CHANNEL_1_RU_KNOWN 0x0100
873*5113495bSYour Name #define QDF_MON_STATUS_CHANNEL_2_RU_KNOWN 0x0200
874*5113495bSYour Name #define QDF_MON_STATUS_CHANNEL_1_CENTER_26_RU_KNOWN 0x1000
875*5113495bSYour Name #define QDF_MON_STATUS_CHANNEL_1_CENTER_26_RU_VALUE 0x2000
876*5113495bSYour Name #define QDF_MON_STATUS_CHANNEL_1_CENTER_26_RU_SHIFT 13
877*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_SYM_NUM_KNOWN 0x8000
878*5113495bSYour Name #define QDF_MON_STATUS_RU_0_KNOWN 0x0100
879*5113495bSYour Name #define QDF_MON_STATUS_RU_1_KNOWN 0x0200
880*5113495bSYour Name #define QDF_MON_STATUS_RU_2_KNOWN 0x0400
881*5113495bSYour Name #define QDF_MON_STATUS_RU_3_KNOWN 0x0800
882*5113495bSYour Name #define QDF_MON_STATUS_DCM_FLAG_1_SHIFT 5
883*5113495bSYour Name #define QDF_MON_STATUS_SPATIAL_REUSE_MU_KNOWN 0x0100
884*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_1_KNOWN 0x4000
885*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_SYMBOL_USER_KNOWN 0x8000
886*5113495bSYour Name
887*5113495bSYour Name /* HE radiotap HE-MU flags2 */
888*5113495bSYour Name #define QDF_MON_STATUS_SIG_A_BANDWIDTH_KNOWN 0x0004
889*5113495bSYour Name #define QDF_MON_STATUS_SIG_A_BANDWIDTH_SHIFT 0
890*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_2_SHIFT 3
891*5113495bSYour Name #define QDF_MON_STATUS_BW_KNOWN 0x0004
892*5113495bSYour Name #define QDF_MON_STATUS_NUM_SIG_B_SYMBOLS_SHIFT 4
893*5113495bSYour Name #define QDF_MON_STATUS_SIG_B_COMPRESSION_FLAG_2_KNOWN 0x0100
894*5113495bSYour Name #define QDF_MON_STATUS_NUM_SIG_B_FLAG_2_SHIFT 9
895*5113495bSYour Name #define QDF_MON_STATUS_SIG_A_PUNC_BANDWIDTH_KNOWN 0x0400
896*5113495bSYour Name #define QDF_MON_STATUS_SIG_A_PUNC_BANDWIDTH_SHIFT 8
897*5113495bSYour Name #define QDF_MON_STATUS_CHANNEL_2_CENTER_26_RU_VALUE 0x0800
898*5113495bSYour Name #define QDF_MON_STATUS_CHANNEL_2_CENTER_26_RU_SHIFT 11
899*5113495bSYour Name #define QDF_MON_STATUS_LTF_FLAG_2_SYMBOLS_SHIFT 12
900*5113495bSYour Name #define QDF_MON_STATUS_LTF_KNOWN 0x8000
901*5113495bSYour Name
902*5113495bSYour Name /* HE radiotap per_user_1 */
903*5113495bSYour Name #define QDF_MON_STATUS_STA_SPATIAL_SHIFT 11
904*5113495bSYour Name #define QDF_MON_STATUS_TXBF_SHIFT 14
905*5113495bSYour Name #define QDF_MON_STATUS_RESERVED_SET_TO_1_SHIFT 19
906*5113495bSYour Name #define QDF_MON_STATUS_STA_CODING_SHIFT 20
907*5113495bSYour Name
908*5113495bSYour Name /* HE radiotap per_user_2 */
909*5113495bSYour Name #define QDF_MON_STATUS_STA_MCS_SHIFT 4
910*5113495bSYour Name #define QDF_MON_STATUS_STA_DCM_SHIFT 5
911*5113495bSYour Name
912*5113495bSYour Name /* HE radiotap per user known */
913*5113495bSYour Name #define QDF_MON_STATUS_USER_FIELD_POSITION_KNOWN 0x01
914*5113495bSYour Name #define QDF_MON_STATUS_STA_ID_PER_USER_KNOWN 0x02
915*5113495bSYour Name #define QDF_MON_STATUS_STA_NSTS_KNOWN 0x04
916*5113495bSYour Name #define QDF_MON_STATUS_STA_TX_BF_KNOWN 0x08
917*5113495bSYour Name #define QDF_MON_STATUS_STA_SPATIAL_CONFIG_KNOWN 0x10
918*5113495bSYour Name #define QDF_MON_STATUS_STA_MCS_KNOWN 0x20
919*5113495bSYour Name #define QDF_MON_STATUS_STA_DCM_KNOWN 0x40
920*5113495bSYour Name #define QDF_MON_STATUS_STA_CODING_KNOWN 0x80
921*5113495bSYour Name
922*5113495bSYour Name /* U-SIG Common Mask */
923*5113495bSYour Name #define QDF_MON_STATUS_USIG_PHY_VERSION_KNOWN 0x00000001
924*5113495bSYour Name #define QDF_MON_STATUS_USIG_BW_KNOWN 0x00000002
925*5113495bSYour Name #define QDF_MON_STATUS_USIG_UL_DL_KNOWN 0x00000004
926*5113495bSYour Name #define QDF_MON_STATUS_USIG_BSS_COLOR_KNOWN 0x00000008
927*5113495bSYour Name #define QDF_MON_STATUS_USIG_TXOP_KNOWN 0x00000010
928*5113495bSYour Name
929*5113495bSYour Name #define QDF_MON_STATUS_USIG_PHY_VERSION_SHIFT 12
930*5113495bSYour Name #define QDF_MON_STATUS_USIG_BW_SHIFT 15
931*5113495bSYour Name #define QDF_MON_STATUS_USIG_UL_DL_SHIFT 18
932*5113495bSYour Name #define QDF_MON_STATUS_USIG_BSS_COLOR_SHIFT 19
933*5113495bSYour Name #define QDF_MON_STATUS_USIG_TXOP_SHIFT 25
934*5113495bSYour Name
935*5113495bSYour Name /* U-SIG MU/TB Value */
936*5113495bSYour Name #define QDF_MON_STATUS_USIG_DISREGARD_SHIFT 0
937*5113495bSYour Name #define QDF_MON_STATUS_USIG_PPDU_TYPE_N_COMP_MODE_SHIFT 6
938*5113495bSYour Name #define QDF_MON_STATUS_USIG_VALIDATE_SHIFT 8
939*5113495bSYour Name
940*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_VALIDATE1_SHIFT 5
941*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_PUNCTURE_CH_INFO_SHIFT 9
942*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_VALIDATE2_SHIFT 14
943*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_EHT_SIG_MCS_SHIFT 15
944*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_NUM_EHT_SIG_SYM_SHIFT 17
945*5113495bSYour Name
946*5113495bSYour Name #define QDF_MON_STATUS_USIG_TB_SPATIAL_REUSE_1_SHIFT 9
947*5113495bSYour Name #define QDF_MON_STATUS_USIG_TB_SPATIAL_REUSE_2_SHIFT 13
948*5113495bSYour Name #define QDF_MON_STATUS_USIG_TB_DISREGARD1_SHIFT 17
949*5113495bSYour Name
950*5113495bSYour Name #define QDF_MON_STATUS_USIG_CRC_SHIFT 22
951*5113495bSYour Name #define QDF_MON_STATUS_USIG_TAIL_SHIFT 26
952*5113495bSYour Name
953*5113495bSYour Name /* U-SIG MU/TB Mask */
954*5113495bSYour Name #define QDF_MON_STATUS_USIG_DISREGARD_KNOWN 0x00000001
955*5113495bSYour Name #define QDF_MON_STATUS_USIG_PPDU_TYPE_N_COMP_MODE_KNOWN 0x00000004
956*5113495bSYour Name #define QDF_MON_STATUS_USIG_VALIDATE_KNOWN 0x00000008
957*5113495bSYour Name
958*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_VALIDATE1_KNOWN 0x00000002
959*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_PUNCTURE_CH_INFO_KNOWN 0x00000010
960*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_VALIDATE2_KNOWN 0x00000020
961*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_EHT_SIG_MCS_KNOWN 0x00000040
962*5113495bSYour Name #define QDF_MON_STATUS_USIG_MU_NUM_EHT_SIG_SYM_KNOWN 0x00000080
963*5113495bSYour Name
964*5113495bSYour Name #define QDF_MON_STATUS_USIG_TB_SPATIAL_REUSE_1_KNOWN 0x00000010
965*5113495bSYour Name #define QDF_MON_STATUS_USIG_TB_SPATIAL_REUSE_2_KNOWN 0x00000020
966*5113495bSYour Name #define QDF_MON_STATUS_USIG_TB_DISREGARD1_KNOWN 0x00000040
967*5113495bSYour Name
968*5113495bSYour Name #define QDF_MON_STATUS_USIG_CRC_KNOWN 0x00000100
969*5113495bSYour Name #define QDF_MON_STATUS_USIG_TAIL_KNOWN 0x00000200
970*5113495bSYour Name
971*5113495bSYour Name /* EHT known Mask */
972*5113495bSYour Name #define QDF_MON_STATUS_EHT_CONTENT_CH_INDEX_KNOWN 0x00000001
973*5113495bSYour Name #define QDF_MON_STATUS_EHT_SPATIAL_REUSE_KNOWN 0x00000002
974*5113495bSYour Name #define QDF_MON_STATUS_EHT_GUARD_INTERVAL_KNOWN 0x00000004
975*5113495bSYour Name #define QDF_MON_STATUS_EHT_LTF_KNOWN 0x00000008
976*5113495bSYour Name #define QDF_MON_STATUS_EHT_EHT_LTF_KNOWN 0x00000010
977*5113495bSYour Name #define QDF_MON_STATUS_EHT_LDPC_EXTRA_SYMBOL_SEG_KNOWN 0x00000020
978*5113495bSYour Name #define QDF_MON_STATUS_EHT_PRE_FEC_PADDING_FACTOR_KNOWN 0x00000040
979*5113495bSYour Name #define QDF_MON_STATUS_EHT_PE_DISAMBIGUITY_KNOWN 0x00000080
980*5113495bSYour Name #define QDF_MON_STATUS_EHT_DISREARD_KNOWN 0x00000100
981*5113495bSYour Name #define QDF_MON_STATUS_EHT_CRC1_KNOWN 0x00002000
982*5113495bSYour Name #define QDF_MON_STATUS_EHT_TAIL1_KNOWN 0x00004000
983*5113495bSYour Name #define QDF_MON_STATUS_EHT_CRC2_KNOWN 0x00008000
984*5113495bSYour Name #define QDF_MON_STATUS_EHT_TAIL2_KNOWN 0x00010000
985*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_MRU_SIZE_KNOWN 0x00400000
986*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_MRU_INDEX_KNOWN 0x00800000
987*5113495bSYour Name #define QDF_MON_STATUS_EHT_TB_RU_ALLOCATION_KNOWN 0x01000000
988*5113495bSYour Name
989*5113495bSYour Name #define QDF_MON_STATUS_EHT_NUM_NON_OFDMA_USERS_KNOWN 0x00080000
990*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_ENC_BLOCK_CRC_KNOWN 0x00100000
991*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_ENC_BLOCK_TAIL_KNOWN 0x00200000
992*5113495bSYour Name
993*5113495bSYour Name #define QDF_MON_STATUS_EHT_NDP_DISREGARD_KNOWN 0x00000200
994*5113495bSYour Name #define QDF_MON_STATUS_EHT_NDP_NSS_KNOWN 0x00020000
995*5113495bSYour Name #define QDF_MON_STATUS_EHT_NDP_BEAMFORMED_KNOWN 0x00040000
996*5113495bSYour Name
997*5113495bSYour Name #define QDF_MON_STATUS_EHT_NUM_KNOWN_RU_ALLOCATIONS_SHIFT 10
998*5113495bSYour Name
999*5113495bSYour Name /* EHT data0 Mask/SHIFT */
1000*5113495bSYour Name #define QDF_MON_STATUS_EHT_CONTENT_CH_INDEX_SHIFT 0
1001*5113495bSYour Name #define QDF_MON_STATUS_EHT_SPATIAL_REUSE_SHIFT 3
1002*5113495bSYour Name #define QDF_MON_STATUS_EHT_GI_SHIFT 7
1003*5113495bSYour Name #define QDF_MON_STATUS_EHT_LTF_SHIFT 9
1004*5113495bSYour Name #define QDF_MON_STATUS_EHT_EHT_LTF_SHIFT 11
1005*5113495bSYour Name #define QDF_MON_STATUS_EHT_LDPC_EXTRA_SYMBOL_SEG_SHIFT 14
1006*5113495bSYour Name #define QDF_MON_STATUS_EHT_PRE_FEC_PADDING_FACTOR_SHIFT 15
1007*5113495bSYour Name #define QDF_MON_STATUS_EHT_PE_DISAMBIGUITY_SHIFT 17
1008*5113495bSYour Name #define QDF_MON_STATUS_EHT_NDP_DISREGARD_SHIFT 18
1009*5113495bSYour Name #define QDF_MON_STATUS_EHT_DISREGARD_SHIFT 18
1010*5113495bSYour Name #define QDF_MON_STATUS_EHT_CRC1_SHIFT 22
1011*5113495bSYour Name #define QDF_MON_STATUS_EHT_TAIL1_SHIFT 26
1012*5113495bSYour Name
1013*5113495bSYour Name /* EHT data1 Mask/SHIFT */
1014*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_MRU_SIZE_SHIFT 0
1015*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_MRU_INDEX_SHIFT 5
1016*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD1_1_SHIFT 13
1017*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN1_1_SHIFT 22
1018*5113495bSYour Name
1019*5113495bSYour Name /* Keeping this as part of Tx Old Code
1020*5113495bSYour Name * needs refactor and cleanup later
1021*5113495bSYour Name */
1022*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOCATION1_1_SHIFT 13
1023*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOCATION1_2_SHIFT 22
1024*5113495bSYour Name
1025*5113495bSYour Name /* EHT data2 Mask/SHIFT */
1026*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD2_1_SHIFT 0
1027*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN2_1_SHIFT 9
1028*5113495bSYour Name
1029*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD1_2_SHIFT 10
1030*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN1_2_SHIFT 19
1031*5113495bSYour Name
1032*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD2_2_SHIFT 20
1033*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN2_2_SHIFT 29
1034*5113495bSYour Name
1035*5113495bSYour Name /* Keeping this as part of Tx Old Code
1036*5113495bSYour Name * needs refactor and cleanup later
1037*5113495bSYour Name */
1038*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOCATION2_1_SHIFT 0
1039*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOCATION2_2_SHIFT 9
1040*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOCATION2_3_SHIFT 18
1041*5113495bSYour Name
1042*5113495bSYour Name /* EHT data3 Mask/SHIFT */
1043*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD1_3_SHIFT 0
1044*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN1_3_SHIFT 9
1045*5113495bSYour Name
1046*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD2_3_SHIFT 10
1047*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN2_3_SHIFT 19
1048*5113495bSYour Name
1049*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD1_4_SHIFT 20
1050*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN1_4_SHIFT 29
1051*5113495bSYour Name
1052*5113495bSYour Name /* Keeping this as part of Tx Old Code
1053*5113495bSYour Name * needs refactor and cleanup later
1054*5113495bSYour Name */
1055*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOCATION2_4_SHIFT 0
1056*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOCATION2_5_SHIFT 9
1057*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOCATION2_6_SHIFT 18
1058*5113495bSYour Name
1059*5113495bSYour Name /* EHT data4 Mask/SHIFT */
1060*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD2_4_SHIFT 0
1061*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN2_4_SHIFT 9
1062*5113495bSYour Name
1063*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD1_5_SHIFT 10
1064*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN1_5_SHIFT 19
1065*5113495bSYour Name
1066*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD2_5_SHIFT 20
1067*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN2_5_SHIFT 29
1068*5113495bSYour Name
1069*5113495bSYour Name /* EHT data5 Mask/SHIFT */
1070*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD1_6_SHIFT 0
1071*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN1_6_SHIFT 9
1072*5113495bSYour Name
1073*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD2_6_SHIFT 10
1074*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN2_6_SHIFT 19
1075*5113495bSYour Name
1076*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD1_7_SHIFT 20
1077*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN1_7_SHIFT 29
1078*5113495bSYour Name
1079*5113495bSYour Name /* EHT data6 Mask/SHIFT */
1080*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD2_7_SHIFT 0
1081*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN2_7_SHIFT 9
1082*5113495bSYour Name
1083*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD1_8_SHIFT 10
1084*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN1_8_SHIFT 19
1085*5113495bSYour Name
1086*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_FIELD2_8_SHIFT 20
1087*5113495bSYour Name #define QDF_MON_STATUS_EHT_RU_ALLOC_KNOWN2_8_SHIFT 29
1088*5113495bSYour Name
1089*5113495bSYour Name /* EHT data7 Mask/SHIFT */
1090*5113495bSYour Name #define QDF_MON_STATUS_EHT_CRC2_SHIFT 0
1091*5113495bSYour Name #define QDF_MON_STATUS_EHT_TAIL2_SHIFT 4
1092*5113495bSYour Name #define QDF_MON_STATUS_EHT_NDP_NSS_SHIFT 12
1093*5113495bSYour Name #define QDF_MON_STATUS_EHT_NDP_BEAMFORMED_SHIFT 16
1094*5113495bSYour Name #define QDF_MON_STATUS_EHT_NUM_NON_OFDMA_USERS_SHIFT 17
1095*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_ENC_BLOCK_CRC_SHIFT 20
1096*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_ENC_BLOCK_TAIL_SHIFT 24
1097*5113495bSYour Name
1098*5113495bSYour Name /* EHT data8 Mask/SHIFT */
1099*5113495bSYour Name #define QDF_MON_STATUS_EHT_TB_RU_PS160_SHIFT 0
1100*5113495bSYour Name #define QDF_MON_STATUS_EHT_TB_RU_PS80_SHIFT 1
1101*5113495bSYour Name #define QDF_MON_STATUS_EHT_TB_RU_B7_B1_SHIFT 2
1102*5113495bSYour Name
1103*5113495bSYour Name /* EHT user info Mask/SHIFT */
1104*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_STA_ID_KNOWN 0x00000001
1105*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_MCS_KNOWN 0x00000002
1106*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_CODING_KNOWN 0x00000004
1107*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_RESERVED_KNOWN 0x00000008
1108*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_NSS_KNOWN 0x00000010
1109*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_BEAMFORMING_KNOWN 0x00000020
1110*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_SPATIAL_CONFIG_KNOWN 0x00000040
1111*5113495bSYour Name
1112*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_DATA_FOR_THIS_USER_SHIFT 7
1113*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_STA_ID_SHIFT 8
1114*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_CODING_SHIFT 19
1115*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_MCS_SHIFT 20
1116*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_NSS_SHIFT 24
1117*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_RESERVED_SHIFT 28
1118*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_BEAMFORMING_SHIFT 29
1119*5113495bSYour Name #define QDF_MON_STATUS_EHT_USER_SPATIAL_CONFIG_SHIFT 24
1120*5113495bSYour Name
1121*5113495bSYour Name /**
1122*5113495bSYour Name * enum qdf_proto_type - protocol type
1123*5113495bSYour Name * @QDF_PROTO_TYPE_DHCP: DHCP
1124*5113495bSYour Name * @QDF_PROTO_TYPE_EAPOL: EAPOL
1125*5113495bSYour Name * @QDF_PROTO_TYPE_ARP: ARP
1126*5113495bSYour Name * @QDF_PROTO_TYPE_MGMT: MGMT
1127*5113495bSYour Name * @QDF_PROTO_TYPE_ICMP: ICMP
1128*5113495bSYour Name * @QDF_PROTO_TYPE_ICMPv6: ICMPv6
1129*5113495bSYour Name * @QDF_PROTO_TYPE_EVENT: EVENT
1130*5113495bSYour Name * @QDF_PROTO_TYPE_DNS: DNS
1131*5113495bSYour Name * @QDF_PROTO_TYPE_MAX: Max enumeration
1132*5113495bSYour Name */
1133*5113495bSYour Name enum qdf_proto_type {
1134*5113495bSYour Name QDF_PROTO_TYPE_DHCP,
1135*5113495bSYour Name QDF_PROTO_TYPE_EAPOL,
1136*5113495bSYour Name QDF_PROTO_TYPE_ARP,
1137*5113495bSYour Name QDF_PROTO_TYPE_MGMT,
1138*5113495bSYour Name QDF_PROTO_TYPE_ICMP,
1139*5113495bSYour Name QDF_PROTO_TYPE_ICMPv6,
1140*5113495bSYour Name QDF_PROTO_TYPE_EVENT,
1141*5113495bSYour Name QDF_PROTO_TYPE_DNS,
1142*5113495bSYour Name QDF_PROTO_TYPE_MAX
1143*5113495bSYour Name };
1144*5113495bSYour Name
1145*5113495bSYour Name /**
1146*5113495bSYour Name * enum qdf_reception_type - reception type used by lithium phy TLV
1147*5113495bSYour Name * @QDF_RECEPTION_TYPE_ULOFMDA: UL OFDMA
1148*5113495bSYour Name * @QDF_RECEPTION_TYPE_ULMIMO: UL MIMO
1149*5113495bSYour Name * @QDF_RECEPTION_TYPE_FRAMELESS: Frame less
1150*5113495bSYour Name * @QDF_RECEPTION_TYPE_OTHER: All the other types
1151*5113495bSYour Name */
1152*5113495bSYour Name enum qdf_reception_type {
1153*5113495bSYour Name QDF_RECEPTION_TYPE_ULOFMDA,
1154*5113495bSYour Name QDF_RECEPTION_TYPE_ULMIMO,
1155*5113495bSYour Name QDF_RECEPTION_TYPE_OTHER,
1156*5113495bSYour Name QDF_RECEPTION_TYPE_FRAMELESS
1157*5113495bSYour Name };
1158*5113495bSYour Name
1159*5113495bSYour Name /**
1160*5113495bSYour Name * enum cb_ftype - Frame type information in skb cb
1161*5113495bSYour Name * @CB_FTYPE_INVALID: Invalid
1162*5113495bSYour Name * @CB_FTYPE_MCAST2UCAST: Multicast to Unicast converted packet
1163*5113495bSYour Name * @CB_FTYPE_TSO: TCP Segmentation Offload
1164*5113495bSYour Name * @CB_FTYPE_TSO_SG: TSO Scatter Gather
1165*5113495bSYour Name * @CB_FTYPE_SG: Scatter Gather
1166*5113495bSYour Name * @CB_FTYPE_INTRABSS_FWD: Intra BSS forwarding
1167*5113495bSYour Name * @CB_FTYPE_RX_INFO: Rx information
1168*5113495bSYour Name * @CB_FTYPE_MESH_RX_INFO: Mesh Rx information
1169*5113495bSYour Name * @CB_FTYPE_MESH_TX_INFO: Mesh Tx information
1170*5113495bSYour Name * @CB_FTYPE_DMS: Directed Multicast Service
1171*5113495bSYour Name * @CB_FTYPE_SAWF: SAWF information
1172*5113495bSYour Name * @CB_FTYPE_MLO_MCAST: MLO MCAST enable information
1173*5113495bSYour Name */
1174*5113495bSYour Name enum cb_ftype {
1175*5113495bSYour Name CB_FTYPE_INVALID = 0,
1176*5113495bSYour Name CB_FTYPE_MCAST2UCAST = 1,
1177*5113495bSYour Name CB_FTYPE_TSO = 2,
1178*5113495bSYour Name CB_FTYPE_TSO_SG = 3,
1179*5113495bSYour Name CB_FTYPE_SG = 4,
1180*5113495bSYour Name CB_FTYPE_INTRABSS_FWD = 5,
1181*5113495bSYour Name CB_FTYPE_RX_INFO = 6,
1182*5113495bSYour Name CB_FTYPE_MESH_RX_INFO = 7,
1183*5113495bSYour Name CB_FTYPE_MESH_TX_INFO = 8,
1184*5113495bSYour Name CB_FTYPE_DMS = 9,
1185*5113495bSYour Name CB_FTYPE_SAWF = 10,
1186*5113495bSYour Name CB_FTYPE_MLO_MCAST = 11,
1187*5113495bSYour Name };
1188*5113495bSYour Name
1189*5113495bSYour Name /**
1190*5113495bSYour Name * typedef qdf_nbuf_t - Platform independent packet abstraction
1191*5113495bSYour Name */
1192*5113495bSYour Name typedef __qdf_nbuf_t qdf_nbuf_t;
1193*5113495bSYour Name
1194*5113495bSYour Name /**
1195*5113495bSYour Name * typedef qdf_nbuf_shared_info_t - Platform independent shared info
1196*5113495bSYour Name */
1197*5113495bSYour Name typedef __qdf_nbuf_shared_info_t qdf_nbuf_shared_info_t;
1198*5113495bSYour Name
1199*5113495bSYour Name /**
1200*5113495bSYour Name * struct qdf_nbuf_track_t - Network buffer track structure
1201*5113495bSYour Name *
1202*5113495bSYour Name * @p_next: Pointer to next
1203*5113495bSYour Name * @net_buf: Pointer to network buffer
1204*5113495bSYour Name * @func_name: Function name
1205*5113495bSYour Name * @line_num: Line number
1206*5113495bSYour Name * @size: Size
1207*5113495bSYour Name * @map_func_name: nbuf mapping function name
1208*5113495bSYour Name * @map_line_num: mapping function line number
1209*5113495bSYour Name * @unmap_func_name: nbuf unmapping function name
1210*5113495bSYour Name * @unmap_line_num: mapping function line number
1211*5113495bSYour Name * @is_nbuf_mapped: indicate mapped/unmapped nbuf
1212*5113495bSYour Name * @time: mapping function timestamp
1213*5113495bSYour Name * @smmu_map_line_num: smmu mapping line number
1214*5113495bSYour Name * @smmu_unmap_line_num: smmu unmapping line number
1215*5113495bSYour Name * @smmu_map_func_name: smmu mapping function name
1216*5113495bSYour Name * @smmu_unmap_func_name: smmu unmapping function name
1217*5113495bSYour Name * @is_nbuf_smmu_mapped: nbuf is smmu mapped
1218*5113495bSYour Name * @smmu_map_iova_addr: nbuf smmu map virtual address
1219*5113495bSYour Name * @smmu_map_pa_addr: nbuf smmu map physical address
1220*5113495bSYour Name * @smmu_unmap_iova_addr: nbuf smmu unmap virtual address
1221*5113495bSYour Name * @smmu_unmap_pa_addr: nbuf smmu unmap physical address
1222*5113495bSYour Name */
1223*5113495bSYour Name struct qdf_nbuf_track_t {
1224*5113495bSYour Name struct qdf_nbuf_track_t *p_next;
1225*5113495bSYour Name qdf_nbuf_t net_buf;
1226*5113495bSYour Name char func_name[QDF_MEM_FUNC_NAME_SIZE];
1227*5113495bSYour Name uint32_t line_num;
1228*5113495bSYour Name size_t size;
1229*5113495bSYour Name char map_func_name[QDF_MEM_FUNC_NAME_SIZE];
1230*5113495bSYour Name uint32_t map_line_num;
1231*5113495bSYour Name char unmap_func_name[QDF_MEM_FUNC_NAME_SIZE];
1232*5113495bSYour Name uint32_t unmap_line_num;
1233*5113495bSYour Name bool is_nbuf_mapped;
1234*5113495bSYour Name qdf_time_t time;
1235*5113495bSYour Name #ifdef NBUF_SMMU_MAP_UNMAP_DEBUG
1236*5113495bSYour Name uint32_t smmu_map_line_num;
1237*5113495bSYour Name uint32_t smmu_unmap_line_num;
1238*5113495bSYour Name char smmu_map_func_name[QDF_MEM_FUNC_NAME_SIZE];
1239*5113495bSYour Name char smmu_unmap_func_name[QDF_MEM_FUNC_NAME_SIZE];
1240*5113495bSYour Name bool is_nbuf_smmu_mapped;
1241*5113495bSYour Name unsigned long smmu_map_iova_addr;
1242*5113495bSYour Name unsigned long smmu_map_pa_addr;
1243*5113495bSYour Name unsigned long smmu_unmap_iova_addr;
1244*5113495bSYour Name unsigned long smmu_unmap_pa_addr;
1245*5113495bSYour Name #endif
1246*5113495bSYour Name };
1247*5113495bSYour Name
1248*5113495bSYour Name typedef struct qdf_nbuf_track_t QDF_NBUF_TRACK;
1249*5113495bSYour Name
1250*5113495bSYour Name /**
1251*5113495bSYour Name * typedef qdf_nbuf_queue_head_t - Platform independent nbuf queue head
1252*5113495bSYour Name */
1253*5113495bSYour Name typedef __qdf_nbuf_queue_head_t qdf_nbuf_queue_head_t;
1254*5113495bSYour Name
1255*5113495bSYour Name /**
1256*5113495bSYour Name * typedef qdf_dma_map_cb_t() - Dma map callback prototype
1257*5113495bSYour Name * @arg: callback context
1258*5113495bSYour Name * @buf: netbuf
1259*5113495bSYour Name * @dmap: DMA map
1260*5113495bSYour Name */
1261*5113495bSYour Name typedef void (*qdf_dma_map_cb_t)(void *arg, qdf_nbuf_t buf,
1262*5113495bSYour Name qdf_dma_map_t dmap);
1263*5113495bSYour Name
1264*5113495bSYour Name /* BUS/DMA mapping routines */
1265*5113495bSYour Name
1266*5113495bSYour Name static inline QDF_STATUS
qdf_nbuf_dmamap_create(qdf_device_t osdev,qdf_dma_map_t * dmap)1267*5113495bSYour Name qdf_nbuf_dmamap_create(qdf_device_t osdev, qdf_dma_map_t *dmap)
1268*5113495bSYour Name {
1269*5113495bSYour Name return __qdf_nbuf_dmamap_create(osdev, dmap);
1270*5113495bSYour Name }
1271*5113495bSYour Name
1272*5113495bSYour Name static inline void
qdf_nbuf_dmamap_destroy(qdf_device_t osdev,qdf_dma_map_t dmap)1273*5113495bSYour Name qdf_nbuf_dmamap_destroy(qdf_device_t osdev, qdf_dma_map_t dmap)
1274*5113495bSYour Name {
1275*5113495bSYour Name __qdf_nbuf_dmamap_destroy(osdev, dmap);
1276*5113495bSYour Name }
1277*5113495bSYour Name
1278*5113495bSYour Name static inline void
qdf_nbuf_dmamap_set_cb(qdf_dma_map_t dmap,qdf_dma_map_cb_t cb,void * arg)1279*5113495bSYour Name qdf_nbuf_dmamap_set_cb(qdf_dma_map_t dmap, qdf_dma_map_cb_t cb, void *arg)
1280*5113495bSYour Name {
1281*5113495bSYour Name __qdf_nbuf_dmamap_set_cb(dmap, cb, arg);
1282*5113495bSYour Name }
1283*5113495bSYour Name
1284*5113495bSYour Name static inline void
qdf_nbuf_set_send_complete_flag(qdf_nbuf_t buf,bool flag)1285*5113495bSYour Name qdf_nbuf_set_send_complete_flag(qdf_nbuf_t buf, bool flag)
1286*5113495bSYour Name {
1287*5113495bSYour Name __qdf_nbuf_set_send_complete_flag(buf, flag);
1288*5113495bSYour Name }
1289*5113495bSYour Name
1290*5113495bSYour Name #define QDF_NBUF_QUEUE_WALK_SAFE(queue, var, tvar) \
1291*5113495bSYour Name __qdf_nbuf_queue_walk_safe(queue, var, tvar)
1292*5113495bSYour Name
1293*5113495bSYour Name #ifdef NBUF_MAP_UNMAP_DEBUG
1294*5113495bSYour Name /**
1295*5113495bSYour Name * qdf_nbuf_map_check_for_leaks() - check for nbuf map leaks
1296*5113495bSYour Name *
1297*5113495bSYour Name * Check for net buffers that have been mapped, but never unmapped.
1298*5113495bSYour Name *
1299*5113495bSYour Name * Returns: None
1300*5113495bSYour Name */
1301*5113495bSYour Name void qdf_nbuf_map_check_for_leaks(void);
1302*5113495bSYour Name
1303*5113495bSYour Name QDF_STATUS qdf_nbuf_map_debug(qdf_device_t osdev,
1304*5113495bSYour Name qdf_nbuf_t buf,
1305*5113495bSYour Name qdf_dma_dir_t dir,
1306*5113495bSYour Name const char *func,
1307*5113495bSYour Name uint32_t line);
1308*5113495bSYour Name
1309*5113495bSYour Name #define qdf_nbuf_map(osdev, buf, dir) \
1310*5113495bSYour Name qdf_nbuf_map_debug(osdev, buf, dir, __func__, __LINE__)
1311*5113495bSYour Name
1312*5113495bSYour Name void qdf_nbuf_unmap_debug(qdf_device_t osdev,
1313*5113495bSYour Name qdf_nbuf_t buf,
1314*5113495bSYour Name qdf_dma_dir_t dir,
1315*5113495bSYour Name const char *func,
1316*5113495bSYour Name uint32_t line);
1317*5113495bSYour Name
1318*5113495bSYour Name #define qdf_nbuf_unmap(osdev, buf, dir) \
1319*5113495bSYour Name qdf_nbuf_unmap_debug(osdev, buf, dir, __func__, __LINE__)
1320*5113495bSYour Name
1321*5113495bSYour Name QDF_STATUS qdf_nbuf_map_single_debug(qdf_device_t osdev,
1322*5113495bSYour Name qdf_nbuf_t buf,
1323*5113495bSYour Name qdf_dma_dir_t dir,
1324*5113495bSYour Name const char *func,
1325*5113495bSYour Name uint32_t line);
1326*5113495bSYour Name
1327*5113495bSYour Name #define qdf_nbuf_map_single(osdev, buf, dir) \
1328*5113495bSYour Name qdf_nbuf_map_single_debug(osdev, buf, dir, __func__, __LINE__)
1329*5113495bSYour Name
1330*5113495bSYour Name void qdf_nbuf_unmap_single_debug(qdf_device_t osdev,
1331*5113495bSYour Name qdf_nbuf_t buf,
1332*5113495bSYour Name qdf_dma_dir_t dir,
1333*5113495bSYour Name const char *func,
1334*5113495bSYour Name uint32_t line);
1335*5113495bSYour Name
1336*5113495bSYour Name #define qdf_nbuf_unmap_single(osdev, buf, dir) \
1337*5113495bSYour Name qdf_nbuf_unmap_single_debug(osdev, buf, dir, __func__, __LINE__)
1338*5113495bSYour Name
1339*5113495bSYour Name QDF_STATUS qdf_nbuf_map_nbytes_debug(qdf_device_t osdev,
1340*5113495bSYour Name qdf_nbuf_t buf,
1341*5113495bSYour Name qdf_dma_dir_t dir,
1342*5113495bSYour Name int nbytes,
1343*5113495bSYour Name const char *func,
1344*5113495bSYour Name uint32_t line);
1345*5113495bSYour Name
1346*5113495bSYour Name #define qdf_nbuf_map_nbytes(osdev, buf, dir, nbytes) \
1347*5113495bSYour Name qdf_nbuf_map_nbytes_debug(osdev, buf, dir, nbytes, __func__, __LINE__)
1348*5113495bSYour Name
1349*5113495bSYour Name void qdf_nbuf_unmap_nbytes_debug(qdf_device_t osdev,
1350*5113495bSYour Name qdf_nbuf_t buf,
1351*5113495bSYour Name qdf_dma_dir_t dir,
1352*5113495bSYour Name int nbytes,
1353*5113495bSYour Name const char *func,
1354*5113495bSYour Name uint32_t line);
1355*5113495bSYour Name
1356*5113495bSYour Name #define qdf_nbuf_unmap_nbytes(osdev, buf, dir, nbytes) \
1357*5113495bSYour Name qdf_nbuf_unmap_nbytes_debug(osdev, buf, dir, nbytes, __func__, __LINE__)
1358*5113495bSYour Name
1359*5113495bSYour Name QDF_STATUS qdf_nbuf_map_nbytes_single_debug(qdf_device_t osdev,
1360*5113495bSYour Name qdf_nbuf_t buf,
1361*5113495bSYour Name qdf_dma_dir_t dir,
1362*5113495bSYour Name int nbytes,
1363*5113495bSYour Name const char *func,
1364*5113495bSYour Name uint32_t line);
1365*5113495bSYour Name
1366*5113495bSYour Name #define qdf_nbuf_map_nbytes_single(osdev, buf, dir, nbytes) \
1367*5113495bSYour Name qdf_nbuf_map_nbytes_single_debug(osdev, buf, dir, nbytes, \
1368*5113495bSYour Name __func__, __LINE__)
1369*5113495bSYour Name
1370*5113495bSYour Name void qdf_nbuf_unmap_nbytes_single_debug(qdf_device_t osdev,
1371*5113495bSYour Name qdf_nbuf_t buf,
1372*5113495bSYour Name qdf_dma_dir_t dir,
1373*5113495bSYour Name int nbytes,
1374*5113495bSYour Name const char *func,
1375*5113495bSYour Name uint32_t line);
1376*5113495bSYour Name
1377*5113495bSYour Name #define qdf_nbuf_unmap_nbytes_single(osdev, buf, dir, nbytes) \
1378*5113495bSYour Name qdf_nbuf_unmap_nbytes_single_debug(osdev, buf, dir, nbytes, \
1379*5113495bSYour Name __func__, __LINE__)
1380*5113495bSYour Name
1381*5113495bSYour Name void qdf_nbuf_unmap_nbytes_single_paddr_debug(qdf_device_t osdev,
1382*5113495bSYour Name qdf_nbuf_t buf,
1383*5113495bSYour Name qdf_dma_addr_t phy_addr,
1384*5113495bSYour Name qdf_dma_dir_t dir, int nbytes,
1385*5113495bSYour Name const char *func, uint32_t line);
1386*5113495bSYour Name
1387*5113495bSYour Name #define qdf_nbuf_unmap_nbytes_single_paddr(osdev, buf, phy_addr, dir, nbytes) \
1388*5113495bSYour Name qdf_nbuf_unmap_nbytes_single_paddr_debug(osdev, buf, phy_addr, \
1389*5113495bSYour Name dir, nbytes, __func__, \
1390*5113495bSYour Name __LINE__)
1391*5113495bSYour Name #else /* NBUF_MAP_UNMAP_DEBUG */
1392*5113495bSYour Name
qdf_nbuf_map_check_for_leaks(void)1393*5113495bSYour Name static inline void qdf_nbuf_map_check_for_leaks(void) {}
1394*5113495bSYour Name
1395*5113495bSYour Name static inline QDF_STATUS
qdf_nbuf_map(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir)1396*5113495bSYour Name qdf_nbuf_map(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
1397*5113495bSYour Name {
1398*5113495bSYour Name return __qdf_nbuf_map(osdev, buf, dir);
1399*5113495bSYour Name }
1400*5113495bSYour Name
1401*5113495bSYour Name static inline void
qdf_nbuf_unmap(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir)1402*5113495bSYour Name qdf_nbuf_unmap(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
1403*5113495bSYour Name {
1404*5113495bSYour Name __qdf_nbuf_unmap(osdev, buf, dir);
1405*5113495bSYour Name }
1406*5113495bSYour Name
1407*5113495bSYour Name static inline QDF_STATUS
qdf_nbuf_map_single(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir)1408*5113495bSYour Name qdf_nbuf_map_single(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
1409*5113495bSYour Name {
1410*5113495bSYour Name return __qdf_nbuf_map_single(osdev, buf, dir);
1411*5113495bSYour Name }
1412*5113495bSYour Name
1413*5113495bSYour Name static inline void
qdf_nbuf_unmap_single(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir)1414*5113495bSYour Name qdf_nbuf_unmap_single(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
1415*5113495bSYour Name {
1416*5113495bSYour Name __qdf_nbuf_unmap_single(osdev, buf, dir);
1417*5113495bSYour Name }
1418*5113495bSYour Name
1419*5113495bSYour Name static inline QDF_STATUS
qdf_nbuf_map_nbytes(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir,int nbytes)1420*5113495bSYour Name qdf_nbuf_map_nbytes(qdf_device_t osdev, qdf_nbuf_t buf,
1421*5113495bSYour Name qdf_dma_dir_t dir, int nbytes)
1422*5113495bSYour Name {
1423*5113495bSYour Name return __qdf_nbuf_map_nbytes(osdev, buf, dir, nbytes);
1424*5113495bSYour Name }
1425*5113495bSYour Name
1426*5113495bSYour Name static inline void
qdf_nbuf_unmap_nbytes(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir,int nbytes)1427*5113495bSYour Name qdf_nbuf_unmap_nbytes(qdf_device_t osdev,
1428*5113495bSYour Name qdf_nbuf_t buf, qdf_dma_dir_t dir, int nbytes)
1429*5113495bSYour Name {
1430*5113495bSYour Name __qdf_nbuf_unmap_nbytes(osdev, buf, dir, nbytes);
1431*5113495bSYour Name }
1432*5113495bSYour Name
1433*5113495bSYour Name static inline QDF_STATUS
qdf_nbuf_map_nbytes_single(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir,int nbytes)1434*5113495bSYour Name qdf_nbuf_map_nbytes_single(
1435*5113495bSYour Name qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir, int nbytes)
1436*5113495bSYour Name {
1437*5113495bSYour Name return __qdf_nbuf_map_nbytes_single(osdev, buf, dir, nbytes);
1438*5113495bSYour Name }
1439*5113495bSYour Name
1440*5113495bSYour Name static inline void
qdf_nbuf_unmap_nbytes_single(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir,int nbytes)1441*5113495bSYour Name qdf_nbuf_unmap_nbytes_single(
1442*5113495bSYour Name qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir, int nbytes)
1443*5113495bSYour Name {
1444*5113495bSYour Name return __qdf_nbuf_unmap_nbytes_single(osdev, buf, dir, nbytes);
1445*5113495bSYour Name }
1446*5113495bSYour Name
1447*5113495bSYour Name static inline void
qdf_nbuf_unmap_nbytes_single_paddr(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_addr_t phy_addr,qdf_dma_dir_t dir,int nbytes)1448*5113495bSYour Name qdf_nbuf_unmap_nbytes_single_paddr(qdf_device_t osdev, qdf_nbuf_t buf,
1449*5113495bSYour Name qdf_dma_addr_t phy_addr, qdf_dma_dir_t dir,
1450*5113495bSYour Name int nbytes)
1451*5113495bSYour Name {
1452*5113495bSYour Name __qdf_record_nbuf_nbytes(__qdf_nbuf_get_end_offset(buf), dir, false);
1453*5113495bSYour Name __qdf_mem_unmap_nbytes_single(osdev, phy_addr, dir, nbytes);
1454*5113495bSYour Name }
1455*5113495bSYour Name #endif /* NBUF_MAP_UNMAP_DEBUG */
1456*5113495bSYour Name
1457*5113495bSYour Name /**
1458*5113495bSYour Name * qdf_nbuf_queue_head_dequeue() - dequeue nbuf from the head of queue
1459*5113495bSYour Name * @nbuf_queue_head: pointer to nbuf queue head
1460*5113495bSYour Name *
1461*5113495bSYour Name * Return: pointer to network buffer dequeued
1462*5113495bSYour Name */
1463*5113495bSYour Name static inline
qdf_nbuf_queue_head_dequeue(qdf_nbuf_queue_head_t * nbuf_queue_head)1464*5113495bSYour Name qdf_nbuf_t qdf_nbuf_queue_head_dequeue(qdf_nbuf_queue_head_t *nbuf_queue_head)
1465*5113495bSYour Name {
1466*5113495bSYour Name return __qdf_nbuf_queue_head_dequeue(nbuf_queue_head);
1467*5113495bSYour Name }
1468*5113495bSYour Name
1469*5113495bSYour Name /**
1470*5113495bSYour Name * qdf_nbuf_queue_head_qlen() - length of the queue
1471*5113495bSYour Name * @nbuf_queue_head: pointer to nbuf queue head
1472*5113495bSYour Name *
1473*5113495bSYour Name * Return: length of queue (number of nbufs) pointed by qdf_nbuf_queue_head_t
1474*5113495bSYour Name */
1475*5113495bSYour Name static inline
qdf_nbuf_queue_head_qlen(qdf_nbuf_queue_head_t * nbuf_queue_head)1476*5113495bSYour Name uint32_t qdf_nbuf_queue_head_qlen(qdf_nbuf_queue_head_t *nbuf_queue_head)
1477*5113495bSYour Name {
1478*5113495bSYour Name return __qdf_nbuf_queue_head_qlen(nbuf_queue_head);
1479*5113495bSYour Name }
1480*5113495bSYour Name
1481*5113495bSYour Name /**
1482*5113495bSYour Name * qdf_nbuf_queue_head_enqueue_tail() - enqueue nbuf into queue tail
1483*5113495bSYour Name * @nbuf_queue_head: pointer to nbuf queue head
1484*5113495bSYour Name * @nbuf: nbuf to be enqueued
1485*5113495bSYour Name *
1486*5113495bSYour Name * Return: None
1487*5113495bSYour Name */
1488*5113495bSYour Name static inline
qdf_nbuf_queue_head_enqueue_tail(qdf_nbuf_queue_head_t * nbuf_queue_head,qdf_nbuf_t nbuf)1489*5113495bSYour Name void qdf_nbuf_queue_head_enqueue_tail(qdf_nbuf_queue_head_t *nbuf_queue_head,
1490*5113495bSYour Name qdf_nbuf_t nbuf)
1491*5113495bSYour Name {
1492*5113495bSYour Name return __qdf_nbuf_queue_head_enqueue_tail(nbuf_queue_head, nbuf);
1493*5113495bSYour Name }
1494*5113495bSYour Name
1495*5113495bSYour Name /**
1496*5113495bSYour Name * qdf_nbuf_queue_head_init() - initialize qdf_nbuf_queue_head_t
1497*5113495bSYour Name * @nbuf_queue_head: pointer to nbuf queue head to be initialized
1498*5113495bSYour Name *
1499*5113495bSYour Name * Return: None
1500*5113495bSYour Name */
1501*5113495bSYour Name static inline
qdf_nbuf_queue_head_init(qdf_nbuf_queue_head_t * nbuf_queue_head)1502*5113495bSYour Name void qdf_nbuf_queue_head_init(qdf_nbuf_queue_head_t *nbuf_queue_head)
1503*5113495bSYour Name {
1504*5113495bSYour Name return __qdf_nbuf_queue_head_init(nbuf_queue_head);
1505*5113495bSYour Name }
1506*5113495bSYour Name
1507*5113495bSYour Name /**
1508*5113495bSYour Name * qdf_nbuf_queue_head_purge() - purge qdf_nbuf_queue_head_t
1509*5113495bSYour Name * @nbuf_queue_head: pointer to nbuf queue head to be purged
1510*5113495bSYour Name *
1511*5113495bSYour Name * Return: None
1512*5113495bSYour Name */
1513*5113495bSYour Name static inline
qdf_nbuf_queue_head_purge(qdf_nbuf_queue_head_t * nbuf_queue_head)1514*5113495bSYour Name void qdf_nbuf_queue_head_purge(qdf_nbuf_queue_head_t *nbuf_queue_head)
1515*5113495bSYour Name {
1516*5113495bSYour Name return __qdf_nbuf_queue_head_purge(nbuf_queue_head);
1517*5113495bSYour Name }
1518*5113495bSYour Name
1519*5113495bSYour Name /**
1520*5113495bSYour Name * qdf_nbuf_queue_empty() - dequeue nbuf from the head of queue
1521*5113495bSYour Name * @nbuf_queue_head: pointer to nbuf queue head
1522*5113495bSYour Name *
1523*5113495bSYour Name * Return: true if queue is empty else false
1524*5113495bSYour Name */
1525*5113495bSYour Name static inline
qdf_nbuf_queue_empty(qdf_nbuf_queue_head_t * nbuf_queue_head)1526*5113495bSYour Name int qdf_nbuf_queue_empty(qdf_nbuf_queue_head_t *nbuf_queue_head)
1527*5113495bSYour Name {
1528*5113495bSYour Name return __qdf_nbuf_queue_empty(nbuf_queue_head);
1529*5113495bSYour Name }
1530*5113495bSYour Name
1531*5113495bSYour Name /**
1532*5113495bSYour Name * qdf_nbuf_queue_head_lock() - Acquire the nbuf_queue_head lock
1533*5113495bSYour Name * @head: nbuf_queue_head of the nbuf_list for which lock is to be acquired
1534*5113495bSYour Name *
1535*5113495bSYour Name * Return: void
1536*5113495bSYour Name */
qdf_nbuf_queue_head_lock(qdf_nbuf_queue_head_t * head)1537*5113495bSYour Name static inline void qdf_nbuf_queue_head_lock(qdf_nbuf_queue_head_t *head)
1538*5113495bSYour Name {
1539*5113495bSYour Name __qdf_nbuf_queue_head_lock(head);
1540*5113495bSYour Name }
1541*5113495bSYour Name
1542*5113495bSYour Name /**
1543*5113495bSYour Name * qdf_nbuf_queue_head_unlock() - Release the nbuf queue lock
1544*5113495bSYour Name * @head: nbuf_queue_head of the nbuf_list for which lock is to be release
1545*5113495bSYour Name *
1546*5113495bSYour Name * Return: void
1547*5113495bSYour Name */
qdf_nbuf_queue_head_unlock(qdf_nbuf_queue_head_t * head)1548*5113495bSYour Name static inline void qdf_nbuf_queue_head_unlock(qdf_nbuf_queue_head_t *head)
1549*5113495bSYour Name {
1550*5113495bSYour Name __qdf_nbuf_queue_head_unlock(head);
1551*5113495bSYour Name }
1552*5113495bSYour Name
1553*5113495bSYour Name static inline void
qdf_nbuf_sync_for_cpu(qdf_device_t osdev,qdf_nbuf_t buf,qdf_dma_dir_t dir)1554*5113495bSYour Name qdf_nbuf_sync_for_cpu(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
1555*5113495bSYour Name {
1556*5113495bSYour Name __qdf_nbuf_sync_for_cpu(osdev, buf, dir);
1557*5113495bSYour Name }
1558*5113495bSYour Name
1559*5113495bSYour Name /**
1560*5113495bSYour Name * qdf_nbuf_dma_inv_range() - Invalidate the specified virtual address range
1561*5113495bSYour Name * @buf_start: start address
1562*5113495bSYour Name * @buf_end: end address
1563*5113495bSYour Name *
1564*5113495bSYour Name * Return: none
1565*5113495bSYour Name */
1566*5113495bSYour Name static inline void
qdf_nbuf_dma_inv_range(const void * buf_start,const void * buf_end)1567*5113495bSYour Name qdf_nbuf_dma_inv_range(const void *buf_start, const void *buf_end)
1568*5113495bSYour Name {
1569*5113495bSYour Name __qdf_nbuf_dma_inv_range(buf_start, buf_end);
1570*5113495bSYour Name }
1571*5113495bSYour Name
1572*5113495bSYour Name /**
1573*5113495bSYour Name * qdf_nbuf_dma_inv_range_no_dsb() - barrierless Invalidate the specified
1574*5113495bSYour Name * virtual address range
1575*5113495bSYour Name * @buf_start: start address
1576*5113495bSYour Name * @buf_end: end address
1577*5113495bSYour Name *
1578*5113495bSYour Name * Return: none
1579*5113495bSYour Name */
1580*5113495bSYour Name static inline void
qdf_nbuf_dma_inv_range_no_dsb(const void * buf_start,const void * buf_end)1581*5113495bSYour Name qdf_nbuf_dma_inv_range_no_dsb(const void *buf_start, const void *buf_end)
1582*5113495bSYour Name {
1583*5113495bSYour Name __qdf_nbuf_dma_inv_range_no_dsb(buf_start, buf_end);
1584*5113495bSYour Name }
1585*5113495bSYour Name
1586*5113495bSYour Name /**
1587*5113495bSYour Name * qdf_nbuf_dma_clean_range_no_dsb() - barrierless clean the specified
1588*5113495bSYour Name * virtual address range
1589*5113495bSYour Name * @buf_start: start address
1590*5113495bSYour Name * @buf_end: end address
1591*5113495bSYour Name *
1592*5113495bSYour Name * Return: none
1593*5113495bSYour Name */
1594*5113495bSYour Name static inline void
qdf_nbuf_dma_clean_range_no_dsb(const void * buf_start,const void * buf_end)1595*5113495bSYour Name qdf_nbuf_dma_clean_range_no_dsb(const void *buf_start, const void *buf_end)
1596*5113495bSYour Name {
1597*5113495bSYour Name __qdf_nbuf_dma_clean_range_no_dsb(buf_start, buf_end);
1598*5113495bSYour Name }
1599*5113495bSYour Name
1600*5113495bSYour Name static inline void
qdf_dsb(void)1601*5113495bSYour Name qdf_dsb(void)
1602*5113495bSYour Name {
1603*5113495bSYour Name __qdf_dsb();
1604*5113495bSYour Name }
1605*5113495bSYour Name
qdf_nbuf_get_num_frags(qdf_nbuf_t buf)1606*5113495bSYour Name static inline int qdf_nbuf_get_num_frags(qdf_nbuf_t buf)
1607*5113495bSYour Name {
1608*5113495bSYour Name return __qdf_nbuf_get_num_frags(buf);
1609*5113495bSYour Name }
1610*5113495bSYour Name
1611*5113495bSYour Name /**
1612*5113495bSYour Name * qdf_nbuf_dma_clean_range() - Clean the specified virtual address range
1613*5113495bSYour Name * @buf_start: start address
1614*5113495bSYour Name * @buf_end: end address
1615*5113495bSYour Name *
1616*5113495bSYour Name * Return: none
1617*5113495bSYour Name */
1618*5113495bSYour Name static inline void
qdf_nbuf_dma_clean_range(const void * buf_start,const void * buf_end)1619*5113495bSYour Name qdf_nbuf_dma_clean_range(const void *buf_start, const void *buf_end)
1620*5113495bSYour Name {
1621*5113495bSYour Name __qdf_nbuf_dma_clean_range(buf_start, buf_end);
1622*5113495bSYour Name }
1623*5113495bSYour Name
1624*5113495bSYour Name /**
1625*5113495bSYour Name * qdf_nbuf_get_frag_len() - get fragment length
1626*5113495bSYour Name * @buf: Network buffer
1627*5113495bSYour Name * @frag_num: Fragment number
1628*5113495bSYour Name *
1629*5113495bSYour Name * Return: Fragment length
1630*5113495bSYour Name */
qdf_nbuf_get_frag_len(qdf_nbuf_t buf,int frag_num)1631*5113495bSYour Name static inline int qdf_nbuf_get_frag_len(qdf_nbuf_t buf, int frag_num)
1632*5113495bSYour Name {
1633*5113495bSYour Name QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
1634*5113495bSYour Name return __qdf_nbuf_get_frag_len(buf, frag_num);
1635*5113495bSYour Name }
1636*5113495bSYour Name
1637*5113495bSYour Name /**
1638*5113495bSYour Name * qdf_nbuf_get_frag_vaddr() - get fragment virtual address
1639*5113495bSYour Name * @buf: Network buffer
1640*5113495bSYour Name * @frag_num: Fragment number
1641*5113495bSYour Name *
1642*5113495bSYour Name * Return: Fragment virtual address
1643*5113495bSYour Name */
qdf_nbuf_get_frag_vaddr(qdf_nbuf_t buf,int frag_num)1644*5113495bSYour Name static inline unsigned char *qdf_nbuf_get_frag_vaddr(qdf_nbuf_t buf,
1645*5113495bSYour Name int frag_num)
1646*5113495bSYour Name {
1647*5113495bSYour Name QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
1648*5113495bSYour Name return __qdf_nbuf_get_frag_vaddr(buf, frag_num);
1649*5113495bSYour Name }
1650*5113495bSYour Name
1651*5113495bSYour Name /**
1652*5113495bSYour Name * qdf_nbuf_get_frag_vaddr_always() - get fragment virtual address
1653*5113495bSYour Name * @buf: Network buffer
1654*5113495bSYour Name *
1655*5113495bSYour Name * Return: Fragment virtual address
1656*5113495bSYour Name */
1657*5113495bSYour Name static inline unsigned char *
qdf_nbuf_get_frag_vaddr_always(qdf_nbuf_t buf)1658*5113495bSYour Name qdf_nbuf_get_frag_vaddr_always(qdf_nbuf_t buf)
1659*5113495bSYour Name {
1660*5113495bSYour Name return __qdf_nbuf_get_frag_vaddr_always(buf);
1661*5113495bSYour Name }
1662*5113495bSYour Name
1663*5113495bSYour Name /**
1664*5113495bSYour Name * qdf_nbuf_get_frag_paddr() - get physical address for skb linear buffer
1665*5113495bSYour Name * or skb fragment, based on frag_num passed
1666*5113495bSYour Name * @buf: Network buffer
1667*5113495bSYour Name * @frag_num: Fragment number
1668*5113495bSYour Name *
1669*5113495bSYour Name * Return: Fragment physical address
1670*5113495bSYour Name */
qdf_nbuf_get_frag_paddr(qdf_nbuf_t buf,unsigned int frag_num)1671*5113495bSYour Name static inline qdf_dma_addr_t qdf_nbuf_get_frag_paddr(qdf_nbuf_t buf,
1672*5113495bSYour Name unsigned int frag_num)
1673*5113495bSYour Name {
1674*5113495bSYour Name QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
1675*5113495bSYour Name return __qdf_nbuf_get_frag_paddr(buf, frag_num);
1676*5113495bSYour Name }
1677*5113495bSYour Name
1678*5113495bSYour Name /**
1679*5113495bSYour Name * qdf_nbuf_get_tx_frag_paddr() - get physical address for skb fragments only
1680*5113495bSYour Name * @buf: Network buffer
1681*5113495bSYour Name *
1682*5113495bSYour Name * Return: Fragment physical address
1683*5113495bSYour Name * Usage guideline: Use “qdf_nbuf_frag_map()” to dma map the specific
1684*5113495bSYour Name * skb fragment , followed by “qdf_nbuf_get_tx_frag_paddr”
1685*5113495bSYour Name */
qdf_nbuf_get_tx_frag_paddr(qdf_nbuf_t buf)1686*5113495bSYour Name static inline qdf_dma_addr_t qdf_nbuf_get_tx_frag_paddr(qdf_nbuf_t buf)
1687*5113495bSYour Name {
1688*5113495bSYour Name return __qdf_nbuf_get_tx_frag_paddr(buf);
1689*5113495bSYour Name }
1690*5113495bSYour Name
1691*5113495bSYour Name /**
1692*5113495bSYour Name * qdf_nbuf_get_frag_is_wordstream() - is fragment wordstream
1693*5113495bSYour Name * @buf: Network buffer
1694*5113495bSYour Name * @frag_num: Fragment number
1695*5113495bSYour Name *
1696*5113495bSYour Name * Return: Fragment wordstream or not
1697*5113495bSYour Name */
qdf_nbuf_get_frag_is_wordstream(qdf_nbuf_t buf,int frag_num)1698*5113495bSYour Name static inline int qdf_nbuf_get_frag_is_wordstream(qdf_nbuf_t buf, int frag_num)
1699*5113495bSYour Name {
1700*5113495bSYour Name QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
1701*5113495bSYour Name return __qdf_nbuf_get_frag_is_wordstream(buf, frag_num);
1702*5113495bSYour Name }
1703*5113495bSYour Name
1704*5113495bSYour Name /**
1705*5113495bSYour Name * qdf_nbuf_set_frag_is_wordstream() - set fragment wordstream
1706*5113495bSYour Name * @buf: Network buffer
1707*5113495bSYour Name * @frag_num: Fragment number
1708*5113495bSYour Name * @is_wordstream: Wordstream
1709*5113495bSYour Name *
1710*5113495bSYour Name * Return: none
1711*5113495bSYour Name */
1712*5113495bSYour Name static inline void
qdf_nbuf_set_frag_is_wordstream(qdf_nbuf_t buf,int frag_num,int is_wordstream)1713*5113495bSYour Name qdf_nbuf_set_frag_is_wordstream(qdf_nbuf_t buf,
1714*5113495bSYour Name int frag_num, int is_wordstream)
1715*5113495bSYour Name {
1716*5113495bSYour Name QDF_BUG(!(frag_num >= QDF_NBUF_CB_TX_MAX_EXTRA_FRAGS));
1717*5113495bSYour Name __qdf_nbuf_set_frag_is_wordstream(buf, frag_num, is_wordstream);
1718*5113495bSYour Name }
1719*5113495bSYour Name
1720*5113495bSYour Name static inline void
qdf_nbuf_set_vdev_ctx(qdf_nbuf_t buf,uint8_t vdev_id)1721*5113495bSYour Name qdf_nbuf_set_vdev_ctx(qdf_nbuf_t buf, uint8_t vdev_id)
1722*5113495bSYour Name {
1723*5113495bSYour Name __qdf_nbuf_set_vdev_ctx(buf, vdev_id);
1724*5113495bSYour Name }
1725*5113495bSYour Name
1726*5113495bSYour Name static inline void
qdf_nbuf_set_tx_ftype(qdf_nbuf_t buf,enum cb_ftype type)1727*5113495bSYour Name qdf_nbuf_set_tx_ftype(qdf_nbuf_t buf, enum cb_ftype type)
1728*5113495bSYour Name {
1729*5113495bSYour Name __qdf_nbuf_set_tx_ftype(buf, type);
1730*5113495bSYour Name }
1731*5113495bSYour Name
1732*5113495bSYour Name static inline void
qdf_nbuf_set_rx_ftype(qdf_nbuf_t buf,enum cb_ftype type)1733*5113495bSYour Name qdf_nbuf_set_rx_ftype(qdf_nbuf_t buf, enum cb_ftype type)
1734*5113495bSYour Name {
1735*5113495bSYour Name __qdf_nbuf_set_rx_ftype(buf, type);
1736*5113495bSYour Name }
1737*5113495bSYour Name
1738*5113495bSYour Name #if defined(CONFIG_NBUF_AP_PLATFORM)
qdf_nbuf_set_vdev_xmit_type(qdf_nbuf_t buf,uint8_t type)1739*5113495bSYour Name static inline void qdf_nbuf_set_vdev_xmit_type(qdf_nbuf_t buf, uint8_t type)
1740*5113495bSYour Name {
1741*5113495bSYour Name __qdf_nbuf_set_vdev_xmit_type(buf, type);
1742*5113495bSYour Name }
1743*5113495bSYour Name
qdf_nbuf_get_vdev_xmit_type(qdf_nbuf_t buf)1744*5113495bSYour Name static inline uint8_t qdf_nbuf_get_vdev_xmit_type(qdf_nbuf_t buf)
1745*5113495bSYour Name {
1746*5113495bSYour Name return __qdf_nbuf_get_vdev_xmit_type(buf);
1747*5113495bSYour Name }
1748*5113495bSYour Name #else
qdf_nbuf_set_vdev_xmit_type(qdf_nbuf_t buf,uint8_t type)1749*5113495bSYour Name static inline void qdf_nbuf_set_vdev_xmit_type(qdf_nbuf_t buf, uint8_t type)
1750*5113495bSYour Name {
1751*5113495bSYour Name }
1752*5113495bSYour Name
qdf_nbuf_get_vdev_xmit_type(qdf_nbuf_t buf)1753*5113495bSYour Name static inline uint8_t qdf_nbuf_get_vdev_xmit_type(qdf_nbuf_t buf)
1754*5113495bSYour Name {
1755*5113495bSYour Name return 0;
1756*5113495bSYour Name }
1757*5113495bSYour Name #endif
1758*5113495bSYour Name
1759*5113495bSYour Name static inline uint8_t
qdf_nbuf_get_vdev_ctx(qdf_nbuf_t buf)1760*5113495bSYour Name qdf_nbuf_get_vdev_ctx(qdf_nbuf_t buf)
1761*5113495bSYour Name {
1762*5113495bSYour Name return __qdf_nbuf_get_vdev_ctx(buf);
1763*5113495bSYour Name }
1764*5113495bSYour Name
qdf_nbuf_get_tx_ftype(qdf_nbuf_t buf)1765*5113495bSYour Name static inline enum cb_ftype qdf_nbuf_get_tx_ftype(qdf_nbuf_t buf)
1766*5113495bSYour Name {
1767*5113495bSYour Name return __qdf_nbuf_get_tx_ftype(buf);
1768*5113495bSYour Name }
1769*5113495bSYour Name
qdf_nbuf_get_rx_ftype(qdf_nbuf_t buf)1770*5113495bSYour Name static inline enum cb_ftype qdf_nbuf_get_rx_ftype(qdf_nbuf_t buf)
1771*5113495bSYour Name {
1772*5113495bSYour Name return __qdf_nbuf_get_rx_ftype(buf);
1773*5113495bSYour Name }
1774*5113495bSYour Name
1775*5113495bSYour Name
1776*5113495bSYour Name static inline qdf_dma_addr_t
qdf_nbuf_mapped_paddr_get(qdf_nbuf_t buf)1777*5113495bSYour Name qdf_nbuf_mapped_paddr_get(qdf_nbuf_t buf)
1778*5113495bSYour Name {
1779*5113495bSYour Name return __qdf_nbuf_mapped_paddr_get(buf);
1780*5113495bSYour Name }
1781*5113495bSYour Name
1782*5113495bSYour Name static inline void
qdf_nbuf_mapped_paddr_set(qdf_nbuf_t buf,qdf_dma_addr_t paddr)1783*5113495bSYour Name qdf_nbuf_mapped_paddr_set(qdf_nbuf_t buf, qdf_dma_addr_t paddr)
1784*5113495bSYour Name {
1785*5113495bSYour Name __qdf_nbuf_mapped_paddr_set(buf, paddr);
1786*5113495bSYour Name }
1787*5113495bSYour Name
1788*5113495bSYour Name static inline void
qdf_nbuf_frag_push_head(qdf_nbuf_t buf,int frag_len,unsigned char * frag_vaddr,qdf_dma_addr_t frag_paddr)1789*5113495bSYour Name qdf_nbuf_frag_push_head(qdf_nbuf_t buf,
1790*5113495bSYour Name int frag_len, unsigned char *frag_vaddr,
1791*5113495bSYour Name qdf_dma_addr_t frag_paddr)
1792*5113495bSYour Name {
1793*5113495bSYour Name __qdf_nbuf_frag_push_head(buf, frag_len, frag_vaddr, frag_paddr);
1794*5113495bSYour Name }
1795*5113495bSYour Name
1796*5113495bSYour Name #define qdf_nbuf_num_frags_init(_nbuf) __qdf_nbuf_num_frags_init((_nbuf))
1797*5113495bSYour Name
1798*5113495bSYour Name /**
1799*5113495bSYour Name * qdf_nbuf_set_rx_chfrag_start() - set msdu start bit
1800*5113495bSYour Name * @buf: Network buffer
1801*5113495bSYour Name * @val: 0/1
1802*5113495bSYour Name *
1803*5113495bSYour Name * Return: void
1804*5113495bSYour Name */
1805*5113495bSYour Name static inline void
qdf_nbuf_set_rx_chfrag_start(qdf_nbuf_t buf,uint8_t val)1806*5113495bSYour Name qdf_nbuf_set_rx_chfrag_start(qdf_nbuf_t buf, uint8_t val)
1807*5113495bSYour Name {
1808*5113495bSYour Name __qdf_nbuf_set_rx_chfrag_start(buf, val);
1809*5113495bSYour Name }
1810*5113495bSYour Name
1811*5113495bSYour Name /**
1812*5113495bSYour Name * qdf_nbuf_is_rx_chfrag_start() - get msdu start bit
1813*5113495bSYour Name * @buf: Network buffer
1814*5113495bSYour Name *
1815*5113495bSYour Name * Return: integer value - 0/1
1816*5113495bSYour Name */
qdf_nbuf_is_rx_chfrag_start(qdf_nbuf_t buf)1817*5113495bSYour Name static inline int qdf_nbuf_is_rx_chfrag_start(qdf_nbuf_t buf)
1818*5113495bSYour Name {
1819*5113495bSYour Name return __qdf_nbuf_is_rx_chfrag_start(buf);
1820*5113495bSYour Name }
1821*5113495bSYour Name
1822*5113495bSYour Name /**
1823*5113495bSYour Name * qdf_nbuf_set_rx_chfrag_cont() - set msdu continuation bit
1824*5113495bSYour Name * @buf: Network buffer
1825*5113495bSYour Name * @val: 0/1
1826*5113495bSYour Name *
1827*5113495bSYour Name * Return: void
1828*5113495bSYour Name */
1829*5113495bSYour Name static inline void
qdf_nbuf_set_rx_chfrag_cont(qdf_nbuf_t buf,uint8_t val)1830*5113495bSYour Name qdf_nbuf_set_rx_chfrag_cont(qdf_nbuf_t buf, uint8_t val)
1831*5113495bSYour Name {
1832*5113495bSYour Name __qdf_nbuf_set_rx_chfrag_cont(buf, val);
1833*5113495bSYour Name }
1834*5113495bSYour Name
1835*5113495bSYour Name /**
1836*5113495bSYour Name * qdf_nbuf_is_rx_chfrag_cont() - get msdu continuation bit
1837*5113495bSYour Name * @buf: Network buffer
1838*5113495bSYour Name *
1839*5113495bSYour Name * Return: integer value - 0/1
1840*5113495bSYour Name */
qdf_nbuf_is_rx_chfrag_cont(qdf_nbuf_t buf)1841*5113495bSYour Name static inline int qdf_nbuf_is_rx_chfrag_cont(qdf_nbuf_t buf)
1842*5113495bSYour Name {
1843*5113495bSYour Name return __qdf_nbuf_is_rx_chfrag_cont(buf);
1844*5113495bSYour Name }
1845*5113495bSYour Name
1846*5113495bSYour Name /**
1847*5113495bSYour Name * qdf_nbuf_set_rx_chfrag_end() - set msdu end bit
1848*5113495bSYour Name * @buf: Network buffer
1849*5113495bSYour Name * @val: 0/1
1850*5113495bSYour Name *
1851*5113495bSYour Name * Return: void
1852*5113495bSYour Name */
qdf_nbuf_set_rx_chfrag_end(qdf_nbuf_t buf,uint8_t val)1853*5113495bSYour Name static inline void qdf_nbuf_set_rx_chfrag_end(qdf_nbuf_t buf, uint8_t val)
1854*5113495bSYour Name {
1855*5113495bSYour Name __qdf_nbuf_set_rx_chfrag_end(buf, val);
1856*5113495bSYour Name }
1857*5113495bSYour Name
1858*5113495bSYour Name /**
1859*5113495bSYour Name * qdf_nbuf_is_rx_chfrag_end() - set msdu end bit
1860*5113495bSYour Name * @buf: Network buffer
1861*5113495bSYour Name *
1862*5113495bSYour Name * Return: integer value - 0/1
1863*5113495bSYour Name */
qdf_nbuf_is_rx_chfrag_end(qdf_nbuf_t buf)1864*5113495bSYour Name static inline int qdf_nbuf_is_rx_chfrag_end(qdf_nbuf_t buf)
1865*5113495bSYour Name {
1866*5113495bSYour Name return __qdf_nbuf_is_rx_chfrag_end(buf);
1867*5113495bSYour Name }
1868*5113495bSYour Name
1869*5113495bSYour Name /**
1870*5113495bSYour Name * qdf_nbuf_set_da_mcbc() - set da is mcbc
1871*5113495bSYour Name * @buf: Network buffer
1872*5113495bSYour Name * @val: 0/1
1873*5113495bSYour Name *
1874*5113495bSYour Name * Return: void
1875*5113495bSYour Name */
1876*5113495bSYour Name static inline void
qdf_nbuf_set_da_mcbc(qdf_nbuf_t buf,uint8_t val)1877*5113495bSYour Name qdf_nbuf_set_da_mcbc(qdf_nbuf_t buf, uint8_t val)
1878*5113495bSYour Name {
1879*5113495bSYour Name __qdf_nbuf_set_da_mcbc(buf, val);
1880*5113495bSYour Name }
1881*5113495bSYour Name
1882*5113495bSYour Name /**
1883*5113495bSYour Name * qdf_nbuf_is_da_mcbc() - get da is mcbc bit
1884*5113495bSYour Name * @buf: Network buffer
1885*5113495bSYour Name *
1886*5113495bSYour Name * Return: integer value - 0/1
1887*5113495bSYour Name */
qdf_nbuf_is_da_mcbc(qdf_nbuf_t buf)1888*5113495bSYour Name static inline int qdf_nbuf_is_da_mcbc(qdf_nbuf_t buf)
1889*5113495bSYour Name {
1890*5113495bSYour Name return __qdf_nbuf_is_da_mcbc(buf);
1891*5113495bSYour Name }
1892*5113495bSYour Name
1893*5113495bSYour Name /**
1894*5113495bSYour Name * qdf_nbuf_set_da_valid() - set da valid bit
1895*5113495bSYour Name * @buf: Network buffer
1896*5113495bSYour Name * @val: 0/1
1897*5113495bSYour Name *
1898*5113495bSYour Name * Return: void
1899*5113495bSYour Name */
qdf_nbuf_set_da_valid(qdf_nbuf_t buf,uint8_t val)1900*5113495bSYour Name static inline void qdf_nbuf_set_da_valid(qdf_nbuf_t buf, uint8_t val)
1901*5113495bSYour Name {
1902*5113495bSYour Name __qdf_nbuf_set_da_valid(buf, val);
1903*5113495bSYour Name }
1904*5113495bSYour Name
1905*5113495bSYour Name /**
1906*5113495bSYour Name * qdf_nbuf_is_da_valid() - get da valid bit
1907*5113495bSYour Name * @buf: Network buffer
1908*5113495bSYour Name *
1909*5113495bSYour Name * Return: integer value - 0/1
1910*5113495bSYour Name */
qdf_nbuf_is_da_valid(qdf_nbuf_t buf)1911*5113495bSYour Name static inline int qdf_nbuf_is_da_valid(qdf_nbuf_t buf)
1912*5113495bSYour Name {
1913*5113495bSYour Name return __qdf_nbuf_is_da_valid(buf);
1914*5113495bSYour Name }
1915*5113495bSYour Name
1916*5113495bSYour Name /**
1917*5113495bSYour Name * qdf_nbuf_set_sa_valid() - set sa valid bit
1918*5113495bSYour Name * @buf: Network buffer
1919*5113495bSYour Name * @val: 0/1
1920*5113495bSYour Name *
1921*5113495bSYour Name * Return: void
1922*5113495bSYour Name */
qdf_nbuf_set_sa_valid(qdf_nbuf_t buf,uint8_t val)1923*5113495bSYour Name static inline void qdf_nbuf_set_sa_valid(qdf_nbuf_t buf, uint8_t val)
1924*5113495bSYour Name {
1925*5113495bSYour Name __qdf_nbuf_set_sa_valid(buf, val);
1926*5113495bSYour Name }
1927*5113495bSYour Name
1928*5113495bSYour Name /**
1929*5113495bSYour Name * qdf_nbuf_is_sa_valid() - get da valid bit
1930*5113495bSYour Name * @buf: Network buffer
1931*5113495bSYour Name *
1932*5113495bSYour Name * Return: integer value - 0/1
1933*5113495bSYour Name */
qdf_nbuf_is_sa_valid(qdf_nbuf_t buf)1934*5113495bSYour Name static inline int qdf_nbuf_is_sa_valid(qdf_nbuf_t buf)
1935*5113495bSYour Name {
1936*5113495bSYour Name return __qdf_nbuf_is_sa_valid(buf);
1937*5113495bSYour Name }
1938*5113495bSYour Name
1939*5113495bSYour Name /**
1940*5113495bSYour Name * qdf_nbuf_set_rx_retry_flag() - set rx retry flag bit
1941*5113495bSYour Name * @buf: Network buffer
1942*5113495bSYour Name * @val: 0/1
1943*5113495bSYour Name *
1944*5113495bSYour Name * Return: void
1945*5113495bSYour Name */
qdf_nbuf_set_rx_retry_flag(qdf_nbuf_t buf,uint8_t val)1946*5113495bSYour Name static inline void qdf_nbuf_set_rx_retry_flag(qdf_nbuf_t buf, uint8_t val)
1947*5113495bSYour Name {
1948*5113495bSYour Name __qdf_nbuf_set_rx_retry_flag(buf, val);
1949*5113495bSYour Name }
1950*5113495bSYour Name
1951*5113495bSYour Name /**
1952*5113495bSYour Name * qdf_nbuf_is_rx_retry_flag() - get rx retry flag bit
1953*5113495bSYour Name * @buf: Network buffer
1954*5113495bSYour Name *
1955*5113495bSYour Name * Return: integer value - 0/1
1956*5113495bSYour Name */
qdf_nbuf_is_rx_retry_flag(qdf_nbuf_t buf)1957*5113495bSYour Name static inline int qdf_nbuf_is_rx_retry_flag(qdf_nbuf_t buf)
1958*5113495bSYour Name {
1959*5113495bSYour Name return __qdf_nbuf_is_rx_retry_flag(buf);
1960*5113495bSYour Name }
1961*5113495bSYour Name
1962*5113495bSYour Name /**
1963*5113495bSYour Name * qdf_nbuf_set_raw_frame() - set raw_frame bit
1964*5113495bSYour Name * @buf: Network buffer
1965*5113495bSYour Name * @val: 0/1
1966*5113495bSYour Name *
1967*5113495bSYour Name * Return: void
1968*5113495bSYour Name */
qdf_nbuf_set_raw_frame(qdf_nbuf_t buf,uint8_t val)1969*5113495bSYour Name static inline void qdf_nbuf_set_raw_frame(qdf_nbuf_t buf, uint8_t val)
1970*5113495bSYour Name {
1971*5113495bSYour Name __qdf_nbuf_set_raw_frame(buf, val);
1972*5113495bSYour Name }
1973*5113495bSYour Name
1974*5113495bSYour Name /**
1975*5113495bSYour Name * qdf_nbuf_is_raw_frame() - get raw_frame bit
1976*5113495bSYour Name * @buf: Network buffer
1977*5113495bSYour Name *
1978*5113495bSYour Name * Return: integer value - 0/1
1979*5113495bSYour Name */
qdf_nbuf_is_raw_frame(qdf_nbuf_t buf)1980*5113495bSYour Name static inline int qdf_nbuf_is_raw_frame(qdf_nbuf_t buf)
1981*5113495bSYour Name {
1982*5113495bSYour Name return __qdf_nbuf_is_raw_frame(buf);
1983*5113495bSYour Name }
1984*5113495bSYour Name
1985*5113495bSYour Name /**
1986*5113495bSYour Name * qdf_nbuf_is_fr_ds_set() - get from DS bit
1987*5113495bSYour Name * @buf: Network buffer
1988*5113495bSYour Name *
1989*5113495bSYour Name * Return: integer value - 0/1
1990*5113495bSYour Name */
qdf_nbuf_is_fr_ds_set(qdf_nbuf_t buf)1991*5113495bSYour Name static inline int qdf_nbuf_is_fr_ds_set(qdf_nbuf_t buf)
1992*5113495bSYour Name {
1993*5113495bSYour Name return __qdf_nbuf_is_fr_ds_set(buf);
1994*5113495bSYour Name }
1995*5113495bSYour Name
1996*5113495bSYour Name /**
1997*5113495bSYour Name * qdf_nbuf_is_to_ds_set() - get to DS bit
1998*5113495bSYour Name * @buf: Network buffer
1999*5113495bSYour Name *
2000*5113495bSYour Name * Return: integer value - 0/1
2001*5113495bSYour Name */
qdf_nbuf_is_to_ds_set(qdf_nbuf_t buf)2002*5113495bSYour Name static inline int qdf_nbuf_is_to_ds_set(qdf_nbuf_t buf)
2003*5113495bSYour Name {
2004*5113495bSYour Name return __qdf_nbuf_is_to_ds_set(buf);
2005*5113495bSYour Name }
2006*5113495bSYour Name
2007*5113495bSYour Name /**
2008*5113495bSYour Name * qdf_nbuf_set_tid_val() - set tid_val
2009*5113495bSYour Name * @buf: Network buffer
2010*5113495bSYour Name * @val: 4 bits tid value
2011*5113495bSYour Name */
qdf_nbuf_set_tid_val(qdf_nbuf_t buf,uint8_t val)2012*5113495bSYour Name static inline void qdf_nbuf_set_tid_val(qdf_nbuf_t buf, uint8_t val)
2013*5113495bSYour Name {
2014*5113495bSYour Name __qdf_nbuf_set_tid_val(buf, val);
2015*5113495bSYour Name }
2016*5113495bSYour Name
2017*5113495bSYour Name /**
2018*5113495bSYour Name * qdf_nbuf_get_tid_val() - get tid_val
2019*5113495bSYour Name * @buf: Network buffer
2020*5113495bSYour Name *
2021*5113495bSYour Name * Return: integer value[4 bits tid value]
2022*5113495bSYour Name */
qdf_nbuf_get_tid_val(qdf_nbuf_t buf)2023*5113495bSYour Name static inline uint8_t qdf_nbuf_get_tid_val(qdf_nbuf_t buf)
2024*5113495bSYour Name {
2025*5113495bSYour Name return __qdf_nbuf_get_tid_val(buf);
2026*5113495bSYour Name }
2027*5113495bSYour Name
2028*5113495bSYour Name /**
2029*5113495bSYour Name * qdf_nbuf_set_is_frag() - set frag list bit
2030*5113495bSYour Name * @buf: Network buffer
2031*5113495bSYour Name * @val: 0/1
2032*5113495bSYour Name *
2033*5113495bSYour Name * Return: void
2034*5113495bSYour Name */
qdf_nbuf_set_is_frag(qdf_nbuf_t buf,uint8_t val)2035*5113495bSYour Name static inline void qdf_nbuf_set_is_frag(qdf_nbuf_t buf, uint8_t val)
2036*5113495bSYour Name {
2037*5113495bSYour Name __qdf_nbuf_set_is_frag(buf, val);
2038*5113495bSYour Name }
2039*5113495bSYour Name
2040*5113495bSYour Name /**
2041*5113495bSYour Name * qdf_nbuf_is_frag() - get da frag list bit
2042*5113495bSYour Name * @buf: Network buffer
2043*5113495bSYour Name *
2044*5113495bSYour Name * Return: integer value - 0/1
2045*5113495bSYour Name */
qdf_nbuf_is_frag(qdf_nbuf_t buf)2046*5113495bSYour Name static inline int qdf_nbuf_is_frag(qdf_nbuf_t buf)
2047*5113495bSYour Name {
2048*5113495bSYour Name return __qdf_nbuf_is_frag(buf);
2049*5113495bSYour Name }
2050*5113495bSYour Name
2051*5113495bSYour Name /**
2052*5113495bSYour Name * qdf_nbuf_set_tx_chfrag_start() - set msdu start bit
2053*5113495bSYour Name * @buf: Network buffer
2054*5113495bSYour Name * @val: 0/1
2055*5113495bSYour Name *
2056*5113495bSYour Name * Return: void
2057*5113495bSYour Name */
2058*5113495bSYour Name static inline void
qdf_nbuf_set_tx_chfrag_start(qdf_nbuf_t buf,uint8_t val)2059*5113495bSYour Name qdf_nbuf_set_tx_chfrag_start(qdf_nbuf_t buf, uint8_t val)
2060*5113495bSYour Name {
2061*5113495bSYour Name __qdf_nbuf_set_tx_chfrag_start(buf, val);
2062*5113495bSYour Name }
2063*5113495bSYour Name
2064*5113495bSYour Name /**
2065*5113495bSYour Name * qdf_nbuf_is_tx_chfrag_start() - get msdu start bit
2066*5113495bSYour Name * @buf: Network buffer
2067*5113495bSYour Name *
2068*5113495bSYour Name * Return: integer value - 0/1
2069*5113495bSYour Name */
qdf_nbuf_is_tx_chfrag_start(qdf_nbuf_t buf)2070*5113495bSYour Name static inline int qdf_nbuf_is_tx_chfrag_start(qdf_nbuf_t buf)
2071*5113495bSYour Name {
2072*5113495bSYour Name return __qdf_nbuf_is_tx_chfrag_start(buf);
2073*5113495bSYour Name }
2074*5113495bSYour Name
2075*5113495bSYour Name /**
2076*5113495bSYour Name * qdf_nbuf_set_tx_chfrag_cont() - set msdu continuation bit
2077*5113495bSYour Name * @buf: Network buffer
2078*5113495bSYour Name * @val: 0/1
2079*5113495bSYour Name *
2080*5113495bSYour Name * Return: void
2081*5113495bSYour Name */
2082*5113495bSYour Name static inline void
qdf_nbuf_set_tx_chfrag_cont(qdf_nbuf_t buf,uint8_t val)2083*5113495bSYour Name qdf_nbuf_set_tx_chfrag_cont(qdf_nbuf_t buf, uint8_t val)
2084*5113495bSYour Name {
2085*5113495bSYour Name __qdf_nbuf_set_tx_chfrag_cont(buf, val);
2086*5113495bSYour Name }
2087*5113495bSYour Name
2088*5113495bSYour Name /**
2089*5113495bSYour Name * qdf_nbuf_is_tx_chfrag_cont() - get msdu continuation bit
2090*5113495bSYour Name * @buf: Network buffer
2091*5113495bSYour Name *
2092*5113495bSYour Name * Return: integer value - 0/1
2093*5113495bSYour Name */
qdf_nbuf_is_tx_chfrag_cont(qdf_nbuf_t buf)2094*5113495bSYour Name static inline int qdf_nbuf_is_tx_chfrag_cont(qdf_nbuf_t buf)
2095*5113495bSYour Name {
2096*5113495bSYour Name return __qdf_nbuf_is_tx_chfrag_cont(buf);
2097*5113495bSYour Name }
2098*5113495bSYour Name
2099*5113495bSYour Name /**
2100*5113495bSYour Name * qdf_nbuf_set_tx_chfrag_end() - set msdu end bit
2101*5113495bSYour Name * @buf: Network buffer
2102*5113495bSYour Name * @val: 0/1
2103*5113495bSYour Name *
2104*5113495bSYour Name * Return: void
2105*5113495bSYour Name */
qdf_nbuf_set_tx_chfrag_end(qdf_nbuf_t buf,uint8_t val)2106*5113495bSYour Name static inline void qdf_nbuf_set_tx_chfrag_end(qdf_nbuf_t buf, uint8_t val)
2107*5113495bSYour Name {
2108*5113495bSYour Name __qdf_nbuf_set_tx_chfrag_end(buf, val);
2109*5113495bSYour Name }
2110*5113495bSYour Name
2111*5113495bSYour Name /**
2112*5113495bSYour Name * qdf_nbuf_is_tx_chfrag_end() - set msdu end bit
2113*5113495bSYour Name * @buf: Network buffer
2114*5113495bSYour Name *
2115*5113495bSYour Name * Return: integer value - 0/1
2116*5113495bSYour Name */
qdf_nbuf_is_tx_chfrag_end(qdf_nbuf_t buf)2117*5113495bSYour Name static inline int qdf_nbuf_is_tx_chfrag_end(qdf_nbuf_t buf)
2118*5113495bSYour Name {
2119*5113495bSYour Name return __qdf_nbuf_is_tx_chfrag_end(buf);
2120*5113495bSYour Name }
2121*5113495bSYour Name
2122*5113495bSYour Name static inline void
qdf_nbuf_dma_map_info(qdf_dma_map_t bmap,qdf_dmamap_info_t * sg)2123*5113495bSYour Name qdf_nbuf_dma_map_info(qdf_dma_map_t bmap, qdf_dmamap_info_t *sg)
2124*5113495bSYour Name {
2125*5113495bSYour Name __qdf_nbuf_dma_map_info(bmap, sg);
2126*5113495bSYour Name }
2127*5113495bSYour Name
2128*5113495bSYour Name /**
2129*5113495bSYour Name * qdf_nbuf_is_tso() - is the network buffer a jumbo packet?
2130*5113495bSYour Name * @nbuf: Network buffer
2131*5113495bSYour Name *
2132*5113495bSYour Name * Return: 1 - this is a jumbo packet 0 - not a jumbo packet
2133*5113495bSYour Name */
qdf_nbuf_is_tso(qdf_nbuf_t nbuf)2134*5113495bSYour Name static inline uint8_t qdf_nbuf_is_tso(qdf_nbuf_t nbuf)
2135*5113495bSYour Name {
2136*5113495bSYour Name return __qdf_nbuf_is_tso(nbuf);
2137*5113495bSYour Name }
2138*5113495bSYour Name
2139*5113495bSYour Name /**
2140*5113495bSYour Name * qdf_nbuf_get_users() - function to get the number of users referencing this
2141*5113495bSYour Name * network buffer
2142*5113495bSYour Name *
2143*5113495bSYour Name * @nbuf: network buffer
2144*5113495bSYour Name *
2145*5113495bSYour Name * Return: number of user references to nbuf.
2146*5113495bSYour Name */
qdf_nbuf_get_users(qdf_nbuf_t nbuf)2147*5113495bSYour Name static inline int qdf_nbuf_get_users(qdf_nbuf_t nbuf)
2148*5113495bSYour Name {
2149*5113495bSYour Name return __qdf_nbuf_get_users(nbuf);
2150*5113495bSYour Name }
2151*5113495bSYour Name
2152*5113495bSYour Name /**
2153*5113495bSYour Name * qdf_nbuf_next() - get the next packet in the linked list
2154*5113495bSYour Name * @buf: Network buffer
2155*5113495bSYour Name *
2156*5113495bSYour Name * This function can be used when nbufs are directly linked into a list,
2157*5113495bSYour Name * rather than using a separate network buffer queue object.
2158*5113495bSYour Name *
2159*5113495bSYour Name * Return: next network buffer in the linked list
2160*5113495bSYour Name */
qdf_nbuf_next(qdf_nbuf_t buf)2161*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_next(qdf_nbuf_t buf)
2162*5113495bSYour Name {
2163*5113495bSYour Name return __qdf_nbuf_next(buf);
2164*5113495bSYour Name }
2165*5113495bSYour Name
2166*5113495bSYour Name #ifdef IPA_OFFLOAD
2167*5113495bSYour Name /**
2168*5113495bSYour Name * qdf_nbuf_smmu_map_debug() - map smmu buffer
2169*5113495bSYour Name * @nbuf: network buffer
2170*5113495bSYour Name * @hdl: ipa handle
2171*5113495bSYour Name * @num_buffers: number of buffers
2172*5113495bSYour Name * @info: memory info
2173*5113495bSYour Name * @func: function name
2174*5113495bSYour Name * @line: line number
2175*5113495bSYour Name *
2176*5113495bSYour Name * Return: QDF_STATUS
2177*5113495bSYour Name */
2178*5113495bSYour Name QDF_STATUS qdf_nbuf_smmu_map_debug(qdf_nbuf_t nbuf,
2179*5113495bSYour Name uint8_t hdl,
2180*5113495bSYour Name uint8_t num_buffers,
2181*5113495bSYour Name qdf_mem_info_t *info,
2182*5113495bSYour Name const char *func,
2183*5113495bSYour Name uint32_t line);
2184*5113495bSYour Name
2185*5113495bSYour Name /**
2186*5113495bSYour Name * qdf_nbuf_smmu_unmap_debug() - unmap smmu buffer
2187*5113495bSYour Name * @nbuf: network buffer
2188*5113495bSYour Name * @hdl: ipa handle
2189*5113495bSYour Name * @num_buffers: number of buffers
2190*5113495bSYour Name * @info: memory info
2191*5113495bSYour Name * @func: function name
2192*5113495bSYour Name * @line: line number
2193*5113495bSYour Name *
2194*5113495bSYour Name * Return: QDF_STATUS
2195*5113495bSYour Name */
2196*5113495bSYour Name QDF_STATUS qdf_nbuf_smmu_unmap_debug(qdf_nbuf_t nbuf,
2197*5113495bSYour Name uint8_t hdl,
2198*5113495bSYour Name uint8_t num_buffers,
2199*5113495bSYour Name qdf_mem_info_t *info,
2200*5113495bSYour Name const char *func,
2201*5113495bSYour Name uint32_t line);
2202*5113495bSYour Name
2203*5113495bSYour Name #endif /* IPA_OFFLOAD */
2204*5113495bSYour Name
2205*5113495bSYour Name #ifdef NBUF_MEMORY_DEBUG
2206*5113495bSYour Name
2207*5113495bSYour Name #define QDF_NET_BUF_TRACK_MAX_SIZE (1024)
2208*5113495bSYour Name
2209*5113495bSYour Name enum qdf_nbuf_event_type {
2210*5113495bSYour Name QDF_NBUF_ALLOC,
2211*5113495bSYour Name QDF_NBUF_ALLOC_CLONE,
2212*5113495bSYour Name QDF_NBUF_ALLOC_COPY,
2213*5113495bSYour Name QDF_NBUF_ALLOC_FAILURE,
2214*5113495bSYour Name QDF_NBUF_FREE,
2215*5113495bSYour Name QDF_NBUF_MAP,
2216*5113495bSYour Name QDF_NBUF_UNMAP,
2217*5113495bSYour Name QDF_NBUF_ALLOC_COPY_EXPAND,
2218*5113495bSYour Name QDF_NBUF_SMMU_MAP,
2219*5113495bSYour Name QDF_NBUF_SMMU_UNMAP,
2220*5113495bSYour Name };
2221*5113495bSYour Name
2222*5113495bSYour Name /**
2223*5113495bSYour Name * qdf_net_buf_debug_init() - initialize network buffer debug functionality
2224*5113495bSYour Name *
2225*5113495bSYour Name * QDF network buffer debug feature tracks all SKBs allocated by WLAN driver
2226*5113495bSYour Name * in a hash table and when driver is unloaded it reports about leaked SKBs.
2227*5113495bSYour Name * WLAN driver module whose allocated SKB is freed by network stack are
2228*5113495bSYour Name * suppose to call qdf_net_buf_debug_release_skb() such that the SKB is not
2229*5113495bSYour Name * reported as memory leak.
2230*5113495bSYour Name *
2231*5113495bSYour Name * Return: none
2232*5113495bSYour Name */
2233*5113495bSYour Name void qdf_net_buf_debug_init(void);
2234*5113495bSYour Name
2235*5113495bSYour Name /**
2236*5113495bSYour Name * qdf_net_buf_debug_exit() - exit network buffer debug functionality
2237*5113495bSYour Name *
2238*5113495bSYour Name * Exit network buffer tracking debug functionality and log SKB memory leaks
2239*5113495bSYour Name * As part of exiting the functionality, free the leaked memory and
2240*5113495bSYour Name * cleanup the tracking buffers.
2241*5113495bSYour Name *
2242*5113495bSYour Name * Return: none
2243*5113495bSYour Name */
2244*5113495bSYour Name void qdf_net_buf_debug_exit(void);
2245*5113495bSYour Name
2246*5113495bSYour Name void qdf_net_buf_debug_clean(void);
2247*5113495bSYour Name void qdf_nbuf_history_add(qdf_nbuf_t nbuf, const char *func, uint32_t line,
2248*5113495bSYour Name enum qdf_nbuf_event_type type);
2249*5113495bSYour Name
2250*5113495bSYour Name /**
2251*5113495bSYour Name * qdf_net_buf_debug_add_node() - store skb in debug hash table
2252*5113495bSYour Name * @net_buf: network buffer
2253*5113495bSYour Name * @size: buffer size
2254*5113495bSYour Name * @func_name: function name that requests for mapping the nbuf
2255*5113495bSYour Name * @line_num: function line number
2256*5113495bSYour Name *
2257*5113495bSYour Name * Return: none
2258*5113495bSYour Name */
2259*5113495bSYour Name void qdf_net_buf_debug_add_node(qdf_nbuf_t net_buf, size_t size,
2260*5113495bSYour Name const char *func_name, uint32_t line_num);
2261*5113495bSYour Name
2262*5113495bSYour Name /**
2263*5113495bSYour Name * qdf_net_buf_debug_update_node() - update nbuf in debug hash table
2264*5113495bSYour Name * @net_buf: network buffer
2265*5113495bSYour Name * @func_name: function name that requests for mapping the nbuf
2266*5113495bSYour Name * @line_num: function line number
2267*5113495bSYour Name *
2268*5113495bSYour Name * Return: none
2269*5113495bSYour Name */
2270*5113495bSYour Name void qdf_net_buf_debug_update_node(qdf_nbuf_t net_buf, const char *func_name,
2271*5113495bSYour Name uint32_t line_num);
2272*5113495bSYour Name
2273*5113495bSYour Name /**
2274*5113495bSYour Name * qdf_net_buf_debug_delete_node() - remove skb from debug hash table
2275*5113495bSYour Name * @net_buf: network buffer
2276*5113495bSYour Name *
2277*5113495bSYour Name * Return: none
2278*5113495bSYour Name */
2279*5113495bSYour Name void qdf_net_buf_debug_delete_node(qdf_nbuf_t net_buf);
2280*5113495bSYour Name
2281*5113495bSYour Name /**
2282*5113495bSYour Name * qdf_net_buf_debug_update_map_node() - update nbuf in debug
2283*5113495bSYour Name * hash table with the mapping function info
2284*5113495bSYour Name * @net_buf: network buffer
2285*5113495bSYour Name * @func_name: function name that requests for mapping the nbuf
2286*5113495bSYour Name * @line_num: function line number
2287*5113495bSYour Name *
2288*5113495bSYour Name * Return: none
2289*5113495bSYour Name */
2290*5113495bSYour Name void qdf_net_buf_debug_update_map_node(qdf_nbuf_t net_buf,
2291*5113495bSYour Name const char *func_name,
2292*5113495bSYour Name uint32_t line_num);
2293*5113495bSYour Name
2294*5113495bSYour Name #ifdef NBUF_SMMU_MAP_UNMAP_DEBUG
2295*5113495bSYour Name /**
2296*5113495bSYour Name * qdf_nbuf_map_check_for_smmu_leaks() - check for nbuf smmu map leaks
2297*5113495bSYour Name *
2298*5113495bSYour Name * Check for net buffers that have been smmu mapped, but never smmu unmapped.
2299*5113495bSYour Name *
2300*5113495bSYour Name * Returns: None
2301*5113495bSYour Name */
2302*5113495bSYour Name void qdf_nbuf_map_check_for_smmu_leaks(void);
2303*5113495bSYour Name
2304*5113495bSYour Name /**
2305*5113495bSYour Name * qdf_net_buf_debug_update_smmu_map_node() - update nbuf in debug
2306*5113495bSYour Name * hash table with the mapping function info
2307*5113495bSYour Name * @nbuf: network buffer
2308*5113495bSYour Name * @iova: Virtual address of buffer
2309*5113495bSYour Name * @pa: Physical address of buffer
2310*5113495bSYour Name * @func: function name that requests for mapping the nbuf
2311*5113495bSYour Name * @line: function line number
2312*5113495bSYour Name *
2313*5113495bSYour Name * Return: none
2314*5113495bSYour Name */
2315*5113495bSYour Name void qdf_net_buf_debug_update_smmu_map_node(qdf_nbuf_t nbuf,
2316*5113495bSYour Name unsigned long iova,
2317*5113495bSYour Name unsigned long pa,
2318*5113495bSYour Name const char *func,
2319*5113495bSYour Name uint32_t line);
2320*5113495bSYour Name
2321*5113495bSYour Name /**
2322*5113495bSYour Name * qdf_net_buf_debug_update_smmu_unmap_node() - update nbuf in debug
2323*5113495bSYour Name * hash table with the unmapping function info
2324*5113495bSYour Name * @nbuf: network buffer
2325*5113495bSYour Name * @iova: Virtual address of buffer
2326*5113495bSYour Name * @pa: Physical address of buffer
2327*5113495bSYour Name * @func: function name that requests for unmapping the nbuf
2328*5113495bSYour Name * @line: function line number
2329*5113495bSYour Name *
2330*5113495bSYour Name * Return: none
2331*5113495bSYour Name */
2332*5113495bSYour Name void qdf_net_buf_debug_update_smmu_unmap_node(qdf_nbuf_t nbuf,
2333*5113495bSYour Name unsigned long iova,
2334*5113495bSYour Name unsigned long pa,
2335*5113495bSYour Name const char *func,
2336*5113495bSYour Name uint32_t line);
2337*5113495bSYour Name #endif /* NBUF_SMMU_MAP_UNMAP_DEBUG */
2338*5113495bSYour Name
2339*5113495bSYour Name /**
2340*5113495bSYour Name * qdf_net_buf_debug_update_unmap_node() - update nbuf in debug
2341*5113495bSYour Name * hash table with the unmap function info
2342*5113495bSYour Name * @net_buf: network buffer
2343*5113495bSYour Name * @func_name: function name that requests for unmapping the nbuf
2344*5113495bSYour Name * @line_num: function line number
2345*5113495bSYour Name *
2346*5113495bSYour Name * Return: none
2347*5113495bSYour Name */
2348*5113495bSYour Name void qdf_net_buf_debug_update_unmap_node(qdf_nbuf_t net_buf,
2349*5113495bSYour Name const char *func_name,
2350*5113495bSYour Name uint32_t line_num);
2351*5113495bSYour Name
2352*5113495bSYour Name /**
2353*5113495bSYour Name * qdf_net_buf_debug_acquire_skb() - acquire skb to avoid memory leak
2354*5113495bSYour Name * @net_buf: Network buf holding head segment (single)
2355*5113495bSYour Name * @func_name: pointer to function name
2356*5113495bSYour Name * @line_num: line number
2357*5113495bSYour Name *
2358*5113495bSYour Name * WLAN driver module's SKB which are allocated by network stack are
2359*5113495bSYour Name * suppose to call this API before freeing it such that the SKB
2360*5113495bSYour Name * is not reported as memory leak.
2361*5113495bSYour Name *
2362*5113495bSYour Name * Return: none
2363*5113495bSYour Name */
2364*5113495bSYour Name void qdf_net_buf_debug_acquire_skb(qdf_nbuf_t net_buf,
2365*5113495bSYour Name const char *func_name,
2366*5113495bSYour Name uint32_t line_num);
2367*5113495bSYour Name
2368*5113495bSYour Name /**
2369*5113495bSYour Name * qdf_net_buf_debug_release_skb() - release skb to avoid memory leak
2370*5113495bSYour Name * @net_buf: Network buf holding head segment (single)
2371*5113495bSYour Name *
2372*5113495bSYour Name * WLAN driver module whose allocated SKB is freed by network stack are
2373*5113495bSYour Name * suppose to call this API before returning SKB to network stack such
2374*5113495bSYour Name * that the SKB is not reported as memory leak.
2375*5113495bSYour Name *
2376*5113495bSYour Name * Return: none
2377*5113495bSYour Name */
2378*5113495bSYour Name void qdf_net_buf_debug_release_skb(qdf_nbuf_t net_buf);
2379*5113495bSYour Name
2380*5113495bSYour Name /* nbuf allocation routines */
2381*5113495bSYour Name
2382*5113495bSYour Name #define qdf_nbuf_alloc_simple(d, s, r, a, p) \
2383*5113495bSYour Name __qdf_nbuf_alloc_simple(d, s, __func__, __LINE__)
2384*5113495bSYour Name
2385*5113495bSYour Name #define qdf_nbuf_alloc(d, s, r, a, p) \
2386*5113495bSYour Name qdf_nbuf_alloc_debug(d, s, r, a, p, __func__, __LINE__)
2387*5113495bSYour Name
2388*5113495bSYour Name qdf_nbuf_t qdf_nbuf_alloc_debug(qdf_device_t osdev, qdf_size_t size,
2389*5113495bSYour Name int reserve, int align, int prio,
2390*5113495bSYour Name const char *func, uint32_t line);
2391*5113495bSYour Name
2392*5113495bSYour Name #define qdf_nbuf_frag_alloc(d, s, r, a, p) \
2393*5113495bSYour Name qdf_nbuf_frag_alloc_debug(d, s, r, a, p, __func__, __LINE__)
2394*5113495bSYour Name
2395*5113495bSYour Name qdf_nbuf_t qdf_nbuf_frag_alloc_debug(qdf_device_t osdev, qdf_size_t size,
2396*5113495bSYour Name int reserve, int align, int prio,
2397*5113495bSYour Name const char *func, uint32_t line);
2398*5113495bSYour Name
2399*5113495bSYour Name /**
2400*5113495bSYour Name * qdf_nbuf_alloc_no_recycler() - Allocates skb
2401*5113495bSYour Name * @size: Size to be allocated for skb
2402*5113495bSYour Name * @reserve: Reserved headroom size
2403*5113495bSYour Name * @align: Align
2404*5113495bSYour Name *
2405*5113495bSYour Name * This API allocates skb of required size and aligns if needed and reserves
2406*5113495bSYour Name * some space in the front. This skb allocation is not from skb recycler pool.
2407*5113495bSYour Name *
2408*5113495bSYour Name * Return: Allocated nbuf pointer
2409*5113495bSYour Name */
2410*5113495bSYour Name #define qdf_nbuf_alloc_no_recycler(size, reserve, align) \
2411*5113495bSYour Name qdf_nbuf_alloc_no_recycler_debug(size, reserve, align, __func__, __LINE__)
2412*5113495bSYour Name
2413*5113495bSYour Name /**
2414*5113495bSYour Name * qdf_nbuf_alloc_no_recycler_debug() - Allocates skb
2415*5113495bSYour Name * @size: Size to be allocated for skb
2416*5113495bSYour Name * @reserve: Reserved headroom size
2417*5113495bSYour Name * @align: Align
2418*5113495bSYour Name * @func: Function name of the call site
2419*5113495bSYour Name * @line: Line number of the callsite
2420*5113495bSYour Name *
2421*5113495bSYour Name * This API allocates skb of required size and aligns if needed and reserves
2422*5113495bSYour Name * some space in the front. This skb allocation is not from skb recycler pool.
2423*5113495bSYour Name *
2424*5113495bSYour Name * Return: Allocated nbuf pointer
2425*5113495bSYour Name */
2426*5113495bSYour Name qdf_nbuf_t qdf_nbuf_alloc_no_recycler_debug(size_t size, int reserve, int align,
2427*5113495bSYour Name const char *func, uint32_t line);
2428*5113495bSYour Name #define qdf_nbuf_free(d) \
2429*5113495bSYour Name qdf_nbuf_free_debug(d, __func__, __LINE__)
2430*5113495bSYour Name
2431*5113495bSYour Name void qdf_nbuf_free_debug(qdf_nbuf_t nbuf, const char *func, uint32_t line);
2432*5113495bSYour Name
2433*5113495bSYour Name #define qdf_nbuf_free_simple(d) \
2434*5113495bSYour Name qdf_nbuf_free_debug_simple(d, __func__, __LINE__)
2435*5113495bSYour Name
2436*5113495bSYour Name void qdf_nbuf_free_debug_simple(qdf_nbuf_t nbuf, const char *func,
2437*5113495bSYour Name uint32_t line);
2438*5113495bSYour Name
2439*5113495bSYour Name #define qdf_nbuf_clone(buf) \
2440*5113495bSYour Name qdf_nbuf_clone_debug(buf, __func__, __LINE__)
2441*5113495bSYour Name
2442*5113495bSYour Name /**
2443*5113495bSYour Name * qdf_nbuf_clone_debug() - clone the nbuf (copy is readonly)
2444*5113495bSYour Name * @buf: nbuf to clone from
2445*5113495bSYour Name * @func: name of the calling function
2446*5113495bSYour Name * @line: line number of the callsite
2447*5113495bSYour Name *
2448*5113495bSYour Name * This function clones the nbuf and creates a memory tracking
2449*5113495bSYour Name * node corresponding to that cloned skbuff structure.
2450*5113495bSYour Name *
2451*5113495bSYour Name * Return: cloned buffer
2452*5113495bSYour Name */
2453*5113495bSYour Name qdf_nbuf_t qdf_nbuf_clone_debug(qdf_nbuf_t buf, const char *func,
2454*5113495bSYour Name uint32_t line);
2455*5113495bSYour Name
2456*5113495bSYour Name #define qdf_nbuf_copy(buf) \
2457*5113495bSYour Name qdf_nbuf_copy_debug(buf, __func__, __LINE__)
2458*5113495bSYour Name
2459*5113495bSYour Name /**
2460*5113495bSYour Name * qdf_nbuf_copy_debug() - returns a private copy of the buf
2461*5113495bSYour Name * @buf: nbuf to copy from
2462*5113495bSYour Name * @func: name of the calling function
2463*5113495bSYour Name * @line: line number of the callsite
2464*5113495bSYour Name *
2465*5113495bSYour Name * This API returns a private copy of the buf, the buf returned is completely
2466*5113495bSYour Name * modifiable by callers. It also creates a memory tracking node corresponding
2467*5113495bSYour Name * to that new skbuff structure.
2468*5113495bSYour Name *
2469*5113495bSYour Name * Return: copied buffer
2470*5113495bSYour Name */
2471*5113495bSYour Name qdf_nbuf_t qdf_nbuf_copy_debug(qdf_nbuf_t buf, const char *func, uint32_t line);
2472*5113495bSYour Name
2473*5113495bSYour Name #define qdf_nbuf_copy_expand(buf, headroom, tailroom) \
2474*5113495bSYour Name qdf_nbuf_copy_expand_debug(buf, headroom, tailroom, __func__, __LINE__)
2475*5113495bSYour Name
2476*5113495bSYour Name /**
2477*5113495bSYour Name * qdf_nbuf_copy_expand_debug() - copy and expand nbuf
2478*5113495bSYour Name * @buf: Network buf instance
2479*5113495bSYour Name * @headroom: Additional headroom to be added
2480*5113495bSYour Name * @tailroom: Additional tailroom to be added
2481*5113495bSYour Name * @func: name of the calling function
2482*5113495bSYour Name * @line: line number of the callsite
2483*5113495bSYour Name *
2484*5113495bSYour Name * Return: New nbuf that is a copy of buf, with additional head and tailroom
2485*5113495bSYour Name * or NULL if there is no memory
2486*5113495bSYour Name */
2487*5113495bSYour Name qdf_nbuf_t
2488*5113495bSYour Name qdf_nbuf_copy_expand_debug(qdf_nbuf_t buf, int headroom, int tailroom,
2489*5113495bSYour Name const char *func, uint32_t line);
2490*5113495bSYour Name
2491*5113495bSYour Name /**
2492*5113495bSYour Name * qdf_nbuf_unshare() - make a copy of the shared nbuf
2493*5113495bSYour Name * @buf: Network buf instance
2494*5113495bSYour Name *
2495*5113495bSYour Name * Return: New nbuf which is a copy of the received nbuf if it is cloned,
2496*5113495bSYour Name * else, return the original nbuf
2497*5113495bSYour Name */
2498*5113495bSYour Name #define qdf_nbuf_unshare(buf) \
2499*5113495bSYour Name qdf_nbuf_unshare_debug(buf, __func__, __LINE__)
2500*5113495bSYour Name
2501*5113495bSYour Name qdf_nbuf_t
2502*5113495bSYour Name qdf_nbuf_unshare_debug(qdf_nbuf_t buf, const char *func_name,
2503*5113495bSYour Name uint32_t line_num);
2504*5113495bSYour Name
2505*5113495bSYour Name /**
2506*5113495bSYour Name * qdf_nbuf_dev_kfree_list() - Free nbuf list using kfree
2507*5113495bSYour Name * @buf: Pointer to network buffer head
2508*5113495bSYour Name *
2509*5113495bSYour Name * This function is called to free the nbuf list on failure cases
2510*5113495bSYour Name *
2511*5113495bSYour Name * Return: None
2512*5113495bSYour Name */
2513*5113495bSYour Name #define qdf_nbuf_dev_kfree_list(buf) \
2514*5113495bSYour Name qdf_nbuf_dev_kfree_list_debug(buf, __func__, __LINE__)
2515*5113495bSYour Name
2516*5113495bSYour Name void
2517*5113495bSYour Name qdf_nbuf_dev_kfree_list_debug(qdf_nbuf_queue_head_t *nbuf_queue_head,
2518*5113495bSYour Name const char *func_name,
2519*5113495bSYour Name uint32_t line_num);
2520*5113495bSYour Name
2521*5113495bSYour Name #define qdf_nbuf_page_frag_alloc(d, s, r, a, p) \
2522*5113495bSYour Name qdf_nbuf_page_frag_alloc_debug(d, s, r, a, p, __func__, __LINE__)
2523*5113495bSYour Name
2524*5113495bSYour Name qdf_nbuf_t
2525*5113495bSYour Name qdf_nbuf_page_frag_alloc_debug(qdf_device_t osdev, qdf_size_t size, int reserve,
2526*5113495bSYour Name int align, qdf_frag_cache_t *pf_cache,
2527*5113495bSYour Name const char *func, uint32_t line);
2528*5113495bSYour Name
2529*5113495bSYour Name /**
2530*5113495bSYour Name * qdf_nbuf_ssr_register_region() - Register nbuf history with SSR dump
2531*5113495bSYour Name *
2532*5113495bSYour Name * Return: None
2533*5113495bSYour Name */
2534*5113495bSYour Name void qdf_nbuf_ssr_register_region(void);
2535*5113495bSYour Name
2536*5113495bSYour Name /**
2537*5113495bSYour Name * qdf_nbuf_ssr_unregister_region() - Unregister nbuf history with SSR dump
2538*5113495bSYour Name *
2539*5113495bSYour Name * Return: None
2540*5113495bSYour Name */
2541*5113495bSYour Name
2542*5113495bSYour Name void qdf_nbuf_ssr_unregister_region(void);
2543*5113495bSYour Name
2544*5113495bSYour Name #else /* NBUF_MEMORY_DEBUG */
2545*5113495bSYour Name
2546*5113495bSYour Name static inline
qdf_nbuf_ssr_register_region(void)2547*5113495bSYour Name void qdf_nbuf_ssr_register_region(void)
2548*5113495bSYour Name {
2549*5113495bSYour Name }
2550*5113495bSYour Name
2551*5113495bSYour Name static inline
qdf_nbuf_ssr_unregister_region(void)2552*5113495bSYour Name void qdf_nbuf_ssr_unregister_region(void)
2553*5113495bSYour Name {
2554*5113495bSYour Name }
2555*5113495bSYour Name
qdf_net_buf_debug_init(void)2556*5113495bSYour Name static inline void qdf_net_buf_debug_init(void) {}
qdf_net_buf_debug_exit(void)2557*5113495bSYour Name static inline void qdf_net_buf_debug_exit(void) {}
2558*5113495bSYour Name
qdf_net_buf_debug_acquire_skb(qdf_nbuf_t net_buf,const char * func_name,uint32_t line_num)2559*5113495bSYour Name static inline void qdf_net_buf_debug_acquire_skb(qdf_nbuf_t net_buf,
2560*5113495bSYour Name const char *func_name,
2561*5113495bSYour Name uint32_t line_num)
2562*5113495bSYour Name {
2563*5113495bSYour Name }
2564*5113495bSYour Name
qdf_net_buf_debug_release_skb(qdf_nbuf_t net_buf)2565*5113495bSYour Name static inline void qdf_net_buf_debug_release_skb(qdf_nbuf_t net_buf)
2566*5113495bSYour Name {
2567*5113495bSYour Name }
2568*5113495bSYour Name
2569*5113495bSYour Name static inline void
qdf_net_buf_debug_update_node(qdf_nbuf_t net_buf,const char * func_name,uint32_t line_num)2570*5113495bSYour Name qdf_net_buf_debug_update_node(qdf_nbuf_t net_buf, const char *func_name,
2571*5113495bSYour Name uint32_t line_num)
2572*5113495bSYour Name {
2573*5113495bSYour Name }
2574*5113495bSYour Name
2575*5113495bSYour Name static inline void
qdf_net_buf_debug_update_map_node(qdf_nbuf_t net_buf,const char * func_name,uint32_t line_num)2576*5113495bSYour Name qdf_net_buf_debug_update_map_node(qdf_nbuf_t net_buf,
2577*5113495bSYour Name const char *func_name,
2578*5113495bSYour Name uint32_t line_num)
2579*5113495bSYour Name {
2580*5113495bSYour Name }
2581*5113495bSYour Name
2582*5113495bSYour Name static inline void
qdf_net_buf_debug_update_unmap_node(qdf_nbuf_t net_buf,const char * func_name,uint32_t line_num)2583*5113495bSYour Name qdf_net_buf_debug_update_unmap_node(qdf_nbuf_t net_buf,
2584*5113495bSYour Name const char *func_name,
2585*5113495bSYour Name uint32_t line_num)
2586*5113495bSYour Name {
2587*5113495bSYour Name }
2588*5113495bSYour Name /* Nbuf allocation routines */
2589*5113495bSYour Name
2590*5113495bSYour Name #define qdf_nbuf_alloc_simple(osdev, size, reserve, align, prio) \
2591*5113495bSYour Name qdf_nbuf_alloc_fl(osdev, size, reserve, align, prio, \
2592*5113495bSYour Name __func__, __LINE__)
2593*5113495bSYour Name
2594*5113495bSYour Name #define qdf_nbuf_alloc(osdev, size, reserve, align, prio) \
2595*5113495bSYour Name qdf_nbuf_alloc_fl(osdev, size, reserve, align, prio, \
2596*5113495bSYour Name __func__, __LINE__)
2597*5113495bSYour Name
2598*5113495bSYour Name #define qdf_nbuf_alloc_no_recycler(size, reserve, align) \
2599*5113495bSYour Name qdf_nbuf_alloc_no_recycler_fl(size, reserve, align, __func__, __LINE__)
2600*5113495bSYour Name
2601*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_alloc_fl(qdf_device_t osdev,qdf_size_t size,int reserve,int align,int prio,const char * func,uint32_t line)2602*5113495bSYour Name qdf_nbuf_alloc_fl(qdf_device_t osdev, qdf_size_t size, int reserve, int align,
2603*5113495bSYour Name int prio, const char *func, uint32_t line)
2604*5113495bSYour Name {
2605*5113495bSYour Name return __qdf_nbuf_alloc(osdev, size, reserve, align, prio, func, line);
2606*5113495bSYour Name }
2607*5113495bSYour Name
2608*5113495bSYour Name #define qdf_nbuf_frag_alloc(osdev, size, reserve, align, prio) \
2609*5113495bSYour Name qdf_nbuf_frag_alloc_fl(osdev, size, reserve, align, prio, \
2610*5113495bSYour Name __func__, __LINE__)
2611*5113495bSYour Name
2612*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_frag_alloc_fl(qdf_device_t osdev,qdf_size_t size,int reserve,int align,int prio,const char * func,uint32_t line)2613*5113495bSYour Name qdf_nbuf_frag_alloc_fl(qdf_device_t osdev, qdf_size_t size, int reserve,
2614*5113495bSYour Name int align, int prio, const char *func, uint32_t line)
2615*5113495bSYour Name {
2616*5113495bSYour Name return __qdf_nbuf_frag_alloc(osdev, size, reserve, align, prio,
2617*5113495bSYour Name func, line);
2618*5113495bSYour Name }
2619*5113495bSYour Name
2620*5113495bSYour Name /**
2621*5113495bSYour Name * qdf_nbuf_alloc_no_recycler_fl() - Allocate SKB
2622*5113495bSYour Name * @size: Size to be allocated for skb
2623*5113495bSYour Name * @reserve: Reserved headroom size
2624*5113495bSYour Name * @align: Align
2625*5113495bSYour Name * @func: Function name of the call site
2626*5113495bSYour Name * @line: Line number of the callsite
2627*5113495bSYour Name *
2628*5113495bSYour Name * This API allocates skb of required size and aligns if needed and reserves
2629*5113495bSYour Name * some space in the front. This skb allocation is not from skb recycler pool.
2630*5113495bSYour Name *
2631*5113495bSYour Name * Return: Allocated nbuf pointer
2632*5113495bSYour Name */
2633*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_alloc_no_recycler_fl(size_t size,int reserve,int align,const char * func,uint32_t line)2634*5113495bSYour Name qdf_nbuf_alloc_no_recycler_fl(size_t size, int reserve, int align,
2635*5113495bSYour Name const char *func, uint32_t line)
2636*5113495bSYour Name {
2637*5113495bSYour Name return __qdf_nbuf_alloc_no_recycler(size, reserve, align, func, line);
2638*5113495bSYour Name }
2639*5113495bSYour Name
2640*5113495bSYour Name #define qdf_nbuf_free_simple(d) qdf_nbuf_free(d)
2641*5113495bSYour Name
qdf_nbuf_free(qdf_nbuf_t buf)2642*5113495bSYour Name static inline void qdf_nbuf_free(qdf_nbuf_t buf)
2643*5113495bSYour Name {
2644*5113495bSYour Name if (qdf_likely(buf))
2645*5113495bSYour Name __qdf_nbuf_free(buf);
2646*5113495bSYour Name }
2647*5113495bSYour Name
2648*5113495bSYour Name /**
2649*5113495bSYour Name * qdf_nbuf_clone() - clone the nbuf (copy is readonly)
2650*5113495bSYour Name * @buf: Pointer to network buffer
2651*5113495bSYour Name *
2652*5113495bSYour Name * This function clones the nbuf and returns new sk_buff
2653*5113495bSYour Name * structure.
2654*5113495bSYour Name *
2655*5113495bSYour Name * Return: cloned skb
2656*5113495bSYour Name */
qdf_nbuf_clone(qdf_nbuf_t buf)2657*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_clone(qdf_nbuf_t buf)
2658*5113495bSYour Name {
2659*5113495bSYour Name return __qdf_nbuf_clone(buf);
2660*5113495bSYour Name }
2661*5113495bSYour Name
2662*5113495bSYour Name /**
2663*5113495bSYour Name * qdf_nbuf_copy() - returns a private copy of the buf
2664*5113495bSYour Name * @buf: Pointer to network buffer
2665*5113495bSYour Name *
2666*5113495bSYour Name * This API returns a private copy of the buf, the buf returned is completely
2667*5113495bSYour Name * modifiable by callers
2668*5113495bSYour Name *
2669*5113495bSYour Name * Return: skb or NULL
2670*5113495bSYour Name */
qdf_nbuf_copy(qdf_nbuf_t buf)2671*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_copy(qdf_nbuf_t buf)
2672*5113495bSYour Name {
2673*5113495bSYour Name return __qdf_nbuf_copy(buf);
2674*5113495bSYour Name }
2675*5113495bSYour Name
2676*5113495bSYour Name /**
2677*5113495bSYour Name * qdf_nbuf_copy_expand() - copy and expand nbuf
2678*5113495bSYour Name * @buf: Network buf instance
2679*5113495bSYour Name * @headroom: Additional headroom to be added
2680*5113495bSYour Name * @tailroom: Additional tailroom to be added
2681*5113495bSYour Name *
2682*5113495bSYour Name * Return: New nbuf that is a copy of buf, with additional head and tailroom
2683*5113495bSYour Name * or NULL if there is no memory
2684*5113495bSYour Name */
qdf_nbuf_copy_expand(qdf_nbuf_t buf,int headroom,int tailroom)2685*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_copy_expand(qdf_nbuf_t buf, int headroom,
2686*5113495bSYour Name int tailroom)
2687*5113495bSYour Name {
2688*5113495bSYour Name return __qdf_nbuf_copy_expand(buf, headroom, tailroom);
2689*5113495bSYour Name }
2690*5113495bSYour Name
qdf_nbuf_unshare(qdf_nbuf_t buf)2691*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_unshare(qdf_nbuf_t buf)
2692*5113495bSYour Name {
2693*5113495bSYour Name return __qdf_nbuf_unshare(buf);
2694*5113495bSYour Name }
2695*5113495bSYour Name
2696*5113495bSYour Name /**
2697*5113495bSYour Name * qdf_nbuf_dev_kfree_list() - Free nbuf list using kfree
2698*5113495bSYour Name * @nbuf_queue_head: Pointer to buffer list head
2699*5113495bSYour Name *
2700*5113495bSYour Name * This function is called to free the nbuf list on failure cases
2701*5113495bSYour Name *
2702*5113495bSYour Name * Return: None
2703*5113495bSYour Name */
2704*5113495bSYour Name static inline void
qdf_nbuf_dev_kfree_list(qdf_nbuf_queue_head_t * nbuf_queue_head)2705*5113495bSYour Name qdf_nbuf_dev_kfree_list(qdf_nbuf_queue_head_t *nbuf_queue_head)
2706*5113495bSYour Name {
2707*5113495bSYour Name __qdf_nbuf_dev_kfree_list(nbuf_queue_head);
2708*5113495bSYour Name }
2709*5113495bSYour Name
2710*5113495bSYour Name #define qdf_nbuf_page_frag_alloc(osdev, size, reserve, align, pf_cache) \
2711*5113495bSYour Name qdf_nbuf_page_frag_alloc_fl(osdev, size, reserve, align, pf_cache, \
2712*5113495bSYour Name __func__, __LINE__)
2713*5113495bSYour Name
2714*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_page_frag_alloc_fl(qdf_device_t osdev,qdf_size_t size,int reserve,int align,qdf_frag_cache_t * pf_cache,const char * func,uint32_t line)2715*5113495bSYour Name qdf_nbuf_page_frag_alloc_fl(qdf_device_t osdev, qdf_size_t size, int reserve,
2716*5113495bSYour Name int align, qdf_frag_cache_t *pf_cache,
2717*5113495bSYour Name const char *func, uint32_t line)
2718*5113495bSYour Name {
2719*5113495bSYour Name return __qdf_nbuf_page_frag_alloc(osdev, size, reserve, align, pf_cache,
2720*5113495bSYour Name func, line);
2721*5113495bSYour Name }
2722*5113495bSYour Name #endif /* NBUF_MEMORY_DEBUG */
2723*5113495bSYour Name
2724*5113495bSYour Name #if defined(QCA_DP_NBUF_FAST_PPEDS)
2725*5113495bSYour Name #define qdf_nbuf_alloc_ppe_ds(d, s, r, a, p) \
2726*5113495bSYour Name __qdf_nbuf_alloc_ppe_ds(d, s, __func__, __LINE__)
2727*5113495bSYour Name #endif /* QCA_DP_NBUF_FAST_PPEDS */
2728*5113495bSYour Name
2729*5113495bSYour Name /**
2730*5113495bSYour Name * qdf_nbuf_dev_queue_head() - Queue a buffer at the list head
2731*5113495bSYour Name * @nbuf_queue_head: Pointer to buffer list head
2732*5113495bSYour Name * @buf: Pointer to network buffer head
2733*5113495bSYour Name *
2734*5113495bSYour Name * This function is called to queue a buffer at the list head
2735*5113495bSYour Name *
2736*5113495bSYour Name * Return: None
2737*5113495bSYour Name */
2738*5113495bSYour Name static inline void
qdf_nbuf_dev_queue_head(qdf_nbuf_queue_head_t * nbuf_queue_head,qdf_nbuf_t buf)2739*5113495bSYour Name qdf_nbuf_dev_queue_head(qdf_nbuf_queue_head_t *nbuf_queue_head,
2740*5113495bSYour Name qdf_nbuf_t buf)
2741*5113495bSYour Name {
2742*5113495bSYour Name __qdf_nbuf_dev_queue_head(nbuf_queue_head, buf);
2743*5113495bSYour Name }
2744*5113495bSYour Name
2745*5113495bSYour Name /**
2746*5113495bSYour Name * qdf_nbuf_kfree() - Free nbuf using kfree
2747*5113495bSYour Name * @buf: Pointer to network buffer
2748*5113495bSYour Name *
2749*5113495bSYour Name * This function is called to free the skb on failure cases
2750*5113495bSYour Name *
2751*5113495bSYour Name * Return: None
2752*5113495bSYour Name */
qdf_nbuf_kfree(qdf_nbuf_t buf)2753*5113495bSYour Name static inline void qdf_nbuf_kfree(qdf_nbuf_t buf)
2754*5113495bSYour Name {
2755*5113495bSYour Name __qdf_nbuf_kfree(buf);
2756*5113495bSYour Name }
2757*5113495bSYour Name
2758*5113495bSYour Name /**
2759*5113495bSYour Name * qdf_nbuf_dev_kfree() - Free nbuf using dev based os call
2760*5113495bSYour Name * @buf: Pointer to network buffer
2761*5113495bSYour Name *
2762*5113495bSYour Name * This function is called to free the skb on failure cases
2763*5113495bSYour Name *
2764*5113495bSYour Name * Return: None
2765*5113495bSYour Name */
qdf_nbuf_dev_kfree(qdf_nbuf_t buf)2766*5113495bSYour Name static inline void qdf_nbuf_dev_kfree(qdf_nbuf_t buf)
2767*5113495bSYour Name {
2768*5113495bSYour Name __qdf_nbuf_dev_kfree(buf);
2769*5113495bSYour Name }
2770*5113495bSYour Name
2771*5113495bSYour Name /**
2772*5113495bSYour Name * qdf_nbuf_copy_expand_fraglist() - copy and expand nbuf and
2773*5113495bSYour Name * get reference of the fraglist.
2774*5113495bSYour Name * @buf: Network buf instance
2775*5113495bSYour Name * @headroom: Additional headroom to be added
2776*5113495bSYour Name * @tailroom: Additional tailroom to be added
2777*5113495bSYour Name *
2778*5113495bSYour Name * Return: New nbuf that is a copy of buf, with additional head and tailroom
2779*5113495bSYour Name * or NULL if there is no memory
2780*5113495bSYour Name */
2781*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_copy_expand_fraglist(qdf_nbuf_t buf,int headroom,int tailroom)2782*5113495bSYour Name qdf_nbuf_copy_expand_fraglist(qdf_nbuf_t buf, int headroom,
2783*5113495bSYour Name int tailroom)
2784*5113495bSYour Name {
2785*5113495bSYour Name buf = qdf_nbuf_copy_expand(buf, headroom, tailroom);
2786*5113495bSYour Name
2787*5113495bSYour Name /* get fraglist reference */
2788*5113495bSYour Name if (buf)
2789*5113495bSYour Name __qdf_nbuf_get_ref_fraglist(buf);
2790*5113495bSYour Name
2791*5113495bSYour Name return buf;
2792*5113495bSYour Name }
2793*5113495bSYour Name
2794*5113495bSYour Name #ifdef WLAN_FEATURE_FASTPATH
2795*5113495bSYour Name /**
2796*5113495bSYour Name * qdf_nbuf_init_fast() - before put buf into pool,turn it to init state
2797*5113495bSYour Name * @nbuf: buf instance
2798*5113495bSYour Name *
2799*5113495bSYour Name * Return: data pointer of this buf where new data has to be
2800*5113495bSYour Name * put, or NULL if there is not enough room in this buf.
2801*5113495bSYour Name */
2802*5113495bSYour Name void qdf_nbuf_init_fast(qdf_nbuf_t nbuf);
2803*5113495bSYour Name #endif /* WLAN_FEATURE_FASTPATH */
2804*5113495bSYour Name
2805*5113495bSYour Name /**
2806*5113495bSYour Name * qdf_nbuf_list_free() - free a list of nbufs
2807*5113495bSYour Name * @buf_list: A list of nbufs to be freed
2808*5113495bSYour Name *
2809*5113495bSYour Name * Return: none
2810*5113495bSYour Name */
qdf_nbuf_list_free(qdf_nbuf_t buf_list)2811*5113495bSYour Name static inline void qdf_nbuf_list_free(qdf_nbuf_t buf_list)
2812*5113495bSYour Name {
2813*5113495bSYour Name while (buf_list) {
2814*5113495bSYour Name qdf_nbuf_t next = qdf_nbuf_next(buf_list);
2815*5113495bSYour Name qdf_nbuf_free(buf_list);
2816*5113495bSYour Name buf_list = next;
2817*5113495bSYour Name }
2818*5113495bSYour Name }
2819*5113495bSYour Name
qdf_nbuf_tx_free(qdf_nbuf_t buf_list,int tx_err)2820*5113495bSYour Name static inline void qdf_nbuf_tx_free(qdf_nbuf_t buf_list, int tx_err)
2821*5113495bSYour Name {
2822*5113495bSYour Name qdf_nbuf_list_free(buf_list);
2823*5113495bSYour Name }
2824*5113495bSYour Name
qdf_nbuf_ref(qdf_nbuf_t buf)2825*5113495bSYour Name static inline void qdf_nbuf_ref(qdf_nbuf_t buf)
2826*5113495bSYour Name {
2827*5113495bSYour Name __qdf_nbuf_ref(buf);
2828*5113495bSYour Name }
2829*5113495bSYour Name
qdf_nbuf_shared(qdf_nbuf_t buf)2830*5113495bSYour Name static inline int qdf_nbuf_shared(qdf_nbuf_t buf)
2831*5113495bSYour Name {
2832*5113495bSYour Name return __qdf_nbuf_shared(buf);
2833*5113495bSYour Name }
2834*5113495bSYour Name
qdf_nbuf_cat(qdf_nbuf_t dst,qdf_nbuf_t src)2835*5113495bSYour Name static inline QDF_STATUS qdf_nbuf_cat(qdf_nbuf_t dst, qdf_nbuf_t src)
2836*5113495bSYour Name {
2837*5113495bSYour Name return __qdf_nbuf_cat(dst, src);
2838*5113495bSYour Name }
2839*5113495bSYour Name
2840*5113495bSYour Name /**
2841*5113495bSYour Name * qdf_nbuf_copy_bits() - return the length of the copy bits for skb
2842*5113495bSYour Name * @nbuf: netbuf
2843*5113495bSYour Name * @offset: offset
2844*5113495bSYour Name * @len: Length
2845*5113495bSYour Name * @to: To
2846*5113495bSYour Name *
2847*5113495bSYour Name * Return: int32_t
2848*5113495bSYour Name */
2849*5113495bSYour Name static inline int32_t
qdf_nbuf_copy_bits(qdf_nbuf_t nbuf,uint32_t offset,uint32_t len,void * to)2850*5113495bSYour Name qdf_nbuf_copy_bits(qdf_nbuf_t nbuf, uint32_t offset, uint32_t len, void *to)
2851*5113495bSYour Name {
2852*5113495bSYour Name return __qdf_nbuf_copy_bits(nbuf, offset, len, to);
2853*5113495bSYour Name }
2854*5113495bSYour Name
2855*5113495bSYour Name
2856*5113495bSYour Name /* nbuf manipulation routines */
2857*5113495bSYour Name
2858*5113495bSYour Name /**
2859*5113495bSYour Name * qdf_nbuf_head() - return the address of an nbuf's buffer
2860*5113495bSYour Name * @buf: netbuf
2861*5113495bSYour Name *
2862*5113495bSYour Name * Return: head address
2863*5113495bSYour Name */
qdf_nbuf_head(qdf_nbuf_t buf)2864*5113495bSYour Name static inline uint8_t *qdf_nbuf_head(qdf_nbuf_t buf)
2865*5113495bSYour Name {
2866*5113495bSYour Name return __qdf_nbuf_head(buf);
2867*5113495bSYour Name }
2868*5113495bSYour Name
2869*5113495bSYour Name /**
2870*5113495bSYour Name * qdf_nbuf_data() - Return the address of the start of data within an nbuf
2871*5113495bSYour Name * @buf: Network buffer
2872*5113495bSYour Name *
2873*5113495bSYour Name * Return: Data address
2874*5113495bSYour Name */
qdf_nbuf_data(qdf_nbuf_t buf)2875*5113495bSYour Name static inline uint8_t *qdf_nbuf_data(qdf_nbuf_t buf)
2876*5113495bSYour Name {
2877*5113495bSYour Name return __qdf_nbuf_data(buf);
2878*5113495bSYour Name }
2879*5113495bSYour Name
2880*5113495bSYour Name /**
2881*5113495bSYour Name * qdf_nbuf_data_addr() - Return the address of skb->data
2882*5113495bSYour Name * @buf: Network buffer
2883*5113495bSYour Name *
2884*5113495bSYour Name * Return: Data address
2885*5113495bSYour Name */
qdf_nbuf_data_addr(qdf_nbuf_t buf)2886*5113495bSYour Name static inline uint8_t *qdf_nbuf_data_addr(qdf_nbuf_t buf)
2887*5113495bSYour Name {
2888*5113495bSYour Name return __qdf_nbuf_data_addr(buf);
2889*5113495bSYour Name }
2890*5113495bSYour Name
2891*5113495bSYour Name /**
2892*5113495bSYour Name * qdf_nbuf_headroom() - amount of headroom int the current nbuf
2893*5113495bSYour Name * @buf: Network buffer
2894*5113495bSYour Name *
2895*5113495bSYour Name * Return: Amount of head room
2896*5113495bSYour Name */
qdf_nbuf_headroom(qdf_nbuf_t buf)2897*5113495bSYour Name static inline uint32_t qdf_nbuf_headroom(qdf_nbuf_t buf)
2898*5113495bSYour Name {
2899*5113495bSYour Name return __qdf_nbuf_headroom(buf);
2900*5113495bSYour Name }
2901*5113495bSYour Name
2902*5113495bSYour Name /**
2903*5113495bSYour Name * qdf_nbuf_tailroom() - amount of tail space available
2904*5113495bSYour Name * @buf: Network buffer
2905*5113495bSYour Name *
2906*5113495bSYour Name * Return: amount of tail room
2907*5113495bSYour Name */
qdf_nbuf_tailroom(qdf_nbuf_t buf)2908*5113495bSYour Name static inline uint32_t qdf_nbuf_tailroom(qdf_nbuf_t buf)
2909*5113495bSYour Name {
2910*5113495bSYour Name return __qdf_nbuf_tailroom(buf);
2911*5113495bSYour Name }
2912*5113495bSYour Name
2913*5113495bSYour Name /**
2914*5113495bSYour Name * qdf_nbuf_push_head() - push data in the front
2915*5113495bSYour Name * @buf: Network buf instance
2916*5113495bSYour Name * @size: Size to be pushed
2917*5113495bSYour Name *
2918*5113495bSYour Name * Return: New data pointer of this buf after data has been pushed,
2919*5113495bSYour Name * or NULL if there is not enough room in this buf.
2920*5113495bSYour Name */
qdf_nbuf_push_head(qdf_nbuf_t buf,qdf_size_t size)2921*5113495bSYour Name static inline uint8_t *qdf_nbuf_push_head(qdf_nbuf_t buf, qdf_size_t size)
2922*5113495bSYour Name {
2923*5113495bSYour Name return __qdf_nbuf_push_head(buf, size);
2924*5113495bSYour Name }
2925*5113495bSYour Name
2926*5113495bSYour Name /**
2927*5113495bSYour Name * qdf_nbuf_put_tail() - puts data in the end
2928*5113495bSYour Name * @buf: Network buf instance
2929*5113495bSYour Name * @size: Size to be pushed
2930*5113495bSYour Name *
2931*5113495bSYour Name * Return: Data pointer of this buf where new data has to be
2932*5113495bSYour Name * put, or NULL if there is not enough room in this buf.
2933*5113495bSYour Name */
qdf_nbuf_put_tail(qdf_nbuf_t buf,qdf_size_t size)2934*5113495bSYour Name static inline uint8_t *qdf_nbuf_put_tail(qdf_nbuf_t buf, qdf_size_t size)
2935*5113495bSYour Name {
2936*5113495bSYour Name return __qdf_nbuf_put_tail(buf, size);
2937*5113495bSYour Name }
2938*5113495bSYour Name
2939*5113495bSYour Name /**
2940*5113495bSYour Name * qdf_nbuf_pull_head() - pull data out from the front
2941*5113495bSYour Name * @buf: Network buf instance
2942*5113495bSYour Name * @size: Size to be popped
2943*5113495bSYour Name *
2944*5113495bSYour Name * Return: New data pointer of this buf after data has been popped,
2945*5113495bSYour Name * or NULL if there is not sufficient data to pull.
2946*5113495bSYour Name */
qdf_nbuf_pull_head(qdf_nbuf_t buf,qdf_size_t size)2947*5113495bSYour Name static inline uint8_t *qdf_nbuf_pull_head(qdf_nbuf_t buf, qdf_size_t size)
2948*5113495bSYour Name {
2949*5113495bSYour Name return __qdf_nbuf_pull_head(buf, size);
2950*5113495bSYour Name }
2951*5113495bSYour Name
2952*5113495bSYour Name /**
2953*5113495bSYour Name * qdf_nbuf_trim_tail() - trim data out from the end
2954*5113495bSYour Name * @buf: Network buf instance
2955*5113495bSYour Name * @size: Size to be popped
2956*5113495bSYour Name *
2957*5113495bSYour Name * Return: none
2958*5113495bSYour Name */
qdf_nbuf_trim_tail(qdf_nbuf_t buf,qdf_size_t size)2959*5113495bSYour Name static inline void qdf_nbuf_trim_tail(qdf_nbuf_t buf, qdf_size_t size)
2960*5113495bSYour Name {
2961*5113495bSYour Name __qdf_nbuf_trim_tail(buf, size);
2962*5113495bSYour Name }
2963*5113495bSYour Name
2964*5113495bSYour Name /**
2965*5113495bSYour Name * qdf_nbuf_len() - get the length of the buf
2966*5113495bSYour Name * @buf: Network buf instance
2967*5113495bSYour Name *
2968*5113495bSYour Name * Return: total length of this buf.
2969*5113495bSYour Name */
qdf_nbuf_len(qdf_nbuf_t buf)2970*5113495bSYour Name static inline qdf_size_t qdf_nbuf_len(qdf_nbuf_t buf)
2971*5113495bSYour Name {
2972*5113495bSYour Name return __qdf_nbuf_len(buf);
2973*5113495bSYour Name }
2974*5113495bSYour Name
2975*5113495bSYour Name /**
2976*5113495bSYour Name * qdf_nbuf_set_pktlen() - set the length of the buf
2977*5113495bSYour Name * @buf: Network buf instance
2978*5113495bSYour Name * @len: Size to be set
2979*5113495bSYour Name *
2980*5113495bSYour Name * Return: none
2981*5113495bSYour Name */
qdf_nbuf_set_pktlen(qdf_nbuf_t buf,uint32_t len)2982*5113495bSYour Name static inline void qdf_nbuf_set_pktlen(qdf_nbuf_t buf, uint32_t len)
2983*5113495bSYour Name {
2984*5113495bSYour Name __qdf_nbuf_set_pktlen(buf, len);
2985*5113495bSYour Name }
2986*5113495bSYour Name
2987*5113495bSYour Name /**
2988*5113495bSYour Name * qdf_nbuf_reserve() - trim data out from the end
2989*5113495bSYour Name * @buf: Network buf instance
2990*5113495bSYour Name * @size: Size to be popped
2991*5113495bSYour Name *
2992*5113495bSYour Name * Return: none
2993*5113495bSYour Name */
qdf_nbuf_reserve(qdf_nbuf_t buf,qdf_size_t size)2994*5113495bSYour Name static inline void qdf_nbuf_reserve(qdf_nbuf_t buf, qdf_size_t size)
2995*5113495bSYour Name {
2996*5113495bSYour Name __qdf_nbuf_reserve(buf, size);
2997*5113495bSYour Name }
2998*5113495bSYour Name
2999*5113495bSYour Name /**
3000*5113495bSYour Name * qdf_nbuf_set_data_pointer() - set data pointer
3001*5113495bSYour Name * @buf: Network buf instance
3002*5113495bSYour Name * @data: data pointer
3003*5113495bSYour Name *
3004*5113495bSYour Name * Return: none
3005*5113495bSYour Name */
qdf_nbuf_set_data_pointer(qdf_nbuf_t buf,uint8_t * data)3006*5113495bSYour Name static inline void qdf_nbuf_set_data_pointer(qdf_nbuf_t buf, uint8_t *data)
3007*5113495bSYour Name {
3008*5113495bSYour Name __qdf_nbuf_set_data_pointer(buf, data);
3009*5113495bSYour Name }
3010*5113495bSYour Name
3011*5113495bSYour Name /**
3012*5113495bSYour Name * qdf_nbuf_set_len() - set data length
3013*5113495bSYour Name * @buf: Network buf instance
3014*5113495bSYour Name * @len: data length
3015*5113495bSYour Name * Return: none
3016*5113495bSYour Name */
qdf_nbuf_set_len(qdf_nbuf_t buf,uint32_t len)3017*5113495bSYour Name static inline void qdf_nbuf_set_len(qdf_nbuf_t buf, uint32_t len)
3018*5113495bSYour Name {
3019*5113495bSYour Name __qdf_nbuf_set_len(buf, len);
3020*5113495bSYour Name }
3021*5113495bSYour Name
3022*5113495bSYour Name /**
3023*5113495bSYour Name * qdf_nbuf_set_tail_pointer() - set data tail pointer
3024*5113495bSYour Name * @buf: Network buf instance
3025*5113495bSYour Name * @len: length of data
3026*5113495bSYour Name *
3027*5113495bSYour Name * Return: none
3028*5113495bSYour Name */
qdf_nbuf_set_tail_pointer(qdf_nbuf_t buf,int len)3029*5113495bSYour Name static inline void qdf_nbuf_set_tail_pointer(qdf_nbuf_t buf, int len)
3030*5113495bSYour Name {
3031*5113495bSYour Name __qdf_nbuf_set_tail_pointer(buf, len);
3032*5113495bSYour Name }
3033*5113495bSYour Name
3034*5113495bSYour Name /**
3035*5113495bSYour Name * qdf_nbuf_unlink_no_lock() - unlink a nbuf from nbuf list
3036*5113495bSYour Name * @buf: Network buf instance
3037*5113495bSYour Name * @list: list to use
3038*5113495bSYour Name *
3039*5113495bSYour Name * This is a lockless version, driver must acquire locks if it
3040*5113495bSYour Name * needs to synchronize
3041*5113495bSYour Name *
3042*5113495bSYour Name * Return: none
3043*5113495bSYour Name */
3044*5113495bSYour Name static inline void
qdf_nbuf_unlink_no_lock(qdf_nbuf_t buf,qdf_nbuf_queue_head_t * list)3045*5113495bSYour Name qdf_nbuf_unlink_no_lock(qdf_nbuf_t buf, qdf_nbuf_queue_head_t *list)
3046*5113495bSYour Name {
3047*5113495bSYour Name __qdf_nbuf_unlink_no_lock(buf, list);
3048*5113495bSYour Name }
3049*5113495bSYour Name
3050*5113495bSYour Name /**
3051*5113495bSYour Name * qdf_nbuf_reset() - reset the buffer data and pointer
3052*5113495bSYour Name * @buf: Network buf instance
3053*5113495bSYour Name * @reserve: reserve
3054*5113495bSYour Name * @align: align
3055*5113495bSYour Name *
3056*5113495bSYour Name * Return: none
3057*5113495bSYour Name */
qdf_nbuf_reset(qdf_nbuf_t buf,int reserve,int align)3058*5113495bSYour Name static inline void qdf_nbuf_reset(qdf_nbuf_t buf, int reserve, int align)
3059*5113495bSYour Name {
3060*5113495bSYour Name __qdf_nbuf_reset(buf, reserve, align);
3061*5113495bSYour Name }
3062*5113495bSYour Name
3063*5113495bSYour Name /**
3064*5113495bSYour Name * qdf_nbuf_is_dev_scratch_supported() - dev_scratch support for network buffer
3065*5113495bSYour Name * in kernel
3066*5113495bSYour Name *
3067*5113495bSYour Name * Return: true if dev_scratch is supported
3068*5113495bSYour Name * false if dev_scratch is not supported
3069*5113495bSYour Name */
qdf_nbuf_is_dev_scratch_supported(void)3070*5113495bSYour Name static inline bool qdf_nbuf_is_dev_scratch_supported(void)
3071*5113495bSYour Name {
3072*5113495bSYour Name return __qdf_nbuf_is_dev_scratch_supported();
3073*5113495bSYour Name }
3074*5113495bSYour Name
3075*5113495bSYour Name /**
3076*5113495bSYour Name * qdf_nbuf_get_dev_scratch() - get dev_scratch of network buffer
3077*5113495bSYour Name * @buf: Pointer to network buffer
3078*5113495bSYour Name *
3079*5113495bSYour Name * Return: dev_scratch if dev_scratch supported
3080*5113495bSYour Name * 0 if dev_scratch not supported
3081*5113495bSYour Name */
qdf_nbuf_get_dev_scratch(qdf_nbuf_t buf)3082*5113495bSYour Name static inline unsigned long qdf_nbuf_get_dev_scratch(qdf_nbuf_t buf)
3083*5113495bSYour Name {
3084*5113495bSYour Name return __qdf_nbuf_get_dev_scratch(buf);
3085*5113495bSYour Name }
3086*5113495bSYour Name
3087*5113495bSYour Name /**
3088*5113495bSYour Name * qdf_nbuf_set_dev_scratch() - set dev_scratch of network buffer
3089*5113495bSYour Name * @buf: Pointer to network buffer
3090*5113495bSYour Name * @value: value to be set in dev_scratch of network buffer
3091*5113495bSYour Name *
3092*5113495bSYour Name * Return: void
3093*5113495bSYour Name */
qdf_nbuf_set_dev_scratch(qdf_nbuf_t buf,unsigned long value)3094*5113495bSYour Name static inline void qdf_nbuf_set_dev_scratch(qdf_nbuf_t buf, unsigned long value)
3095*5113495bSYour Name {
3096*5113495bSYour Name __qdf_nbuf_set_dev_scratch(buf, value);
3097*5113495bSYour Name }
3098*5113495bSYour Name
3099*5113495bSYour Name /**
3100*5113495bSYour Name * qdf_nbuf_set_dev() - set dev in network buffer
3101*5113495bSYour Name * @nbuf: Pointer to network buffer
3102*5113495bSYour Name * @dev: netdev to be set in network buffer
3103*5113495bSYour Name *
3104*5113495bSYour Name * Return: void
3105*5113495bSYour Name */
3106*5113495bSYour Name static inline
qdf_nbuf_set_dev(qdf_nbuf_t nbuf,qdf_netdev_t dev)3107*5113495bSYour Name void qdf_nbuf_set_dev(qdf_nbuf_t nbuf, qdf_netdev_t dev)
3108*5113495bSYour Name {
3109*5113495bSYour Name __qdf_nbuf_set_dev(nbuf, dev);
3110*5113495bSYour Name }
3111*5113495bSYour Name
3112*5113495bSYour Name /**
3113*5113495bSYour Name * qdf_nbuf_get_dev_mtu() - get dev mtu in n/w buffer
3114*5113495bSYour Name * @nbuf: Pointer to network buffer
3115*5113495bSYour Name *
3116*5113495bSYour Name * Return: dev mtu value in nbuf
3117*5113495bSYour Name */
3118*5113495bSYour Name static inline
qdf_nbuf_get_dev_mtu(qdf_nbuf_t nbuf)3119*5113495bSYour Name unsigned int qdf_nbuf_get_dev_mtu(qdf_nbuf_t nbuf)
3120*5113495bSYour Name {
3121*5113495bSYour Name return __qdf_nbuf_get_dev_mtu(nbuf);
3122*5113495bSYour Name }
3123*5113495bSYour Name
3124*5113495bSYour Name /**
3125*5113495bSYour Name * qdf_nbuf_set_protocol_eth_tye_trans() - set protocol using eth trans os API
3126*5113495bSYour Name * @nbuf: Pointer to network buffer
3127*5113495bSYour Name *
3128*5113495bSYour Name * Return: None
3129*5113495bSYour Name */
3130*5113495bSYour Name static inline
qdf_nbuf_set_protocol_eth_tye_trans(qdf_nbuf_t nbuf)3131*5113495bSYour Name void qdf_nbuf_set_protocol_eth_tye_trans(qdf_nbuf_t nbuf)
3132*5113495bSYour Name {
3133*5113495bSYour Name __qdf_nbuf_set_protocol_eth_type_trans(nbuf);
3134*5113495bSYour Name }
3135*5113495bSYour Name
3136*5113495bSYour Name /**
3137*5113495bSYour Name * qdf_nbuf_peek_header() - return the data pointer & length of the header
3138*5113495bSYour Name * @buf: Network nbuf
3139*5113495bSYour Name * @addr: Data pointer
3140*5113495bSYour Name * @len: Length of the data
3141*5113495bSYour Name *
3142*5113495bSYour Name * Return: none
3143*5113495bSYour Name */
3144*5113495bSYour Name static inline void
qdf_nbuf_peek_header(qdf_nbuf_t buf,uint8_t ** addr,uint32_t * len)3145*5113495bSYour Name qdf_nbuf_peek_header(qdf_nbuf_t buf, uint8_t **addr, uint32_t *len)
3146*5113495bSYour Name {
3147*5113495bSYour Name __qdf_nbuf_peek_header(buf, addr, len);
3148*5113495bSYour Name }
3149*5113495bSYour Name
3150*5113495bSYour Name /* nbuf queue routines */
3151*5113495bSYour Name
3152*5113495bSYour Name /**
3153*5113495bSYour Name * qdf_nbuf_queue_init() - initialize buf queue
3154*5113495bSYour Name * @head: Network buf queue head
3155*5113495bSYour Name *
3156*5113495bSYour Name * Return: none
3157*5113495bSYour Name */
qdf_nbuf_queue_init(qdf_nbuf_queue_t * head)3158*5113495bSYour Name static inline void qdf_nbuf_queue_init(qdf_nbuf_queue_t *head)
3159*5113495bSYour Name {
3160*5113495bSYour Name __qdf_nbuf_queue_init(head);
3161*5113495bSYour Name }
3162*5113495bSYour Name
3163*5113495bSYour Name /**
3164*5113495bSYour Name * qdf_nbuf_queue_add() - append a nbuf to the tail of the buf queue
3165*5113495bSYour Name * @head: Network buf queue head
3166*5113495bSYour Name * @buf: Network buf
3167*5113495bSYour Name *
3168*5113495bSYour Name * Return: none
3169*5113495bSYour Name */
qdf_nbuf_queue_add(qdf_nbuf_queue_t * head,qdf_nbuf_t buf)3170*5113495bSYour Name static inline void qdf_nbuf_queue_add(qdf_nbuf_queue_t *head, qdf_nbuf_t buf)
3171*5113495bSYour Name {
3172*5113495bSYour Name __qdf_nbuf_queue_add(head, buf);
3173*5113495bSYour Name }
3174*5113495bSYour Name
3175*5113495bSYour Name /**
3176*5113495bSYour Name * qdf_nbuf_queue_insert_head() - insert nbuf at the head of queue
3177*5113495bSYour Name * @head: Network buf queue head
3178*5113495bSYour Name * @buf: Network buf
3179*5113495bSYour Name *
3180*5113495bSYour Name * Return: none
3181*5113495bSYour Name */
3182*5113495bSYour Name static inline void
qdf_nbuf_queue_insert_head(qdf_nbuf_queue_t * head,qdf_nbuf_t buf)3183*5113495bSYour Name qdf_nbuf_queue_insert_head(qdf_nbuf_queue_t *head, qdf_nbuf_t buf)
3184*5113495bSYour Name {
3185*5113495bSYour Name __qdf_nbuf_queue_insert_head(head, buf);
3186*5113495bSYour Name }
3187*5113495bSYour Name
3188*5113495bSYour Name /**
3189*5113495bSYour Name * qdf_nbuf_queue_remove_last() - remove last nbuf from queue
3190*5113495bSYour Name * @head: Network buf queue head
3191*5113495bSYour Name *
3192*5113495bSYour Name * Return: none
3193*5113495bSYour Name */
qdf_nbuf_queue_remove_last(qdf_nbuf_queue_t * head)3194*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_queue_remove_last(qdf_nbuf_queue_t *head)
3195*5113495bSYour Name {
3196*5113495bSYour Name return __qdf_nbuf_queue_remove_last(head);
3197*5113495bSYour Name }
3198*5113495bSYour Name
3199*5113495bSYour Name /**
3200*5113495bSYour Name * qdf_nbuf_queue_remove() - retrieve a buf from the head of the buf queue
3201*5113495bSYour Name * @head: Network buf queue head
3202*5113495bSYour Name *
3203*5113495bSYour Name * Return: The head buf in the buf queue.
3204*5113495bSYour Name */
qdf_nbuf_queue_remove(qdf_nbuf_queue_t * head)3205*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_queue_remove(qdf_nbuf_queue_t *head)
3206*5113495bSYour Name {
3207*5113495bSYour Name return __qdf_nbuf_queue_remove(head);
3208*5113495bSYour Name }
3209*5113495bSYour Name
3210*5113495bSYour Name /**
3211*5113495bSYour Name * qdf_nbuf_queue_len() - get the length of the queue
3212*5113495bSYour Name * @head: Network buf queue head
3213*5113495bSYour Name *
3214*5113495bSYour Name * Return: length of the queue
3215*5113495bSYour Name */
qdf_nbuf_queue_len(qdf_nbuf_queue_t * head)3216*5113495bSYour Name static inline uint32_t qdf_nbuf_queue_len(qdf_nbuf_queue_t *head)
3217*5113495bSYour Name {
3218*5113495bSYour Name return __qdf_nbuf_queue_len(head);
3219*5113495bSYour Name }
3220*5113495bSYour Name
3221*5113495bSYour Name /**
3222*5113495bSYour Name * qdf_nbuf_queue_next() - get the next guy/packet of the given buffer
3223*5113495bSYour Name * @buf: Network buffer
3224*5113495bSYour Name *
3225*5113495bSYour Name * Return: next buffer/packet
3226*5113495bSYour Name */
qdf_nbuf_queue_next(qdf_nbuf_t buf)3227*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_queue_next(qdf_nbuf_t buf)
3228*5113495bSYour Name {
3229*5113495bSYour Name return __qdf_nbuf_queue_next(buf);
3230*5113495bSYour Name }
3231*5113495bSYour Name
3232*5113495bSYour Name /**
3233*5113495bSYour Name * qdf_nbuf_is_queue_empty() - check if the buf queue is empty
3234*5113495bSYour Name * @nbq: Network buf queue handle
3235*5113495bSYour Name *
3236*5113495bSYour Name * Return: true if queue is empty
3237*5113495bSYour Name * false if queue is not empty
3238*5113495bSYour Name */
qdf_nbuf_is_queue_empty(qdf_nbuf_queue_t * nbq)3239*5113495bSYour Name static inline bool qdf_nbuf_is_queue_empty(qdf_nbuf_queue_t *nbq)
3240*5113495bSYour Name {
3241*5113495bSYour Name return __qdf_nbuf_is_queue_empty(nbq);
3242*5113495bSYour Name }
3243*5113495bSYour Name
3244*5113495bSYour Name static inline qdf_nbuf_queue_t *
qdf_nbuf_queue_append(qdf_nbuf_queue_t * dest,qdf_nbuf_queue_t * src)3245*5113495bSYour Name qdf_nbuf_queue_append(qdf_nbuf_queue_t *dest, qdf_nbuf_queue_t *src)
3246*5113495bSYour Name {
3247*5113495bSYour Name return __qdf_nbuf_queue_append(dest, src);
3248*5113495bSYour Name }
3249*5113495bSYour Name
3250*5113495bSYour Name static inline void
qdf_nbuf_queue_free(qdf_nbuf_queue_t * head)3251*5113495bSYour Name qdf_nbuf_queue_free(qdf_nbuf_queue_t *head)
3252*5113495bSYour Name {
3253*5113495bSYour Name qdf_nbuf_t buf = NULL;
3254*5113495bSYour Name
3255*5113495bSYour Name while ((buf = qdf_nbuf_queue_remove(head)) != NULL)
3256*5113495bSYour Name qdf_nbuf_free(buf);
3257*5113495bSYour Name }
3258*5113495bSYour Name
3259*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_queue_first(qdf_nbuf_queue_t * head)3260*5113495bSYour Name qdf_nbuf_queue_first(qdf_nbuf_queue_t *head)
3261*5113495bSYour Name {
3262*5113495bSYour Name return __qdf_nbuf_queue_first(head);
3263*5113495bSYour Name }
3264*5113495bSYour Name
3265*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_queue_last(qdf_nbuf_queue_t * head)3266*5113495bSYour Name qdf_nbuf_queue_last(qdf_nbuf_queue_t *head)
3267*5113495bSYour Name {
3268*5113495bSYour Name return __qdf_nbuf_queue_last(head);
3269*5113495bSYour Name }
3270*5113495bSYour Name
3271*5113495bSYour Name /**
3272*5113495bSYour Name * qdf_nbuf_get_protocol() - return the protocol value of the skb
3273*5113495bSYour Name * @skb: Pointer to network buffer
3274*5113495bSYour Name *
3275*5113495bSYour Name * Return: skb protocol
3276*5113495bSYour Name */
qdf_nbuf_get_protocol(struct sk_buff * skb)3277*5113495bSYour Name static inline uint16_t qdf_nbuf_get_protocol(struct sk_buff *skb)
3278*5113495bSYour Name {
3279*5113495bSYour Name return __qdf_nbuf_get_protocol(skb);
3280*5113495bSYour Name }
3281*5113495bSYour Name
3282*5113495bSYour Name /**
3283*5113495bSYour Name * qdf_nbuf_get_ip_summed() - return the ip checksum value of the skb
3284*5113495bSYour Name * @skb: Pointer to network buffer
3285*5113495bSYour Name *
3286*5113495bSYour Name * Return: skb ip_summed
3287*5113495bSYour Name */
qdf_nbuf_get_ip_summed(struct sk_buff * skb)3288*5113495bSYour Name static inline uint8_t qdf_nbuf_get_ip_summed(struct sk_buff *skb)
3289*5113495bSYour Name {
3290*5113495bSYour Name return __qdf_nbuf_get_ip_summed(skb);
3291*5113495bSYour Name }
3292*5113495bSYour Name
3293*5113495bSYour Name /**
3294*5113495bSYour Name * qdf_nbuf_set_ip_summed() - sets the ip_summed value of the skb
3295*5113495bSYour Name * @skb: Pointer to network buffer
3296*5113495bSYour Name * @ip_summed: ip checksum
3297*5113495bSYour Name *
3298*5113495bSYour Name * Return: none
3299*5113495bSYour Name */
qdf_nbuf_set_ip_summed(struct sk_buff * skb,uint8_t ip_summed)3300*5113495bSYour Name static inline void qdf_nbuf_set_ip_summed(struct sk_buff *skb,
3301*5113495bSYour Name uint8_t ip_summed)
3302*5113495bSYour Name {
3303*5113495bSYour Name __qdf_nbuf_set_ip_summed(skb, ip_summed);
3304*5113495bSYour Name }
3305*5113495bSYour Name
3306*5113495bSYour Name /**
3307*5113495bSYour Name * qdf_nbuf_set_next() - add a packet to a linked list
3308*5113495bSYour Name * @this_buf: Predecessor buffer
3309*5113495bSYour Name * @next_buf: Successor buffer
3310*5113495bSYour Name *
3311*5113495bSYour Name * This function can be used to directly link nbufs, rather than using
3312*5113495bSYour Name * a separate network buffer queue object.
3313*5113495bSYour Name *
3314*5113495bSYour Name * Return: none
3315*5113495bSYour Name */
qdf_nbuf_set_next(qdf_nbuf_t this_buf,qdf_nbuf_t next_buf)3316*5113495bSYour Name static inline void qdf_nbuf_set_next(qdf_nbuf_t this_buf, qdf_nbuf_t next_buf)
3317*5113495bSYour Name {
3318*5113495bSYour Name __qdf_nbuf_set_next(this_buf, next_buf);
3319*5113495bSYour Name }
3320*5113495bSYour Name
3321*5113495bSYour Name /* nbuf extension routines */
3322*5113495bSYour Name
3323*5113495bSYour Name /**
3324*5113495bSYour Name * qdf_nbuf_set_next_ext() - link extension of this packet contained in a new
3325*5113495bSYour Name * nbuf
3326*5113495bSYour Name * @this_buf: predecessor buffer
3327*5113495bSYour Name * @next_buf: successor buffer
3328*5113495bSYour Name *
3329*5113495bSYour Name * This function is used to link up many nbufs containing a single logical
3330*5113495bSYour Name * packet - not a collection of packets. Do not use for linking the first
3331*5113495bSYour Name * extension to the head
3332*5113495bSYour Name *
3333*5113495bSYour Name * Return: none
3334*5113495bSYour Name */
3335*5113495bSYour Name static inline void
qdf_nbuf_set_next_ext(qdf_nbuf_t this_buf,qdf_nbuf_t next_buf)3336*5113495bSYour Name qdf_nbuf_set_next_ext(qdf_nbuf_t this_buf, qdf_nbuf_t next_buf)
3337*5113495bSYour Name {
3338*5113495bSYour Name __qdf_nbuf_set_next_ext(this_buf, next_buf);
3339*5113495bSYour Name }
3340*5113495bSYour Name
3341*5113495bSYour Name /**
3342*5113495bSYour Name * qdf_nbuf_next_ext() - get the next packet extension in the linked list
3343*5113495bSYour Name * @buf: Network buffer
3344*5113495bSYour Name *
3345*5113495bSYour Name * Return: Next network buffer in the linked list
3346*5113495bSYour Name */
qdf_nbuf_next_ext(qdf_nbuf_t buf)3347*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_next_ext(qdf_nbuf_t buf)
3348*5113495bSYour Name {
3349*5113495bSYour Name return __qdf_nbuf_next_ext(buf);
3350*5113495bSYour Name }
3351*5113495bSYour Name
3352*5113495bSYour Name /**
3353*5113495bSYour Name * qdf_nbuf_append_ext_list() - link list of packet extensions to the head
3354*5113495bSYour Name * segment
3355*5113495bSYour Name * @head_buf: Network buf holding head segment (single)
3356*5113495bSYour Name * @ext_list: Network buf list holding linked extensions to the head
3357*5113495bSYour Name * @ext_len: Total length of all buffers in the extension list
3358*5113495bSYour Name *
3359*5113495bSYour Name * This function is used to link up a list of packet extensions (seg1, 2,
3360*5113495bSYour Name * ...) to the nbuf holding the head segment (seg0)
3361*5113495bSYour Name *
3362*5113495bSYour Name * Return: none
3363*5113495bSYour Name */
3364*5113495bSYour Name static inline void
qdf_nbuf_append_ext_list(qdf_nbuf_t head_buf,qdf_nbuf_t ext_list,qdf_size_t ext_len)3365*5113495bSYour Name qdf_nbuf_append_ext_list(qdf_nbuf_t head_buf, qdf_nbuf_t ext_list,
3366*5113495bSYour Name qdf_size_t ext_len)
3367*5113495bSYour Name {
3368*5113495bSYour Name __qdf_nbuf_append_ext_list(head_buf, ext_list, ext_len);
3369*5113495bSYour Name }
3370*5113495bSYour Name
3371*5113495bSYour Name /**
3372*5113495bSYour Name * qdf_nbuf_get_ext_list() - Get the link to extended nbuf list.
3373*5113495bSYour Name * @head_buf: Network buf holding head segment (single)
3374*5113495bSYour Name *
3375*5113495bSYour Name * This ext_list is populated when we have Jumbo packet, for example in case of
3376*5113495bSYour Name * monitor mode amsdu packet reception, and are stiched using frags_list.
3377*5113495bSYour Name *
3378*5113495bSYour Name * Return: Network buf list holding linked extensions from head buf.
3379*5113495bSYour Name */
qdf_nbuf_get_ext_list(qdf_nbuf_t head_buf)3380*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_get_ext_list(qdf_nbuf_t head_buf)
3381*5113495bSYour Name {
3382*5113495bSYour Name return (qdf_nbuf_t)__qdf_nbuf_get_ext_list(head_buf);
3383*5113495bSYour Name }
3384*5113495bSYour Name
3385*5113495bSYour Name /**
3386*5113495bSYour Name * qdf_nbuf_get_shinfo() - gets the shared info of head buf
3387*5113495bSYour Name * @head_buf: Network buffer
3388*5113495bSYour Name *
3389*5113495bSYour Name * Return: shared info of head buf
3390*5113495bSYour Name */
qdf_nbuf_get_shinfo(qdf_nbuf_t head_buf)3391*5113495bSYour Name static inline qdf_nbuf_shared_info_t qdf_nbuf_get_shinfo(qdf_nbuf_t head_buf)
3392*5113495bSYour Name {
3393*5113495bSYour Name return (qdf_nbuf_shared_info_t)__qdf_nbuf_get_shinfo(head_buf);
3394*5113495bSYour Name }
3395*5113495bSYour Name
3396*5113495bSYour Name /**
3397*5113495bSYour Name * qdf_nbuf_get_tx_cksum() - gets the tx checksum offload demand
3398*5113495bSYour Name * @buf: Network buffer
3399*5113495bSYour Name *
3400*5113495bSYour Name * Return: qdf_nbuf_tx_cksum_t checksum offload demand for the frame
3401*5113495bSYour Name */
qdf_nbuf_get_tx_cksum(qdf_nbuf_t buf)3402*5113495bSYour Name static inline qdf_nbuf_tx_cksum_t qdf_nbuf_get_tx_cksum(qdf_nbuf_t buf)
3403*5113495bSYour Name {
3404*5113495bSYour Name return __qdf_nbuf_get_tx_cksum(buf);
3405*5113495bSYour Name }
3406*5113495bSYour Name
3407*5113495bSYour Name /**
3408*5113495bSYour Name * qdf_nbuf_set_rx_cksum() - drivers that support hw checksumming use this to
3409*5113495bSYour Name * indicate checksum info to the stack.
3410*5113495bSYour Name * @buf: Network buffer
3411*5113495bSYour Name * @cksum: Checksum
3412*5113495bSYour Name *
3413*5113495bSYour Name * Return: none
3414*5113495bSYour Name */
3415*5113495bSYour Name static inline void
qdf_nbuf_set_rx_cksum(qdf_nbuf_t buf,qdf_nbuf_rx_cksum_t * cksum)3416*5113495bSYour Name qdf_nbuf_set_rx_cksum(qdf_nbuf_t buf, qdf_nbuf_rx_cksum_t *cksum)
3417*5113495bSYour Name {
3418*5113495bSYour Name __qdf_nbuf_set_rx_cksum(buf, cksum);
3419*5113495bSYour Name }
3420*5113495bSYour Name
3421*5113495bSYour Name /**
3422*5113495bSYour Name * qdf_nbuf_get_tid() - this function extracts the TID value from nbuf
3423*5113495bSYour Name * @buf: Network buffer
3424*5113495bSYour Name *
3425*5113495bSYour Name * Return: TID value
3426*5113495bSYour Name */
qdf_nbuf_get_tid(qdf_nbuf_t buf)3427*5113495bSYour Name static inline uint8_t qdf_nbuf_get_tid(qdf_nbuf_t buf)
3428*5113495bSYour Name {
3429*5113495bSYour Name return __qdf_nbuf_get_tid(buf);
3430*5113495bSYour Name }
3431*5113495bSYour Name
3432*5113495bSYour Name /**
3433*5113495bSYour Name * qdf_nbuf_set_tid() - this function sets the TID value in nbuf
3434*5113495bSYour Name * @buf: Network buffer
3435*5113495bSYour Name * @tid: TID value
3436*5113495bSYour Name *
3437*5113495bSYour Name * Return: none
3438*5113495bSYour Name */
qdf_nbuf_set_tid(qdf_nbuf_t buf,uint8_t tid)3439*5113495bSYour Name static inline void qdf_nbuf_set_tid(qdf_nbuf_t buf, uint8_t tid)
3440*5113495bSYour Name {
3441*5113495bSYour Name __qdf_nbuf_set_tid(buf, tid);
3442*5113495bSYour Name }
3443*5113495bSYour Name
3444*5113495bSYour Name /**
3445*5113495bSYour Name * qdf_nbuf_get_exemption_type() - this function extracts the exemption type
3446*5113495bSYour Name * from nbuf
3447*5113495bSYour Name * @buf: Network buffer
3448*5113495bSYour Name *
3449*5113495bSYour Name * Return: Exemption type
3450*5113495bSYour Name */
qdf_nbuf_get_exemption_type(qdf_nbuf_t buf)3451*5113495bSYour Name static inline uint8_t qdf_nbuf_get_exemption_type(qdf_nbuf_t buf)
3452*5113495bSYour Name {
3453*5113495bSYour Name return __qdf_nbuf_get_exemption_type(buf);
3454*5113495bSYour Name }
3455*5113495bSYour Name
3456*5113495bSYour Name /**
3457*5113495bSYour Name * qdf_nbuf_set_protocol() - this function peeks data into the buffer at given
3458*5113495bSYour Name * offset
3459*5113495bSYour Name * @buf: Network buffer
3460*5113495bSYour Name * @proto: Protocol
3461*5113495bSYour Name *
3462*5113495bSYour Name * Return: none
3463*5113495bSYour Name */
qdf_nbuf_set_protocol(qdf_nbuf_t buf,uint16_t proto)3464*5113495bSYour Name static inline void qdf_nbuf_set_protocol(qdf_nbuf_t buf, uint16_t proto)
3465*5113495bSYour Name {
3466*5113495bSYour Name __qdf_nbuf_set_protocol(buf, proto);
3467*5113495bSYour Name }
3468*5113495bSYour Name
3469*5113495bSYour Name /**
3470*5113495bSYour Name * qdf_nbuf_trace_get_proto_type() - this function return packet proto type
3471*5113495bSYour Name * @buf: Network buffer
3472*5113495bSYour Name *
3473*5113495bSYour Name * Return: Packet protocol type
3474*5113495bSYour Name */
qdf_nbuf_trace_get_proto_type(qdf_nbuf_t buf)3475*5113495bSYour Name static inline uint8_t qdf_nbuf_trace_get_proto_type(qdf_nbuf_t buf)
3476*5113495bSYour Name {
3477*5113495bSYour Name return __qdf_nbuf_trace_get_proto_type(buf);
3478*5113495bSYour Name }
3479*5113495bSYour Name
3480*5113495bSYour Name /**
3481*5113495bSYour Name * qdf_nbuf_reg_trace_cb() - this function registers protocol trace callback
3482*5113495bSYour Name * @cb_func_ptr: Callback pointer
3483*5113495bSYour Name *
3484*5113495bSYour Name * Return: none
3485*5113495bSYour Name */
qdf_nbuf_reg_trace_cb(qdf_nbuf_trace_update_t cb_func_ptr)3486*5113495bSYour Name static inline void qdf_nbuf_reg_trace_cb(qdf_nbuf_trace_update_t cb_func_ptr)
3487*5113495bSYour Name {
3488*5113495bSYour Name __qdf_nbuf_reg_trace_cb(cb_func_ptr);
3489*5113495bSYour Name }
3490*5113495bSYour Name
3491*5113495bSYour Name
3492*5113495bSYour Name /**
3493*5113495bSYour Name * qdf_nbuf_set_tx_parallel_dnload_frm() - set tx parallel download
3494*5113495bSYour Name * @buf: Network buffer
3495*5113495bSYour Name * @candi: Candidate of parallel download frame
3496*5113495bSYour Name *
3497*5113495bSYour Name * This function stores a flag specifying this TX frame is suitable for
3498*5113495bSYour Name * downloading though a 2nd TX data pipe that is used for short frames for
3499*5113495bSYour Name * protocols that can accept out-of-order delivery.
3500*5113495bSYour Name *
3501*5113495bSYour Name * Return: none
3502*5113495bSYour Name */
3503*5113495bSYour Name static inline void
qdf_nbuf_set_tx_parallel_dnload_frm(qdf_nbuf_t buf,uint8_t candi)3504*5113495bSYour Name qdf_nbuf_set_tx_parallel_dnload_frm(qdf_nbuf_t buf, uint8_t candi)
3505*5113495bSYour Name {
3506*5113495bSYour Name __qdf_nbuf_set_tx_htt2_frm(buf, candi);
3507*5113495bSYour Name }
3508*5113495bSYour Name
3509*5113495bSYour Name /**
3510*5113495bSYour Name * qdf_nbuf_get_tx_parallel_dnload_frm() - get tx parallel download
3511*5113495bSYour Name * @buf: Network buffer
3512*5113495bSYour Name *
3513*5113495bSYour Name * This function return whether this TX frame is allow to download though a 2nd
3514*5113495bSYour Name * TX data pipe or not.
3515*5113495bSYour Name *
3516*5113495bSYour Name * Return: none
3517*5113495bSYour Name */
qdf_nbuf_get_tx_parallel_dnload_frm(qdf_nbuf_t buf)3518*5113495bSYour Name static inline uint8_t qdf_nbuf_get_tx_parallel_dnload_frm(qdf_nbuf_t buf)
3519*5113495bSYour Name {
3520*5113495bSYour Name return __qdf_nbuf_get_tx_htt2_frm(buf);
3521*5113495bSYour Name }
3522*5113495bSYour Name
3523*5113495bSYour Name /**
3524*5113495bSYour Name * qdf_nbuf_get_dhcp_subtype() - get the subtype
3525*5113495bSYour Name * of DHCP packet.
3526*5113495bSYour Name * @buf: Pointer to DHCP packet buffer
3527*5113495bSYour Name *
3528*5113495bSYour Name * This func. returns the subtype of DHCP packet.
3529*5113495bSYour Name *
3530*5113495bSYour Name * Return: subtype of the DHCP packet.
3531*5113495bSYour Name */
3532*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_get_dhcp_subtype(qdf_nbuf_t buf)3533*5113495bSYour Name qdf_nbuf_get_dhcp_subtype(qdf_nbuf_t buf)
3534*5113495bSYour Name {
3535*5113495bSYour Name return __qdf_nbuf_data_get_dhcp_subtype(qdf_nbuf_data(buf));
3536*5113495bSYour Name }
3537*5113495bSYour Name
3538*5113495bSYour Name /**
3539*5113495bSYour Name * qdf_nbuf_data_get_dhcp_subtype() - get the subtype
3540*5113495bSYour Name * of DHCP packet.
3541*5113495bSYour Name * @data: Pointer to DHCP packet data buffer
3542*5113495bSYour Name *
3543*5113495bSYour Name * This func. returns the subtype of DHCP packet.
3544*5113495bSYour Name *
3545*5113495bSYour Name * Return: subtype of the DHCP packet.
3546*5113495bSYour Name */
3547*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_data_get_dhcp_subtype(uint8_t * data)3548*5113495bSYour Name qdf_nbuf_data_get_dhcp_subtype(uint8_t *data)
3549*5113495bSYour Name {
3550*5113495bSYour Name return __qdf_nbuf_data_get_dhcp_subtype(data);
3551*5113495bSYour Name }
3552*5113495bSYour Name
3553*5113495bSYour Name /**
3554*5113495bSYour Name * qdf_nbuf_get_eapol_subtype() - get the subtype
3555*5113495bSYour Name * of EAPOL packet.
3556*5113495bSYour Name * @buf: Pointer to EAPOL packet buffer
3557*5113495bSYour Name *
3558*5113495bSYour Name * This func. returns the subtype of EAPOL packet.
3559*5113495bSYour Name *
3560*5113495bSYour Name * Return: subtype of the EAPOL packet.
3561*5113495bSYour Name */
3562*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_get_eapol_subtype(qdf_nbuf_t buf)3563*5113495bSYour Name qdf_nbuf_get_eapol_subtype(qdf_nbuf_t buf)
3564*5113495bSYour Name {
3565*5113495bSYour Name return __qdf_nbuf_data_get_eapol_subtype(qdf_nbuf_data(buf));
3566*5113495bSYour Name }
3567*5113495bSYour Name
3568*5113495bSYour Name /**
3569*5113495bSYour Name * qdf_nbuf_data_get_eapol_subtype() - get the subtype
3570*5113495bSYour Name * of EAPOL packet.
3571*5113495bSYour Name * @data: Pointer to EAPOL packet data buffer
3572*5113495bSYour Name *
3573*5113495bSYour Name * This func. returns the subtype of EAPOL packet.
3574*5113495bSYour Name *
3575*5113495bSYour Name * Return: subtype of the EAPOL packet.
3576*5113495bSYour Name */
3577*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_data_get_eapol_subtype(uint8_t * data)3578*5113495bSYour Name qdf_nbuf_data_get_eapol_subtype(uint8_t *data)
3579*5113495bSYour Name {
3580*5113495bSYour Name return __qdf_nbuf_data_get_eapol_subtype(data);
3581*5113495bSYour Name }
3582*5113495bSYour Name
3583*5113495bSYour Name /**
3584*5113495bSYour Name * qdf_nbuf_get_arp_subtype() - get the subtype
3585*5113495bSYour Name * of ARP packet.
3586*5113495bSYour Name * @buf: Pointer to ARP packet buffer
3587*5113495bSYour Name *
3588*5113495bSYour Name * This func. returns the subtype of ARP packet.
3589*5113495bSYour Name *
3590*5113495bSYour Name * Return: subtype of the ARP packet.
3591*5113495bSYour Name */
3592*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_get_arp_subtype(qdf_nbuf_t buf)3593*5113495bSYour Name qdf_nbuf_get_arp_subtype(qdf_nbuf_t buf)
3594*5113495bSYour Name {
3595*5113495bSYour Name return __qdf_nbuf_data_get_arp_subtype(qdf_nbuf_data(buf));
3596*5113495bSYour Name }
3597*5113495bSYour Name
3598*5113495bSYour Name /**
3599*5113495bSYour Name * qdf_nbuf_data_get_arp_subtype() - get the subtype
3600*5113495bSYour Name * of ARP packet.
3601*5113495bSYour Name * @data: Pointer to ARP packet data buffer
3602*5113495bSYour Name *
3603*5113495bSYour Name * This func. returns the subtype of ARP packet.
3604*5113495bSYour Name *
3605*5113495bSYour Name * Return: subtype of the ARP packet.
3606*5113495bSYour Name */
3607*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_data_get_arp_subtype(uint8_t * data)3608*5113495bSYour Name qdf_nbuf_data_get_arp_subtype(uint8_t *data)
3609*5113495bSYour Name {
3610*5113495bSYour Name return __qdf_nbuf_data_get_arp_subtype(data);
3611*5113495bSYour Name }
3612*5113495bSYour Name
3613*5113495bSYour Name /**
3614*5113495bSYour Name * qdf_nbuf_get_icmp_subtype() - get the subtype
3615*5113495bSYour Name * of IPV4 ICMP packet.
3616*5113495bSYour Name * @buf: Pointer to IPV4 ICMP packet buffer
3617*5113495bSYour Name *
3618*5113495bSYour Name * This func. returns the subtype of ICMP packet.
3619*5113495bSYour Name *
3620*5113495bSYour Name * Return: subtype of the ICMP packet.
3621*5113495bSYour Name */
3622*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_get_icmp_subtype(qdf_nbuf_t buf)3623*5113495bSYour Name qdf_nbuf_get_icmp_subtype(qdf_nbuf_t buf)
3624*5113495bSYour Name {
3625*5113495bSYour Name return __qdf_nbuf_data_get_icmp_subtype(qdf_nbuf_data(buf));
3626*5113495bSYour Name }
3627*5113495bSYour Name
3628*5113495bSYour Name /**
3629*5113495bSYour Name * qdf_nbuf_data_get_icmp_subtype() - get the subtype
3630*5113495bSYour Name * of IPV4 ICMP packet.
3631*5113495bSYour Name * @data: Pointer to IPV4 ICMP packet data buffer
3632*5113495bSYour Name *
3633*5113495bSYour Name * This func. returns the subtype of ICMP packet.
3634*5113495bSYour Name *
3635*5113495bSYour Name * Return: subtype of the ICMP packet.
3636*5113495bSYour Name */
3637*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_data_get_icmp_subtype(uint8_t * data)3638*5113495bSYour Name qdf_nbuf_data_get_icmp_subtype(uint8_t *data)
3639*5113495bSYour Name {
3640*5113495bSYour Name return __qdf_nbuf_data_get_icmp_subtype(data);
3641*5113495bSYour Name }
3642*5113495bSYour Name
3643*5113495bSYour Name /**
3644*5113495bSYour Name * qdf_nbuf_get_icmpv6_subtype() - get the subtype
3645*5113495bSYour Name * of IPV6 ICMPV6 packet.
3646*5113495bSYour Name * @buf: Pointer to IPV6 ICMPV6 packet buffer
3647*5113495bSYour Name *
3648*5113495bSYour Name * This func. returns the subtype of ICMPV6 packet.
3649*5113495bSYour Name *
3650*5113495bSYour Name * Return: subtype of the ICMPV6 packet.
3651*5113495bSYour Name */
3652*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_get_icmpv6_subtype(qdf_nbuf_t buf)3653*5113495bSYour Name qdf_nbuf_get_icmpv6_subtype(qdf_nbuf_t buf)
3654*5113495bSYour Name {
3655*5113495bSYour Name return __qdf_nbuf_data_get_icmpv6_subtype(qdf_nbuf_data(buf));
3656*5113495bSYour Name }
3657*5113495bSYour Name
3658*5113495bSYour Name /**
3659*5113495bSYour Name * qdf_nbuf_data_get_icmpv6_subtype() - get the subtype
3660*5113495bSYour Name * of IPV6 ICMPV6 packet.
3661*5113495bSYour Name * @data: Pointer to IPV6 ICMPV6 packet data buffer
3662*5113495bSYour Name *
3663*5113495bSYour Name * This func. returns the subtype of ICMPV6 packet.
3664*5113495bSYour Name *
3665*5113495bSYour Name * Return: subtype of the ICMPV6 packet.
3666*5113495bSYour Name */
3667*5113495bSYour Name static inline enum qdf_proto_subtype
qdf_nbuf_data_get_icmpv6_subtype(uint8_t * data)3668*5113495bSYour Name qdf_nbuf_data_get_icmpv6_subtype(uint8_t *data)
3669*5113495bSYour Name {
3670*5113495bSYour Name return __qdf_nbuf_data_get_icmpv6_subtype(data);
3671*5113495bSYour Name }
3672*5113495bSYour Name
3673*5113495bSYour Name /**
3674*5113495bSYour Name * qdf_nbuf_is_ipv4_last_fragment() - Check if IPV4 packet is last fragment
3675*5113495bSYour Name * @nbuf: Network buffer
3676*5113495bSYour Name *
3677*5113495bSYour Name * This function check if IPV4 packet is last fragment or not.
3678*5113495bSYour Name * Caller has to call this function for ipv4 packets only.
3679*5113495bSYour Name *
3680*5113495bSYour Name * Return: True if ipv4 packet is last fragment otherwise false
3681*5113495bSYour Name */
3682*5113495bSYour Name static inline bool
qdf_nbuf_is_ipv4_last_fragment(qdf_nbuf_t nbuf)3683*5113495bSYour Name qdf_nbuf_is_ipv4_last_fragment(qdf_nbuf_t nbuf)
3684*5113495bSYour Name {
3685*5113495bSYour Name return __qdf_nbuf_is_ipv4_last_fragment(nbuf);
3686*5113495bSYour Name }
3687*5113495bSYour Name
3688*5113495bSYour Name /**
3689*5113495bSYour Name * qdf_nbuf_is_ipv4_fragment() - Check if IPV4 packet is fragment
3690*5113495bSYour Name * @nbuf: Network buffer
3691*5113495bSYour Name *
3692*5113495bSYour Name * This function check if IPV4 packet is fragment or not.
3693*5113495bSYour Name * Caller has to call this function for ipv4 packets only.
3694*5113495bSYour Name *
3695*5113495bSYour Name * Return: True if ipv4 packet is fragment otherwise false
3696*5113495bSYour Name */
3697*5113495bSYour Name static inline bool
qdf_nbuf_is_ipv4_fragment(qdf_nbuf_t nbuf)3698*5113495bSYour Name qdf_nbuf_is_ipv4_fragment(qdf_nbuf_t nbuf)
3699*5113495bSYour Name {
3700*5113495bSYour Name return __qdf_nbuf_is_ipv4_fragment(nbuf);
3701*5113495bSYour Name }
3702*5113495bSYour Name
3703*5113495bSYour Name /**
3704*5113495bSYour Name * qdf_nbuf_data_set_ipv4_tos() - set the TOS field of IPV4 packet.
3705*5113495bSYour Name *
3706*5113495bSYour Name * @data: Pointer to IPV4 packet data buffer
3707*5113495bSYour Name * @tos: TOS value to be set in IPV4 packet
3708*5113495bSYour Name *
3709*5113495bSYour Name * This func. set the TOS field of IPV4 packet.
3710*5113495bSYour Name *
3711*5113495bSYour Name * Return: None
3712*5113495bSYour Name */
3713*5113495bSYour Name static inline void
qdf_nbuf_data_set_ipv4_tos(uint8_t * data,uint8_t tos)3714*5113495bSYour Name qdf_nbuf_data_set_ipv4_tos(uint8_t *data, uint8_t tos)
3715*5113495bSYour Name {
3716*5113495bSYour Name __qdf_nbuf_data_set_ipv4_tos(data, tos);
3717*5113495bSYour Name }
3718*5113495bSYour Name
3719*5113495bSYour Name /**
3720*5113495bSYour Name * qdf_nbuf_data_get_ipv4_tos() - get the TOS field of IPV4 packet.
3721*5113495bSYour Name *
3722*5113495bSYour Name * @data: Pointer to IPV4 packet data buffer
3723*5113495bSYour Name *
3724*5113495bSYour Name * This func. returns the TOS field of IPV4 packet.
3725*5113495bSYour Name *
3726*5113495bSYour Name * Return: TOS of IPV4 packet.
3727*5113495bSYour Name */
3728*5113495bSYour Name static inline uint8_t
qdf_nbuf_data_get_ipv4_tos(uint8_t * data)3729*5113495bSYour Name qdf_nbuf_data_get_ipv4_tos(uint8_t *data)
3730*5113495bSYour Name {
3731*5113495bSYour Name return __qdf_nbuf_data_get_ipv4_tos(data);
3732*5113495bSYour Name }
3733*5113495bSYour Name
3734*5113495bSYour Name /**
3735*5113495bSYour Name * qdf_nbuf_data_get_ipv4_proto() - get the proto type
3736*5113495bSYour Name * of IPV4 packet.
3737*5113495bSYour Name * @data: Pointer to IPV4 packet data buffer
3738*5113495bSYour Name *
3739*5113495bSYour Name * This func. returns the proto type of IPV4 packet.
3740*5113495bSYour Name *
3741*5113495bSYour Name * Return: proto type of IPV4 packet.
3742*5113495bSYour Name */
3743*5113495bSYour Name static inline uint8_t
qdf_nbuf_data_get_ipv4_proto(uint8_t * data)3744*5113495bSYour Name qdf_nbuf_data_get_ipv4_proto(uint8_t *data)
3745*5113495bSYour Name {
3746*5113495bSYour Name return __qdf_nbuf_data_get_ipv4_proto(data);
3747*5113495bSYour Name }
3748*5113495bSYour Name
3749*5113495bSYour Name /**
3750*5113495bSYour Name * qdf_nbuf_data_set_ipv6_tc() - set the TC field
3751*5113495bSYour Name * of IPV6 packet.
3752*5113495bSYour Name * @data: Pointer to IPV6 packet data buffer
3753*5113495bSYour Name * @tc: Value to IPV6 packet TC field
3754*5113495bSYour Name *
3755*5113495bSYour Name * This func. set the TC field of IPV6 packet.
3756*5113495bSYour Name *
3757*5113495bSYour Name * Return: None
3758*5113495bSYour Name */
3759*5113495bSYour Name static inline void
qdf_nbuf_data_set_ipv6_tc(uint8_t * data,uint8_t tc)3760*5113495bSYour Name qdf_nbuf_data_set_ipv6_tc(uint8_t *data, uint8_t tc)
3761*5113495bSYour Name {
3762*5113495bSYour Name __qdf_nbuf_data_set_ipv6_tc(data, tc);
3763*5113495bSYour Name }
3764*5113495bSYour Name
3765*5113495bSYour Name /**
3766*5113495bSYour Name * qdf_nbuf_data_get_ipv6_tc() - get the TC field
3767*5113495bSYour Name * of IPV6 packet.
3768*5113495bSYour Name * @data: Pointer to IPV6 packet data buffer
3769*5113495bSYour Name *
3770*5113495bSYour Name * This func. returns the TC field of IPV6 packet.
3771*5113495bSYour Name *
3772*5113495bSYour Name * Return: Traffic classification field of IPV6 packet.
3773*5113495bSYour Name */
3774*5113495bSYour Name static inline uint8_t
qdf_nbuf_data_get_ipv6_tc(uint8_t * data)3775*5113495bSYour Name qdf_nbuf_data_get_ipv6_tc(uint8_t *data)
3776*5113495bSYour Name {
3777*5113495bSYour Name return __qdf_nbuf_data_get_ipv6_tc(data);
3778*5113495bSYour Name }
3779*5113495bSYour Name
3780*5113495bSYour Name /**
3781*5113495bSYour Name * qdf_nbuf_data_get_ipv6_proto() - get the proto type
3782*5113495bSYour Name * of IPV6 packet.
3783*5113495bSYour Name * @data: Pointer to IPV6 packet data buffer
3784*5113495bSYour Name *
3785*5113495bSYour Name * This func. returns the proto type of IPV6 packet.
3786*5113495bSYour Name *
3787*5113495bSYour Name * Return: proto type of IPV6 packet.
3788*5113495bSYour Name */
3789*5113495bSYour Name static inline uint8_t
qdf_nbuf_data_get_ipv6_proto(uint8_t * data)3790*5113495bSYour Name qdf_nbuf_data_get_ipv6_proto(uint8_t *data)
3791*5113495bSYour Name {
3792*5113495bSYour Name return __qdf_nbuf_data_get_ipv6_proto(data);
3793*5113495bSYour Name }
3794*5113495bSYour Name
3795*5113495bSYour Name /**
3796*5113495bSYour Name * qdf_nbuf_is_ipv4_pkt() - check if packet is a ipv4 packet or not
3797*5113495bSYour Name * @buf: buffer
3798*5113495bSYour Name *
3799*5113495bSYour Name * This api is for Tx packets.
3800*5113495bSYour Name *
3801*5113495bSYour Name * Return: true if packet is ipv4 packet
3802*5113495bSYour Name */
3803*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_pkt(qdf_nbuf_t buf)3804*5113495bSYour Name bool qdf_nbuf_is_ipv4_pkt(qdf_nbuf_t buf)
3805*5113495bSYour Name {
3806*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_pkt(qdf_nbuf_data(buf));
3807*5113495bSYour Name }
3808*5113495bSYour Name
3809*5113495bSYour Name /**
3810*5113495bSYour Name * qdf_nbuf_data_is_ipv4_pkt() - check if packet is a ipv4 packet or not
3811*5113495bSYour Name * @data: data
3812*5113495bSYour Name *
3813*5113495bSYour Name * This api is for Tx packets.
3814*5113495bSYour Name *
3815*5113495bSYour Name * Return: true if packet is ipv4 packet
3816*5113495bSYour Name */
3817*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv4_pkt(uint8_t * data)3818*5113495bSYour Name bool qdf_nbuf_data_is_ipv4_pkt(uint8_t *data)
3819*5113495bSYour Name {
3820*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_pkt(data);
3821*5113495bSYour Name }
3822*5113495bSYour Name
3823*5113495bSYour Name /**
3824*5113495bSYour Name * qdf_nbuf_is_ipv4_dhcp_pkt() - check if packet is a dhcp packet or not
3825*5113495bSYour Name * @buf: buffer
3826*5113495bSYour Name *
3827*5113495bSYour Name * This api is for ipv4 packet.
3828*5113495bSYour Name *
3829*5113495bSYour Name * Return: true if packet is DHCP packet
3830*5113495bSYour Name */
3831*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_dhcp_pkt(qdf_nbuf_t buf)3832*5113495bSYour Name bool qdf_nbuf_is_ipv4_dhcp_pkt(qdf_nbuf_t buf)
3833*5113495bSYour Name {
3834*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_dhcp_pkt(qdf_nbuf_data(buf));
3835*5113495bSYour Name }
3836*5113495bSYour Name
3837*5113495bSYour Name /**
3838*5113495bSYour Name * qdf_nbuf_data_is_ipv4_dhcp_pkt() - check if it is DHCP packet.
3839*5113495bSYour Name * @data: Pointer to DHCP packet data buffer
3840*5113495bSYour Name *
3841*5113495bSYour Name * This func. checks whether it is a DHCP packet or not.
3842*5113495bSYour Name *
3843*5113495bSYour Name * Return: true if it is a DHCP packet
3844*5113495bSYour Name * false if not
3845*5113495bSYour Name */
3846*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv4_dhcp_pkt(uint8_t * data)3847*5113495bSYour Name bool qdf_nbuf_data_is_ipv4_dhcp_pkt(uint8_t *data)
3848*5113495bSYour Name {
3849*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_dhcp_pkt(data);
3850*5113495bSYour Name }
3851*5113495bSYour Name
3852*5113495bSYour Name /**
3853*5113495bSYour Name * qdf_nbuf_is_ipv6_mdns_pkt() - check if it is MDNS packet.
3854*5113495bSYour Name * @buf: Pointer to packet data buffer
3855*5113495bSYour Name *
3856*5113495bSYour Name * This func. checks whether it is a MDNS packet or not.
3857*5113495bSYour Name *
3858*5113495bSYour Name * Return: true if it is a MDNS packet, false if not
3859*5113495bSYour Name */
3860*5113495bSYour Name static inline
qdf_nbuf_is_ipv6_mdns_pkt(qdf_nbuf_t buf)3861*5113495bSYour Name bool qdf_nbuf_is_ipv6_mdns_pkt(qdf_nbuf_t buf)
3862*5113495bSYour Name {
3863*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_mdns_pkt(qdf_nbuf_data(buf));
3864*5113495bSYour Name }
3865*5113495bSYour Name
3866*5113495bSYour Name /**
3867*5113495bSYour Name * qdf_nbuf_is_ipv6_dhcp_pkt() - check if it is DHCP packet.
3868*5113495bSYour Name * @buf: Pointer to DHCP packet data buffer
3869*5113495bSYour Name *
3870*5113495bSYour Name * This func. checks whether it is a DHCP packet or not.
3871*5113495bSYour Name *
3872*5113495bSYour Name * Return: true if it is a DHCP packet
3873*5113495bSYour Name * false if not
3874*5113495bSYour Name */
3875*5113495bSYour Name static inline
qdf_nbuf_is_ipv6_dhcp_pkt(qdf_nbuf_t buf)3876*5113495bSYour Name bool qdf_nbuf_is_ipv6_dhcp_pkt(qdf_nbuf_t buf)
3877*5113495bSYour Name {
3878*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_dhcp_pkt(qdf_nbuf_data(buf));
3879*5113495bSYour Name }
3880*5113495bSYour Name
3881*5113495bSYour Name /**
3882*5113495bSYour Name * qdf_nbuf_is_ipv4_eapol_pkt() - check if packet is a eapol packet or not
3883*5113495bSYour Name * @buf: buffer
3884*5113495bSYour Name *
3885*5113495bSYour Name * This api is for ipv4 packet.
3886*5113495bSYour Name *
3887*5113495bSYour Name * Return: true if packet is EAPOL packet
3888*5113495bSYour Name */
3889*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_eapol_pkt(qdf_nbuf_t buf)3890*5113495bSYour Name bool qdf_nbuf_is_ipv4_eapol_pkt(qdf_nbuf_t buf)
3891*5113495bSYour Name {
3892*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_eapol_pkt(qdf_nbuf_data(buf));
3893*5113495bSYour Name }
3894*5113495bSYour Name
3895*5113495bSYour Name /**
3896*5113495bSYour Name * qdf_nbuf_data_is_ipv4_eapol_pkt() - check if it is EAPOL packet.
3897*5113495bSYour Name * @data: Pointer to EAPOL packet data buffer
3898*5113495bSYour Name *
3899*5113495bSYour Name * This func. checks whether it is a EAPOL packet or not.
3900*5113495bSYour Name *
3901*5113495bSYour Name * Return: true if it is a EAPOL packet
3902*5113495bSYour Name * false if not
3903*5113495bSYour Name */
3904*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv4_eapol_pkt(uint8_t * data)3905*5113495bSYour Name bool qdf_nbuf_data_is_ipv4_eapol_pkt(uint8_t *data)
3906*5113495bSYour Name {
3907*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_eapol_pkt(data);
3908*5113495bSYour Name }
3909*5113495bSYour Name
3910*5113495bSYour Name /**
3911*5113495bSYour Name * qdf_nbuf_is_ipv4_wapi_pkt() - check if packet is a wapi packet or not
3912*5113495bSYour Name * @buf: buffer
3913*5113495bSYour Name *
3914*5113495bSYour Name * This api is for ipv4 packet.
3915*5113495bSYour Name *
3916*5113495bSYour Name * Return: true if packet is WAPI packet
3917*5113495bSYour Name */
3918*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_wapi_pkt(qdf_nbuf_t buf)3919*5113495bSYour Name bool qdf_nbuf_is_ipv4_wapi_pkt(qdf_nbuf_t buf)
3920*5113495bSYour Name {
3921*5113495bSYour Name return __qdf_nbuf_is_ipv4_wapi_pkt(buf);
3922*5113495bSYour Name }
3923*5113495bSYour Name
3924*5113495bSYour Name /**
3925*5113495bSYour Name * qdf_nbuf_is_ipv4_igmp_pkt() - check if packet is a igmp packet or not
3926*5113495bSYour Name * @buf: buffer
3927*5113495bSYour Name *
3928*5113495bSYour Name * This api is for ipv4 packet.
3929*5113495bSYour Name *
3930*5113495bSYour Name * Return: true if packet is igmp packet
3931*5113495bSYour Name */
3932*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_igmp_pkt(qdf_nbuf_t buf)3933*5113495bSYour Name bool qdf_nbuf_is_ipv4_igmp_pkt(qdf_nbuf_t buf)
3934*5113495bSYour Name {
3935*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_igmp_pkt(qdf_nbuf_data(buf));
3936*5113495bSYour Name }
3937*5113495bSYour Name
3938*5113495bSYour Name /**
3939*5113495bSYour Name * qdf_nbuf_is_ipv6_igmp_pkt() - check if packet is a igmp packet or not
3940*5113495bSYour Name * @buf: buffer
3941*5113495bSYour Name *
3942*5113495bSYour Name * This api is for ipv6 packet.
3943*5113495bSYour Name *
3944*5113495bSYour Name * Return: true if packet is igmp packet
3945*5113495bSYour Name */
3946*5113495bSYour Name static inline
qdf_nbuf_is_ipv6_igmp_pkt(qdf_nbuf_t buf)3947*5113495bSYour Name bool qdf_nbuf_is_ipv6_igmp_pkt(qdf_nbuf_t buf)
3948*5113495bSYour Name {
3949*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_igmp_pkt(qdf_nbuf_data(buf));
3950*5113495bSYour Name }
3951*5113495bSYour Name
3952*5113495bSYour Name /**
3953*5113495bSYour Name * qdf_nbuf_is_ipv4_igmp_leave_pkt() - check if it is a igmp leave packet or not
3954*5113495bSYour Name * @buf: buffer
3955*5113495bSYour Name *
3956*5113495bSYour Name * This api is for ipv4 packet.
3957*5113495bSYour Name *
3958*5113495bSYour Name * Return: true if packet is igmp packet
3959*5113495bSYour Name */
3960*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_igmp_leave_pkt(qdf_nbuf_t buf)3961*5113495bSYour Name bool qdf_nbuf_is_ipv4_igmp_leave_pkt(qdf_nbuf_t buf)
3962*5113495bSYour Name {
3963*5113495bSYour Name return __qdf_nbuf_is_ipv4_igmp_leave_pkt(buf);
3964*5113495bSYour Name }
3965*5113495bSYour Name
3966*5113495bSYour Name /**
3967*5113495bSYour Name * qdf_nbuf_is_ipv6_igmp_leave_pkt() - check if it is a igmp leave packet or not
3968*5113495bSYour Name * @buf: buffer
3969*5113495bSYour Name *
3970*5113495bSYour Name * This api is for ipv6 packet.
3971*5113495bSYour Name *
3972*5113495bSYour Name * Return: true if packet is igmp packet
3973*5113495bSYour Name */
3974*5113495bSYour Name static inline
qdf_nbuf_is_ipv6_igmp_leave_pkt(qdf_nbuf_t buf)3975*5113495bSYour Name bool qdf_nbuf_is_ipv6_igmp_leave_pkt(qdf_nbuf_t buf)
3976*5113495bSYour Name {
3977*5113495bSYour Name return __qdf_nbuf_is_ipv6_igmp_leave_pkt(buf);
3978*5113495bSYour Name }
3979*5113495bSYour Name
3980*5113495bSYour Name /**
3981*5113495bSYour Name * qdf_nbuf_is_ipv4_tdls_pkt() - check if packet is a tdls packet or not
3982*5113495bSYour Name * @buf: buffer
3983*5113495bSYour Name *
3984*5113495bSYour Name * This api is for ipv4 packet.
3985*5113495bSYour Name *
3986*5113495bSYour Name * Return: true if packet is TDLS packet
3987*5113495bSYour Name */
3988*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_tdls_pkt(qdf_nbuf_t buf)3989*5113495bSYour Name bool qdf_nbuf_is_ipv4_tdls_pkt(qdf_nbuf_t buf)
3990*5113495bSYour Name {
3991*5113495bSYour Name return __qdf_nbuf_is_ipv4_tdls_pkt(buf);
3992*5113495bSYour Name }
3993*5113495bSYour Name
3994*5113495bSYour Name /**
3995*5113495bSYour Name * qdf_nbuf_is_ipv4_arp_pkt() - check if packet is a arp packet or not
3996*5113495bSYour Name * @buf: buffer
3997*5113495bSYour Name *
3998*5113495bSYour Name * This api is for ipv4 packet.
3999*5113495bSYour Name *
4000*5113495bSYour Name * Return: true if packet is ARP packet
4001*5113495bSYour Name */
4002*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_arp_pkt(qdf_nbuf_t buf)4003*5113495bSYour Name bool qdf_nbuf_is_ipv4_arp_pkt(qdf_nbuf_t buf)
4004*5113495bSYour Name {
4005*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_arp_pkt(qdf_nbuf_data(buf));
4006*5113495bSYour Name }
4007*5113495bSYour Name
4008*5113495bSYour Name /**
4009*5113495bSYour Name * qdf_nbuf_data_is_ipv4_arp_pkt() - check if it is ARP packet.
4010*5113495bSYour Name * @data: Pointer to ARP packet data buffer
4011*5113495bSYour Name *
4012*5113495bSYour Name * This func. checks whether it is a ARP packet or not.
4013*5113495bSYour Name *
4014*5113495bSYour Name * Return: TRUE if it is a ARP packet
4015*5113495bSYour Name * FALSE if not
4016*5113495bSYour Name */
4017*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv4_arp_pkt(uint8_t * data)4018*5113495bSYour Name bool qdf_nbuf_data_is_ipv4_arp_pkt(uint8_t *data)
4019*5113495bSYour Name {
4020*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_arp_pkt(data);
4021*5113495bSYour Name }
4022*5113495bSYour Name
4023*5113495bSYour Name /**
4024*5113495bSYour Name * qdf_nbuf_data_is_arp_req() - check if ARP packet is request.
4025*5113495bSYour Name * @buf: buffer
4026*5113495bSYour Name *
4027*5113495bSYour Name * This func. checks whether it is a ARP request or not.
4028*5113495bSYour Name *
4029*5113495bSYour Name * Return: true if it is a ARP request or FALSE if not
4030*5113495bSYour Name */
4031*5113495bSYour Name static inline
qdf_nbuf_data_is_arp_req(qdf_nbuf_t buf)4032*5113495bSYour Name bool qdf_nbuf_data_is_arp_req(qdf_nbuf_t buf)
4033*5113495bSYour Name {
4034*5113495bSYour Name return __qdf_nbuf_data_is_arp_req(qdf_nbuf_data(buf));
4035*5113495bSYour Name }
4036*5113495bSYour Name
4037*5113495bSYour Name /**
4038*5113495bSYour Name * qdf_nbuf_data_is_arp_rsp() - check if ARP packet is response.
4039*5113495bSYour Name * @buf: buffer
4040*5113495bSYour Name *
4041*5113495bSYour Name * This func. checks whether it is a ARP response or not.
4042*5113495bSYour Name *
4043*5113495bSYour Name * Return: true if it is a ARP response or FALSE if not
4044*5113495bSYour Name */
4045*5113495bSYour Name static inline
qdf_nbuf_data_is_arp_rsp(qdf_nbuf_t buf)4046*5113495bSYour Name bool qdf_nbuf_data_is_arp_rsp(qdf_nbuf_t buf)
4047*5113495bSYour Name {
4048*5113495bSYour Name return __qdf_nbuf_data_is_arp_rsp(qdf_nbuf_data(buf));
4049*5113495bSYour Name }
4050*5113495bSYour Name
4051*5113495bSYour Name /**
4052*5113495bSYour Name * qdf_nbuf_get_arp_src_ip() - get ARP packet source IP gateway.
4053*5113495bSYour Name * @buf: buffer
4054*5113495bSYour Name *
4055*5113495bSYour Name * Return: ARP packet source IP value.
4056*5113495bSYour Name */
4057*5113495bSYour Name static inline
qdf_nbuf_get_arp_src_ip(qdf_nbuf_t buf)4058*5113495bSYour Name uint32_t qdf_nbuf_get_arp_src_ip(qdf_nbuf_t buf)
4059*5113495bSYour Name {
4060*5113495bSYour Name return __qdf_nbuf_get_arp_src_ip(qdf_nbuf_data(buf));
4061*5113495bSYour Name }
4062*5113495bSYour Name
4063*5113495bSYour Name /**
4064*5113495bSYour Name * qdf_nbuf_get_arp_tgt_ip() - get ARP packet target IP gateway.
4065*5113495bSYour Name * @buf: buffer
4066*5113495bSYour Name *
4067*5113495bSYour Name * Return: ARP packet target IP value.
4068*5113495bSYour Name */
4069*5113495bSYour Name static inline
qdf_nbuf_get_arp_tgt_ip(qdf_nbuf_t buf)4070*5113495bSYour Name uint32_t qdf_nbuf_get_arp_tgt_ip(qdf_nbuf_t buf)
4071*5113495bSYour Name {
4072*5113495bSYour Name return __qdf_nbuf_get_arp_tgt_ip(qdf_nbuf_data(buf));
4073*5113495bSYour Name }
4074*5113495bSYour Name
4075*5113495bSYour Name /**
4076*5113495bSYour Name * qdf_nbuf_get_dns_domain_name() - get dns domain name of required length
4077*5113495bSYour Name * @buf: buffer
4078*5113495bSYour Name * @len: length to copy
4079*5113495bSYour Name *
4080*5113495bSYour Name * Return: dns domain name
4081*5113495bSYour Name */
4082*5113495bSYour Name static inline
qdf_nbuf_get_dns_domain_name(qdf_nbuf_t buf,uint32_t len)4083*5113495bSYour Name uint8_t *qdf_nbuf_get_dns_domain_name(qdf_nbuf_t buf, uint32_t len)
4084*5113495bSYour Name {
4085*5113495bSYour Name return __qdf_nbuf_get_dns_domain_name(qdf_nbuf_data(buf), len);
4086*5113495bSYour Name }
4087*5113495bSYour Name
4088*5113495bSYour Name /**
4089*5113495bSYour Name * qdf_nbuf_data_is_dns_query() - check if skb data is a dns query
4090*5113495bSYour Name * @buf: buffer
4091*5113495bSYour Name *
4092*5113495bSYour Name * Return: true if packet is dns query packet.
4093*5113495bSYour Name * false otherwise.
4094*5113495bSYour Name */
4095*5113495bSYour Name static inline
qdf_nbuf_data_is_dns_query(qdf_nbuf_t buf)4096*5113495bSYour Name bool qdf_nbuf_data_is_dns_query(qdf_nbuf_t buf)
4097*5113495bSYour Name {
4098*5113495bSYour Name return __qdf_nbuf_data_is_dns_query(qdf_nbuf_data(buf));
4099*5113495bSYour Name }
4100*5113495bSYour Name
4101*5113495bSYour Name /**
4102*5113495bSYour Name * qdf_nbuf_data_is_dns_response() - check if skb data is a dns response
4103*5113495bSYour Name * @buf: buffer
4104*5113495bSYour Name *
4105*5113495bSYour Name * Return: true if packet is dns response packet.
4106*5113495bSYour Name * false otherwise.
4107*5113495bSYour Name */
4108*5113495bSYour Name static inline
qdf_nbuf_data_is_dns_response(qdf_nbuf_t buf)4109*5113495bSYour Name bool qdf_nbuf_data_is_dns_response(qdf_nbuf_t buf)
4110*5113495bSYour Name {
4111*5113495bSYour Name return __qdf_nbuf_data_is_dns_response(qdf_nbuf_data(buf));
4112*5113495bSYour Name }
4113*5113495bSYour Name
4114*5113495bSYour Name /**
4115*5113495bSYour Name * qdf_nbuf_data_is_tcp_fin() - check if skb data is a tcp fin
4116*5113495bSYour Name * @buf: buffer
4117*5113495bSYour Name *
4118*5113495bSYour Name * Return: true if packet is tcp fin packet.
4119*5113495bSYour Name * false otherwise.
4120*5113495bSYour Name */
4121*5113495bSYour Name static inline
qdf_nbuf_data_is_tcp_fin(qdf_nbuf_t buf)4122*5113495bSYour Name bool qdf_nbuf_data_is_tcp_fin(qdf_nbuf_t buf)
4123*5113495bSYour Name {
4124*5113495bSYour Name return __qdf_nbuf_data_is_tcp_fin(qdf_nbuf_data(buf));
4125*5113495bSYour Name }
4126*5113495bSYour Name
4127*5113495bSYour Name /**
4128*5113495bSYour Name * qdf_nbuf_data_is_tcp_fin_ack() - check if skb data is a tcp fin ack
4129*5113495bSYour Name * @buf: buffer
4130*5113495bSYour Name *
4131*5113495bSYour Name * Return: true if packet is tcp fin ack packet.
4132*5113495bSYour Name * false otherwise.
4133*5113495bSYour Name */
4134*5113495bSYour Name static inline
qdf_nbuf_data_is_tcp_fin_ack(qdf_nbuf_t buf)4135*5113495bSYour Name bool qdf_nbuf_data_is_tcp_fin_ack(qdf_nbuf_t buf)
4136*5113495bSYour Name {
4137*5113495bSYour Name return __qdf_nbuf_data_is_tcp_fin_ack(qdf_nbuf_data(buf));
4138*5113495bSYour Name }
4139*5113495bSYour Name
4140*5113495bSYour Name /**
4141*5113495bSYour Name * qdf_nbuf_data_is_tcp_syn() - check if skb data is a tcp syn
4142*5113495bSYour Name * @buf: buffer
4143*5113495bSYour Name *
4144*5113495bSYour Name * Return: true if packet is tcp syn packet.
4145*5113495bSYour Name * false otherwise.
4146*5113495bSYour Name */
4147*5113495bSYour Name static inline
qdf_nbuf_data_is_tcp_syn(qdf_nbuf_t buf)4148*5113495bSYour Name bool qdf_nbuf_data_is_tcp_syn(qdf_nbuf_t buf)
4149*5113495bSYour Name {
4150*5113495bSYour Name return __qdf_nbuf_data_is_tcp_syn(qdf_nbuf_data(buf));
4151*5113495bSYour Name }
4152*5113495bSYour Name
4153*5113495bSYour Name /**
4154*5113495bSYour Name * qdf_nbuf_data_is_tcp_syn_ack() - check if skb data is a tcp syn ack
4155*5113495bSYour Name * @buf: buffer
4156*5113495bSYour Name *
4157*5113495bSYour Name * Return: true if packet is tcp syn ack packet.
4158*5113495bSYour Name * false otherwise.
4159*5113495bSYour Name */
4160*5113495bSYour Name static inline
qdf_nbuf_data_is_tcp_syn_ack(qdf_nbuf_t buf)4161*5113495bSYour Name bool qdf_nbuf_data_is_tcp_syn_ack(qdf_nbuf_t buf)
4162*5113495bSYour Name {
4163*5113495bSYour Name return __qdf_nbuf_data_is_tcp_syn_ack(qdf_nbuf_data(buf));
4164*5113495bSYour Name }
4165*5113495bSYour Name
4166*5113495bSYour Name /**
4167*5113495bSYour Name * qdf_nbuf_data_is_tcp_rst() - check if skb data is a tcp rst
4168*5113495bSYour Name * @buf: buffer
4169*5113495bSYour Name *
4170*5113495bSYour Name * Return: true if packet is tcp rst packet.
4171*5113495bSYour Name * false otherwise.
4172*5113495bSYour Name */
4173*5113495bSYour Name static inline
qdf_nbuf_data_is_tcp_rst(qdf_nbuf_t buf)4174*5113495bSYour Name bool qdf_nbuf_data_is_tcp_rst(qdf_nbuf_t buf)
4175*5113495bSYour Name {
4176*5113495bSYour Name return __qdf_nbuf_data_is_tcp_rst(qdf_nbuf_data(buf));
4177*5113495bSYour Name }
4178*5113495bSYour Name
4179*5113495bSYour Name /**
4180*5113495bSYour Name * qdf_nbuf_data_is_tcp_ack() - check if skb data is a tcp ack
4181*5113495bSYour Name * @buf: buffer
4182*5113495bSYour Name *
4183*5113495bSYour Name * Return: true if packet is tcp ack packet.
4184*5113495bSYour Name * false otherwise.
4185*5113495bSYour Name */
4186*5113495bSYour Name static inline
qdf_nbuf_data_is_tcp_ack(qdf_nbuf_t buf)4187*5113495bSYour Name bool qdf_nbuf_data_is_tcp_ack(qdf_nbuf_t buf)
4188*5113495bSYour Name {
4189*5113495bSYour Name return __qdf_nbuf_data_is_tcp_ack(qdf_nbuf_data(buf));
4190*5113495bSYour Name }
4191*5113495bSYour Name
4192*5113495bSYour Name /**
4193*5113495bSYour Name * qdf_nbuf_data_get_tcp_src_port() - get tcp src port
4194*5113495bSYour Name * @buf: buffer
4195*5113495bSYour Name *
4196*5113495bSYour Name * Return: tcp source port value.
4197*5113495bSYour Name */
4198*5113495bSYour Name static inline
qdf_nbuf_data_get_tcp_src_port(qdf_nbuf_t buf)4199*5113495bSYour Name uint16_t qdf_nbuf_data_get_tcp_src_port(qdf_nbuf_t buf)
4200*5113495bSYour Name {
4201*5113495bSYour Name return __qdf_nbuf_data_get_tcp_src_port(qdf_nbuf_data(buf));
4202*5113495bSYour Name }
4203*5113495bSYour Name
4204*5113495bSYour Name /**
4205*5113495bSYour Name * qdf_nbuf_data_get_tcp_dst_port() - get tcp dst port
4206*5113495bSYour Name * @buf: buffer
4207*5113495bSYour Name *
4208*5113495bSYour Name * Return: tcp destination port value.
4209*5113495bSYour Name */
4210*5113495bSYour Name static inline
qdf_nbuf_data_get_tcp_dst_port(qdf_nbuf_t buf)4211*5113495bSYour Name uint16_t qdf_nbuf_data_get_tcp_dst_port(qdf_nbuf_t buf)
4212*5113495bSYour Name {
4213*5113495bSYour Name return __qdf_nbuf_data_get_tcp_dst_port(qdf_nbuf_data(buf));
4214*5113495bSYour Name }
4215*5113495bSYour Name
4216*5113495bSYour Name /**
4217*5113495bSYour Name * qdf_nbuf_data_is_icmpv4_req() - check if ICMPv4 packet is request.
4218*5113495bSYour Name * @buf: buffer
4219*5113495bSYour Name *
4220*5113495bSYour Name * This func. checks whether it is a ICMPv4 request or not.
4221*5113495bSYour Name *
4222*5113495bSYour Name * Return: true if it is a ICMPv4 request or fALSE if not
4223*5113495bSYour Name */
4224*5113495bSYour Name static inline
qdf_nbuf_data_is_icmpv4_req(qdf_nbuf_t buf)4225*5113495bSYour Name bool qdf_nbuf_data_is_icmpv4_req(qdf_nbuf_t buf)
4226*5113495bSYour Name {
4227*5113495bSYour Name return __qdf_nbuf_data_is_icmpv4_req(qdf_nbuf_data(buf));
4228*5113495bSYour Name }
4229*5113495bSYour Name
4230*5113495bSYour Name /**
4231*5113495bSYour Name * qdf_nbuf_data_is_icmpv4_rsp() - check if ICMPv4 packet is res
4232*5113495bSYour Name * @buf: buffer
4233*5113495bSYour Name *
4234*5113495bSYour Name * Return: true if packet is icmpv4 response
4235*5113495bSYour Name * false otherwise.
4236*5113495bSYour Name */
4237*5113495bSYour Name static inline
qdf_nbuf_data_is_icmpv4_rsp(qdf_nbuf_t buf)4238*5113495bSYour Name bool qdf_nbuf_data_is_icmpv4_rsp(qdf_nbuf_t buf)
4239*5113495bSYour Name {
4240*5113495bSYour Name return __qdf_nbuf_data_is_icmpv4_rsp(qdf_nbuf_data(buf));
4241*5113495bSYour Name }
4242*5113495bSYour Name
4243*5113495bSYour Name static inline
qdf_nbuf_is_icmpv4_redirect(qdf_nbuf_t buf)4244*5113495bSYour Name bool qdf_nbuf_is_icmpv4_redirect(qdf_nbuf_t buf)
4245*5113495bSYour Name {
4246*5113495bSYour Name return __qdf_nbuf_data_is_icmpv4_redirect(qdf_nbuf_data(buf));
4247*5113495bSYour Name }
4248*5113495bSYour Name
4249*5113495bSYour Name /**
4250*5113495bSYour Name * qdf_nbuf_get_icmpv4_src_ip() - get icmpv4 src IP
4251*5113495bSYour Name * @buf: buffer
4252*5113495bSYour Name *
4253*5113495bSYour Name * Return: icmpv4 packet source IP value.
4254*5113495bSYour Name */
4255*5113495bSYour Name static inline
qdf_nbuf_get_icmpv4_src_ip(qdf_nbuf_t buf)4256*5113495bSYour Name uint32_t qdf_nbuf_get_icmpv4_src_ip(qdf_nbuf_t buf)
4257*5113495bSYour Name {
4258*5113495bSYour Name return __qdf_nbuf_get_icmpv4_src_ip(qdf_nbuf_data(buf));
4259*5113495bSYour Name }
4260*5113495bSYour Name
4261*5113495bSYour Name /**
4262*5113495bSYour Name * qdf_nbuf_get_icmpv4_tgt_ip() - get icmpv4 target IP
4263*5113495bSYour Name * @buf: buffer
4264*5113495bSYour Name *
4265*5113495bSYour Name * Return: icmpv4 packet target IP value.
4266*5113495bSYour Name */
4267*5113495bSYour Name static inline
qdf_nbuf_get_icmpv4_tgt_ip(qdf_nbuf_t buf)4268*5113495bSYour Name uint32_t qdf_nbuf_get_icmpv4_tgt_ip(qdf_nbuf_t buf)
4269*5113495bSYour Name {
4270*5113495bSYour Name return __qdf_nbuf_get_icmpv4_tgt_ip(qdf_nbuf_data(buf));
4271*5113495bSYour Name }
4272*5113495bSYour Name
4273*5113495bSYour Name /**
4274*5113495bSYour Name * qdf_nbuf_is_ipv6_pkt() - check if it is IPV6 packet.
4275*5113495bSYour Name * @buf: Pointer to IPV6 packet buffer
4276*5113495bSYour Name *
4277*5113495bSYour Name * This func. checks whether it is a IPV6 packet or not.
4278*5113495bSYour Name *
4279*5113495bSYour Name * Return: TRUE if it is a IPV6 packet
4280*5113495bSYour Name * FALSE if not
4281*5113495bSYour Name */
4282*5113495bSYour Name static inline
qdf_nbuf_is_ipv6_pkt(qdf_nbuf_t buf)4283*5113495bSYour Name bool qdf_nbuf_is_ipv6_pkt(qdf_nbuf_t buf)
4284*5113495bSYour Name {
4285*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_pkt(qdf_nbuf_data(buf));
4286*5113495bSYour Name }
4287*5113495bSYour Name
4288*5113495bSYour Name static inline
qdf_nbuf_is_icmpv6_redirect(qdf_nbuf_t buf)4289*5113495bSYour Name bool qdf_nbuf_is_icmpv6_redirect(qdf_nbuf_t buf)
4290*5113495bSYour Name {
4291*5113495bSYour Name return __qdf_nbuf_data_is_icmpv6_redirect(qdf_nbuf_data(buf));
4292*5113495bSYour Name }
4293*5113495bSYour Name /**
4294*5113495bSYour Name * qdf_nbuf_data_is_ipv6_pkt() - check if it is IPV6 packet.
4295*5113495bSYour Name * @data: Pointer to IPV6 packet data buffer
4296*5113495bSYour Name *
4297*5113495bSYour Name * This func. checks whether it is a IPV6 packet or not.
4298*5113495bSYour Name *
4299*5113495bSYour Name * Return: TRUE if it is a IPV6 packet
4300*5113495bSYour Name * FALSE if not
4301*5113495bSYour Name */
4302*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv6_pkt(uint8_t * data)4303*5113495bSYour Name bool qdf_nbuf_data_is_ipv6_pkt(uint8_t *data)
4304*5113495bSYour Name {
4305*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_pkt(data);
4306*5113495bSYour Name }
4307*5113495bSYour Name
4308*5113495bSYour Name /**
4309*5113495bSYour Name * qdf_nbuf_data_is_ipv4_mcast_pkt() - check if it is IPV4 multicast packet.
4310*5113495bSYour Name * @data: Pointer to IPV4 packet data buffer
4311*5113495bSYour Name *
4312*5113495bSYour Name * This func. checks whether it is a IPV4 multicast packet or not.
4313*5113495bSYour Name *
4314*5113495bSYour Name * Return: TRUE if it is a IPV4 multicast packet
4315*5113495bSYour Name * FALSE if not
4316*5113495bSYour Name */
4317*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv4_mcast_pkt(uint8_t * data)4318*5113495bSYour Name bool qdf_nbuf_data_is_ipv4_mcast_pkt(uint8_t *data)
4319*5113495bSYour Name {
4320*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_mcast_pkt(data);
4321*5113495bSYour Name }
4322*5113495bSYour Name
4323*5113495bSYour Name /**
4324*5113495bSYour Name * qdf_nbuf_data_is_ipv6_mcast_pkt() - check if it is IPV6 multicast packet.
4325*5113495bSYour Name * @data: Pointer to IPV6 packet data buffer
4326*5113495bSYour Name *
4327*5113495bSYour Name * This func. checks whether it is a IPV6 multicast packet or not.
4328*5113495bSYour Name *
4329*5113495bSYour Name * Return: TRUE if it is a IPV6 multicast packet
4330*5113495bSYour Name * FALSE if not
4331*5113495bSYour Name */
4332*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv6_mcast_pkt(uint8_t * data)4333*5113495bSYour Name bool qdf_nbuf_data_is_ipv6_mcast_pkt(uint8_t *data)
4334*5113495bSYour Name {
4335*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_mcast_pkt(data);
4336*5113495bSYour Name }
4337*5113495bSYour Name
4338*5113495bSYour Name /**
4339*5113495bSYour Name * qdf_nbuf_is_icmp_pkt() - check if it is IPV4 ICMP packet.
4340*5113495bSYour Name * @buf: Pointer to IPV4 ICMP packet buffer
4341*5113495bSYour Name *
4342*5113495bSYour Name * This func. checks whether it is a ICMP packet or not.
4343*5113495bSYour Name *
4344*5113495bSYour Name * Return: TRUE if it is a ICMP packet
4345*5113495bSYour Name * FALSE if not
4346*5113495bSYour Name */
4347*5113495bSYour Name static inline
qdf_nbuf_is_icmp_pkt(qdf_nbuf_t buf)4348*5113495bSYour Name bool qdf_nbuf_is_icmp_pkt(qdf_nbuf_t buf)
4349*5113495bSYour Name {
4350*5113495bSYour Name return __qdf_nbuf_data_is_icmp_pkt(qdf_nbuf_data(buf));
4351*5113495bSYour Name }
4352*5113495bSYour Name
4353*5113495bSYour Name /**
4354*5113495bSYour Name * qdf_nbuf_data_is_icmp_pkt() - check if it is IPV4 ICMP packet.
4355*5113495bSYour Name * @data: Pointer to IPV4 ICMP packet data buffer
4356*5113495bSYour Name *
4357*5113495bSYour Name * This func. checks whether it is a ICMP packet or not.
4358*5113495bSYour Name *
4359*5113495bSYour Name * Return: TRUE if it is a ICMP packet
4360*5113495bSYour Name * FALSE if not
4361*5113495bSYour Name */
4362*5113495bSYour Name static inline
qdf_nbuf_data_is_icmp_pkt(uint8_t * data)4363*5113495bSYour Name bool qdf_nbuf_data_is_icmp_pkt(uint8_t *data)
4364*5113495bSYour Name {
4365*5113495bSYour Name return __qdf_nbuf_data_is_icmp_pkt(data);
4366*5113495bSYour Name }
4367*5113495bSYour Name
4368*5113495bSYour Name /**
4369*5113495bSYour Name * qdf_nbuf_is_icmpv6_pkt() - check if it is IPV6 ICMPV6 packet.
4370*5113495bSYour Name * @buf: Pointer to IPV6 ICMPV6 packet buffer
4371*5113495bSYour Name *
4372*5113495bSYour Name * This func. checks whether it is a ICMPV6 packet or not.
4373*5113495bSYour Name *
4374*5113495bSYour Name * Return: TRUE if it is a ICMPV6 packet
4375*5113495bSYour Name * FALSE if not
4376*5113495bSYour Name */
4377*5113495bSYour Name static inline
qdf_nbuf_is_icmpv6_pkt(qdf_nbuf_t buf)4378*5113495bSYour Name bool qdf_nbuf_is_icmpv6_pkt(qdf_nbuf_t buf)
4379*5113495bSYour Name {
4380*5113495bSYour Name return __qdf_nbuf_data_is_icmpv6_pkt(qdf_nbuf_data(buf));
4381*5113495bSYour Name }
4382*5113495bSYour Name
4383*5113495bSYour Name /**
4384*5113495bSYour Name * qdf_nbuf_data_is_icmpv6_pkt() - check if it is IPV6 ICMPV6 packet.
4385*5113495bSYour Name * @data: Pointer to IPV6 ICMPV6 packet data buffer
4386*5113495bSYour Name *
4387*5113495bSYour Name * This func. checks whether it is a ICMPV6 packet or not.
4388*5113495bSYour Name *
4389*5113495bSYour Name * Return: TRUE if it is a ICMPV6 packet
4390*5113495bSYour Name * FALSE if not
4391*5113495bSYour Name */
4392*5113495bSYour Name static inline
qdf_nbuf_data_is_icmpv6_pkt(uint8_t * data)4393*5113495bSYour Name bool qdf_nbuf_data_is_icmpv6_pkt(uint8_t *data)
4394*5113495bSYour Name {
4395*5113495bSYour Name return __qdf_nbuf_data_is_icmpv6_pkt(data);
4396*5113495bSYour Name }
4397*5113495bSYour Name
4398*5113495bSYour Name /**
4399*5113495bSYour Name * qdf_nbuf_is_ipv4_udp_pkt() - check if it is IPV4 UDP packet.
4400*5113495bSYour Name * @buf: Pointer to IPV4 UDP packet buffer
4401*5113495bSYour Name *
4402*5113495bSYour Name * This func. checks whether it is a IPV4 UDP packet or not.
4403*5113495bSYour Name *
4404*5113495bSYour Name * Return: TRUE if it is a IPV4 UDP packet
4405*5113495bSYour Name * FALSE if not
4406*5113495bSYour Name */
4407*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_udp_pkt(qdf_nbuf_t buf)4408*5113495bSYour Name bool qdf_nbuf_is_ipv4_udp_pkt(qdf_nbuf_t buf)
4409*5113495bSYour Name {
4410*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_udp_pkt(qdf_nbuf_data(buf));
4411*5113495bSYour Name }
4412*5113495bSYour Name
4413*5113495bSYour Name /**
4414*5113495bSYour Name * qdf_nbuf_data_is_ipv4_udp_pkt() - check if it is IPV4 UDP packet.
4415*5113495bSYour Name * @data: Pointer to IPV4 UDP packet data buffer
4416*5113495bSYour Name *
4417*5113495bSYour Name * This func. checks whether it is a IPV4 UDP packet or not.
4418*5113495bSYour Name *
4419*5113495bSYour Name * Return: TRUE if it is a IPV4 UDP packet
4420*5113495bSYour Name * FALSE if not
4421*5113495bSYour Name */
4422*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv4_udp_pkt(uint8_t * data)4423*5113495bSYour Name bool qdf_nbuf_data_is_ipv4_udp_pkt(uint8_t *data)
4424*5113495bSYour Name {
4425*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_udp_pkt(data);
4426*5113495bSYour Name }
4427*5113495bSYour Name
4428*5113495bSYour Name /**
4429*5113495bSYour Name * qdf_nbuf_is_ipv4_tcp_pkt() - check if it is IPV4 TCP packet.
4430*5113495bSYour Name * @buf: Pointer to IPV4 TCP packet buffer
4431*5113495bSYour Name *
4432*5113495bSYour Name * This func. checks whether it is a IPV4 TCP packet or not.
4433*5113495bSYour Name *
4434*5113495bSYour Name * Return: TRUE if it is a IPV4 TCP packet
4435*5113495bSYour Name * FALSE if not
4436*5113495bSYour Name */
4437*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_tcp_pkt(qdf_nbuf_t buf)4438*5113495bSYour Name bool qdf_nbuf_is_ipv4_tcp_pkt(qdf_nbuf_t buf)
4439*5113495bSYour Name {
4440*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_tcp_pkt(qdf_nbuf_data(buf));
4441*5113495bSYour Name }
4442*5113495bSYour Name
4443*5113495bSYour Name /**
4444*5113495bSYour Name * qdf_nbuf_data_is_ipv4_tcp_pkt() - check if it is IPV4 TCP packet.
4445*5113495bSYour Name * @data: Pointer to IPV4 TCP packet data buffer
4446*5113495bSYour Name *
4447*5113495bSYour Name * This func. checks whether it is a IPV4 TCP packet or not.
4448*5113495bSYour Name *
4449*5113495bSYour Name * Return: TRUE if it is a IPV4 TCP packet
4450*5113495bSYour Name * FALSE if not
4451*5113495bSYour Name */
4452*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv4_tcp_pkt(uint8_t * data)4453*5113495bSYour Name bool qdf_nbuf_data_is_ipv4_tcp_pkt(uint8_t *data)
4454*5113495bSYour Name {
4455*5113495bSYour Name return __qdf_nbuf_data_is_ipv4_tcp_pkt(data);
4456*5113495bSYour Name }
4457*5113495bSYour Name
4458*5113495bSYour Name /**
4459*5113495bSYour Name * qdf_nbuf_is_ipv6_udp_pkt() - check if it is IPV6 UDP packet.
4460*5113495bSYour Name * @buf: Pointer to IPV6 UDP packet buffer
4461*5113495bSYour Name *
4462*5113495bSYour Name * This func. checks whether it is a IPV6 UDP packet or not.
4463*5113495bSYour Name *
4464*5113495bSYour Name * Return: TRUE if it is a IPV6 UDP packet
4465*5113495bSYour Name * FALSE if not
4466*5113495bSYour Name */
4467*5113495bSYour Name static inline
qdf_nbuf_is_ipv6_udp_pkt(qdf_nbuf_t buf)4468*5113495bSYour Name bool qdf_nbuf_is_ipv6_udp_pkt(qdf_nbuf_t buf)
4469*5113495bSYour Name {
4470*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_udp_pkt(qdf_nbuf_data(buf));
4471*5113495bSYour Name }
4472*5113495bSYour Name
4473*5113495bSYour Name /**
4474*5113495bSYour Name * qdf_nbuf_data_is_ipv6_udp_pkt() - check if it is IPV6 UDP packet.
4475*5113495bSYour Name * @data: Pointer to IPV6 UDP packet data buffer
4476*5113495bSYour Name *
4477*5113495bSYour Name * This func. checks whether it is a IPV6 UDP packet or not.
4478*5113495bSYour Name *
4479*5113495bSYour Name * Return: TRUE if it is a IPV6 UDP packet
4480*5113495bSYour Name * FALSE if not
4481*5113495bSYour Name */
4482*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv6_udp_pkt(uint8_t * data)4483*5113495bSYour Name bool qdf_nbuf_data_is_ipv6_udp_pkt(uint8_t *data)
4484*5113495bSYour Name {
4485*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_udp_pkt(data);
4486*5113495bSYour Name }
4487*5113495bSYour Name
4488*5113495bSYour Name /**
4489*5113495bSYour Name * qdf_nbuf_is_ipv6_tcp_pkt() - check if it is IPV6 TCP packet.
4490*5113495bSYour Name * @buf: Pointer to IPV6 TCP packet buffer
4491*5113495bSYour Name *
4492*5113495bSYour Name * This func. checks whether it is a IPV6 TCP packet or not.
4493*5113495bSYour Name *
4494*5113495bSYour Name * Return: TRUE if it is a IPV6 TCP packet
4495*5113495bSYour Name * FALSE if not
4496*5113495bSYour Name */
4497*5113495bSYour Name static inline
qdf_nbuf_is_ipv6_tcp_pkt(qdf_nbuf_t buf)4498*5113495bSYour Name bool qdf_nbuf_is_ipv6_tcp_pkt(qdf_nbuf_t buf)
4499*5113495bSYour Name {
4500*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_tcp_pkt(qdf_nbuf_data(buf));
4501*5113495bSYour Name }
4502*5113495bSYour Name
4503*5113495bSYour Name /**
4504*5113495bSYour Name * qdf_nbuf_data_is_ipv6_tcp_pkt() - check if it is IPV6 TCP packet.
4505*5113495bSYour Name * @data: Pointer to IPV6 TCP packet data buffer
4506*5113495bSYour Name *
4507*5113495bSYour Name * This func. checks whether it is a IPV6 TCP packet or not.
4508*5113495bSYour Name *
4509*5113495bSYour Name * Return: TRUE if it is a IPV6 TCP packet
4510*5113495bSYour Name * FALSE if not
4511*5113495bSYour Name */
4512*5113495bSYour Name static inline
qdf_nbuf_data_is_ipv6_tcp_pkt(uint8_t * data)4513*5113495bSYour Name bool qdf_nbuf_data_is_ipv6_tcp_pkt(uint8_t *data)
4514*5113495bSYour Name {
4515*5113495bSYour Name return __qdf_nbuf_data_is_ipv6_tcp_pkt(data);
4516*5113495bSYour Name }
4517*5113495bSYour Name
4518*5113495bSYour Name /**
4519*5113495bSYour Name * qdf_nbuf_is_bcast_pkt() - check if it is broadcast packet.
4520*5113495bSYour Name * @buf: Network buffer
4521*5113495bSYour Name *
4522*5113495bSYour Name * This func. checks whether packet is broadcast or not.
4523*5113495bSYour Name *
4524*5113495bSYour Name * Return: TRUE if it is broadcast packet
4525*5113495bSYour Name * FALSE if not
4526*5113495bSYour Name */
4527*5113495bSYour Name static inline
qdf_nbuf_is_bcast_pkt(qdf_nbuf_t buf)4528*5113495bSYour Name bool qdf_nbuf_is_bcast_pkt(qdf_nbuf_t buf)
4529*5113495bSYour Name {
4530*5113495bSYour Name return __qdf_nbuf_is_bcast_pkt(buf);
4531*5113495bSYour Name }
4532*5113495bSYour Name
4533*5113495bSYour Name /**
4534*5113495bSYour Name * qdf_nbuf_pkt_type_is_mcast() - check if skb pkt type is mcast
4535*5113495bSYour Name * @buf: Network buffer
4536*5113495bSYour Name *
4537*5113495bSYour Name * Return: TRUE if skb pkt type is mcast
4538*5113495bSYour Name * FALSE if not
4539*5113495bSYour Name */
4540*5113495bSYour Name static inline
qdf_nbuf_pkt_type_is_mcast(qdf_nbuf_t buf)4541*5113495bSYour Name bool qdf_nbuf_pkt_type_is_mcast(qdf_nbuf_t buf)
4542*5113495bSYour Name {
4543*5113495bSYour Name return __qdf_nbuf_pkt_type_is_mcast(buf);
4544*5113495bSYour Name }
4545*5113495bSYour Name
4546*5113495bSYour Name /**
4547*5113495bSYour Name * qdf_nbuf_pkt_type_is_bcast() - check if skb pkt type is bcast
4548*5113495bSYour Name * @buf: Network buffer
4549*5113495bSYour Name *
4550*5113495bSYour Name * Return: TRUE if skb pkt type is mcast
4551*5113495bSYour Name * FALSE if not
4552*5113495bSYour Name */
4553*5113495bSYour Name static inline
qdf_nbuf_pkt_type_is_bcast(qdf_nbuf_t buf)4554*5113495bSYour Name bool qdf_nbuf_pkt_type_is_bcast(qdf_nbuf_t buf)
4555*5113495bSYour Name {
4556*5113495bSYour Name return __qdf_nbuf_pkt_type_is_bcast(buf);
4557*5113495bSYour Name }
4558*5113495bSYour Name
4559*5113495bSYour Name /**
4560*5113495bSYour Name * qdf_nbuf_is_mcast_replay() - check if it is multicast replay packet.
4561*5113495bSYour Name * @buf: Network buffer
4562*5113495bSYour Name *
4563*5113495bSYour Name * This func. checks whether packet is multicast replay packet or not.
4564*5113495bSYour Name *
4565*5113495bSYour Name * Return: TRUE if it is multicast packet
4566*5113495bSYour Name * FALSE if not
4567*5113495bSYour Name */
4568*5113495bSYour Name static inline
qdf_nbuf_is_mcast_replay(qdf_nbuf_t buf)4569*5113495bSYour Name bool qdf_nbuf_is_mcast_replay(qdf_nbuf_t buf)
4570*5113495bSYour Name {
4571*5113495bSYour Name return __qdf_nbuf_is_mcast_replay(buf);
4572*5113495bSYour Name }
4573*5113495bSYour Name
4574*5113495bSYour Name #ifdef DP_TX_PACKET_INSPECT_FOR_ILP
4575*5113495bSYour Name /* Reuse bit24~31 in skb->priority for packet type */
4576*5113495bSYour Name #define QDF_NBUF_PRIORITY_PKT_TYPE_MASK 0xFF000000
4577*5113495bSYour Name #define QDF_NBUF_PRIORITY_PKT_TYPE_LSB 24
4578*5113495bSYour Name /* TCP ACK */
4579*5113495bSYour Name #define QDF_NBUF_PRIORITY_PKT_TCP_ACK 0x1
4580*5113495bSYour Name
4581*5113495bSYour Name #define QDF_NBUF_GET_PRIORITY_PKT_TYPE(_pri) \
4582*5113495bSYour Name (((_pri) & QDF_NBUF_PRIORITY_PKT_TYPE_MASK) >> \
4583*5113495bSYour Name QDF_NBUF_PRIORITY_PKT_TYPE_LSB)
4584*5113495bSYour Name
4585*5113495bSYour Name #define QDF_NBUF_PRIORITY_PKT_TYPE(_pkt_type) \
4586*5113495bSYour Name (((_pkt_type) << QDF_NBUF_PRIORITY_PKT_TYPE_LSB) & \
4587*5113495bSYour Name QDF_NBUF_PRIORITY_PKT_TYPE_MASK)
4588*5113495bSYour Name
4589*5113495bSYour Name /**
4590*5113495bSYour Name * qdf_nbuf_get_priority_pkt_type() - Get packet type from priority
4591*5113495bSYour Name * @nbuf: pointer to network buffer
4592*5113495bSYour Name *
4593*5113495bSYour Name * Return: packet type
4594*5113495bSYour Name */
4595*5113495bSYour Name static inline
qdf_nbuf_get_priority_pkt_type(qdf_nbuf_t nbuf)4596*5113495bSYour Name uint8_t qdf_nbuf_get_priority_pkt_type(qdf_nbuf_t nbuf)
4597*5113495bSYour Name {
4598*5113495bSYour Name return QDF_NBUF_GET_PRIORITY_PKT_TYPE(nbuf->priority);
4599*5113495bSYour Name }
4600*5113495bSYour Name
4601*5113495bSYour Name /**
4602*5113495bSYour Name * qdf_nbuf_set_priority_pkt_type() - Set packet type to priority
4603*5113495bSYour Name * @nbuf: pointer to network buffer
4604*5113495bSYour Name * @pkt_type: packet type to be set
4605*5113495bSYour Name *
4606*5113495bSYour Name * Return: none
4607*5113495bSYour Name */
4608*5113495bSYour Name static inline
qdf_nbuf_set_priority_pkt_type(qdf_nbuf_t nbuf,uint8_t pkt_type)4609*5113495bSYour Name void qdf_nbuf_set_priority_pkt_type(qdf_nbuf_t nbuf, uint8_t pkt_type)
4610*5113495bSYour Name {
4611*5113495bSYour Name nbuf->priority |= QDF_NBUF_PRIORITY_PKT_TYPE(pkt_type);
4612*5113495bSYour Name }
4613*5113495bSYour Name
4614*5113495bSYour Name /**
4615*5113495bSYour Name * qdf_nbuf_remove_priority_pkt_type() - Remove the packet type bits
4616*5113495bSYour Name * from priority
4617*5113495bSYour Name * @nbuf: pointer to network buffer
4618*5113495bSYour Name *
4619*5113495bSYour Name * Return: none
4620*5113495bSYour Name */
4621*5113495bSYour Name static inline
qdf_nbuf_remove_priority_pkt_type(qdf_nbuf_t nbuf)4622*5113495bSYour Name void qdf_nbuf_remove_priority_pkt_type(qdf_nbuf_t nbuf)
4623*5113495bSYour Name {
4624*5113495bSYour Name nbuf->priority &= ~QDF_NBUF_PRIORITY_PKT_TYPE_MASK;
4625*5113495bSYour Name }
4626*5113495bSYour Name #endif
4627*5113495bSYour Name
4628*5113495bSYour Name /**
4629*5113495bSYour Name * qdf_nbuf_is_ipv4_v6_pure_tcp_ack() - check if it is pure tcp ack
4630*5113495bSYour Name * without data payload
4631*5113495bSYour Name * @buf: Network buffer
4632*5113495bSYour Name *
4633*5113495bSYour Name * Check whether the packet is pure TCP ack without data payload.
4634*5113495bSYour Name *
4635*5113495bSYour Name * Return : true if TCP ack, else return false
4636*5113495bSYour Name */
4637*5113495bSYour Name static inline
qdf_nbuf_is_ipv4_v6_pure_tcp_ack(qdf_nbuf_t buf)4638*5113495bSYour Name bool qdf_nbuf_is_ipv4_v6_pure_tcp_ack(qdf_nbuf_t buf)
4639*5113495bSYour Name {
4640*5113495bSYour Name return __qdf_nbuf_is_ipv4_v6_pure_tcp_ack(buf);
4641*5113495bSYour Name }
4642*5113495bSYour Name
4643*5113495bSYour Name /**
4644*5113495bSYour Name * qdf_nbuf_is_arp_local() - check if it is local or no local arp
4645*5113495bSYour Name * @buf: Network buffer
4646*5113495bSYour Name *
4647*5113495bSYour Name * This func. checks whether packet is local or no local arp.
4648*5113495bSYour Name *
4649*5113495bSYour Name * Return: TRUE if it is broadcast packet
4650*5113495bSYour Name * FALSE if not
4651*5113495bSYour Name */
4652*5113495bSYour Name static inline
qdf_nbuf_is_arp_local(qdf_nbuf_t buf)4653*5113495bSYour Name bool qdf_nbuf_is_arp_local(qdf_nbuf_t buf)
4654*5113495bSYour Name {
4655*5113495bSYour Name return __qdf_nbuf_is_arp_local(buf);
4656*5113495bSYour Name }
4657*5113495bSYour Name
4658*5113495bSYour Name /**
4659*5113495bSYour Name * qdf_nbuf_reset_num_frags() - decrement the number of fragments
4660*5113495bSYour Name * @buf: Network buffer
4661*5113495bSYour Name *
4662*5113495bSYour Name * Return: Number of fragments
4663*5113495bSYour Name */
qdf_nbuf_reset_num_frags(qdf_nbuf_t buf)4664*5113495bSYour Name static inline void qdf_nbuf_reset_num_frags(qdf_nbuf_t buf)
4665*5113495bSYour Name {
4666*5113495bSYour Name __qdf_nbuf_reset_num_frags(buf);
4667*5113495bSYour Name }
4668*5113495bSYour Name
4669*5113495bSYour Name /**
4670*5113495bSYour Name * qdf_dmaaddr_to_32s - return high and low parts of dma_addr
4671*5113495bSYour Name * @dmaaddr: DMA address
4672*5113495bSYour Name * @lo: low 32-bits of @dmaaddr
4673*5113495bSYour Name * @hi: high 32-bits of @dmaaddr
4674*5113495bSYour Name *
4675*5113495bSYour Name * Returns the high and low 32-bits of the DMA addr in the provided ptrs
4676*5113495bSYour Name *
4677*5113495bSYour Name * Return: N/A
4678*5113495bSYour Name */
qdf_dmaaddr_to_32s(qdf_dma_addr_t dmaaddr,uint32_t * lo,uint32_t * hi)4679*5113495bSYour Name static inline void qdf_dmaaddr_to_32s(qdf_dma_addr_t dmaaddr,
4680*5113495bSYour Name uint32_t *lo, uint32_t *hi)
4681*5113495bSYour Name {
4682*5113495bSYour Name return __qdf_dmaaddr_to_32s(dmaaddr, lo, hi);
4683*5113495bSYour Name }
4684*5113495bSYour Name
4685*5113495bSYour Name /**
4686*5113495bSYour Name * qdf_nbuf_get_tso_info() - function to divide a jumbo TSO
4687*5113495bSYour Name * network buffer into segments
4688*5113495bSYour Name * @osdev: qdf device handle
4689*5113495bSYour Name * @nbuf: network buffer to be segmented
4690*5113495bSYour Name * @tso_info: This is the output. The information about the
4691*5113495bSYour Name * TSO segments will be populated within this.
4692*5113495bSYour Name *
4693*5113495bSYour Name * This function fragments a TCP jumbo packet into smaller
4694*5113495bSYour Name * segments to be transmitted by the driver. It chains the TSO
4695*5113495bSYour Name * segments created into a list.
4696*5113495bSYour Name *
4697*5113495bSYour Name * Return: number of TSO segments
4698*5113495bSYour Name */
qdf_nbuf_get_tso_info(qdf_device_t osdev,qdf_nbuf_t nbuf,struct qdf_tso_info_t * tso_info)4699*5113495bSYour Name static inline uint32_t qdf_nbuf_get_tso_info(qdf_device_t osdev,
4700*5113495bSYour Name qdf_nbuf_t nbuf, struct qdf_tso_info_t *tso_info)
4701*5113495bSYour Name {
4702*5113495bSYour Name return __qdf_nbuf_get_tso_info(osdev, nbuf, tso_info);
4703*5113495bSYour Name }
4704*5113495bSYour Name
4705*5113495bSYour Name /**
4706*5113495bSYour Name * qdf_nbuf_unmap_tso_segment() - function to dma unmap TSO segment element
4707*5113495bSYour Name *
4708*5113495bSYour Name * @osdev: qdf device handle
4709*5113495bSYour Name * @tso_seg: TSO segment element to be unmapped
4710*5113495bSYour Name * @is_last_seg: whether this is last tso seg or not
4711*5113495bSYour Name *
4712*5113495bSYour Name * Return: none
4713*5113495bSYour Name */
qdf_nbuf_unmap_tso_segment(qdf_device_t osdev,struct qdf_tso_seg_elem_t * tso_seg,bool is_last_seg)4714*5113495bSYour Name static inline void qdf_nbuf_unmap_tso_segment(qdf_device_t osdev,
4715*5113495bSYour Name struct qdf_tso_seg_elem_t *tso_seg,
4716*5113495bSYour Name bool is_last_seg)
4717*5113495bSYour Name {
4718*5113495bSYour Name return __qdf_nbuf_unmap_tso_segment(osdev, tso_seg, is_last_seg);
4719*5113495bSYour Name }
4720*5113495bSYour Name
4721*5113495bSYour Name /**
4722*5113495bSYour Name * qdf_nbuf_get_tcp_payload_len() - function to return the tso payload len
4723*5113495bSYour Name * @nbuf: network buffer
4724*5113495bSYour Name *
4725*5113495bSYour Name * Return: size of the tso packet
4726*5113495bSYour Name */
qdf_nbuf_get_tcp_payload_len(qdf_nbuf_t nbuf)4727*5113495bSYour Name static inline size_t qdf_nbuf_get_tcp_payload_len(qdf_nbuf_t nbuf)
4728*5113495bSYour Name {
4729*5113495bSYour Name return __qdf_nbuf_get_tcp_payload_len(nbuf);
4730*5113495bSYour Name }
4731*5113495bSYour Name
4732*5113495bSYour Name /**
4733*5113495bSYour Name * qdf_nbuf_get_tso_num_seg() - function to calculate the number
4734*5113495bSYour Name * of TCP segments within the TSO jumbo packet
4735*5113495bSYour Name * @nbuf: TSO jumbo network buffer to be segmented
4736*5113495bSYour Name *
4737*5113495bSYour Name * This function calculates the number of TCP segments that the
4738*5113495bSYour Name * network buffer can be divided into.
4739*5113495bSYour Name *
4740*5113495bSYour Name * Return: number of TCP segments
4741*5113495bSYour Name */
qdf_nbuf_get_tso_num_seg(qdf_nbuf_t nbuf)4742*5113495bSYour Name static inline uint32_t qdf_nbuf_get_tso_num_seg(qdf_nbuf_t nbuf)
4743*5113495bSYour Name {
4744*5113495bSYour Name return __qdf_nbuf_get_tso_num_seg(nbuf);
4745*5113495bSYour Name }
4746*5113495bSYour Name
4747*5113495bSYour Name /**
4748*5113495bSYour Name * qdf_nbuf_get_gso_segs() - Return the number of gso segments in nbuf
4749*5113495bSYour Name * @nbuf: Network buffer
4750*5113495bSYour Name *
4751*5113495bSYour Name * Return: number of gso segments in nbuf
4752*5113495bSYour Name */
qdf_nbuf_get_gso_segs(qdf_nbuf_t nbuf)4753*5113495bSYour Name static inline uint16_t qdf_nbuf_get_gso_segs(qdf_nbuf_t nbuf)
4754*5113495bSYour Name {
4755*5113495bSYour Name return __qdf_nbuf_get_gso_segs(nbuf);
4756*5113495bSYour Name }
4757*5113495bSYour Name
4758*5113495bSYour Name /**
4759*5113495bSYour Name * qdf_nbuf_set_gso_segs() - set the number of gso segments in nbuf
4760*5113495bSYour Name * @nbuf: Network buffer
4761*5113495bSYour Name * @val: val to be set
4762*5113495bSYour Name *
4763*5113495bSYour Name * Return: None
4764*5113495bSYour Name */
qdf_nbuf_set_gso_segs(qdf_nbuf_t nbuf,uint16_t val)4765*5113495bSYour Name static inline void qdf_nbuf_set_gso_segs(qdf_nbuf_t nbuf, uint16_t val)
4766*5113495bSYour Name {
4767*5113495bSYour Name __qdf_nbuf_set_gso_segs(nbuf, val);
4768*5113495bSYour Name }
4769*5113495bSYour Name
4770*5113495bSYour Name /**
4771*5113495bSYour Name * qdf_nbuf_set_gso_type_udp_l4() - set the gso type to GSO UDP L4
4772*5113495bSYour Name * @nbuf: Network buffer
4773*5113495bSYour Name *
4774*5113495bSYour Name * Return: None
4775*5113495bSYour Name */
qdf_nbuf_set_gso_type_udp_l4(qdf_nbuf_t nbuf)4776*5113495bSYour Name static inline void qdf_nbuf_set_gso_type_udp_l4(qdf_nbuf_t nbuf)
4777*5113495bSYour Name {
4778*5113495bSYour Name __qdf_nbuf_set_gso_type_udp_l4(nbuf);
4779*5113495bSYour Name }
4780*5113495bSYour Name
4781*5113495bSYour Name /**
4782*5113495bSYour Name * qdf_nbuf_set_ip_summed_partial() - set the ip summed to CHECKSUM_PARTIAL
4783*5113495bSYour Name * @nbuf: Network buffer
4784*5113495bSYour Name *
4785*5113495bSYour Name * Return: None
4786*5113495bSYour Name */
qdf_nbuf_set_ip_summed_partial(qdf_nbuf_t nbuf)4787*5113495bSYour Name static inline void qdf_nbuf_set_ip_summed_partial(qdf_nbuf_t nbuf)
4788*5113495bSYour Name {
4789*5113495bSYour Name __qdf_nbuf_set_ip_summed_partial(nbuf);
4790*5113495bSYour Name }
4791*5113495bSYour Name
4792*5113495bSYour Name /**
4793*5113495bSYour Name * qdf_nbuf_get_gso_size() - Return the number of gso size in nbuf
4794*5113495bSYour Name * @nbuf: Network buffer
4795*5113495bSYour Name *
4796*5113495bSYour Name * Return: number of gso segments in nbuf
4797*5113495bSYour Name */
qdf_nbuf_get_gso_size(qdf_nbuf_t nbuf)4798*5113495bSYour Name static inline unsigned int qdf_nbuf_get_gso_size(qdf_nbuf_t nbuf)
4799*5113495bSYour Name {
4800*5113495bSYour Name return __qdf_nbuf_get_gso_size(nbuf);
4801*5113495bSYour Name }
4802*5113495bSYour Name
4803*5113495bSYour Name /**
4804*5113495bSYour Name * qdf_nbuf_set_gso_size() - Set the gso size in nbuf
4805*5113495bSYour Name * @nbuf: Pointer to network buffer
4806*5113495bSYour Name * @val: number of gso segments in nbuf
4807*5113495bSYour Name *
4808*5113495bSYour Name * Return: None
4809*5113495bSYour Name */
qdf_nbuf_set_gso_size(qdf_nbuf_t nbuf,unsigned int val)4810*5113495bSYour Name static inline void qdf_nbuf_set_gso_size(qdf_nbuf_t nbuf, unsigned int val)
4811*5113495bSYour Name {
4812*5113495bSYour Name __qdf_nbuf_set_gso_size(nbuf, val);
4813*5113495bSYour Name }
4814*5113495bSYour Name
4815*5113495bSYour Name /**
4816*5113495bSYour Name * qdf_nbuf_inc_users() - function to increment the number of
4817*5113495bSYour Name * users referencing this network buffer
4818*5113495bSYour Name * @nbuf: network buffer
4819*5113495bSYour Name *
4820*5113495bSYour Name * This function increments the number of users referencing this
4821*5113495bSYour Name * network buffer
4822*5113495bSYour Name *
4823*5113495bSYour Name * Return: the network buffer
4824*5113495bSYour Name */
qdf_nbuf_inc_users(qdf_nbuf_t nbuf)4825*5113495bSYour Name static inline qdf_nbuf_t qdf_nbuf_inc_users(qdf_nbuf_t nbuf)
4826*5113495bSYour Name {
4827*5113495bSYour Name return __qdf_nbuf_inc_users(nbuf);
4828*5113495bSYour Name }
4829*5113495bSYour Name
4830*5113495bSYour Name /**
4831*5113495bSYour Name * qdf_nbuf_data_attr_get() - Get data_attr field from cvg_nbuf_cb
4832*5113495bSYour Name * @buf: Network buffer (skb on linux)
4833*5113495bSYour Name *
4834*5113495bSYour Name * This function returns the values of data_attr field
4835*5113495bSYour Name * in struct cvg_nbuf_cb{}, to which skb->cb is typecast.
4836*5113495bSYour Name * This value is actually the value programmed in CE descriptor.
4837*5113495bSYour Name *
4838*5113495bSYour Name * Return: Value of data_attr
4839*5113495bSYour Name */
qdf_nbuf_data_attr_get(qdf_nbuf_t buf)4840*5113495bSYour Name static inline uint32_t qdf_nbuf_data_attr_get(qdf_nbuf_t buf)
4841*5113495bSYour Name {
4842*5113495bSYour Name return __qdf_nbuf_data_attr_get(buf);
4843*5113495bSYour Name }
4844*5113495bSYour Name
4845*5113495bSYour Name /**
4846*5113495bSYour Name * qdf_nbuf_data_attr_set() - Sets data_attr field in cvg_nbuf_cb
4847*5113495bSYour Name * @buf: Network buffer (skb on linux)
4848*5113495bSYour Name * @data_attr: Value to be stored cvg_nbuf_cb->data_attr
4849*5113495bSYour Name *
4850*5113495bSYour Name * This function stores the value to be programmed in CE
4851*5113495bSYour Name * descriptor as part skb->cb which is typecast to struct cvg_nbuf_cb{}
4852*5113495bSYour Name *
4853*5113495bSYour Name * Return: void
4854*5113495bSYour Name */
4855*5113495bSYour Name static inline
qdf_nbuf_data_attr_set(qdf_nbuf_t buf,uint32_t data_attr)4856*5113495bSYour Name void qdf_nbuf_data_attr_set(qdf_nbuf_t buf, uint32_t data_attr)
4857*5113495bSYour Name {
4858*5113495bSYour Name __qdf_nbuf_data_attr_set(buf, data_attr);
4859*5113495bSYour Name }
4860*5113495bSYour Name
4861*5113495bSYour Name /**
4862*5113495bSYour Name * qdf_nbuf_tx_info_get() - Parse skb and get Tx metadata
4863*5113495bSYour Name * @nbuf: Network buffer
4864*5113495bSYour Name * @pkt_type: Pkt type (from enum htt_pkt_type)
4865*5113495bSYour Name * @pkt_subtype: Bit 4 of this field in HTT descriptor
4866*5113495bSYour Name * needs to be set in case of CE classification support
4867*5113495bSYour Name * Is set by this macro.
4868*5113495bSYour Name * @hw_classify: This is a flag which is set to indicate
4869*5113495bSYour Name * CE classification is enabled.
4870*5113495bSYour Name * Do not set this bit for VLAN packets
4871*5113495bSYour Name * OR for mcast / bcast frames.
4872*5113495bSYour Name *
4873*5113495bSYour Name * This function parses the payload to figure out relevant
4874*5113495bSYour Name * Tx meta-data e.g. whether to enable tx_classify bit
4875*5113495bSYour Name * in CE.
4876*5113495bSYour Name *
4877*5113495bSYour Name * Return: void
4878*5113495bSYour Name */
4879*5113495bSYour Name #define qdf_nbuf_tx_info_get(nbuf, pkt_type, pkt_subtype, hw_classify) \
4880*5113495bSYour Name __qdf_nbuf_tx_info_get(nbuf, pkt_type, \
4881*5113495bSYour Name pkt_subtype, hw_classify)
4882*5113495bSYour Name
4883*5113495bSYour Name /**
4884*5113495bSYour Name * qdf_nbuf_set_state() - Updates the packet state
4885*5113495bSYour Name * @nbuf: network buffer
4886*5113495bSYour Name * @current_state : layer at which the packet currently is
4887*5113495bSYour Name *
4888*5113495bSYour Name * This function updates the packet state to the layer at which the packet
4889*5113495bSYour Name * currently is
4890*5113495bSYour Name *
4891*5113495bSYour Name * Return: none
4892*5113495bSYour Name */
4893*5113495bSYour Name void qdf_nbuf_set_state(qdf_nbuf_t nbuf, uint8_t current_state);
4894*5113495bSYour Name
4895*5113495bSYour Name /**
4896*5113495bSYour Name * qdf_nbuf_tx_desc_count_display() - Displays the packet counter
4897*5113495bSYour Name *
4898*5113495bSYour Name * Return: none
4899*5113495bSYour Name */
4900*5113495bSYour Name void qdf_nbuf_tx_desc_count_display(void);
4901*5113495bSYour Name
4902*5113495bSYour Name /**
4903*5113495bSYour Name * qdf_nbuf_tx_desc_count_clear() - Clears packet counter for both data, mgmt
4904*5113495bSYour Name *
4905*5113495bSYour Name * Return: none
4906*5113495bSYour Name */
4907*5113495bSYour Name void qdf_nbuf_tx_desc_count_clear(void);
4908*5113495bSYour Name
4909*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_realloc_headroom(qdf_nbuf_t buf,uint32_t headroom)4910*5113495bSYour Name qdf_nbuf_realloc_headroom(qdf_nbuf_t buf, uint32_t headroom)
4911*5113495bSYour Name {
4912*5113495bSYour Name return __qdf_nbuf_realloc_headroom(buf, headroom);
4913*5113495bSYour Name }
4914*5113495bSYour Name
4915*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_realloc_tailroom(qdf_nbuf_t buf,uint32_t tailroom)4916*5113495bSYour Name qdf_nbuf_realloc_tailroom(qdf_nbuf_t buf, uint32_t tailroom)
4917*5113495bSYour Name {
4918*5113495bSYour Name return __qdf_nbuf_realloc_tailroom(buf, tailroom);
4919*5113495bSYour Name }
4920*5113495bSYour Name
4921*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_expand(qdf_nbuf_t buf,uint32_t headroom,uint32_t tailroom)4922*5113495bSYour Name qdf_nbuf_expand(qdf_nbuf_t buf, uint32_t headroom, uint32_t tailroom)
4923*5113495bSYour Name {
4924*5113495bSYour Name return __qdf_nbuf_expand(buf, headroom, tailroom);
4925*5113495bSYour Name }
4926*5113495bSYour Name
4927*5113495bSYour Name static inline int
qdf_nbuf_linearize(qdf_nbuf_t buf)4928*5113495bSYour Name qdf_nbuf_linearize(qdf_nbuf_t buf)
4929*5113495bSYour Name {
4930*5113495bSYour Name return __qdf_nbuf_linearize(buf);
4931*5113495bSYour Name }
4932*5113495bSYour Name
4933*5113495bSYour Name static inline bool
qdf_nbuf_is_cloned(qdf_nbuf_t buf)4934*5113495bSYour Name qdf_nbuf_is_cloned(qdf_nbuf_t buf)
4935*5113495bSYour Name {
4936*5113495bSYour Name return __qdf_nbuf_is_cloned(buf);
4937*5113495bSYour Name }
4938*5113495bSYour Name
4939*5113495bSYour Name static inline void
qdf_nbuf_frag_info(qdf_nbuf_t buf,qdf_sglist_t * sg)4940*5113495bSYour Name qdf_nbuf_frag_info(qdf_nbuf_t buf, qdf_sglist_t *sg)
4941*5113495bSYour Name {
4942*5113495bSYour Name __qdf_nbuf_frag_info(buf, sg);
4943*5113495bSYour Name }
4944*5113495bSYour Name
4945*5113495bSYour Name static inline qdf_nbuf_tx_cksum_t
qdf_nbuf_tx_cksum_info(qdf_nbuf_t buf,uint8_t ** hdr_off,uint8_t ** where)4946*5113495bSYour Name qdf_nbuf_tx_cksum_info(qdf_nbuf_t buf, uint8_t **hdr_off, uint8_t **where)
4947*5113495bSYour Name {
4948*5113495bSYour Name return __qdf_nbuf_tx_cksum_info(buf, hdr_off, where);
4949*5113495bSYour Name }
4950*5113495bSYour Name
qdf_nbuf_reset_ctxt(__qdf_nbuf_t nbuf)4951*5113495bSYour Name static inline void qdf_nbuf_reset_ctxt(__qdf_nbuf_t nbuf)
4952*5113495bSYour Name {
4953*5113495bSYour Name __qdf_nbuf_reset_ctxt(nbuf);
4954*5113495bSYour Name }
4955*5113495bSYour Name
qdf_nbuf_init(qdf_nbuf_t buf)4956*5113495bSYour Name static inline void qdf_nbuf_init(qdf_nbuf_t buf)
4957*5113495bSYour Name {
4958*5113495bSYour Name __qdf_nbuf_init(buf);
4959*5113495bSYour Name }
4960*5113495bSYour Name
qdf_nbuf_network_header(qdf_nbuf_t buf)4961*5113495bSYour Name static inline void *qdf_nbuf_network_header(qdf_nbuf_t buf)
4962*5113495bSYour Name {
4963*5113495bSYour Name return __qdf_nbuf_network_header(buf);
4964*5113495bSYour Name }
4965*5113495bSYour Name
qdf_nbuf_transport_header(qdf_nbuf_t buf)4966*5113495bSYour Name static inline void *qdf_nbuf_transport_header(qdf_nbuf_t buf)
4967*5113495bSYour Name {
4968*5113495bSYour Name return __qdf_nbuf_transport_header(buf);
4969*5113495bSYour Name }
4970*5113495bSYour Name
qdf_nbuf_tcp_tso_size(qdf_nbuf_t buf)4971*5113495bSYour Name static inline qdf_size_t qdf_nbuf_tcp_tso_size(qdf_nbuf_t buf)
4972*5113495bSYour Name {
4973*5113495bSYour Name return __qdf_nbuf_tcp_tso_size(buf);
4974*5113495bSYour Name }
4975*5113495bSYour Name
qdf_nbuf_get_cb(qdf_nbuf_t nbuf)4976*5113495bSYour Name static inline void *qdf_nbuf_get_cb(qdf_nbuf_t nbuf)
4977*5113495bSYour Name {
4978*5113495bSYour Name return __qdf_nbuf_get_cb(nbuf);
4979*5113495bSYour Name }
4980*5113495bSYour Name
qdf_nbuf_get_nr_frags(qdf_nbuf_t nbuf)4981*5113495bSYour Name static inline uint32_t qdf_nbuf_get_nr_frags(qdf_nbuf_t nbuf)
4982*5113495bSYour Name {
4983*5113495bSYour Name return __qdf_nbuf_get_nr_frags(nbuf);
4984*5113495bSYour Name }
4985*5113495bSYour Name
qdf_nbuf_get_nr_frags_in_fraglist(qdf_nbuf_t nbuf)4986*5113495bSYour Name static inline uint32_t qdf_nbuf_get_nr_frags_in_fraglist(qdf_nbuf_t nbuf)
4987*5113495bSYour Name {
4988*5113495bSYour Name return __qdf_nbuf_get_nr_frags_in_fraglist(nbuf);
4989*5113495bSYour Name }
4990*5113495bSYour Name
qdf_nbuf_headlen(qdf_nbuf_t buf)4991*5113495bSYour Name static inline qdf_size_t qdf_nbuf_headlen(qdf_nbuf_t buf)
4992*5113495bSYour Name {
4993*5113495bSYour Name return __qdf_nbuf_headlen(buf);
4994*5113495bSYour Name }
4995*5113495bSYour Name
qdf_nbuf_frag_map(qdf_device_t osdev,qdf_nbuf_t buf,int offset,qdf_dma_dir_t dir,int cur_frag)4996*5113495bSYour Name static inline QDF_STATUS qdf_nbuf_frag_map(qdf_device_t osdev,
4997*5113495bSYour Name qdf_nbuf_t buf, int offset,
4998*5113495bSYour Name qdf_dma_dir_t dir, int cur_frag)
4999*5113495bSYour Name {
5000*5113495bSYour Name return __qdf_nbuf_frag_map(osdev, buf, offset, dir, cur_frag);
5001*5113495bSYour Name }
5002*5113495bSYour Name
qdf_nbuf_tso_tcp_v4(qdf_nbuf_t buf)5003*5113495bSYour Name static inline bool qdf_nbuf_tso_tcp_v4(qdf_nbuf_t buf)
5004*5113495bSYour Name {
5005*5113495bSYour Name return __qdf_nbuf_tso_tcp_v4(buf);
5006*5113495bSYour Name }
5007*5113495bSYour Name
qdf_nbuf_tso_tcp_v6(qdf_nbuf_t buf)5008*5113495bSYour Name static inline bool qdf_nbuf_tso_tcp_v6(qdf_nbuf_t buf)
5009*5113495bSYour Name {
5010*5113495bSYour Name return __qdf_nbuf_tso_tcp_v6(buf);
5011*5113495bSYour Name }
5012*5113495bSYour Name
qdf_nbuf_tcp_seq(qdf_nbuf_t buf)5013*5113495bSYour Name static inline uint32_t qdf_nbuf_tcp_seq(qdf_nbuf_t buf)
5014*5113495bSYour Name {
5015*5113495bSYour Name return __qdf_nbuf_tcp_seq(buf);
5016*5113495bSYour Name }
5017*5113495bSYour Name
qdf_nbuf_l2l3l4_hdr_len(qdf_nbuf_t buf)5018*5113495bSYour Name static inline qdf_size_t qdf_nbuf_l2l3l4_hdr_len(qdf_nbuf_t buf)
5019*5113495bSYour Name {
5020*5113495bSYour Name return __qdf_nbuf_l2l3l4_hdr_len(buf);
5021*5113495bSYour Name }
5022*5113495bSYour Name
5023*5113495bSYour Name /**
5024*5113495bSYour Name * qdf_nbuf_get_tcp_hdr_len() - return TCP header length of the skb
5025*5113495bSYour Name * @nbuf: sk buff
5026*5113495bSYour Name *
5027*5113495bSYour Name * Return: size of TCP header length
5028*5113495bSYour Name */
qdf_nbuf_get_tcp_hdr_len(qdf_nbuf_t nbuf)5029*5113495bSYour Name static inline size_t qdf_nbuf_get_tcp_hdr_len(qdf_nbuf_t nbuf)
5030*5113495bSYour Name {
5031*5113495bSYour Name return __qdf_nbuf_get_tcp_hdr_len(nbuf);
5032*5113495bSYour Name }
5033*5113495bSYour Name
qdf_nbuf_is_nonlinear(qdf_nbuf_t buf)5034*5113495bSYour Name static inline bool qdf_nbuf_is_nonlinear(qdf_nbuf_t buf)
5035*5113495bSYour Name {
5036*5113495bSYour Name return __qdf_nbuf_is_nonlinear(buf);
5037*5113495bSYour Name }
5038*5113495bSYour Name
5039*5113495bSYour Name static inline uint32_t
qdf_nbuf_get_frag_size(qdf_nbuf_t buf,uint32_t frag_num)5040*5113495bSYour Name qdf_nbuf_get_frag_size(qdf_nbuf_t buf, uint32_t frag_num)
5041*5113495bSYour Name {
5042*5113495bSYour Name return __qdf_nbuf_get_frag_size(buf, frag_num);
5043*5113495bSYour Name }
5044*5113495bSYour Name
qdf_nbuf_get_priority(qdf_nbuf_t buf)5045*5113495bSYour Name static inline uint32_t qdf_nbuf_get_priority(qdf_nbuf_t buf)
5046*5113495bSYour Name {
5047*5113495bSYour Name return __qdf_nbuf_get_priority(buf);
5048*5113495bSYour Name }
5049*5113495bSYour Name
qdf_nbuf_set_priority(qdf_nbuf_t buf,uint32_t p)5050*5113495bSYour Name static inline void qdf_nbuf_set_priority(qdf_nbuf_t buf, uint32_t p)
5051*5113495bSYour Name {
5052*5113495bSYour Name __qdf_nbuf_set_priority(buf, p);
5053*5113495bSYour Name }
5054*5113495bSYour Name
qdf_nbuf_record_rx_queue(qdf_nbuf_t buf,uint32_t queue_id)5055*5113495bSYour Name static inline void qdf_nbuf_record_rx_queue(qdf_nbuf_t buf, uint32_t queue_id)
5056*5113495bSYour Name {
5057*5113495bSYour Name __qdf_nbuf_record_rx_queue(buf, queue_id);
5058*5113495bSYour Name }
5059*5113495bSYour Name
5060*5113495bSYour Name static inline uint16_t
qdf_nbuf_get_queue_mapping(qdf_nbuf_t buf)5061*5113495bSYour Name qdf_nbuf_get_queue_mapping(qdf_nbuf_t buf)
5062*5113495bSYour Name {
5063*5113495bSYour Name return __qdf_nbuf_get_queue_mapping(buf);
5064*5113495bSYour Name }
5065*5113495bSYour Name
5066*5113495bSYour Name static inline void
qdf_nbuf_set_queue_mapping(qdf_nbuf_t buf,uint16_t val)5067*5113495bSYour Name qdf_nbuf_set_queue_mapping(qdf_nbuf_t buf, uint16_t val)
5068*5113495bSYour Name {
5069*5113495bSYour Name __qdf_nbuf_set_queue_mapping(buf, val);
5070*5113495bSYour Name }
5071*5113495bSYour Name
5072*5113495bSYour Name static inline char *
qdf_nbuf_get_priv_ptr(qdf_nbuf_t buf)5073*5113495bSYour Name qdf_nbuf_get_priv_ptr(qdf_nbuf_t buf)
5074*5113495bSYour Name {
5075*5113495bSYour Name return __qdf_nbuf_get_priv_ptr(buf);
5076*5113495bSYour Name }
5077*5113495bSYour Name
5078*5113495bSYour Name /**
5079*5113495bSYour Name * qdf_nbuf_has_fraglist() - check if nbuf has attached frag list
5080*5113495bSYour Name * @nbuf: Pointer to nbuf
5081*5113495bSYour Name *
5082*5113495bSYour Name * Return: bool
5083*5113495bSYour Name */
5084*5113495bSYour Name static inline bool
qdf_nbuf_has_fraglist(qdf_nbuf_t nbuf)5085*5113495bSYour Name qdf_nbuf_has_fraglist(qdf_nbuf_t nbuf)
5086*5113495bSYour Name {
5087*5113495bSYour Name return __qdf_nbuf_has_fraglist(nbuf);
5088*5113495bSYour Name }
5089*5113495bSYour Name
5090*5113495bSYour Name /**
5091*5113495bSYour Name * qdf_nbuf_get_last_frag_list_nbuf() - Fetch pointer to last nbuf in frag list
5092*5113495bSYour Name * @nbuf: Pointer to nbuf
5093*5113495bSYour Name *
5094*5113495bSYour Name * Return: Pointer to last nbuf in frag list if parent nbuf has extended frag
5095*5113495bSYour Name * list or else return NULL
5096*5113495bSYour Name */
5097*5113495bSYour Name static inline qdf_nbuf_t
qdf_nbuf_get_last_frag_list_nbuf(qdf_nbuf_t nbuf)5098*5113495bSYour Name qdf_nbuf_get_last_frag_list_nbuf(qdf_nbuf_t nbuf)
5099*5113495bSYour Name {
5100*5113495bSYour Name return __qdf_nbuf_get_last_frag_list_nbuf(nbuf);
5101*5113495bSYour Name }
5102*5113495bSYour Name
5103*5113495bSYour Name /**
5104*5113495bSYour Name * qdf_nbuf_update_radiotap() - update radiotap at head of nbuf.
5105*5113495bSYour Name * @rx_status: rx_status containing required info to update radiotap
5106*5113495bSYour Name * @nbuf: Pointer to nbuf
5107*5113495bSYour Name * @headroom_sz: Available headroom size
5108*5113495bSYour Name *
5109*5113495bSYour Name * Return: radiotap length.
5110*5113495bSYour Name */
5111*5113495bSYour Name unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
5112*5113495bSYour Name qdf_nbuf_t nbuf, uint32_t headroom_sz);
5113*5113495bSYour Name
5114*5113495bSYour Name /**
5115*5113495bSYour Name * qdf_nbuf_mark_wakeup_frame() - mark wakeup frame.
5116*5113495bSYour Name * @buf: Pointer to nbuf
5117*5113495bSYour Name *
5118*5113495bSYour Name * Return: None
5119*5113495bSYour Name */
5120*5113495bSYour Name static inline void
qdf_nbuf_mark_wakeup_frame(qdf_nbuf_t buf)5121*5113495bSYour Name qdf_nbuf_mark_wakeup_frame(qdf_nbuf_t buf)
5122*5113495bSYour Name {
5123*5113495bSYour Name __qdf_nbuf_mark_wakeup_frame(buf);
5124*5113495bSYour Name }
5125*5113495bSYour Name
5126*5113495bSYour Name /**
5127*5113495bSYour Name * qdf_nbuf_reg_free_cb - Registers nbuf free callback
5128*5113495bSYour Name * @cb_func_ptr: Callback pointer
5129*5113495bSYour Name *
5130*5113495bSYour Name * This function registers nbuf free callback
5131*5113495bSYour Name *
5132*5113495bSYour Name * Return: void
5133*5113495bSYour Name */
5134*5113495bSYour Name static inline void
qdf_nbuf_reg_free_cb(qdf_nbuf_free_t cb_func_ptr)5135*5113495bSYour Name qdf_nbuf_reg_free_cb(qdf_nbuf_free_t cb_func_ptr)
5136*5113495bSYour Name {
5137*5113495bSYour Name __qdf_nbuf_reg_free_cb(cb_func_ptr);
5138*5113495bSYour Name }
5139*5113495bSYour Name
5140*5113495bSYour Name /**
5141*5113495bSYour Name * qdf_nbuf_count_get() - get global nbuf gauge
5142*5113495bSYour Name *
5143*5113495bSYour Name * Return: global nbuf gauge
5144*5113495bSYour Name */
qdf_nbuf_count_get(void)5145*5113495bSYour Name static inline int qdf_nbuf_count_get(void)
5146*5113495bSYour Name {
5147*5113495bSYour Name return __qdf_nbuf_count_get();
5148*5113495bSYour Name }
5149*5113495bSYour Name
5150*5113495bSYour Name /**
5151*5113495bSYour Name * qdf_nbuf_count_inc() - increment nbuf global count
5152*5113495bSYour Name *
5153*5113495bSYour Name * @buf: sk buff
5154*5113495bSYour Name *
5155*5113495bSYour Name * Return: void
5156*5113495bSYour Name */
qdf_nbuf_count_inc(qdf_nbuf_t buf)5157*5113495bSYour Name static inline void qdf_nbuf_count_inc(qdf_nbuf_t buf)
5158*5113495bSYour Name {
5159*5113495bSYour Name return __qdf_nbuf_count_inc(buf);
5160*5113495bSYour Name }
5161*5113495bSYour Name
5162*5113495bSYour Name /**
5163*5113495bSYour Name * qdf_nbuf_count_dec() - decrement nbuf global count
5164*5113495bSYour Name *
5165*5113495bSYour Name * @buf: sk buff
5166*5113495bSYour Name *
5167*5113495bSYour Name * Return: void
5168*5113495bSYour Name */
qdf_nbuf_count_dec(qdf_nbuf_t buf)5169*5113495bSYour Name static inline void qdf_nbuf_count_dec(qdf_nbuf_t buf)
5170*5113495bSYour Name {
5171*5113495bSYour Name return __qdf_nbuf_count_dec(buf);
5172*5113495bSYour Name }
5173*5113495bSYour Name
5174*5113495bSYour Name /**
5175*5113495bSYour Name * qdf_nbuf_mod_init() - Initialization routine for qdf_nbuf
5176*5113495bSYour Name *
5177*5113495bSYour Name * Return void
5178*5113495bSYour Name */
qdf_nbuf_mod_init(void)5179*5113495bSYour Name static inline void qdf_nbuf_mod_init(void)
5180*5113495bSYour Name {
5181*5113495bSYour Name return __qdf_nbuf_mod_init();
5182*5113495bSYour Name }
5183*5113495bSYour Name
5184*5113495bSYour Name /**
5185*5113495bSYour Name * qdf_nbuf_mod_exit() - Unintialization routine for qdf_nbuf
5186*5113495bSYour Name *
5187*5113495bSYour Name * Return void
5188*5113495bSYour Name */
qdf_nbuf_mod_exit(void)5189*5113495bSYour Name static inline void qdf_nbuf_mod_exit(void)
5190*5113495bSYour Name {
5191*5113495bSYour Name return __qdf_nbuf_mod_exit();
5192*5113495bSYour Name }
5193*5113495bSYour Name
5194*5113495bSYour Name /**
5195*5113495bSYour Name * qdf_nbuf_orphan() - orphan a nbuf
5196*5113495bSYour Name * @buf: Pointer to network buffer
5197*5113495bSYour Name *
5198*5113495bSYour Name * If a buffer currently has an owner then we call the
5199*5113495bSYour Name * owner's destructor function
5200*5113495bSYour Name *
5201*5113495bSYour Name * Return: void
5202*5113495bSYour Name */
qdf_nbuf_orphan(qdf_nbuf_t buf)5203*5113495bSYour Name static inline void qdf_nbuf_orphan(qdf_nbuf_t buf)
5204*5113495bSYour Name {
5205*5113495bSYour Name return __qdf_nbuf_orphan(buf);
5206*5113495bSYour Name }
5207*5113495bSYour Name
5208*5113495bSYour Name /**
5209*5113495bSYour Name * qdf_nbuf_get_frag_size_by_idx() - Get size of nbuf frag at index idx
5210*5113495bSYour Name * @nbuf: qdf_nbuf_t
5211*5113495bSYour Name * @idx: Frag index for which frag size is requested
5212*5113495bSYour Name *
5213*5113495bSYour Name * Return: Frag size
5214*5113495bSYour Name */
qdf_nbuf_get_frag_size_by_idx(qdf_nbuf_t nbuf,uint8_t idx)5215*5113495bSYour Name static inline unsigned int qdf_nbuf_get_frag_size_by_idx(qdf_nbuf_t nbuf,
5216*5113495bSYour Name uint8_t idx)
5217*5113495bSYour Name {
5218*5113495bSYour Name return __qdf_nbuf_get_frag_size_by_idx(nbuf, idx);
5219*5113495bSYour Name }
5220*5113495bSYour Name
5221*5113495bSYour Name /**
5222*5113495bSYour Name * qdf_nbuf_get_frag_addr() - Get nbuf frag address at index idx
5223*5113495bSYour Name * @nbuf: qdf_nbuf_t
5224*5113495bSYour Name * @idx: Frag index for which frag address is requested
5225*5113495bSYour Name *
5226*5113495bSYour Name * Return: Frag address
5227*5113495bSYour Name */
qdf_nbuf_get_frag_addr(qdf_nbuf_t nbuf,uint8_t idx)5228*5113495bSYour Name static inline qdf_frag_t qdf_nbuf_get_frag_addr(qdf_nbuf_t nbuf, uint8_t idx)
5229*5113495bSYour Name {
5230*5113495bSYour Name return __qdf_nbuf_get_frag_addr(nbuf, idx);
5231*5113495bSYour Name }
5232*5113495bSYour Name
5233*5113495bSYour Name /**
5234*5113495bSYour Name * qdf_nbuf_trim_add_frag_size() - Increase/Decrease frag_size by size
5235*5113495bSYour Name * @nbuf: qdf_nbuf_t
5236*5113495bSYour Name * @idx: Frag index
5237*5113495bSYour Name * @size: Size by which frag_size needs to be increased/decreased
5238*5113495bSYour Name * +Ve means increase, -Ve means decrease
5239*5113495bSYour Name * @truesize: truesize
5240*5113495bSYour Name */
qdf_nbuf_trim_add_frag_size(qdf_nbuf_t nbuf,uint8_t idx,int size,unsigned int truesize)5241*5113495bSYour Name static inline void qdf_nbuf_trim_add_frag_size(qdf_nbuf_t nbuf, uint8_t idx,
5242*5113495bSYour Name int size, unsigned int truesize)
5243*5113495bSYour Name {
5244*5113495bSYour Name __qdf_nbuf_trim_add_frag_size(nbuf, idx, size, truesize);
5245*5113495bSYour Name }
5246*5113495bSYour Name
5247*5113495bSYour Name /**
5248*5113495bSYour Name * qdf_nbuf_set_mark() - Set nbuf mark
5249*5113495bSYour Name * @nbuf: qdf_nbuf_t
5250*5113495bSYour Name * @mark: Value to set mark
5251*5113495bSYour Name *
5252*5113495bSYour Name * Return: none
5253*5113495bSYour Name */
qdf_nbuf_set_mark(qdf_nbuf_t nbuf,uint32_t mark)5254*5113495bSYour Name static inline void qdf_nbuf_set_mark(qdf_nbuf_t nbuf, uint32_t mark)
5255*5113495bSYour Name {
5256*5113495bSYour Name __qdf_nbuf_set_mark(nbuf, mark);
5257*5113495bSYour Name }
5258*5113495bSYour Name
5259*5113495bSYour Name /**
5260*5113495bSYour Name * qdf_nbuf_get_mark() - Get nbuf mark
5261*5113495bSYour Name * @nbuf: qdf_nbuf_t
5262*5113495bSYour Name *
5263*5113495bSYour Name * Return: mark value
5264*5113495bSYour Name */
qdf_nbuf_get_mark(qdf_nbuf_t nbuf)5265*5113495bSYour Name static inline uint32_t qdf_nbuf_get_mark(qdf_nbuf_t nbuf)
5266*5113495bSYour Name {
5267*5113495bSYour Name return __qdf_nbuf_get_mark(nbuf);
5268*5113495bSYour Name }
5269*5113495bSYour Name
5270*5113495bSYour Name /**
5271*5113495bSYour Name * qdf_nbuf_get_data_len() - Return the size of the nbuf from
5272*5113495bSYour Name * data pointer to end pointer
5273*5113495bSYour Name * @nbuf: qdf_nbuf_t
5274*5113495bSYour Name *
5275*5113495bSYour Name * Return: size of network buffer from data pointer to end
5276*5113495bSYour Name * pointer
5277*5113495bSYour Name */
qdf_nbuf_get_data_len(qdf_nbuf_t nbuf)5278*5113495bSYour Name static inline qdf_size_t qdf_nbuf_get_data_len(qdf_nbuf_t nbuf)
5279*5113495bSYour Name {
5280*5113495bSYour Name return __qdf_nbuf_get_data_len(nbuf);
5281*5113495bSYour Name }
5282*5113495bSYour Name
5283*5113495bSYour Name /**
5284*5113495bSYour Name * qdf_nbuf_set_data_len() - Return the data_len of the nbuf
5285*5113495bSYour Name * @nbuf: qdf_nbuf_t
5286*5113495bSYour Name * @len: data_len to be set
5287*5113495bSYour Name *
5288*5113495bSYour Name * Return: set data_len value
5289*5113495bSYour Name */
qdf_nbuf_set_data_len(qdf_nbuf_t nbuf,uint32_t len)5290*5113495bSYour Name static inline qdf_size_t qdf_nbuf_set_data_len(qdf_nbuf_t nbuf, uint32_t len)
5291*5113495bSYour Name {
5292*5113495bSYour Name return __qdf_nbuf_set_data_len(nbuf, len);
5293*5113495bSYour Name }
5294*5113495bSYour Name
5295*5113495bSYour Name /**
5296*5113495bSYour Name * qdf_nbuf_get_only_data_len() - Return the data_len of the nbuf
5297*5113495bSYour Name * @nbuf: qdf_nbuf_t
5298*5113495bSYour Name *
5299*5113495bSYour Name * Return: data_len value
5300*5113495bSYour Name */
qdf_nbuf_get_only_data_len(qdf_nbuf_t nbuf)5301*5113495bSYour Name static inline qdf_size_t qdf_nbuf_get_only_data_len(qdf_nbuf_t nbuf)
5302*5113495bSYour Name {
5303*5113495bSYour Name return __qdf_nbuf_get_only_data_len(nbuf);
5304*5113495bSYour Name }
5305*5113495bSYour Name
5306*5113495bSYour Name /**
5307*5113495bSYour Name * qdf_nbuf_set_hash() - set the hash of the buf
5308*5113495bSYour Name * @buf: Network buf instance
5309*5113495bSYour Name * @len: len to be set
5310*5113495bSYour Name *
5311*5113495bSYour Name * Return: none
5312*5113495bSYour Name */
qdf_nbuf_set_hash(qdf_nbuf_t buf,uint32_t len)5313*5113495bSYour Name static inline void qdf_nbuf_set_hash(qdf_nbuf_t buf, uint32_t len)
5314*5113495bSYour Name {
5315*5113495bSYour Name __qdf_nbuf_set_hash(buf, len);
5316*5113495bSYour Name }
5317*5113495bSYour Name
5318*5113495bSYour Name /**
5319*5113495bSYour Name * qdf_nbuf_set_sw_hash() - set the sw hash of the buf
5320*5113495bSYour Name * @buf: Network buf instance
5321*5113495bSYour Name * @len: len to be set
5322*5113495bSYour Name *
5323*5113495bSYour Name * Return: none
5324*5113495bSYour Name */
qdf_nbuf_set_sw_hash(qdf_nbuf_t buf,uint32_t len)5325*5113495bSYour Name static inline void qdf_nbuf_set_sw_hash(qdf_nbuf_t buf, uint32_t len)
5326*5113495bSYour Name {
5327*5113495bSYour Name __qdf_nbuf_set_sw_hash(buf, len);
5328*5113495bSYour Name }
5329*5113495bSYour Name
5330*5113495bSYour Name /**
5331*5113495bSYour Name * qdf_nbuf_set_csum_start() - set the csum start of the buf
5332*5113495bSYour Name * @buf: Network buf instance
5333*5113495bSYour Name * @len: len to be set
5334*5113495bSYour Name *
5335*5113495bSYour Name * Return: none
5336*5113495bSYour Name */
qdf_nbuf_set_csum_start(qdf_nbuf_t buf,uint16_t len)5337*5113495bSYour Name static inline void qdf_nbuf_set_csum_start(qdf_nbuf_t buf, uint16_t len)
5338*5113495bSYour Name {
5339*5113495bSYour Name __qdf_nbuf_set_csum_start(buf, len);
5340*5113495bSYour Name }
5341*5113495bSYour Name
5342*5113495bSYour Name /**
5343*5113495bSYour Name * qdf_nbuf_set_csum_offset() - set the csum offset of the buf
5344*5113495bSYour Name * @buf: Network buf instance
5345*5113495bSYour Name * @len: len to be set
5346*5113495bSYour Name *
5347*5113495bSYour Name * Return: none
5348*5113495bSYour Name */
qdf_nbuf_set_csum_offset(qdf_nbuf_t buf,uint16_t len)5349*5113495bSYour Name static inline void qdf_nbuf_set_csum_offset(qdf_nbuf_t buf, uint16_t len)
5350*5113495bSYour Name {
5351*5113495bSYour Name __qdf_nbuf_set_csum_offset(buf, len);
5352*5113495bSYour Name }
5353*5113495bSYour Name
5354*5113495bSYour Name /**
5355*5113495bSYour Name * qdf_nbuf_get_end_offset() - Return the size of the nbuf from
5356*5113495bSYour Name * head pointer to end pointer
5357*5113495bSYour Name * @nbuf: qdf_nbuf_t
5358*5113495bSYour Name *
5359*5113495bSYour Name * Return: size of network buffer from head pointer to end
5360*5113495bSYour Name * pointer
5361*5113495bSYour Name */
qdf_nbuf_get_end_offset(qdf_nbuf_t nbuf)5362*5113495bSYour Name static inline qdf_size_t qdf_nbuf_get_end_offset(qdf_nbuf_t nbuf)
5363*5113495bSYour Name {
5364*5113495bSYour Name return __qdf_nbuf_get_end_offset(nbuf);
5365*5113495bSYour Name }
5366*5113495bSYour Name
5367*5113495bSYour Name /**
5368*5113495bSYour Name * qdf_nbuf_get_truesize() - Return the true size of the nbuf
5369*5113495bSYour Name * including the header and variable data area
5370*5113495bSYour Name * @nbuf: qdf_nbuf_t
5371*5113495bSYour Name *
5372*5113495bSYour Name * Return: size of network buffer
5373*5113495bSYour Name */
qdf_nbuf_get_truesize(qdf_nbuf_t nbuf)5374*5113495bSYour Name static inline qdf_size_t qdf_nbuf_get_truesize(qdf_nbuf_t nbuf)
5375*5113495bSYour Name {
5376*5113495bSYour Name return __qdf_nbuf_get_truesize(nbuf);
5377*5113495bSYour Name }
5378*5113495bSYour Name
5379*5113495bSYour Name /**
5380*5113495bSYour Name * qdf_nbuf_get_allocsize() - Return the actual size of the skb->head
5381*5113495bSYour Name * excluding the header and variable data area
5382*5113495bSYour Name * @nbuf: qdf_nbuf_t
5383*5113495bSYour Name *
5384*5113495bSYour Name * Return: actual allocated size of network buffer
5385*5113495bSYour Name */
qdf_nbuf_get_allocsize(qdf_nbuf_t nbuf)5386*5113495bSYour Name static inline qdf_size_t qdf_nbuf_get_allocsize(qdf_nbuf_t nbuf)
5387*5113495bSYour Name {
5388*5113495bSYour Name return __qdf_nbuf_get_allocsize(nbuf);
5389*5113495bSYour Name }
5390*5113495bSYour Name
5391*5113495bSYour Name #ifdef NBUF_FRAG_MEMORY_DEBUG
5392*5113495bSYour Name
5393*5113495bSYour Name #define qdf_nbuf_move_frag_page_offset(f, i, o) \
5394*5113495bSYour Name qdf_nbuf_move_frag_page_offset_debug(f, i, o, __func__, __LINE__)
5395*5113495bSYour Name
5396*5113495bSYour Name /**
5397*5113495bSYour Name * qdf_nbuf_move_frag_page_offset_debug() - Move frag page_offset by size
5398*5113495bSYour Name * and adjust length by size.
5399*5113495bSYour Name * @nbuf: qdf_nbuf_t
5400*5113495bSYour Name * @idx: Frag index
5401*5113495bSYour Name * @offset: Frag page offset should be moved by offset.
5402*5113495bSYour Name * +Ve - Move offset forward.
5403*5113495bSYour Name * -Ve - Move offset backward.
5404*5113495bSYour Name * @func: Caller function name
5405*5113495bSYour Name * @line: Caller function line no.
5406*5113495bSYour Name *
5407*5113495bSYour Name * Return: QDF_STATUS
5408*5113495bSYour Name */
5409*5113495bSYour Name QDF_STATUS qdf_nbuf_move_frag_page_offset_debug(qdf_nbuf_t nbuf, uint8_t idx,
5410*5113495bSYour Name int offset, const char *func,
5411*5113495bSYour Name uint32_t line);
5412*5113495bSYour Name
5413*5113495bSYour Name #define qdf_nbuf_remove_frag(n, i, t) \
5414*5113495bSYour Name qdf_nbuf_remove_frag_debug(n, i, t, __func__, __LINE__)
5415*5113495bSYour Name
5416*5113495bSYour Name /**
5417*5113495bSYour Name * qdf_nbuf_remove_frag_debug - Remove frag from nbuf
5418*5113495bSYour Name * @nbuf: nbuf where frag will be removed
5419*5113495bSYour Name * @idx: frag index
5420*5113495bSYour Name * @truesize: truesize of frag
5421*5113495bSYour Name * @func: Caller function name
5422*5113495bSYour Name * @line: Caller function line no.
5423*5113495bSYour Name *
5424*5113495bSYour Name * Return: QDF_STATUS
5425*5113495bSYour Name *
5426*5113495bSYour Name */
5427*5113495bSYour Name QDF_STATUS
5428*5113495bSYour Name qdf_nbuf_remove_frag_debug(qdf_nbuf_t nbuf,
5429*5113495bSYour Name uint16_t idx,
5430*5113495bSYour Name uint16_t truesize,
5431*5113495bSYour Name const char *func,
5432*5113495bSYour Name uint32_t line);
5433*5113495bSYour Name
5434*5113495bSYour Name #define qdf_nbuf_add_rx_frag(f, b, o, l, s, r) \
5435*5113495bSYour Name qdf_nbuf_add_rx_frag_debug(f, b, o, l, s, r, __func__, __LINE__)
5436*5113495bSYour Name
5437*5113495bSYour Name /**
5438*5113495bSYour Name * qdf_nbuf_add_rx_frag_debug() - Add frag to nbuf at index frag_idx
5439*5113495bSYour Name * @buf: Frag pointer needs to be added in nbuf
5440*5113495bSYour Name * @nbuf: qdf_nbuf_t where frag will be added
5441*5113495bSYour Name * @offset: Offset in frag to be added to nbuf_frags
5442*5113495bSYour Name * @frag_len: Frag length
5443*5113495bSYour Name * @truesize: truesize
5444*5113495bSYour Name * @take_frag_ref: Whether to take ref for frag or not
5445*5113495bSYour Name * This bool must be set as per below comdition:
5446*5113495bSYour Name * 1. False: If this frag is being added in any nbuf
5447*5113495bSYour Name * for the first time after allocation
5448*5113495bSYour Name * 2. True: If frag is already attached part of any
5449*5113495bSYour Name * nbuf
5450*5113495bSYour Name * @func: Caller function name
5451*5113495bSYour Name * @line: Caller function line no.
5452*5113495bSYour Name *
5453*5113495bSYour Name * Return: none
5454*5113495bSYour Name */
5455*5113495bSYour Name void qdf_nbuf_add_rx_frag_debug(qdf_frag_t buf, qdf_nbuf_t nbuf,
5456*5113495bSYour Name int offset, int frag_len,
5457*5113495bSYour Name unsigned int truesize, bool take_frag_ref,
5458*5113495bSYour Name const char *func, uint32_t line);
5459*5113495bSYour Name
5460*5113495bSYour Name
5461*5113495bSYour Name /**
5462*5113495bSYour Name * qdf_net_buf_debug_acquire_frag() - Add frag nodes to frag debug tracker
5463*5113495bSYour Name * when nbuf is received from network stack
5464*5113495bSYour Name * @buf: qdf_nbuf_t
5465*5113495bSYour Name * @func: Caller function name
5466*5113495bSYour Name * @line: Caller function line no.
5467*5113495bSYour Name *
5468*5113495bSYour Name * Return: none
5469*5113495bSYour Name */
5470*5113495bSYour Name void qdf_net_buf_debug_acquire_frag(qdf_nbuf_t buf, const char *func,
5471*5113495bSYour Name uint32_t line);
5472*5113495bSYour Name
5473*5113495bSYour Name /**
5474*5113495bSYour Name * qdf_net_buf_debug_release_frag() - Update frag nodes in frag debug tracker
5475*5113495bSYour Name * when nbuf is sent to network stack
5476*5113495bSYour Name * @buf: qdf_nbuf_t
5477*5113495bSYour Name * @func: Caller function name
5478*5113495bSYour Name * @line: Caller function line no.
5479*5113495bSYour Name *
5480*5113495bSYour Name * Return: none
5481*5113495bSYour Name */
5482*5113495bSYour Name void qdf_net_buf_debug_release_frag(qdf_nbuf_t buf, const char *func,
5483*5113495bSYour Name uint32_t line);
5484*5113495bSYour Name
5485*5113495bSYour Name /**
5486*5113495bSYour Name * qdf_nbuf_frag_count_inc() - Increment global frag counter
5487*5113495bSYour Name * @buf: qdf_nbuf_t
5488*5113495bSYour Name *
5489*5113495bSYour Name * Return: none
5490*5113495bSYour Name */
5491*5113495bSYour Name void qdf_nbuf_frag_count_inc(qdf_nbuf_t buf);
5492*5113495bSYour Name
5493*5113495bSYour Name /**
5494*5113495bSYour Name * qdf_nbuf_frag_count_dec() - Decrement global frag counter
5495*5113495bSYour Name * @buf: qdf_nbuf_t
5496*5113495bSYour Name *
5497*5113495bSYour Name * Return: none
5498*5113495bSYour Name */
5499*5113495bSYour Name void qdf_nbuf_frag_count_dec(qdf_nbuf_t buf);
5500*5113495bSYour Name
5501*5113495bSYour Name #else /* NBUF_FRAG_MEMORY_DEBUG */
5502*5113495bSYour Name
5503*5113495bSYour Name /**
5504*5113495bSYour Name * qdf_nbuf_move_frag_page_offset() - Move frag page_offset by size
5505*5113495bSYour Name * and adjust length by size.
5506*5113495bSYour Name * @nbuf: qdf_nbuf_t
5507*5113495bSYour Name * @idx: Frag index
5508*5113495bSYour Name * @offset: Frag page offset should be moved by offset.
5509*5113495bSYour Name * +Ve - Move offset forward.
5510*5113495bSYour Name * -Ve - Move offset backward.
5511*5113495bSYour Name */
qdf_nbuf_move_frag_page_offset(qdf_nbuf_t nbuf,uint8_t idx,int offset)5512*5113495bSYour Name static inline QDF_STATUS qdf_nbuf_move_frag_page_offset(qdf_nbuf_t nbuf,
5513*5113495bSYour Name uint8_t idx,
5514*5113495bSYour Name int offset)
5515*5113495bSYour Name {
5516*5113495bSYour Name return __qdf_nbuf_move_frag_page_offset(nbuf, idx, offset);
5517*5113495bSYour Name }
5518*5113495bSYour Name
5519*5113495bSYour Name /**
5520*5113495bSYour Name * qdf_nbuf_remove_frag() - Remove frag from nbuf
5521*5113495bSYour Name *
5522*5113495bSYour Name * @nbuf: nbuf pointer
5523*5113495bSYour Name * @idx: idx at which frag need to be removed
5524*5113495bSYour Name * @truesize: truesize of frag
5525*5113495bSYour Name *
5526*5113495bSYour Name * Return: void
5527*5113495bSYour Name */
qdf_nbuf_remove_frag(qdf_nbuf_t nbuf,uint16_t idx,uint16_t truesize)5528*5113495bSYour Name static inline void qdf_nbuf_remove_frag(qdf_nbuf_t nbuf,
5529*5113495bSYour Name uint16_t idx,
5530*5113495bSYour Name uint16_t truesize)
5531*5113495bSYour Name {
5532*5113495bSYour Name return __qdf_nbuf_remove_frag(nbuf, idx, truesize);
5533*5113495bSYour Name }
5534*5113495bSYour Name
5535*5113495bSYour Name /**
5536*5113495bSYour Name * qdf_nbuf_add_rx_frag() - Add frag to nbuf at index frag_idx
5537*5113495bSYour Name * @buf: Frag pointer needs to be added in nbuf frag
5538*5113495bSYour Name * @nbuf: qdf_nbuf_t where frag will be added
5539*5113495bSYour Name * @offset: Offset in frag to be added to nbuf_frags
5540*5113495bSYour Name * @frag_len: Frag length
5541*5113495bSYour Name * @truesize: truesize
5542*5113495bSYour Name * @take_frag_ref: Whether to take ref for frag or not
5543*5113495bSYour Name * This bool must be set as per below comdition:
5544*5113495bSYour Name * 1. False: If this frag is being added in any nbuf
5545*5113495bSYour Name * for the first time after allocation
5546*5113495bSYour Name * 2. True: If frag is already attached part of any
5547*5113495bSYour Name * nbuf
5548*5113495bSYour Name *
5549*5113495bSYour Name * qdf_nbuf_add_rx_frag takes ref_count based on boolean flag take_frag_ref
5550*5113495bSYour Name */
qdf_nbuf_add_rx_frag(qdf_frag_t buf,qdf_nbuf_t nbuf,int offset,int frag_len,unsigned int truesize,bool take_frag_ref)5551*5113495bSYour Name static inline void qdf_nbuf_add_rx_frag(qdf_frag_t buf, qdf_nbuf_t nbuf,
5552*5113495bSYour Name int offset, int frag_len,
5553*5113495bSYour Name unsigned int truesize,
5554*5113495bSYour Name bool take_frag_ref)
5555*5113495bSYour Name {
5556*5113495bSYour Name __qdf_nbuf_add_rx_frag(buf, nbuf, offset,
5557*5113495bSYour Name frag_len, truesize, take_frag_ref);
5558*5113495bSYour Name }
5559*5113495bSYour Name
qdf_net_buf_debug_acquire_frag(qdf_nbuf_t buf,const char * func,uint32_t line)5560*5113495bSYour Name static inline void qdf_net_buf_debug_acquire_frag(qdf_nbuf_t buf,
5561*5113495bSYour Name const char *func,
5562*5113495bSYour Name uint32_t line)
5563*5113495bSYour Name {
5564*5113495bSYour Name }
5565*5113495bSYour Name
qdf_net_buf_debug_release_frag(qdf_nbuf_t buf,const char * func,uint32_t line)5566*5113495bSYour Name static inline void qdf_net_buf_debug_release_frag(qdf_nbuf_t buf,
5567*5113495bSYour Name const char *func,
5568*5113495bSYour Name uint32_t line)
5569*5113495bSYour Name {
5570*5113495bSYour Name }
5571*5113495bSYour Name
qdf_nbuf_frag_count_inc(qdf_nbuf_t buf)5572*5113495bSYour Name static inline void qdf_nbuf_frag_count_inc(qdf_nbuf_t buf)
5573*5113495bSYour Name {
5574*5113495bSYour Name }
5575*5113495bSYour Name
qdf_nbuf_frag_count_dec(qdf_nbuf_t buf)5576*5113495bSYour Name static inline void qdf_nbuf_frag_count_dec(qdf_nbuf_t buf)
5577*5113495bSYour Name {
5578*5113495bSYour Name }
5579*5113495bSYour Name
5580*5113495bSYour Name #endif /* NBUF_FRAG_MEMORY_DEBUG */
5581*5113495bSYour Name
5582*5113495bSYour Name #define qdf_nbuf_add_frag(dev, f, n, o, f_l, t_sz, f_r, sz) \
5583*5113495bSYour Name qdf_nbuf_add_frag_debug(dev, f, n, o, f_l, t_sz, \
5584*5113495bSYour Name f_r, sz, __func__, __LINE__)
5585*5113495bSYour Name
5586*5113495bSYour Name /**
5587*5113495bSYour Name * qdf_nbuf_add_frag_debug() - Add frag to nbuf
5588*5113495bSYour Name * @osdev: Device handle
5589*5113495bSYour Name * @buf: Frag pointer needs to be added in nbuf frag
5590*5113495bSYour Name * @nbuf: qdf_nbuf_t where frag will be added
5591*5113495bSYour Name * @offset: Offset in frag to be added to nbuf_frags
5592*5113495bSYour Name * @frag_len: Frag length
5593*5113495bSYour Name * @truesize: truesize
5594*5113495bSYour Name * @take_frag_ref: Whether to take ref for frag or not
5595*5113495bSYour Name * This bool must be set as per below comdition:
5596*5113495bSYour Name * 1. False: If this frag is being added in any nbuf
5597*5113495bSYour Name * for the first time after allocation
5598*5113495bSYour Name * 2. True: If frag is already attached part of any
5599*5113495bSYour Name * nbuf
5600*5113495bSYour Name * @minsize: Minimum size to allocate
5601*5113495bSYour Name * @func: Caller function name
5602*5113495bSYour Name * @line: Caller function line no.
5603*5113495bSYour Name *
5604*5113495bSYour Name * if number of frag exceed maximum frag array. A new nbuf is allocated
5605*5113495bSYour Name * with minimum headroom and frag it added to that nbuf.
5606*5113495bSYour Name * new nbuf is added as frag_list to the master nbuf.
5607*5113495bSYour Name *
5608*5113495bSYour Name * Return: QDF_STATUS
5609*5113495bSYour Name */
5610*5113495bSYour Name QDF_STATUS
5611*5113495bSYour Name qdf_nbuf_add_frag_debug(qdf_device_t osdev, qdf_frag_t buf,
5612*5113495bSYour Name qdf_nbuf_t nbuf, int offset,
5613*5113495bSYour Name int frag_len, unsigned int truesize,
5614*5113495bSYour Name bool take_frag_ref, unsigned int minsize,
5615*5113495bSYour Name const char *func, uint32_t line);
5616*5113495bSYour Name
5617*5113495bSYour Name #ifdef MEMORY_DEBUG
5618*5113495bSYour Name /**
5619*5113495bSYour Name * qdf_nbuf_acquire_track_lock - acquire the nbuf spinlock at the
5620*5113495bSYour Name * specified index
5621*5113495bSYour Name * @index: index to get the lock
5622*5113495bSYour Name * @irq_flag: lock flag for using nbuf lock
5623*5113495bSYour Name *
5624*5113495bSYour Name * Return: none
5625*5113495bSYour Name */
5626*5113495bSYour Name void qdf_nbuf_acquire_track_lock(uint32_t index,
5627*5113495bSYour Name unsigned long irq_flag);
5628*5113495bSYour Name
5629*5113495bSYour Name /**
5630*5113495bSYour Name * qdf_nbuf_release_track_lock - release the nbuf spinlock at the
5631*5113495bSYour Name * specified index
5632*5113495bSYour Name * @index: index of the lock to be released
5633*5113495bSYour Name * @irq_flag: lock flag for using nbuf lock
5634*5113495bSYour Name *
5635*5113495bSYour Name * Return: none
5636*5113495bSYour Name */
5637*5113495bSYour Name void qdf_nbuf_release_track_lock(uint32_t index,
5638*5113495bSYour Name unsigned long irq_flag);
5639*5113495bSYour Name
5640*5113495bSYour Name /**
5641*5113495bSYour Name * qdf_nbuf_get_track_tbl - get the QDF_NBUF_TRACK entry from the track
5642*5113495bSYour Name * table at the specified index
5643*5113495bSYour Name * @index: index to get the table entry
5644*5113495bSYour Name *
5645*5113495bSYour Name * Return: the QDF_NBUF_TRACK entry at the specified index in the table
5646*5113495bSYour Name */
5647*5113495bSYour Name QDF_NBUF_TRACK *qdf_nbuf_get_track_tbl(uint32_t index);
5648*5113495bSYour Name #endif /* MEMORY_DEBUG */
5649*5113495bSYour Name
5650*5113495bSYour Name #ifdef CONFIG_WLAN_SYSFS_MEM_STATS
5651*5113495bSYour Name /**
5652*5113495bSYour Name * qdf_record_nbuf_nbytes() - add or subtract the size of the nbuf
5653*5113495bSYour Name * from the total skb mem and DP tx/rx skb mem
5654*5113495bSYour Name * @nbytes: number of bytes
5655*5113495bSYour Name * @dir: direction
5656*5113495bSYour Name * @is_mapped: is mapped or unmapped memory
5657*5113495bSYour Name *
5658*5113495bSYour Name * Return: none
5659*5113495bSYour Name */
5660*5113495bSYour Name void qdf_record_nbuf_nbytes(
5661*5113495bSYour Name uint32_t nbytes, qdf_dma_dir_t dir, bool is_mapped);
5662*5113495bSYour Name
5663*5113495bSYour Name #else /* CONFIG_WLAN_SYSFS_MEM_STATS */
qdf_record_nbuf_nbytes(int nbytes,qdf_dma_dir_t dir,bool is_mapped)5664*5113495bSYour Name static inline void qdf_record_nbuf_nbytes(
5665*5113495bSYour Name int nbytes, qdf_dma_dir_t dir, bool is_mapped)
5666*5113495bSYour Name {
5667*5113495bSYour Name }
5668*5113495bSYour Name #endif /* CONFIG_WLAN_SYSFS_MEM_STATS */
5669*5113495bSYour Name
5670*5113495bSYour Name #ifdef ENHANCED_OS_ABSTRACTION
5671*5113495bSYour Name /**
5672*5113495bSYour Name * qdf_nbuf_set_timestamp() - set the timestamp for frame
5673*5113495bSYour Name * @buf: pointer to network buffer
5674*5113495bSYour Name *
5675*5113495bSYour Name * Return: none
5676*5113495bSYour Name */
5677*5113495bSYour Name void qdf_nbuf_set_timestamp(qdf_nbuf_t buf);
5678*5113495bSYour Name
5679*5113495bSYour Name /**
5680*5113495bSYour Name * qdf_nbuf_get_timestamp() - get the timestamp for frame
5681*5113495bSYour Name * @buf: pointer to network buffer
5682*5113495bSYour Name *
5683*5113495bSYour Name * Return: timestamp stored in skb in ms
5684*5113495bSYour Name */
5685*5113495bSYour Name uint64_t qdf_nbuf_get_timestamp(qdf_nbuf_t buf);
5686*5113495bSYour Name
5687*5113495bSYour Name /**
5688*5113495bSYour Name * qdf_nbuf_get_timestamp_us() - get the timestamp for frame
5689*5113495bSYour Name * @buf: pointer to network buffer
5690*5113495bSYour Name *
5691*5113495bSYour Name * Return: timestamp stored in nbuf in us
5692*5113495bSYour Name */
5693*5113495bSYour Name uint64_t qdf_nbuf_get_timestamp_us(qdf_nbuf_t buf);
5694*5113495bSYour Name
5695*5113495bSYour Name /**
5696*5113495bSYour Name * qdf_nbuf_get_timedelta_ms() - get time difference in ms
5697*5113495bSYour Name * @buf: pointer to network buffer
5698*5113495bSYour Name *
5699*5113495bSYour Name * Return: time difference ms
5700*5113495bSYour Name */
5701*5113495bSYour Name uint64_t qdf_nbuf_get_timedelta_ms(qdf_nbuf_t buf);
5702*5113495bSYour Name
5703*5113495bSYour Name /**
5704*5113495bSYour Name * qdf_nbuf_get_timedelta_us() - get time difference in micro seconds
5705*5113495bSYour Name * @buf: pointer to network buffer
5706*5113495bSYour Name *
5707*5113495bSYour Name * Return: time difference in micro seconds
5708*5113495bSYour Name */
5709*5113495bSYour Name uint64_t qdf_nbuf_get_timedelta_us(qdf_nbuf_t buf);
5710*5113495bSYour Name
5711*5113495bSYour Name /**
5712*5113495bSYour Name * qdf_nbuf_net_timedelta() - get time delta
5713*5113495bSYour Name * @t: time as qdf_ktime_t object
5714*5113495bSYour Name *
5715*5113495bSYour Name * Return: time delta as ktime_t object
5716*5113495bSYour Name */
5717*5113495bSYour Name qdf_ktime_t qdf_nbuf_net_timedelta(qdf_ktime_t t);
5718*5113495bSYour Name #else
5719*5113495bSYour Name static inline void
qdf_nbuf_set_timestamp(struct sk_buff * skb)5720*5113495bSYour Name qdf_nbuf_set_timestamp(struct sk_buff *skb)
5721*5113495bSYour Name {
5722*5113495bSYour Name __qdf_nbuf_set_timestamp(skb);
5723*5113495bSYour Name }
5724*5113495bSYour Name
5725*5113495bSYour Name static inline uint64_t
qdf_nbuf_get_timestamp(struct sk_buff * skb)5726*5113495bSYour Name qdf_nbuf_get_timestamp(struct sk_buff *skb)
5727*5113495bSYour Name {
5728*5113495bSYour Name return __qdf_nbuf_get_timestamp(skb);
5729*5113495bSYour Name }
5730*5113495bSYour Name
5731*5113495bSYour Name static inline uint64_t
qdf_nbuf_get_timestamp_us(qdf_nbuf_t buf)5732*5113495bSYour Name qdf_nbuf_get_timestamp_us(qdf_nbuf_t buf)
5733*5113495bSYour Name {
5734*5113495bSYour Name return __qdf_nbuf_get_timestamp_us(buf);
5735*5113495bSYour Name }
5736*5113495bSYour Name
5737*5113495bSYour Name static inline uint64_t
qdf_nbuf_get_timedelta_ms(struct sk_buff * skb)5738*5113495bSYour Name qdf_nbuf_get_timedelta_ms(struct sk_buff *skb)
5739*5113495bSYour Name {
5740*5113495bSYour Name return __qdf_nbuf_get_timedelta_ms(skb);
5741*5113495bSYour Name }
5742*5113495bSYour Name
5743*5113495bSYour Name static inline uint64_t
qdf_nbuf_get_timedelta_us(struct sk_buff * skb)5744*5113495bSYour Name qdf_nbuf_get_timedelta_us(struct sk_buff *skb)
5745*5113495bSYour Name {
5746*5113495bSYour Name return __qdf_nbuf_get_timedelta_us(skb);
5747*5113495bSYour Name }
5748*5113495bSYour Name
qdf_nbuf_net_timedelta(qdf_ktime_t t)5749*5113495bSYour Name static inline qdf_ktime_t qdf_nbuf_net_timedelta(qdf_ktime_t t)
5750*5113495bSYour Name {
5751*5113495bSYour Name return __qdf_nbuf_net_timedelta(t);
5752*5113495bSYour Name }
5753*5113495bSYour Name #endif /* ENHANCED_OS_ABSTRACTION */
5754*5113495bSYour Name
5755*5113495bSYour Name #ifdef NBUF_MEMORY_DEBUG
5756*5113495bSYour Name /**
5757*5113495bSYour Name * qdf_set_smmu_fault_state() - Set smmu fault state
5758*5113495bSYour Name * @smmu_fault_state: state of the wlan smmu
5759*5113495bSYour Name *
5760*5113495bSYour Name * Return: void
5761*5113495bSYour Name */
5762*5113495bSYour Name void qdf_set_smmu_fault_state(bool smmu_fault_state);
5763*5113495bSYour Name #else
qdf_set_smmu_fault_state(bool smmu_fault_state)5764*5113495bSYour Name static inline void qdf_set_smmu_fault_state(bool smmu_fault_state)
5765*5113495bSYour Name {
5766*5113495bSYour Name }
5767*5113495bSYour Name #endif
5768*5113495bSYour Name
5769*5113495bSYour Name #ifdef CONFIG_NBUF_AP_PLATFORM
5770*5113495bSYour Name #include <i_qdf_nbuf_api_w.h>
5771*5113495bSYour Name #else
5772*5113495bSYour Name #include <i_qdf_nbuf_api_m.h>
5773*5113495bSYour Name #endif
5774*5113495bSYour Name
5775*5113495bSYour Name /**
5776*5113495bSYour Name * qdf_nbuf_stop_replenish_timer - Stop alloc fail replenish timer
5777*5113495bSYour Name *
5778*5113495bSYour Name * This function stops the alloc fail replenish timer.
5779*5113495bSYour Name *
5780*5113495bSYour Name * Return: void
5781*5113495bSYour Name */
5782*5113495bSYour Name void qdf_nbuf_stop_replenish_timer(void);
5783*5113495bSYour Name
5784*5113495bSYour Name /**
5785*5113495bSYour Name * qdf_get_nbuf_valid_frag() - Get nbuf to store frag
5786*5113495bSYour Name * @nbuf: qdf_nbuf_t master nbuf
5787*5113495bSYour Name *
5788*5113495bSYour Name * Return: qdf_nbuf_t
5789*5113495bSYour Name */
5790*5113495bSYour Name qdf_nbuf_t qdf_get_nbuf_valid_frag(qdf_nbuf_t nbuf);
5791*5113495bSYour Name
5792*5113495bSYour Name /**
5793*5113495bSYour Name * qdf_nbuf_fast_xmit() - Check if packet has fast_xmit support
5794*5113495bSYour Name * @nbuf: qdf_nbuf_t master nbuf
5795*5113495bSYour Name *
5796*5113495bSYour Name * This function checks if skb has fast_xmit or not.
5797*5113495bSYour Name *
5798*5113495bSYour Name * Return: True if skb support fast_xmit otherwise false
5799*5113495bSYour Name */
5800*5113495bSYour Name bool qdf_nbuf_fast_xmit(qdf_nbuf_t nbuf);
5801*5113495bSYour Name
5802*5113495bSYour Name /**
5803*5113495bSYour Name * qdf_nbuf_set_fast_xmit() - Set fast_xmit in SKB
5804*5113495bSYour Name * @nbuf: qdf_nbuf_t master nbuf
5805*5113495bSYour Name * @value: value to set in fast_xmit
5806*5113495bSYour Name *
5807*5113495bSYour Name * This function set fast_xmit in SKB if it exist.
5808*5113495bSYour Name *
5809*5113495bSYour Name * Return: void
5810*5113495bSYour Name */
5811*5113495bSYour Name void qdf_nbuf_set_fast_xmit(qdf_nbuf_t nbuf, int value);
5812*5113495bSYour Name
5813*5113495bSYour Name #endif /* _QDF_NBUF_H */
5814