xref: /wlan-driver/qcacld-3.0/core/cds/src/i_cds_packet.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2014-2016, 2019, 2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #if !defined(__I_CDS_PACKET_H)
21 #define __I_CDS_PACKET_H
22 
23 /**
24  * DOC: i_cds_packet.h
25  *      Connectivity driver services network packet APIs
26  *      Network Protocol packet/buffer internal include file
27  */
28 
29 #include "qdf_types.h"
30 
31 /**
32  * struct packetmeta - Rx Packet Struct
33  * @frequency: Frequency
34  * @snr: Signal to noise ratio
35  * @rssi: Received signal strength indicator, normalized to -96 dBm as
36  *        normal noise floor by adding -96 to snr. All the configured
37  *        thresholds in the driver assume that noise floor is -96 dBm.
38  * @timestamp: System timestamp when frame was received. Set to jiffies.
39  * @mpdu_hdr_ptr: Pointer to beginning of 802.11 MPDU
40  * @mpdu_data_ptr: Pointer to beginning of payload
41  * @mpdu_len: Length of 802.11 MPDU
42  * @mpdu_hdr_len: Length of 802.11 MPDU header
43  * @mpdu_data_len: Length of 802.11 MPDU payload
44  * @offloadScanLearn: Bit set to 1 for beacons received during roaming scan
45  * @roamCandidateInd: Bit set to 1 when roaming candidate is found by fw
46  * @scan_src: Source of scan
47  * @dpuFeedback: DPU feedback for frame
48  * @session_id: PE session
49  * @tsf_delta: Delta between tsf in frame and local value of tsf
50  * @rssi_raw: rssi based on actual noise floor in hardware.
51  * @pkt_qdf_buf: Pointer to Packet
52  *
53  * Buffer for the packet received from WMA has pointers to 802.11
54  * frame fields and additional information based on the type of frame.
55  */
56 struct packetmeta {
57 	uint32_t frequency;
58 	uint8_t snr;
59 	uint32_t rssi;
60 	uint32_t timestamp;
61 	uint8_t *mpdu_hdr_ptr;
62 	uint8_t *mpdu_data_ptr;
63 	uint32_t mpdu_len;
64 	uint32_t mpdu_hdr_len;
65 	uint32_t mpdu_data_len;
66 	uint8_t offloadScanLearn:1;
67 	uint8_t roamCandidateInd:1;
68 	uint8_t scan_src;
69 	uint8_t dpuFeedback;
70 	uint8_t session_id;
71 	uint32_t tsf_delta;
72 	uint32_t rssi_raw;
73 	void *pkt_qdf_buf;
74 };
75 
76 typedef struct packetmeta t_packetmeta, *tp_packetmeta;
77 
78 /* implementation specific cds packet type */
79 struct cds_pkt_t {
80 	/* Packet Meta Information */
81 	t_packetmeta pkt_meta;
82 
83 	/* Pointer to Packet */
84 	void *pkt_buf;
85 };
86 
87 #endif /* !defined( __I_CDS_PACKET_H ) */
88