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