blob: bb2fe7164387855f6f82a977ea2b0984bf98a578 [file] [log] [blame]
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05301/*
Chaithanya Garrepalli9cc562c2018-11-16 18:30:41 +05302 * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05303 *
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 * @file cdp_txrx_cmn_struct.h
21 * @brief Define the host data path converged API functions
22 * called by the host control SW and the OS interface module
23 */
24#ifndef _CDP_TXRX_CMN_STRUCT_H_
25#define _CDP_TXRX_CMN_STRUCT_H_
26
Leo Changdb6358c2016-09-27 17:00:52 -070027/**
28 * For WIN legacy header compilation
29 * Temporary add dummy definitions
30 * should be removed properly WIN legacy code handle
31 */
32
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053033#include "htc_api.h"
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053034#include "qdf_types.h"
35#include "qdf_nbuf.h"
Pratik Gandhi51b6b6d2017-09-18 15:02:43 +053036#include "qdf_atomic.h"
Vevek Venkatesande31ff62019-06-11 12:50:49 +053037#ifdef DP_MOB_DEFS
Leo Changdb6358c2016-09-27 17:00:52 -070038#include <cdp_txrx_mob_def.h>
Pranita Solanke05862962019-01-09 11:39:29 +053039#endif
c_cgodavbd5b3c22017-06-07 12:31:40 +053040#include <cdp_txrx_handle.h>
Amir Patel78824b12019-02-23 10:54:32 +053041#include <cdp_txrx_stats_struct.h>
Kai Chen52ef33f2019-03-05 18:33:40 -080042#ifdef WLAN_RX_PKT_CAPTURE_ENH
43#include "cdp_txrx_extd_struct.h"
44#endif
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +053045
Leo Changdb6358c2016-09-27 17:00:52 -070046#ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
Alok Kumarc1ec49e2018-11-26 19:14:36 +053047/*
48 * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
49 * Clients will be assigned max 32 IDs.
50 * STA(associated)/P2P DEV(self-PEER) will get one ID.
51 */
52#define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
Leo Changdb6358c2016-09-27 17:00:52 -070053#endif
54
Soumya Bhat835033e2017-10-04 22:21:46 +053055#define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
56#define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
Amir Patel02911572018-07-02 13:00:53 +053057#define CDP_RSSI_CHAIN_LEN 8
Pamidipati, Vijay038d0902017-07-17 09:53:31 +053058
Rakesh Pillai7bce1f02019-06-24 15:06:41 +053059#define OL_TXRX_INVALID_PDEV_ID 0xff
Leo Changdb6358c2016-09-27 17:00:52 -070060#define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
Ishank Jain1e7401c2017-02-17 15:38:39 +053061#define CDP_INVALID_VDEV_ID 0xff
Venkata Sharath Chandra Manchalaa405eb72017-03-06 14:35:00 -080062/* Options for Dump Statistics */
63#define CDP_HDD_STATS 0
64#define CDP_TXRX_PATH_STATS 1
65#define CDP_TXRX_HIST_STATS 2
66#define CDP_TXRX_TSO_STATS 3
67#define CDP_HDD_NETIF_OPER_HISTORY 4
68#define CDP_DUMP_TX_FLOW_POOL_INFO 5
69#define CDP_TXRX_DESC_STATS 6
70#define CDP_HIF_STATS 7
71#define CDP_LRO_STATS 8
72#define CDP_NAPI_STATS 9
Mohit Khanna79db2c42017-03-29 19:08:07 -070073#define CDP_WLAN_RX_BUF_DEBUG_STATS 10
Venkata Sharath Chandra Manchala918aefe2017-04-10 10:21:56 -070074#define CDP_RX_RING_STATS 11
psimha61b1a362017-07-27 15:45:49 -070075#define CDP_DP_NAPI_STATS 12
Mohit Khanna43938662018-11-28 18:37:52 -080076#define CDP_DP_RX_THREAD_STATS 13
Venkata Sharath Chandra Manchalaa405eb72017-03-06 14:35:00 -080077#define CDP_SCHEDULER_STATS 21
78#define CDP_TX_QUEUE_STATS 22
79#define CDP_BUNDLE_STATS 23
80#define CDP_CREDIT_STATS 24
Vignesh Viswanathan3a133b72017-09-06 12:29:07 +053081#define CDP_DISCONNECT_STATS 25
Venkata Sharath Chandra Manchalaa405eb72017-03-06 14:35:00 -080082
Ishank Jain1e7401c2017-02-17 15:38:39 +053083#define WME_AC_TO_TID(_ac) ( \
84 ((_ac) == WME_AC_VO) ? 6 : \
85 ((_ac) == WME_AC_VI) ? 5 : \
86 ((_ac) == WME_AC_BK) ? 1 : \
87 0)
88
89#define TID_TO_WME_AC(_tid) ( \
90 (((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
91 (((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
92 (((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
93 WME_AC_VO)
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +053094
Rhythm Patwa803446e2019-03-14 17:18:34 -070095#define CDP_MU_MAX_USERS 37
Soumya Bhat835033e2017-10-04 22:21:46 +053096#define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
phadiman7821bf82018-02-06 16:03:54 +053097#define CDP_INVALID_PEER 0xffff
Pratik Gandhi78461502018-02-05 17:22:41 +053098#define CDP_INVALID_TID 31
Varsha Mishra27c5bd32019-05-28 11:54:46 +053099#define CDP_INVALID_TX_ENCAP_TYPE 6
100#define CDP_INVALID_SEC_TYPE 12
Soumya Bhat835033e2017-10-04 22:21:46 +0530101
Soumya Bhat1df94642018-01-31 15:38:21 +0530102#define CDP_DATA_TID_MAX 8
Amir Patel23216682019-03-28 18:16:25 +0530103#define CDP_DATA_NON_QOS_TID 16
Ankit Kumarcd66fff2019-07-02 20:54:44 +0530104
105#define CDP_NUM_SA_BW 4
106#define CDP_PERCENT_MACRO 100
107#define CDP_NUM_KB_IN_MB 1000
Pamidipati, Vijay6b0d2a82017-06-09 04:46:32 +0530108/*
nobeljd124b742017-10-16 11:59:12 -0700109 * advance rx monitor filter
110 * */
111#define MON_FILTER_PASS 0x0001
112#define MON_FILTER_OTHER 0x0002
113#define MON_FILTER_ALL 0x0003
114
115#define FILTER_MGMT_ALL 0xFFFF
116#define FILTER_MGMT_ASSOC_REQ 0x0001
117#define FILTER_MGMT_ASSOC_RES 0x0002
118#define FILTER_MGMT_REASSOC_REQ 0x0004
119#define FILTER_MGMT_REASSOC_RES 0x0008
120#define FILTER_MGMT_PROBE_REQ 0x0010
121#define FILTER_MGMT_PROBE_RES 0x0020
122#define FILTER_MGMT_TIM_ADVT 0x0040
123#define FILTER_MGMT_RESERVED_7 0x0080
124#define FILTER_MGMT_BEACON 0x0100
125#define FILTER_MGMT_ATIM 0x0200
126#define FILTER_MGMT_DISASSOC 0x0400
127#define FILTER_MGMT_AUTH 0x0800
128#define FILTER_MGMT_DEAUTH 0x1000
129#define FILTER_MGMT_ACTION 0x2000
130#define FILTER_MGMT_ACT_NO_ACK 0x4000
131#define FILTER_MGMT_RESERVED_15 0x8000
132
133#define FILTER_CTRL_ALL 0xFFFF
134#define FILTER_CTRL_RESERVED_1 0x0001
135#define FILTER_CTRL_RESERVED_2 0x0002
136#define FILTER_CTRL_TRIGGER 0x0004
137#define FILTER_CTRL_RESERVED_4 0x0008
138#define FILTER_CTRL_BF_REP_POLL 0x0010
139#define FILTER_CTRL_VHT_NDP 0x0020
140#define FILTER_CTRL_FRAME_EXT 0x0040
141#define FILTER_CTRL_CTRLWRAP 0x0080
142#define FILTER_CTRL_BA_REQ 0x0100
143#define FILTER_CTRL_BA 0x0200
144#define FILTER_CTRL_PSPOLL 0x0400
145#define FILTER_CTRL_RTS 0x0800
146#define FILTER_CTRL_CTS 0x1000
147#define FILTER_CTRL_ACK 0x2000
148#define FILTER_CTRL_CFEND 0x4000
149#define FILTER_CTRL_CFEND_CFACK 0x8000
150
151#define FILTER_DATA_ALL 0xFFFF
152#define FILTER_DATA_MCAST 0x4000
153#define FILTER_DATA_UCAST 0x8000
154#define FILTER_DATA_DATA 0x0001
155#define FILTER_DATA_NULL 0x0008
156
Ruchi, Agrawal2cbca3b2018-06-20 19:31:03 +0530157QDF_DECLARE_EWMA(tx_lag, 1024, 8)
Amir Patel78824b12019-02-23 10:54:32 +0530158struct cdp_stats_cookie;
Ruchi, Agrawal2cbca3b2018-06-20 19:31:03 +0530159
nobeljd124b742017-10-16 11:59:12 -0700160/*
Pamidipati, Vijay6b0d2a82017-06-09 04:46:32 +0530161 * DP configuration parameters
162 */
163enum cdp_cfg_param_type {
164 CDP_CFG_MAX_PEER_ID,
Ruchi, Agrawal34721392017-11-13 18:02:09 +0530165 CDP_CFG_CCE_DISABLE,
Pamidipati, Vijay6b0d2a82017-06-09 04:46:32 +0530166 CDP_CFG_NUM_PARAMS
167};
168
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530169/*
170 * htt_dbg_stats_type -
171 * bit positions for each stats type within a stats type bitmask
172 * The bitmask contains 24 bits.
173 */
174enum htt_cmn_dbg_stats_type {
Pamidipati, Vijay623fbee2017-07-07 10:58:15 +0530175 HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
176 HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
177 HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
178 HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
179 HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
180 HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
181 HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
182 HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
183 HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
184 HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
185 HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
186 HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
187 HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
188 HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
189 HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
190 HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
191 HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
192 HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
193 /* bits 18-23 currently reserved */
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530194
Pamidipati, Vijay623fbee2017-07-07 10:58:15 +0530195 /* keep this last */
Manjunathappa Prakash029b6652018-03-28 20:07:52 -0700196 HTT_DBG_CMN_NUM_STATS,
197 HTT_DBG_CMN_NUM_STATS_INVALID = 31, /* bit 31 -> 0x80000000 */
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530198};
199
Ishank Jainbc2d91f2017-01-03 18:14:54 +0530200/*
201 * cdp_host_txrx_stats: Different types of host stats
Venkata Sharath Chandra Manchalaa77da0d2017-02-27 22:44:37 -0800202 * @TXRX_HOST_STATS_INVALID: Invalid option
Ishank Jainbc2d91f2017-01-03 18:14:54 +0530203 * @TXRX_RX_RATE_STATS: Rx rate info
204 * @TXRX_TX_RATE_STATS: Tx rate info
205 * @TXRX_TX_HOST_STATS: Print Tx stats
206 * @TXRX_RX_HOST_STATS: Print host Rx stats
207 * @TXRX_CLEAR_STATS: clear all host stats
sumedh baikady72b1c712017-08-24 12:11:46 -0700208 * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
Kai Chen783e0382018-01-25 16:29:08 -0800209 * @TXRX_RX_MON_STATS: Print monitor mode stats
Venkata Sharath Chandra Manchala0cb31982018-03-30 15:55:26 -0700210 * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
Venkata Sharath Chandra Manchalaf167af12018-10-09 20:23:02 -0700211 * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
212 * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
Pamidipati, Vijay37d107d2018-12-31 14:46:14 +0530213 * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
Mohit Khannae5a6e942018-11-28 14:22:48 -0800214 * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
Venkata Sharath Chandra Manchalaf167af12018-10-09 20:23:02 -0700215 */
Ishank Jainbc2d91f2017-01-03 18:14:54 +0530216enum cdp_host_txrx_stats {
Venkata Sharath Chandra Manchalaa77da0d2017-02-27 22:44:37 -0800217 TXRX_HOST_STATS_INVALID = -1,
Venkata Sharath Chandra Manchala0cb31982018-03-30 15:55:26 -0700218 TXRX_CLEAR_STATS = 0,
219 TXRX_RX_RATE_STATS = 1,
220 TXRX_TX_RATE_STATS = 2,
221 TXRX_TX_HOST_STATS = 3,
222 TXRX_RX_HOST_STATS = 4,
223 TXRX_AST_STATS = 5,
224 TXRX_SRNG_PTR_STATS = 6,
225 TXRX_RX_MON_STATS = 7,
226 TXRX_REO_QUEUE_STATS = 8,
Venkata Sharath Chandra Manchalaf167af12018-10-09 20:23:02 -0700227 TXRX_SOC_CFG_PARAMS = 9,
228 TXRX_PDEV_CFG_PARAMS = 10,
Pamidipati, Vijay37d107d2018-12-31 14:46:14 +0530229 TXRX_NAPI_STATS = 11,
Mohit Khannae5a6e942018-11-28 14:22:48 -0800230 TXRX_SOC_INTERRUPT_STATS = 12,
Ishank Jain57c42a12017-04-12 10:42:22 +0530231 TXRX_HOST_STATS_MAX,
Ishank Jainbc2d91f2017-01-03 18:14:54 +0530232};
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530233
Pamidipati, Vijayd7eb83e2017-09-20 21:19:56 +0530234/*
235 * cdp_ppdu_ftype: PPDU Frame Type
236 * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
237 * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
Chaithanya Garrepallibe9d5fc2018-07-26 19:21:24 +0530238 * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
Pamidipati, Vijayd7eb83e2017-09-20 21:19:56 +0530239*/
240enum cdp_ppdu_ftype {
Pamidipati, Vijayd7eb83e2017-09-20 21:19:56 +0530241 CDP_PPDU_FTYPE_CTRL,
Pamidipati, Vijaybd9c13f2017-10-17 20:12:03 +0530242 CDP_PPDU_FTYPE_DATA,
Chaithanya Garrepallibe9d5fc2018-07-26 19:21:24 +0530243 CDP_PPDU_FTYPE_BAR,
Pamidipati, Vijayd7eb83e2017-09-20 21:19:56 +0530244 CDP_PPDU_FTYPE_MAX
245};
246
247
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530248/**
249 * @brief General specification of the tx frame contents
250 *
251 * @details
252 * for efficiency, the HTT packet type values correspond
253 * to the bit positions of the WAL packet type values, so the
254 * translation is a simple shift operation.
255 */
256enum htt_cmn_pkt_type {
phadiman7821bf82018-02-06 16:03:54 +0530257 htt_cmn_pkt_type_raw = 0,
258 htt_cmn_pkt_type_native_wifi = 1,
259 htt_cmn_pkt_type_ethernet = 2,
260 htt_cmn_pkt_type_mgmt = 3,
261 htt_cmn_pkt_type_eth2 = 4,
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530262
phadiman7821bf82018-02-06 16:03:54 +0530263 /* keep this last */
264 htt_cmn_pkt_num_types
265};
266
267/**
268 * @General description of HTT received packets status
269 * It is similar to htt_rx_status enum
270 * but is added as a cdp enum can be freely used in OL_IF layer
271 */
272enum htt_cmn_rx_status {
273 htt_cmn_rx_status_unknown = 0x0,
274 htt_cmn_rx_status_ok,
275 htt_cmn_rx_status_err_fcs,
276 htt_cmn_rx_status_err_dup,
277 htt_cmn_rx_status_err_replay,
278 htt_cmn_rx_status_inv_peer,
279 htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
280 htt_cmn_rx_status_tkip_mic_err = 0x09,
281 htt_cmn_rx_status_decrypt_err = 0x0A,
282 htt_cmn_rx_status_mpdu_length_err = 0x0B,
283 htt_cmn_rx_status_err_misc = 0xFF
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530284};
285
Tallapragada Kalyanfd1edcc2017-03-07 19:34:29 +0530286
287enum cdp_host_reo_dest_ring {
288 cdp_host_reo_dest_ring_unknown = 0,
289 cdp_host_reo_dest_ring_1 = 1,
290 cdp_host_reo_dest_ring_2 = 2,
291 cdp_host_reo_dest_ring_3 = 3,
292 cdp_host_reo_dest_ring_4 = 4,
293};
294
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530295enum htt_cmn_t2h_en_stats_type {
296 /* keep this alwyas first */
297 HTT_CMN_T2H_EN_STATS_TYPE_START = 0,
298
299 /** ppdu_common_stats is the payload */
300 HTT_CMN_T2H_EN_STATS_TYPE_COMMON = 1,
301 /** ppdu_sant_stats is the payload */
302 HTT_CMN_T2H_EN_STATS_TYPE_SANT = 2,
303 /** ppdu_common_stats_v2 is the payload */
304 HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
305
306 /* Keep this last */
307 HTT_CMN_T2H_EN_STATS_TYPE_END = 0x1f,
308};
309
310enum htt_cmn_t2h_en_stats_status {
311 /* Keep this first always */
312 HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL = 0,
313 HTT_CMN_T2H_EN_STATS_STATUS_PRESENT = 1,
314 HTT_CMN_T2H_EN_STATS_STATUS_ERROR = 2,
315 HTT_CMN_T2H_EN_STATS_STATUS_INVALID = 3,
316
317
318 /* keep this always last */
319 HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE = 7,
320};
321
Leo Changdb6358c2016-09-27 17:00:52 -0700322/**
323 * struct ol_txrx_peer_state - Peer state information
324 */
325enum ol_txrx_peer_state {
326 OL_TXRX_PEER_STATE_INVALID,
327 OL_TXRX_PEER_STATE_DISC, /* initial state */
328 OL_TXRX_PEER_STATE_CONN, /* authentication in progress */
329 OL_TXRX_PEER_STATE_AUTH, /* authentication successful */
330};
331
Radha krishna Simha Jiguruf70f9912017-08-02 18:32:22 +0530332/**
333 * struct ol_txrx_ast_type - AST entry type information
334 */
335enum cdp_txrx_ast_entry_type {
336 CDP_TXRX_AST_TYPE_NONE, /* static ast entry for connected peer */
Tallapragada Kalyan57b6bb32018-01-02 12:58:33 +0530337 CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
Pamidipati, Vijay3756b762018-05-12 11:10:37 +0530338 CDP_TXRX_AST_TYPE_SELF, /* static ast entry for self peer (STA mode) */
Radha krishna Simha Jiguruf70f9912017-08-02 18:32:22 +0530339 CDP_TXRX_AST_TYPE_WDS, /* WDS peer ast entry type*/
340 CDP_TXRX_AST_TYPE_MEC, /* Multicast echo ast entry type */
Tallapragada Kalyan57b6bb32018-01-02 12:58:33 +0530341 CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
Radha krishna Simha Jiguru27340792018-09-06 15:08:12 +0530342 CDP_TXRX_AST_TYPE_STA_BSS, /* BSS entry(STA mode) */
Tallapragada Kalyan2ae71e02018-08-31 19:30:54 +0530343 CDP_TXRX_AST_TYPE_DA, /* AST entry based on Destination address */
Tallapragada Kalyan5e3a39c2018-08-24 16:34:12 +0530344 CDP_TXRX_AST_TYPE_WDS_HM_SEC, /* HM WDS entry for secondary radio */
Radha krishna Simha Jiguruf70f9912017-08-02 18:32:22 +0530345 CDP_TXRX_AST_TYPE_MAX
346};
Gurumoorthi Gnanasambandhaned4bcf82017-05-24 00:10:59 +0530347
Chaithanya Garrepalli9cc562c2018-11-16 18:30:41 +0530348/*
349 * cdp_ast_free_status: status passed to callback function before freeing ast
350 * @CDP_TXRX_AST_DELETED - AST is deleted from FW and delete response received
351 * @CDP_TXRX_AST_DELETE_IN_PROGRESS - AST delete command sent to FW and host
352 * is waiting for FW response
353 */
354enum cdp_ast_free_status {
355 CDP_TXRX_AST_DELETED,
356 CDP_TXRX_AST_DELETE_IN_PROGRESS,
357};
358
359/**
360 * txrx_ast_free_cb - callback registered for ast free
361 * @ctrl_soc: control path soc context
362 * @cdp_soc: DP soc context
363 * @cookie: cookie
364 * @cdp_ast_free_status: ast free status
365 */
Akshay Kosigieec6db92019-07-02 14:25:54 +0530366typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
Akshay Kosigi4002f762019-07-08 23:04:36 +0530367 struct cdp_soc *cdp_soc,
Chaithanya Garrepalli9cc562c2018-11-16 18:30:41 +0530368 void *cookie,
369 enum cdp_ast_free_status);
370
Chaithanya Garrepalli9cc562c2018-11-16 18:30:41 +0530371/**
372 * struct cdp_ast_entry_info - AST entry information
373 * @peer_mac_addr: mac address of peer on which AST entry is added
374 * @type: ast entry type
375 * @vdev_id: vdev_id
376 * @pdev_id: pdev_id
377 * @peer_id: peer_id
378 *
379 * This structure holds the ast entry information
380 *
381 */
382struct cdp_ast_entry_info {
Srinivas Girigowda2751b6d2019-02-27 12:28:13 -0800383 uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
Chaithanya Garrepalli9cc562c2018-11-16 18:30:41 +0530384 enum cdp_txrx_ast_entry_type type;
385 uint8_t vdev_id;
386 uint8_t pdev_id;
387 uint16_t peer_id;
388};
389
Rakshith Suresh Patkard863f8d2019-07-16 16:30:59 +0530390#define MIC_SEQ_CTR_SIZE 6
391
392enum cdp_rx_frame_type {
393 cdp_rx_frame_type_802_11,
394 cdp_rx_frame_type_802_3,
395};
396
397/**
398 * struct cdp_rx_mic_err_info - rx mic error information
399 * @frame_type: frame type - 0 - 802.11 frame
400 * - 1 - 802.3 frame
401 * @data: 802.11 frame
402 * @ta_mac_addr: transmitter mac address
403 * @da_mac_addr: destination mac address
404 * @tsc: sequence number
405 * @key_id: Key ID
406 * @multicast: flag for multicast
407 * @vdev_id: vdev ID
408 *
409 * This structure holds rx mic error information
410 *
411 */
412struct cdp_rx_mic_err_info {
413 uint8_t frame_type;
414 uint8_t *data;
415 struct qdf_mac_addr ta_mac_addr;
416 struct qdf_mac_addr da_mac_addr;
417 uint8_t tsc[MIC_SEQ_CTR_SIZE];
418 uint8_t key_id;
419 bool multicast;
420 uint16_t vdev_id;
421};
422
Gurumoorthi Gnanasambandhaned4bcf82017-05-24 00:10:59 +0530423/**
424 * struct cdp_sec_type - security type information
425 */
426enum cdp_sec_type {
427 cdp_sec_type_none,
428 cdp_sec_type_wep128,
429 cdp_sec_type_wep104,
430 cdp_sec_type_wep40,
431 cdp_sec_type_tkip,
432 cdp_sec_type_tkip_nomic,
433 cdp_sec_type_aes_ccmp,
434 cdp_sec_type_wapi,
435 cdp_sec_type_aes_ccmp_256,
436 cdp_sec_type_aes_gcmp,
437 cdp_sec_type_aes_gcmp_256,
438
439 /* keep this last! */
440 cdp_num_sec_types
441};
442
Prathyusha Guduribe41d972018-01-19 14:17:14 +0530443/**
444 * struct cdp_tx_exception_metadata - Exception path parameters
445 * @peer_id: Peer id of the peer
446 * @tid: Transmit Identifier
447 * @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
448 * @sec_type: sec_type to be passed to HAL
Varsha Mishra27c5bd32019-05-28 11:54:46 +0530449 * @is_tx_sniffer: Indicates if the packet has to be sniffed
450 * @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
Prathyusha Guduribe41d972018-01-19 14:17:14 +0530451 *
452 * This structure holds the parameters needed in the exception path of tx
453 *
454 */
455struct cdp_tx_exception_metadata {
456 uint16_t peer_id;
457 uint8_t tid;
458 uint16_t tx_encap_type;
459 enum cdp_sec_type sec_type;
Varsha Mishra27c5bd32019-05-28 11:54:46 +0530460 uint8_t is_tx_sniffer;
461 uint16_t ppdu_cookie;
Prathyusha Guduribe41d972018-01-19 14:17:14 +0530462};
463
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530464typedef struct cdp_soc_t *ol_txrx_soc_handle;
465
466/**
467 * ol_txrx_vdev_delete_cb - callback registered during vdev
468 * detach
469 */
470typedef void (*ol_txrx_vdev_delete_cb)(void *context);
471
472/**
Alok Kumar2e254c52018-11-28 17:26:53 +0530473 * ol_txrx_peer_unmap_sync_cb - callback registered during peer detach sync
474 */
475typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
476 uint32_t peer_id_cnt,
477 uint16_t *peer_id_list);
478
479/**
Pranita Solankeafcd0f12018-08-29 22:49:23 +0530480 * ol_txrx_pkt_direction - Packet Direction
481 * @rx_direction: rx path packet
482 * @tx_direction: tx path packet
483 */
484enum txrx_direction {
485 rx_direction = 1,
486 tx_direction = 0,
487};
488
489/**
Akshay Kosigia4f6e172018-09-03 21:42:27 +0530490 * cdp_capabilities- DP capabilities
491 */
492enum cdp_capabilities {
493 CDP_CFG_DP_TSO,
494 CDP_CFG_DP_LRO,
495 CDP_CFG_DP_SG,
496 CDP_CFG_DP_GRO,
497 CDP_CFG_DP_OL_TX_CSUM,
498 CDP_CFG_DP_OL_RX_CSUM,
499 CDP_CFG_DP_RAWMODE,
500 CDP_CFG_DP_PEER_FLOW_CTRL,
501};
502
503/**
Pranita Solankeafcd0f12018-08-29 22:49:23 +0530504 * ol_txrx_nbuf_classify - Packet classification object
505 * @peer_id: unique peer identifier from fw
506 * @tid: traffic identifier(could be overridden)
507 * @pkt_tid: traffic identifier(cannot be overridden)
508 * @pkt_tos: ip header tos value
509 * @pkt_dscp: ip header dscp value
510 * @tos: index value in map
511 * @dscp: DSCP_TID map index
512 * @is_mcast: multicast pkt check
513 * @is_eap: eapol pkt check
514 * @is_arp: arp pkt check
515 * @is_tcp: tcp pkt check
516 * @is_dhcp: dhcp pkt check
517 * @is_igmp: igmp pkt check
518 * @is_ipv4: ip version 4 pkt check
519 * @is_ipv6: ip version 6 pkt check
520 */
521struct ol_txrx_nbuf_classify {
522 uint16_t peer_id;
523 uint8_t tid;
524 uint8_t pkt_tid;
525 uint8_t pkt_tos;
526 uint8_t pkt_dscp;
527 uint8_t tos;
528 uint8_t dscp;
529 uint8_t is_mcast;
530 uint8_t is_eap;
531 uint8_t is_arp;
532 uint8_t is_tcp;
533 uint8_t is_dhcp;
534 uint8_t is_igmp;
535 uint8_t is_ipv4;
536 uint8_t is_ipv6;
537};
538
539/**
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530540 * ol_osif_vdev_handle - paque handle for OS shim virtual device
541 * object
542 */
543struct ol_osif_vdev_t;
544typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
545
546/**
547 * wlan_op_mode - Virtual device operation mode
548 * @wlan_op_mode_unknown: Unknown mode
549 * @wlan_op_mode_ap: AP mode
550 * @wlan_op_mode_ibss: IBSS mode
551 * @wlan_op_mode_sta: STA (client) mode
552 * @wlan_op_mode_monitor: Monitor mode
553 * @wlan_op_mode_ocb: OCB mode
554 */
555enum wlan_op_mode {
556 wlan_op_mode_unknown,
557 wlan_op_mode_ap,
558 wlan_op_mode_ibss,
559 wlan_op_mode_sta,
560 wlan_op_mode_monitor,
561 wlan_op_mode_ocb,
Leo Changdb6358c2016-09-27 17:00:52 -0700562 wlan_op_mode_ndi,
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530563};
564
565/**
Rakesh Pillai01b9b682019-07-27 18:58:21 -0700566 * enum wlan_op_subtype - Virtual device subtype
567 * @wlan_op_subtype_none: Subtype not applicable
568 * @wlan_op_subtype_p2p_device: P2P device
569 * @wlan_op_subtye_p2p_cli: P2P Client
570 * @wlan_op_subtype_p2p_go: P2P GO
571 *
572 * This enum lists the subtypes of a particular virtual
573 * device.
574 */
575enum wlan_op_subtype {
576 wlan_op_subtype_none,
577 wlan_op_subtype_p2p_device,
578 wlan_op_subtype_p2p_cli,
579 wlan_op_subtype_p2p_go,
580};
581
582/**
Poddar, Siddarth8d33d9b2018-01-16 12:29:36 +0530583 * connectivity_stats_pkt_status - data pkt type
584 * @PKT_TYPE_REQ: Request packet
585 * @PKT_TYPE_RSP: Response packet
586 * @PKT_TYPE_TX_DROPPED: TX packet dropped
587 * @PKT_TYPE_RX_DROPPED: RX packet dropped
588 * @PKT_TYPE_RX_DELIVERED: RX packet delivered
589 * @PKT_TYPE_RX_REFUSED: RX packet refused
590 * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
591 * @PKT_TYPE_TX_ACK_CNT:TC packet acked
592 * @PKT_TYPE_NONE: Invalid packet
593 */
594enum connectivity_stats_pkt_status {
595 PKT_TYPE_REQ,
596 PKT_TYPE_RSP,
597 PKT_TYPE_TX_DROPPED,
598 PKT_TYPE_RX_DROPPED,
599 PKT_TYPE_RX_DELIVERED,
600 PKT_TYPE_RX_REFUSED,
601 PKT_TYPE_TX_HOST_FW_SENT,
602 PKT_TYPE_TX_ACK_CNT,
603 PKT_TYPE_NONE,
604};
605
606/**
Lin Bai324f4912018-12-13 16:13:24 +0800607 * ol_txrx_mgmt_tx_cb - tx management delivery notification
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530608 * callback function
609 */
610typedef void
611(*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
612
613/**
Kabilan Kannan60e3b302017-09-07 20:06:17 -0700614 * ol_txrx_data_tx_cb - Function registered with the data path
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530615 * that is called when tx frames marked as "no free" are
616 * done being transmitted
617 */
618typedef void
619(*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
620
621/**
622 * ol_txrx_tx_fp - top-level transmit function
623 * @data_vdev - handle to the virtual device object
624 * @msdu_list - list of network buffers
625 */
Akshay Kosigic74162c2019-06-10 12:25:10 +0530626typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_vdev *data_vdev,
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530627 qdf_nbuf_t msdu_list);
Prathyusha Guduribe41d972018-01-19 14:17:14 +0530628
629/**
630 * ol_txrx_tx_exc_fp - top-level transmit function on exception path
631 * @data_vdev - handle to the virtual device object
632 * @msdu_list - list of network buffers
633 * @tx_exc_metadata - structure that holds parameters to exception path
634 */
Akshay Kosigic74162c2019-06-10 12:25:10 +0530635typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_vdev *data_vdev,
Prathyusha Guduribe41d972018-01-19 14:17:14 +0530636 qdf_nbuf_t msdu_list,
637 struct cdp_tx_exception_metadata
638 *tx_exc_metadata);
639
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530640/**
Yun Parkaadee8c2018-06-04 11:21:40 -0700641 * ol_txrx_completion_fp - top-level transmit function
642 * for tx completion
643 * @skb: skb data
644 * @osif_dev: the virtual device's OS shim object
645 */
646typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
647 void *osif_dev);
648/**
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530649 * ol_txrx_tx_flow_control_fp - tx flow control notification
650 * function from txrx to OS shim
651 * @osif_dev - the virtual device's OS shim object
652 * @tx_resume - tx os q should be resumed or not
653 */
654typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
655 bool tx_resume);
656
657/**
bings4dcaf8b2017-08-11 10:37:46 +0800658 * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
659 * function from txrx to OS shim
660 * @osif_dev - the virtual device's OS shim object
661 *
662 * Return: true if tx is paused by flow control
663 */
664typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
665
666/**
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530667 * ol_txrx_rx_fp - receive function to hand batches of data
668 * frames from txrx to OS shim
669 * @data_vdev - handle to the OSIF virtual device object
670 * @msdu_list - list of network buffers
671 */
672typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
673
674/**
Rakesh Pillai534a1432019-10-24 06:44:11 +0530675 * ol_txrx_rx_flush_fp - receive function to hand batches of data
676 * frames from txrx to OS shim
677 * @osif_dev: handle to the OSIF virtual device object
678 * @vdev_id: vdev_if of the packets to be flushed
679 */
680typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
681
682/**
Mohit Khanna698987c2019-07-28 21:38:05 -0700683 * ol_txrx_rx_gro_flush_ind - function to send GRO flush indication to stack
684 * for a given RX Context Id.
685 * @osif_dev - handle to the OSIF virtual device object
686 * @rx_ctx_id - Rx context Id for which gro flush should happen
687 */
688typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
689 int rx_ctx_id);
690
691/**
Poddar, Siddarth8d33d9b2018-01-16 12:29:36 +0530692 * ol_txrx_stats_rx_fp - receive function to hand batches of data
693 * frames from txrx to OS shim
694 * @skb: skb data
695 * @osif_dev: the virtual device's OS shim object
696 * @action: data packet type
697 * @pkt_type: packet data type
698 */
699typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
700 void *osif_dev, enum connectivity_stats_pkt_status action,
701 uint8_t *pkt_type);
702
703/**
Venkateswara Swamy Bandaru3f4e1c42017-07-10 19:47:09 +0530704 * ol_txrx_get_key_fp - function to gey key based on keyix and peer
705 * mac address
706 * @osif_dev - the virtual device's OS shim object
707 * @key_buf - pointer to store key
708 * @mac_addr - pointer to mac address
709 * @keyix - key id
710 */
711typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
712
713/**
Venkateswara Swamy Bandarubfbef4f2016-12-16 19:12:31 +0530714 * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
715 * packets in receive path.
716 * @osif_dev - the virtual device's OS shim object
717 * @list_head - poniter to head of receive packet queue to decap
718 * @list_tail - poniter to tail of receive packet queue to decap
c_cgodavbd5b3c22017-06-07 12:31:40 +0530719 * @peer - Peer handler
Venkateswara Swamy Bandarubfbef4f2016-12-16 19:12:31 +0530720 */
721typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
722 qdf_nbuf_t *list_head,
c_cgodavbd5b3c22017-06-07 12:31:40 +0530723 qdf_nbuf_t *list_tail,
724 struct cdp_peer *peer);
Venkateswara Swamy Bandarubfbef4f2016-12-16 19:12:31 +0530725
Venkateswara Swamy Bandaru97482342017-02-16 12:04:50 +0530726/* ol_txrx_rx_fp - external tx free function to read per packet stats and
727 * free tx buffer externally
728 * @netbuf - tx network buffer
729 */
730typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
731
Venkateswara Swamy Bandarubfbef4f2016-12-16 19:12:31 +0530732/**
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530733 * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
734*/
735typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
736 qdf_nbuf_t mpdu_head,
737 qdf_nbuf_t mpdu_tail);
738/**
739 * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
740 * MPDU (802.11 format)
741 */
742typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
743 qdf_nbuf_t mpdu,
744 void *rx_status);
745
746/**
747 * ol_txrx_proxy_arp_fp - proxy arp function pointer
748*/
749typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
750 qdf_nbuf_t netbuf);
751
Ishank Jainc838b132017-02-17 11:08:18 +0530752/*
753 * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
754 */
755typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
756 qdf_nbuf_t netbuf);
757
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530758/**
759 * ol_txrx_stats_callback - statistics notify callback
760 */
761typedef void (*ol_txrx_stats_callback)(void *ctxt,
Nandha Kishore Easwaran870abda2016-11-16 17:37:19 +0530762 enum htt_cmn_dbg_stats_type type,
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530763 uint8_t *buf, int bytes);
764
765/**
Lin Bai324f4912018-12-13 16:13:24 +0800766 * ol_txrx_pktdump_cb - callback for packet dump feature
767 */
Jingxiang Ge434105d2019-03-08 17:06:19 +0800768typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
Rakesh Pillaid295d1e2019-09-11 08:00:36 +0530769 uint8_t pdev_id,
770 uint8_t vdev_id,
771 qdf_nbuf_t netbuf,
772 uint8_t status,
773 uint8_t type);
Lin Bai324f4912018-12-13 16:13:24 +0800774
775/**
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530776 * ol_txrx_ops - (pointers to) the functions used for tx and rx
777 * data xfer
778 *
779 * There are two portions of these txrx operations.
780 * The rx portion is filled in by OSIF SW before calling
781 * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
782 * the txrx SW stores a copy of these rx function pointers, to use
783 * as it delivers rx data frames to the OSIF SW.
784 * The tx portion is filled in by the txrx SW inside
785 * ol_txrx_osif_vdev_register; when the function call returns,
786 * the OSIF SW stores a copy of these tx functions to use as it
787 * delivers tx data frames to the txrx SW.
788 *
789 * @tx.std - the tx function pointer for standard data
790 * frames This function pointer is set by the txrx SW
791 * perform host-side transmit operations based on
792 * whether a HL or LL host/target interface is in use.
793 * @tx.flow_control_cb - the transmit flow control
794 * function that is registered by the
795 * OSIF which is called from txrx to
796 * indicate whether the transmit OS
797 * queues should be paused/resumed
Mohit Khanna7ac554b2018-05-24 11:58:13 -0700798 * @rx.rx - the OS shim rx function to deliver rx data
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530799 * frames to. This can have different values for
800 * different virtual devices, e.g. so one virtual
801 * device's OS shim directly hands rx frames to the OS,
802 * but another virtual device's OS shim filters out P2P
803 * messages before sending the rx frames to the OS. The
804 * netbufs delivered to the osif_rx function are in the
805 * format specified by the OS to use for tx and rx
Mohit Khanna7ac554b2018-05-24 11:58:13 -0700806 * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
807 * are given to the thread, instead of the stack via this pointer.
808 * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
809 * In case RX Threads are enabled, this pointer holds the callback to give
810 * packets to the stack.
Mohit Khanna698987c2019-07-28 21:38:05 -0700811 * @rx.rx_gro_flush - GRO flush indication to stack for a given RX CTX ID
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530812 * @rx.wai_check - the tx function pointer for WAPI frames
813 * @rx.mon - the OS shim rx monitor function to deliver
814 * monitor data to Though in practice, it is probable
815 * that the same function will be used for delivering
816 * rx monitor data for all virtual devices, in theory
817 * each different virtual device can have a different
818 * OS shim function for accepting rx monitor data. The
819 * netbufs delivered to the osif_rx_mon function are in
820 * 802.11 format. Each netbuf holds a 802.11 MPDU, not
821 * an 802.11 MSDU. Depending on compile-time
822 * configuration, each netbuf may also have a
823 * monitor-mode encapsulation header such as a radiotap
824 * header added before the MPDU contents.
Pamidipati, Vijay038d0902017-07-17 09:53:31 +0530825 * @rx.std - the OS shim rx function to deliver rx data
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530826 * @proxy_arp - proxy arp function pointer - specified by
827 * OS shim, stored by txrx
Venkateswara Swamy Bandaru3f4e1c42017-07-10 19:47:09 +0530828 * @get_key - function pointer to get key of the peer with
829 * specific key index
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530830 */
831struct ol_txrx_ops {
832 /* tx function pointers - specified by txrx, stored by OS shim */
833 struct {
834 ol_txrx_tx_fp tx;
Prathyusha Guduribe41d972018-01-19 14:17:14 +0530835 ol_txrx_tx_exc_fp tx_exception;
Venkateswara Swamy Bandaru97482342017-02-16 12:04:50 +0530836 ol_txrx_tx_free_ext_fp tx_free_ext;
Yun Parkaadee8c2018-06-04 11:21:40 -0700837 ol_txrx_completion_fp tx_comp;
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530838 } tx;
839
840 /* rx function pointers - specified by OS shim, stored by txrx */
841 struct {
842 ol_txrx_rx_fp rx;
Mohit Khanna7ac554b2018-05-24 11:58:13 -0700843 ol_txrx_rx_fp rx_stack;
Rakesh Pillai534a1432019-10-24 06:44:11 +0530844 ol_txrx_rx_flush_fp rx_flush;
Mohit Khanna698987c2019-07-28 21:38:05 -0700845 ol_txrx_rx_gro_flush_ind_fp rx_gro_flush;
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530846 ol_txrx_rx_check_wai_fp wai_check;
847 ol_txrx_rx_mon_fp mon;
Poddar, Siddarth8d33d9b2018-01-16 12:29:36 +0530848 ol_txrx_stats_rx_fp stats_rx;
Venkateswara Swamy Bandarubfbef4f2016-12-16 19:12:31 +0530849 ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530850 } rx;
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530851 /* proxy arp function pointer - specified by OS shim, stored by txrx */
852 ol_txrx_proxy_arp_fp proxy_arp;
Ishank Jainc838b132017-02-17 11:08:18 +0530853 ol_txrx_mcast_me_fp me_convert;
Venkateswara Swamy Bandaru3f4e1c42017-07-10 19:47:09 +0530854
855 ol_txrx_get_key_fp get_key;
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530856};
857
858/**
859 * ol_txrx_stats_req - specifications of the requested
860 * statistics
861 */
862struct ol_txrx_stats_req {
863 uint32_t stats_type_upload_mask; /* which stats to upload */
864 uint32_t stats_type_reset_mask; /* which stats to reset */
865
866 /* stats will be printed if either print element is set */
867 struct {
868 int verbose; /* verbose stats printout */
869 int concise; /* concise stats printout (takes precedence) */
870 } print; /* print uploaded stats */
871
872 /* stats notify callback will be invoked if fp is non-NULL */
873 struct {
874 ol_txrx_stats_callback fp;
875 void *ctxt;
876 } callback;
877
878 /* stats will be copied into the specified buffer if buf is non-NULL */
879 struct {
880 uint8_t *buf;
881 int byte_limit; /* don't copy more than this */
882 } copy;
883
884 /*
885 * If blocking is true, the caller will take the specified semaphore
886 * to wait for the stats to be uploaded, and the driver will release
887 * the semaphore when the stats are done being uploaded.
888 */
889 struct {
890 int blocking;
891 /*Note: this needs to change to some qdf_* type */
892 qdf_semaphore_t *sem_ptr;
893 } wait;
894};
895
896
897/* DP soc struct definition */
898struct cdp_soc_t {
899 struct cdp_ops *ops;
Leo Changdb6358c2016-09-27 17:00:52 -0700900 struct ol_if_ops *ol_ops;
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530901};
902
Ishank Jain9f174c62017-03-30 18:37:42 +0530903/*
Soumya Bhatcfbb8952017-10-03 15:04:09 +0530904 * cdp_pdev_param_type: different types of parameters
905 * to set values in pdev
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530906 * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
Vinay Adella873dc402018-05-28 12:06:34 +0530907 * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
Pamidipati, Vijay13f5ec22018-08-06 17:34:21 +0530908 * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
Varsha Mishraa6e58922019-01-17 18:26:55 +0530909 * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
910 * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
911 * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
912 * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
Ankit Kumar8dc0e2a2019-02-28 18:17:15 +0530913 * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
Varsha Mishra18281792019-03-06 17:57:23 +0530914 * @CDP_INGRESS_STATS: Accumulate ingress statistics
915 * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
Kai Chen52ef33f2019-03-05 18:33:40 -0800916 * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
Soumya Bhatcfbb8952017-10-03 15:04:09 +0530917 */
918enum cdp_pdev_param_type {
Soumya Bhat6fee59c2017-10-31 13:12:37 +0530919 CDP_CONFIG_DEBUG_SNIFFER,
Vinay Adella873dc402018-05-28 12:06:34 +0530920 CDP_CONFIG_BPR_ENABLE,
Pamidipati, Vijay13f5ec22018-08-06 17:34:21 +0530921 CDP_CONFIG_PRIMARY_RADIO,
Varsha Mishraa6e58922019-01-17 18:26:55 +0530922 CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
923 CDP_CONFIG_IGMPMLD_OVERRIDE,
924 CDP_CONFIG_IGMPMLD_TID,
925 CDP_CONFIG_ARP_DBG_CONF,
Ankit Kumar8dc0e2a2019-02-28 18:17:15 +0530926 CDP_CONFIG_CAPTURE_LATENCY,
Varsha Mishra18281792019-03-06 17:57:23 +0530927 CDP_INGRESS_STATS,
928 CDP_OSIF_DROP,
Kai Chen52ef33f2019-03-05 18:33:40 -0800929 CDP_CONFIG_ENH_RX_CAPTURE,
nobeljdebe2b32019-04-23 11:18:47 -0700930 CDP_CONFIG_TX_CAPTURE,
Kai Chen52ef33f2019-03-05 18:33:40 -0800931};
932
933/**
934 * cdp_rx_enh_capture_mode - Rx enhanced capture modes
935 * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
936 * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
937 * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
938 */
939enum cdp_rx_enh_capture_mode {
940 CDP_RX_ENH_CAPTURE_DISABLED = 0,
941 CDP_RX_ENH_CAPTURE_MPDU,
942 CDP_RX_ENH_CAPTURE_MPDU_MSDU,
Vinay Adella873dc402018-05-28 12:06:34 +0530943};
944
Sumeet Rao511db292019-07-22 11:42:48 -0700945/**
Kai Chen99efa0d2019-08-20 17:51:27 -0700946 * cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
947 * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
948 * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
949 */
950enum cdp_rx_enh_capture_peer {
951 CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
952 CDP_RX_ENH_CAPTURE_PEER_ENABLED,
953};
954
955/**
Sumeet Rao511db292019-07-22 11:42:48 -0700956 * cdp_tx_enh_capture_mode - Tx enhanced capture modes
957 * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
958 * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
959 * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
960 */
961enum cdp_tx_enh_capture_mode {
962 CDP_TX_ENH_CAPTURE_DISABLED = 0,
963 CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
964 CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
965};
966
Vinay Adella873dc402018-05-28 12:06:34 +0530967/*
968 * enum cdp_pdev_bpr_param - different types of parameters
969 * to set value in pdev
970 * @CDP_BPR_DISABLE: Set bpr to disable state
971 * @CDP_BPR_ENABLE: set bpr to enable state
972 *
973 * Enum indicating bpr state to enable/disable.
974 */
975enum cdp_pdev_bpr_param {
976 CDP_BPR_DISABLE,
977 CDP_BPR_ENABLE,
Soumya Bhatcfbb8952017-10-03 15:04:09 +0530978};
979
980/*
Ishank Jain9f174c62017-03-30 18:37:42 +0530981 * cdp_vdev_param_type: different types of parameters
982 * to set values in vdev
983 * @CDP_ENABLE_NAWDS: set nawds enable/disable
984 * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
Kabilan Kannan56bfd8f2017-04-26 13:26:47 -0700985 * @CDP_ENABLE_WDS: wds sta
phadiman4213e9c2018-10-29 12:50:02 +0530986 * @CDP_ENABLE_MEC: MEC enable flags
Kabilan Kannan56bfd8f2017-04-26 13:26:47 -0700987 * @CDP_ENABLE_PROXYSTA: proxy sta
988 * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
URAJ SASAN81d95712017-08-21 20:51:03 +0530989 * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
ruchi agrawal45f3ac42017-10-25 09:03:28 +0530990 * @CDP_ENABLE_CIPHER : set cipher type based on security
Nandha Kishore Easwaran47e74162017-12-12 11:54:01 +0530991 * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
Ishank Jain9f174c62017-03-30 18:37:42 +0530992 */
993enum cdp_vdev_param_type {
994 CDP_ENABLE_NAWDS,
995 CDP_ENABLE_MCAST_EN,
Pamidipati, Vijayc9a13a52017-04-06 17:45:49 +0530996 CDP_ENABLE_WDS,
phadiman4213e9c2018-10-29 12:50:02 +0530997 CDP_ENABLE_MEC,
998 CDP_ENABLE_DA_WAR,
Pamidipati, Vijayc9a13a52017-04-06 17:45:49 +0530999 CDP_ENABLE_PROXYSTA,
Kabilan Kannan56bfd8f2017-04-26 13:26:47 -07001000 CDP_UPDATE_TDLS_FLAGS,
Pamidipati, Vijayb8bbf162017-06-26 23:47:39 +05301001 CDP_CFG_WDS_AGING_TIMER,
URAJ SASAN81d95712017-08-21 20:51:03 +05301002 CDP_ENABLE_AP_BRIDGE,
Nandha Kishore Easwaran47e74162017-12-12 11:54:01 +05301003 CDP_ENABLE_CIPHER,
Varsha Mishra6e1760c2019-07-27 22:51:42 +05301004 CDP_ENABLE_QWRAP_ISOLATION,
1005 CDP_UPDATE_MULTIPASS
Ishank Jain9f174c62017-03-30 18:37:42 +05301006};
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05301007
1008#define TXRX_FW_STATS_TXSTATS 1
1009#define TXRX_FW_STATS_RXSTATS 2
1010#define TXRX_FW_STATS_RX_RATE_INFO 3
1011#define TXRX_FW_STATS_PHYSTATS 4
1012#define TXRX_FW_STATS_PHYSTATS_CONCISE 5
1013#define TXRX_FW_STATS_TX_RATE_INFO 6
1014#define TXRX_FW_STATS_TID_STATE 7
1015#define TXRX_FW_STATS_HOST_STATS 8
1016#define TXRX_FW_STATS_CLEAR_HOST_STATS 9
1017#define TXRX_FW_STATS_CE_STATS 10
1018#define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
1019#define TXRX_FW_STATS_ME_STATS 12
1020#define TXRX_FW_STATS_TXBF_INFO 13
1021#define TXRX_FW_STATS_SND_INFO 14
1022#define TXRX_FW_STATS_ERROR_INFO 15
1023#define TXRX_FW_STATS_TX_SELFGEN_INFO 16
1024#define TXRX_FW_STATS_TX_MU_INFO 17
1025#define TXRX_FW_SIFS_RESP_INFO 18
1026#define TXRX_FW_RESET_STATS 19
1027#define TXRX_FW_MAC_WDOG_STATS 20
1028#define TXRX_FW_MAC_DESC_STATS 21
1029#define TXRX_FW_MAC_FETCH_MGR_STATS 22
1030#define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
Nandha Kishore Easwaran46249e42016-11-15 14:46:35 +05301031#define TXRX_FW_STATS_DURATION_INFO 24
1032#define TXRX_FW_STATS_DURATION_INFO_RESET 25
Basamma Yakkanahalli51ddfbc2017-10-05 22:03:30 +05301033#define TXRX_FW_HALPHY_STATS 26
phadiman6c99bef2017-09-28 12:24:08 +05301034#define TXRX_FW_COEX_STATS 27
Nandha Kishore Easwaran46249e42016-11-15 14:46:35 +05301035
1036#define PER_RADIO_FW_STATS_REQUEST 0
1037#define PER_VDEV_FW_STATS_REQUEST 1
Poddar, Siddarth5c57a892017-09-04 12:16:38 +05301038/**
1039 * enum data_stall_log_event_indicator - Module triggering data stall
1040 * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
1041 * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
1042 * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
1043 * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
1044 *
1045 * Enum indicating the module that indicates data stall event
1046 */
1047enum data_stall_log_event_indicator {
1048 DATA_STALL_LOG_INDICATOR_UNUSED,
1049 DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
1050 DATA_STALL_LOG_INDICATOR_FIRMWARE,
1051 DATA_STALL_LOG_INDICATOR_FRAMEWORK,
1052};
1053
1054/**
1055 * enum data_stall_log_event_type - data stall event type
1056 * @DATA_STALL_LOG_NONE
1057 * @DATA_STALL_LOG_FW_VDEV_PAUSE
1058 * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
1059 * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
1060 * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
1061 * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
1062 * @DATA_STALL_LOG_FW_WDOG_ERRORS
1063 * @DATA_STALL_LOG_BB_WDOG_ERROR
Poddar, Siddarthec4b2a92017-12-26 14:46:46 +05301064 * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
Poddar, Siddarth5c57a892017-09-04 12:16:38 +05301065 * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
1066 * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
1067 * @DATA_STALL_LOG_NUD_FAILURE
1068 *
1069 * Enum indicating data stall event type
1070 */
1071enum data_stall_log_event_type {
1072 DATA_STALL_LOG_NONE,
1073 DATA_STALL_LOG_FW_VDEV_PAUSE,
1074 DATA_STALL_LOG_HWSCHED_CMD_FILTER,
1075 DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
1076 DATA_STALL_LOG_FW_RX_REFILL_FAILED,
1077 DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
1078 DATA_STALL_LOG_FW_WDOG_ERRORS,
1079 DATA_STALL_LOG_BB_WDOG_ERROR,
Poddar, Siddarthec4b2a92017-12-26 14:46:46 +05301080 DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
1081 /* Stall events triggered by host/framework start from 0x100 onwards. */
1082 DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
Poddar, Siddarth5c57a892017-09-04 12:16:38 +05301083 DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
1084 DATA_STALL_LOG_NUD_FAILURE,
1085};
1086
1087/**
1088 * enum data_stall_log_recovery_type - data stall recovery type
1089 * @DATA_STALL_LOG_RECOVERY_NONE,
1090 * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1091 * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
1092 *
1093 * Enum indicating data stall recovery type
1094 */
1095enum data_stall_log_recovery_type {
1096 DATA_STALL_LOG_RECOVERY_NONE = 0,
1097 DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1098 DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
1099};
1100
1101/**
1102 * struct data_stall_event_info - data stall info
1103 * @indicator: Module triggering data stall
1104 * @data_stall_type: data stall event type
1105 * @vdev_id_bitmap: vdev_id_bitmap
1106 * @pdev_id: pdev id
1107 * @recovery_type: data stall recovery type
1108 */
1109struct data_stall_event_info {
1110 uint32_t indicator;
1111 uint32_t data_stall_type;
1112 uint32_t vdev_id_bitmap;
1113 uint32_t pdev_id;
1114 uint32_t recovery_type;
1115};
1116
1117typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
1118
Venkata Sharath Chandra Manchalaa77da0d2017-02-27 22:44:37 -08001119/*
Venkata Sharath Chandra Manchalaf167af12018-10-09 20:23:02 -07001120 * enum cdp_stats - options for host and firmware
Venkata Sharath Chandra Manchalaa77da0d2017-02-27 22:44:37 -08001121 * statistics
Venkata Sharath Chandra Manchalaf167af12018-10-09 20:23:02 -07001122 * @CDP_TXRX_STATS_1: HTT Pdev tx stats
1123 * @CDP_TXRX_STATS_2: HTT Pdev rx stats
1124 * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
1125 * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
1126 * @CDP_TXRX_STATS_5: HTT Pdev error stats
1127 * @CDP_TXRX_STATS_6: HTT TQM stats
1128 * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
1129 * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
1130 * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
1131 * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
1132 * @CDP_TXRX_STATS_11: HTT Peer stats
1133 * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
1134 * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
1135 * @CDP_TXRX_STATS_14: HTT Ring interface info stats
1136 * @CDP_TXRX_STATS_15: HTT SRNG info stats
1137 * @CDP_TXRX_STATS_16: HTT SFM info stats
1138 * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
1139 * @CDP_TXRX_STATS_18: HTT Peer list details
1140 * @CDP_TXRX_STATS_19: Reserved
1141 * @CDP_TXRX_STATS_20: Reset Host stats
1142 * @CDP_TXRX_STATS_21: Host Rx rate stats
1143 * @CDP_TXRX_STATS_22: Host Tx rate stats
1144 * @CDP_TXRX_STATS_23: Host Tx stats
1145 * @CDP_TXRX_STATS_24: Host Rx stats
1146 * @CDP_TXRX_STATS_25: Host Ast stats
1147 * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
1148 * @CDP_TXRX_STATS_27: Host Monitor mode stats
1149 * @CDP_TXRX_STATS_28: Host Peer entry stats
1150 * @CDP_TXRX_STATS_29: Host Soc config params info
1151 * @CDP_TXRX_STATS_30: Host Pdev config params info
Mohit Khannae5a6e942018-11-28 14:22:48 -08001152 * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
Venkata Sharath Chandra Manchalaf167af12018-10-09 20:23:02 -07001153 */
Venkata Sharath Chandra Manchalaa77da0d2017-02-27 22:44:37 -08001154enum cdp_stats {
1155 CDP_TXRX_STATS_0 = 0,
1156 CDP_TXRX_STATS_1,
1157 CDP_TXRX_STATS_2,
1158 CDP_TXRX_STATS_3,
1159 CDP_TXRX_STATS_4,
1160 CDP_TXRX_STATS_5,
1161 CDP_TXRX_STATS_6,
1162 CDP_TXRX_STATS_7,
1163 CDP_TXRX_STATS_8,
1164 CDP_TXRX_STATS_9,
1165 CDP_TXRX_STATS_10,
1166 CDP_TXRX_STATS_11,
1167 CDP_TXRX_STATS_12,
1168 CDP_TXRX_STATS_13,
1169 CDP_TXRX_STATS_14,
1170 CDP_TXRX_STATS_15,
1171 CDP_TXRX_STATS_16,
1172 CDP_TXRX_STATS_17,
1173 CDP_TXRX_STATS_18,
1174 CDP_TXRX_STATS_19,
1175 CDP_TXRX_STATS_20,
1176 CDP_TXRX_STATS_21,
1177 CDP_TXRX_STATS_22,
1178 CDP_TXRX_STATS_23,
1179 CDP_TXRX_STATS_24,
1180 CDP_TXRX_STATS_25,
1181 CDP_TXRX_STATS_26,
1182 CDP_TXRX_STATS_27,
Venkata Sharath Chandra Manchala0cb31982018-03-30 15:55:26 -07001183 CDP_TXRX_STATS_28,
Venkata Sharath Chandra Manchalaf167af12018-10-09 20:23:02 -07001184 CDP_TXRX_STATS_29,
1185 CDP_TXRX_STATS_30,
Mohit Khannae5a6e942018-11-28 14:22:48 -08001186 CDP_TXRX_STATS_31,
Ishank Jain6290a3c2017-03-21 10:49:39 +05301187 CDP_TXRX_STATS_HTT_MAX = 256,
Venkata Sharath Chandra Manchala599b14c2018-08-06 10:59:11 -07001188 CDP_TXRX_MAX_STATS = 265,
Venkata Sharath Chandra Manchalaa77da0d2017-02-27 22:44:37 -08001189};
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05301190
Ishank Jain1e7401c2017-02-17 15:38:39 +05301191/*
1192 * Different Stat update types sent to OL_IF
1193 * @UPDATE_PEER_STATS: update peer stats
1194 * @UPDATE_VDEV_STATS: update vdev stats
1195 * @UPDATE_PDE_STATS: Update pdev stats
1196 */
1197enum cdp_stat_update_type {
1198 UPDATE_PEER_STATS = 0,
1199 UPDATE_VDEV_STATS = 1,
1200 UPDATE_PDEV_STATS = 2,
1201};
Pamidipati, Vijay623fbee2017-07-07 10:58:15 +05301202
Amir Patel02911572018-07-02 13:00:53 +05301203/*
1204 * struct cdp_tx_sojourn_stats - Tx sojourn stats
1205 * @ppdu_seq_id: ppdu_seq_id from tx completion
1206 * @avg_sojourn_msdu: average sojourn msdu time
1207 * @sum_sojourn_msdu: sum sojourn msdu time
1208 * @num_msdu: number of msdus per ppdu
Amir Patel78824b12019-02-23 10:54:32 +05301209 * @cookie: cookie to be used by upper layer
Amir Patel02911572018-07-02 13:00:53 +05301210 */
1211struct cdp_tx_sojourn_stats {
1212 uint32_t ppdu_seq_id;
Ruchi, Agrawal2cbca3b2018-06-20 19:31:03 +05301213 qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
Amir Patel02911572018-07-02 13:00:53 +05301214 uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
1215 uint32_t num_msdus[CDP_DATA_TID_MAX];
Amir Patel78824b12019-02-23 10:54:32 +05301216 struct cdp_stats_cookie *cookie;
Amir Patel02911572018-07-02 13:00:53 +05301217};
1218
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301219/**
nobelj7b0e2732019-05-31 00:19:07 -07001220 * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
1221 * per-user information
1222 * @frame_ctrl: frame control field in 802.11 header
1223 * @qos_ctrl: QoS control field in 802.11 header
1224 * @mpdu_tried: number of mpdus tried
1225 * @ltf_size: ltf_size
1226 * @stbc: stbc
1227 * @he_re: he_re (range extension)
1228 * @txbf: txbf
1229 * @bw: Transmission bandwidth
1230 * <enum 2 transmit_bw_20_MHz>
1231 * <enum 3 transmit_bw_40_MHz>
1232 * <enum 4 transmit_bw_80_MHz>
1233 * <enum 5 transmit_bw_160_MHz>
1234 * @nss: NSS 1,2, ...8
1235 * @mcs: MCS index
1236 * @preamble: preamble
1237 * @gi: guard interval 800/400/1600/3200 ns
1238 * @dcm: dcm
1239 * @ldpc: ldpc
1240 * @ru_start: RU start index
1241 * @ru_tones: RU tones length
1242 * @is_mcast: MCAST or UCAST
1243 * @user_pos: user position
1244 * @mu_group_id: mu group id
1245 */
1246struct cdp_delayed_tx_completion_ppdu_user {
1247 uint32_t frame_ctrl:16,
1248 qos_ctrl:16;
1249 uint32_t mpdu_tried_ucast:16,
1250 mpdu_tried_mcast:16;
1251 uint32_t ltf_size:2,
1252 stbc:1,
1253 he_re:1,
1254 txbf:4,
1255 bw:4,
1256 nss:4,
1257 mcs:4,
1258 preamble:4,
1259 gi:4,
1260 dcm:1,
1261 ldpc:1,
1262 delayed_ba:1;
1263 uint16_t ru_start;
1264 uint16_t ru_tones;
1265 bool is_mcast;
1266 uint32_t user_pos;
1267 uint32_t mu_group_id;
1268};
1269
1270/**
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301271 * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
1272 * @completion_status: completion status - OK/Filter/Abort/Timeout
1273 * @tid: TID number
1274 * @peer_id: Peer ID
Karunakar Dasineni63429332019-10-15 18:49:33 -07001275 * @ba_size: Block-Ack size
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301276 * @frame_ctrl: frame control field in 802.11 header
1277 * @qos_ctrl: QoS control field in 802.11 header
1278 * @mpdu_tried: number of mpdus tried
1279 * @mpdu_success: number of mpdus successfully transmitted
1280 * @long_retries: long retries
1281 * @short_retries: short retries
1282 * @is_ampdu: mpdu aggregate or non-aggregate?
1283 * @success_bytes: bytes successfully transmitted
1284 * @retry_bytes: bytes retried
1285 * @failed_msdus: MSDUs failed transmission
1286 * @duration: user duration in ppdu
1287 * @ltf_size: ltf_size
1288 * @stbc: stbc
1289 * @he_re: he_re (range extension)
1290 * @txbf: txbf
1291 * @bw: Transmission bandwidth
Pranita Solanked7e10ba2017-12-13 15:40:38 +05301292 * <enum 2 transmit_bw_20_MHz>
1293 * <enum 3 transmit_bw_40_MHz>
1294 * <enum 4 transmit_bw_80_MHz>
1295 * <enum 5 transmit_bw_160_MHz>
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301296 * @nss: NSS 1,2, ...8
1297 * @mcs: MCS index
1298 * @preamble: preamble
1299 * @gi: guard interval 800/400/1600/3200 ns
1300 * @dcm: dcm
1301 * @ldpc: ldpc
Chaithanya Garrepallibe9d5fc2018-07-26 19:21:24 +05301302 * @delayed_ba: delayed ba bit
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301303 * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1304 * UL_BSR_TRIG/UNKNOWN
1305 * @ba_seq_no: Block Ack sequence number
1306 * @ba_bitmap: Block Ack bitmap
1307 * @start_seqa: Sequence number of first MPDU
1308 * @enq_bitmap: Enqueue MPDU bitmap
nobelj4e9d51f2018-08-07 19:36:47 -07001309 * @ru_start: RU start index
1310 * @ru_tones: RU tones length
Soumya Bhat1c73aa62017-09-20 22:18:22 +05301311 * @is_mcast: MCAST or UCAST
Pranita Solankea12b4b32017-11-20 23:04:14 +05301312 * @tx_rate: Transmission Rate
nobelj4e9d51f2018-08-07 19:36:47 -07001313 * @user_pos: user position
1314 * @mu_group_id: mu group id
Amir Patel78824b12019-02-23 10:54:32 +05301315 * @rix: rate index
1316 * @cookie: cookie to used by upper layer
Varsha Mishra27c5bd32019-05-28 11:54:46 +05301317 * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
1318 * @ppdu_cookie: 16-bit ppdu_cookie
Subrat Mishra3948e3f2019-07-25 14:37:43 +05301319 * @sa_is_training: smart antenna training packets indication
1320 * @rssi_chain: rssi chain per bandwidth
1321 * @sa_tx_antenna: antenna in which packet is transmitted
1322 * @sa_max_rates: smart antenna tx feedback info max rates
1323 * @sa_goodput: smart antenna tx feedback info goodput
Ankit Kumarcd66fff2019-07-02 20:54:44 +05301324 * @current_rate_per: Moving average per
Karunakar Dasineni63429332019-10-15 18:49:33 -07001325 * @last_enq_seq: last equeue sequence number
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301326 */
1327struct cdp_tx_completion_ppdu_user {
1328 uint32_t completion_status:8,
1329 tid:8,
1330 peer_id:16;
1331 uint8_t mac_addr[6];
Karunakar Dasineni63429332019-10-15 18:49:33 -07001332 uint16_t ba_size;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301333 uint32_t frame_ctrl:16,
1334 qos_ctrl:16;
Soumya Bhat539ecfa2017-09-08 12:50:30 +05301335 uint32_t mpdu_tried_ucast:16,
1336 mpdu_tried_mcast:16;
1337 uint16_t mpdu_success:16;
Amir Patel02911572018-07-02 13:00:53 +05301338 uint16_t mpdu_failed:16;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301339 uint32_t long_retries:4,
1340 short_retries:4,
Ankit Kumarcd66fff2019-07-02 20:54:44 +05301341 tx_ratecode:16,
Soumya Bhat835033e2017-10-04 22:21:46 +05301342 is_ampdu:1,
1343 ppdu_type:5;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301344 uint32_t success_bytes;
1345 uint32_t retry_bytes;
1346 uint32_t failed_bytes;
1347 uint32_t success_msdus:16,
1348 retry_msdus:16;
1349 uint32_t failed_msdus:16,
1350 duration:16;
1351 uint32_t ltf_size:2,
1352 stbc:1,
1353 he_re:1,
1354 txbf:4,
1355 bw:4,
1356 nss:4,
1357 mcs:4,
1358 preamble:4,
1359 gi:4,
1360 dcm:1,
Chaithanya Garrepallibe9d5fc2018-07-26 19:21:24 +05301361 ldpc:1,
1362 delayed_ba:1;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301363 uint32_t ba_seq_no;
1364 uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1365 uint32_t start_seq;
1366 uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
Amir Patel02911572018-07-02 13:00:53 +05301367 uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
Soumya Bhat539ecfa2017-09-08 12:50:30 +05301368 uint32_t num_mpdu:9,
1369 num_msdu:16;
Soumya Bhat1c73aa62017-09-20 22:18:22 +05301370 uint32_t tx_duration;
nobelj4e9d51f2018-08-07 19:36:47 -07001371 uint16_t ru_start;
Soumya Bhat28541112017-11-22 16:58:29 +05301372 uint16_t ru_tones;
Soumya Bhat1c73aa62017-09-20 22:18:22 +05301373 bool is_mcast;
Pranita Solankea12b4b32017-11-20 23:04:14 +05301374 uint32_t tx_rate;
Amir Patel02911572018-07-02 13:00:53 +05301375 uint32_t tx_ratekbps;
1376 /*ack rssi for separate chains*/
1377 uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
Anish Nataraj7235d9b2018-08-20 13:10:25 +05301378 bool ack_rssi_valid;
nobelj4e9d51f2018-08-07 19:36:47 -07001379 uint32_t user_pos;
1380 uint32_t mu_group_id;
Amir Patel78824b12019-02-23 10:54:32 +05301381 uint32_t rix;
1382 struct cdp_stats_cookie *cookie;
Varsha Mishra27c5bd32019-05-28 11:54:46 +05301383 uint8_t is_ppdu_cookie_valid;
1384 uint16_t ppdu_cookie;
Subrat Mishra3948e3f2019-07-25 14:37:43 +05301385 uint8_t sa_is_training;
1386 uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
1387 uint32_t sa_tx_antenna;
Ankit Kumarcd66fff2019-07-02 20:54:44 +05301388 /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
1389 * |---------------------------------------|
1390 * | 16 bits | 16 bits | 16 bits | 16 bits |
1391 * | BW-1 | BW-2 | BW-3 | BW-4 |
1392 * | /\ \ |
1393 * | / \ \ |
1394 * | / \ \ |
1395 * | / \ \ |
1396 * | / \ \ |
1397 * | / \ \ |
1398 * |/ \ \ |
1399 * |[11|8] [5|8] \ |
1400 * | BW1 PADDED \ |
1401 * |---------------------------------------|
1402 */
1403 uint16_t sa_max_rates[CDP_NUM_SA_BW];
Subrat Mishra3948e3f2019-07-25 14:37:43 +05301404 uint32_t sa_goodput;
Ankit Kumarcd66fff2019-07-02 20:54:44 +05301405 /* below field is used to calculate goodput in non-training period
1406 * Note: As host is exposing goodput and hence current_rate_per is
1407 * of no use. It is just for Host computation.
1408 */
1409 uint32_t current_rate_per;
Karunakar Dasineni63429332019-10-15 18:49:33 -07001410 uint32_t last_enq_seq;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301411};
1412
1413/**
nobeljdebe2b32019-04-23 11:18:47 -07001414 * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
1415 * @ppdu_id: PPDU id
1416 * @duration: user duration in ppdu
1417 * @frame_type: frame type MGMT/CTRL/DATA/BAR
1418 * @frame_ctrl: frame control field in 802.11 header
1419 * @qos_ctrl: QoS control field in 802.11 header
1420 * @tid: TID number
1421 * @num_msdu: number of msdu in MPDU
1422 * @seq_no: Sequence number of first MPDU
1423 * @ltf_size: ltf_size
1424 * @stbc: stbc
1425 * @he_re: he_re (range extension)
1426 * @txbf: txbf
1427 * @bw: Transmission bandwidth
1428 * <enum 2 transmit_bw_20_MHz>
1429 * <enum 3 transmit_bw_40_MHz>
1430 * <enum 4 transmit_bw_80_MHz>
1431 * <enum 5 transmit_bw_160_MHz>
1432 * @nss: NSS 1,2, ...8
1433 * @mcs: MCS index
1434 * @preamble: preamble
1435 * @gi: guard interval 800/400/1600/3200 ns
nobelj68930ca2019-10-03 17:22:47 -07001436 * @resp_type: response type
1437 * @mprot_type: medium protection type
1438 * @rts_success: rts success
1439 * @rts failure: rts failure
nobeljdebe2b32019-04-23 11:18:47 -07001440 * @channel: frequency
1441 * @channel_num: channel number
1442 * @ack_rssi: ack rssi
1443 * @ldpc: ldpc
1444 * @tx_rate: Transmission Rate
1445 * @mac_address: peer mac address
1446 * @bss_mac_address: bss mac address
1447 * @ppdu_start_timestamp: TSF at PPDU start
1448 * @ppdu_end_timestamp: TSF at PPDU end
1449 * @ba_start_seq: Block Ack sequence number
1450 * @ba_bitmap: Block Ack bitmap
Varsha Mishra27c5bd32019-05-28 11:54:46 +05301451 * @ppdu_cookie: 16-bit ppdu_cookie
nobelj68930ca2019-10-03 17:22:47 -07001452 * @long_retries: long retries
1453 * @short_retries: short retries
1454 * @completion_status: completion status - OK/Filter/Abort/Timeout
nobeljdebe2b32019-04-23 11:18:47 -07001455 */
1456struct cdp_tx_indication_mpdu_info {
1457 uint32_t ppdu_id;
1458 uint32_t tx_duration;
1459 uint16_t frame_type;
1460 uint16_t frame_ctrl;
1461 uint16_t qos_ctrl;
1462 uint8_t tid;
1463 uint32_t num_msdu;
1464 uint32_t seq_no;
1465 uint32_t ltf_size:2,
1466 he_re:1,
1467 txbf:4,
1468 bw:4,
1469 nss:4,
1470 mcs:4,
1471 preamble:4,
1472 gi:4;
1473 uint32_t channel;
1474 uint8_t channel_num;
1475 uint32_t ack_rssi;
1476 uint32_t ldpc;
1477 uint32_t tx_rate;
1478 uint8_t mac_address[QDF_MAC_ADDR_SIZE];
1479 uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
nobelj182938a2019-11-25 14:09:08 -08001480 uint64_t ppdu_start_timestamp;
1481 uint64_t ppdu_end_timestamp;
nobeljdebe2b32019-04-23 11:18:47 -07001482 uint32_t ba_start_seq;
1483 uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
Varsha Mishra27c5bd32019-05-28 11:54:46 +05301484 uint16_t ppdu_cookie;
nobelj68930ca2019-10-03 17:22:47 -07001485 uint16_t long_retries:4,
1486 short_retries:4,
1487 completion_status:8;
1488 uint16_t resp_type:4,
1489 mprot_type:3,
1490 rts_success:1,
1491 rts_failure:1;
nobeljdebe2b32019-04-23 11:18:47 -07001492};
1493
1494/**
1495 * struct cdp_tx_indication_info - Tx capture information
1496 * @mpdu_info: Tx MPDU completion information
1497 * @mpdu_nbuf: reconstructed mpdu packet
1498 */
1499struct cdp_tx_indication_info {
1500 struct cdp_tx_indication_mpdu_info mpdu_info;
1501 qdf_nbuf_t mpdu_nbuf;
1502};
1503
1504/**
nobeljcf57a9a2019-12-06 14:23:27 -08001505 * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
1506 * @ppdu_id: ppdu_id
1507 * @is_sgen_pkt: payload recevied from wmi or htt path
1508 * @retries_count: retries count
1509 * @tx_tsf: 64 bit timestamp
1510 */
1511struct cdp_tx_mgmt_comp_info {
1512 uint32_t ppdu_id;
1513 bool is_sgen_pkt;
1514 uint16_t retries_count;
1515 uint64_t tx_tsf;
1516};
1517
1518/**
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301519 * struct cdp_tx_completion_ppdu - Tx PPDU completion information
1520 * @completion_status: completion status - OK/Filter/Abort/Timeout
1521 * @ppdu_id: PPDU Id
Amir Patel02911572018-07-02 13:00:53 +05301522 * @ppdu_seq_id: ppdu sequence id for sojourn stats
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301523 * @vdev_id: VAP Id
nobelj7b0e2732019-05-31 00:19:07 -07001524 * @bar_num_users: BA response user count, based on completion common TLV
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301525 * @num_users: Number of users
Karunakar Dasineni63429332019-10-15 18:49:33 -07001526 * @pending_retries: pending MPDUs (retries)
nobelj0e007762019-12-13 12:59:14 -08001527 * @drop_reason: drop reason from flush status
1528 * @is_flush: is_flush is set based on flush tlv
1529 * @flow_type: tx flow type from flush status
1530 * @queue_type: queue type from flush status
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301531 * @num_mpdu: Number of MPDUs in PPDU
1532 * @num_msdu: Number of MSDUs in PPDU
Anish Natarajb9e7d012018-02-16 00:38:10 +05301533 * @frame_type: frame SU or MU
nobelj68930ca2019-10-03 17:22:47 -07001534 * @htt_frame_type: frame type from htt
Anish Natarajb9e7d012018-02-16 00:38:10 +05301535 * @frame_ctrl: frame control of 80211 header
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301536 * @channel: Channel informartion
nobelj68930ca2019-10-03 17:22:47 -07001537 * @resp_type: response type
1538 * @mprot_type: medium protection type
1539 * @rts_success: rts success
1540 * @rts failure: rts failure
1541 * @phymode: phy mode
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301542 * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
Pranita Solankea12b4b32017-11-20 23:04:14 +05301543 * @tx_duration: PPDU airtime
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301544 * @ppdu_start_timestamp: TSF at PPDU start
1545 * @ppdu_end_timestamp: TSF at PPDU end
1546 * @ack_timestamp: TSF at the reception of ACK
nobelj7b0e2732019-05-31 00:19:07 -07001547 * @delayed_ba: Delayed ba flag
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301548 * @user: per-User stats (array of per-user structures)
nobeljdebe2b32019-04-23 11:18:47 -07001549 * @mpdu_q: queue of mpdu in a ppdu
Karunakar Dasineni63429332019-10-15 18:49:33 -07001550 * @mpdus: MPDU list based on enqueue sequence bitmap
nobelj68930ca2019-10-03 17:22:47 -07001551 * @bar_ppdu_id: BAR ppdu_id
1552 * @bar_tx_duration: BAR tx duration
1553 * @bar_ppdu_start_timestamp: BAR start timestamp
1554 * @bar_ppdu_end_timestamp: BAR end timestamp
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301555 */
1556struct cdp_tx_completion_ppdu {
1557 uint32_t ppdu_id;
Amir Patel02911572018-07-02 13:00:53 +05301558 uint32_t ppdu_seq_id;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301559 uint16_t vdev_id;
nobelj7b0e2732019-05-31 00:19:07 -07001560 uint16_t bar_num_users;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301561 uint32_t num_users;
Santosh Anbu4de9ffb2019-03-01 17:20:29 +05301562 uint8_t last_usr_index;
Karunakar Dasineni63429332019-10-15 18:49:33 -07001563 uint32_t pending_retries;
nobelj0e007762019-12-13 12:59:14 -08001564 uint32_t drop_reason;
1565 uint32_t is_flush:1,
1566 flow_type:8,
1567 queue_type:8;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301568 uint32_t num_mpdu:9,
1569 num_msdu:16;
Soumya Bhat539ecfa2017-09-08 12:50:30 +05301570 uint16_t frame_type;
nobelj68930ca2019-10-03 17:22:47 -07001571 uint16_t htt_frame_type;
Anish Natarajb9e7d012018-02-16 00:38:10 +05301572 uint16_t frame_ctrl;
Soumya Bhat539ecfa2017-09-08 12:50:30 +05301573 uint16_t channel;
nobelj68930ca2019-10-03 17:22:47 -07001574 uint16_t resp_type:4,
1575 mprot_type:3,
1576 rts_success:1,
1577 rts_failure:1;
Soumya Bhat539ecfa2017-09-08 12:50:30 +05301578 uint16_t phy_mode;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301579 uint32_t ack_rssi;
Pranita Solankea12b4b32017-11-20 23:04:14 +05301580 uint32_t tx_duration;
nobelj182938a2019-11-25 14:09:08 -08001581 uint64_t ppdu_start_timestamp;
1582 uint64_t ppdu_end_timestamp;
1583 uint64_t ack_timestamp;
nobelj7b0e2732019-05-31 00:19:07 -07001584 bool delayed_ba;
Soumya Bhat835033e2017-10-04 22:21:46 +05301585 struct cdp_tx_completion_ppdu_user user[CDP_MU_MAX_USERS];
nobeljdebe2b32019-04-23 11:18:47 -07001586 qdf_nbuf_queue_t mpdu_q;
Karunakar Dasineni63429332019-10-15 18:49:33 -07001587 qdf_nbuf_t *mpdus;
nobelj68930ca2019-10-03 17:22:47 -07001588 uint32_t bar_ppdu_id;
1589 uint32_t bar_tx_duration;
1590 uint32_t bar_ppdu_start_timestamp;
1591 uint32_t bar_ppdu_end_timestamp;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301592};
1593
1594/**
Anish Natarajf12b0a32018-03-14 14:27:13 +05301595 * struct cdp_dev_stats - Network device stats structure
1596 * @tx_packets: Tx total packets transmitted
1597 * @tx_bytes : Tx total bytes transmitted
1598 * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
1599 * @tx_dropped: Tx dropped is same as tx errors as above
1600 * @rx_packets: Rx total packets transmitted
1601 * @rx_bytes : Rx total bytes transmitted
Ankit Kumarb5029b02019-07-24 14:46:12 +05301602 * @rx_errors : Rx erros
Ankit Kumar1c69ca12019-07-30 14:03:12 +05301603 * @rx_dropped: Rx dropped stats
Anish Natarajf12b0a32018-03-14 14:27:13 +05301604 */
1605struct cdp_dev_stats {
1606 uint32_t tx_packets;
1607 uint32_t tx_bytes;
1608 uint32_t tx_errors;
1609 uint32_t tx_dropped;
1610 uint32_t rx_packets;
1611 uint32_t rx_bytes;
Ankit Kumarb5029b02019-07-24 14:46:12 +05301612 uint32_t rx_errors;
Ankit Kumar1c69ca12019-07-30 14:03:12 +05301613 uint32_t rx_dropped;
Anish Natarajf12b0a32018-03-14 14:27:13 +05301614};
1615
1616/**
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301617 * struct cdp_rate_stats - Tx/Rx Rate statistics
1618 * @bw: Indicates the BW of the upcoming transmission -
Pranita Solanked7e10ba2017-12-13 15:40:38 +05301619 * <enum 2 transmit_bw_20_MHz>
1620 * <enum 3 transmit_bw_40_MHz>
1621 * <enum 4 transmit_bw_80_MHz>
1622 * <enum 5 transmit_bw_160_MHz>
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301623 * @pkt_type: Transmit Packet Type
1624 * @stbc: When set, STBC transmission rate was used
1625 * @ldpc: When set, use LDPC transmission rates
1626 * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
1627 * <enum 1 0_4_us_sgi > Legacy short GI
1628 * <enum 2 1_6_us_sgi > HE related GI
1629 * <enum 3 3_2_us_sgi > HE
1630 * @mcs: Transmit MCS Rate
1631 * @ofdma: Set when the transmission was an OFDMA transmission
1632 * @tones_in_ru: The number of tones in the RU used.
1633 * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
1634 * @peer_id: Peer ID of the flow or MPDU queue
1635 * @tid: TID of the flow or MPDU queue
1636 */
1637struct cdp_rate_stats {
1638 uint32_t rate_stats_info_valid:1,
1639 bw:2,
1640 pkt_type:4,
1641 stbc:1,
1642 ldpc:1,
1643 sgi:2,
1644 mcs:4,
1645 ofdma:1,
1646 tones_in_ru:12,
1647 resvd0:4;
1648 uint32_t tsf;
1649 uint16_t peer_id;
1650 uint8_t tid;
1651};
1652
1653/**
1654 * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
1655 * @ppdu_id: PPDU to which this MSDU belongs
1656 * @transmit_cnt: Number of times this frame has been transmitted
1657 * @ack_frame_rssi: RSSI of the received ACK or BA frame
1658 * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
1659 * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
1660 * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
1661 * @extd: Extended structure containing rate statistics
1662 */
1663struct cdp_tx_completion_msdu {
1664 uint32_t ppdu_id;
1665 uint8_t transmit_cnt;
1666 uint32_t ack_frame_rssi:8,
1667 resvd0:1,
1668 first_msdu:1,
1669 last_msdu:1,
1670 msdu_part_of_amsdu:1,
1671 resvd1:20;
1672 struct cdp_rate_stats extd;
1673};
1674
1675/**
nobelj14531642019-06-25 17:41:55 -07001676 * struct cdp_rx_stats_ppdu_user -- per user RX stats
1677 * @peer_id: Peer ID
1678 * @vdev_id: VAP ID
1679 * @is_ampdu: mpdu aggregate or non-aggregate?
Kai Chena8cf5942019-10-14 17:42:24 -07001680 * @mu_ul_info_valid: MU UL info valid
nobelj14531642019-06-25 17:41:55 -07001681 * @ofdma_ru_start_index: RU index number(0-73)
1682 * @ofdma_ru_width: size of RU in units of 1(26tone)RU
1683 * @nss: NSS 1,2, ...8
1684 * @mcs: MCS index
1685 * @user_index: user ID in multi-user case
1686 * @ast_index: ast index in multi-user case
1687 * @tid: TID number
1688 * @num_msdu: Number of MSDUs in PPDU
1689 * @udp_msdu_count: Number of UDP MSDUs in PPDU
1690 * @tcp_msdu_count: Number of TCP MSDUs in PPDU
1691 * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
1692 * @frame_control: frame control field
1693 * @frame_control_info_valid: frame_control valid
1694 * @data_sequence_control_info_valid: data_sequence_control_info valid
1695 * @first_data_seq_ctrl: Sequence control field of first data frame
1696 * @preamble: preamble
1697 * @ht_flag: ht flag
1698 * @vht_flag: vht flag
1699 * @he_re: he_re (range extension)
1700 * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
1701 * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
1702 * @mpdu_fcs_ok_bitmap - MPDU with fcs ok bitmap
1703 * @retried - number of retries
1704 * @mac_addr: Peer MAC Address
1705 */
1706struct cdp_rx_stats_ppdu_user {
1707 uint16_t peer_id;
1708 uint8_t vdev_id;
1709 bool is_ampdu;
Kai Chena8cf5942019-10-14 17:42:24 -07001710 uint32_t mu_ul_info_valid:1,
nobelj14531642019-06-25 17:41:55 -07001711 ofdma_ru_start_index:7,
1712 ofdma_ru_width:7,
1713 nss:4,
1714 mcs:4;
1715 /* user id */
1716 uint8_t user_index;
1717 uint32_t ast_index;
1718 uint32_t tid;
Kai Chena8cf5942019-10-14 17:42:24 -07001719 uint32_t num_msdu;
nobelj14531642019-06-25 17:41:55 -07001720 uint16_t tcp_msdu_count;
1721 uint16_t udp_msdu_count;
1722 uint16_t other_msdu_count;
1723 uint16_t frame_control;
1724 uint8_t frame_control_info_valid;
1725 uint8_t data_sequence_control_info_valid;
1726 uint16_t first_data_seq_ctrl;
1727 uint32_t preamble_type;
1728 uint16_t ht_flags;
1729 uint16_t vht_flags;
1730 uint16_t he_flags;
1731 uint32_t mpdu_cnt_fcs_ok;
1732 uint32_t mpdu_cnt_fcs_err;
Chaithanya Garrepalli1f89b972019-07-31 12:33:53 +05301733 uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
nobelj14531642019-06-25 17:41:55 -07001734 uint32_t mpdu_ok_byte_count;
1735 uint32_t mpdu_err_byte_count;
1736 uint32_t retries;
1737 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
1738};
1739
1740/**
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301741 * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
1742 * @ppdu_id: PPDU Id
1743 * @is_ampdu: mpdu aggregate or non-aggregate?
1744 * @num_mpdu: Number of MPDUs in PPDU
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +05301745 * @reserved: Reserved bits for future use
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301746 * @num_msdu: Number of MSDUs in PPDU
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +05301747 * @udp_msdu_count: Number of UDP MSDUs in PPDU
1748 * @tcp_msdu_count: Number of TCP MSDUs in PPDU
1749 * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301750 * @duration: PPDU duration
1751 * @tid: TID number
1752 * @peer_id: Peer ID
Pamidipati, Vijayd7eb83e2017-09-20 21:19:56 +05301753 * @vdev_id: VAP ID
1754 * @mac_addr: Peer MAC Address
1755 * @first_data_seq_ctrl: Sequence control field of first data frame
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301756 * @ltf_size: ltf_size
1757 * @stbc: When set, STBC rate was used
1758 * @he_re: he_re (range extension)
1759 * @bw: Bandwidth
1760 * <enum 0 bw_20_MHz>
1761 * <enum 1 bw_40_MHz>
1762 * <enum 2 bw_80_MHz>
1763 * <enum 3 bw_160_MHz>
1764 * @nss: NSS 1,2, ...8
1765 * @mcs: MCS index
1766 * @preamble: preamble
1767 * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
1768 * <enum 1 0_4_us_sgi > Legacy short GI
1769 * <enum 2 1_6_us_sgi > HE related GI
1770 * <enum 3 3_2_us_sgi > HE
1771 * @dcm: dcm
1772 * @ldpc: ldpc
1773 * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1774 * UL_BSR_TRIG/UNKNOWN
1775 * @rssi: RSSI value (units = dB above noise floor)
1776 * @timestamp: TSF at the reception of PPDU
nobelj9ab76e22018-02-13 18:10:54 -08001777 * @length: PPDU length
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301778 * @channel: Channel informartion
1779 * @lsig_A: L-SIG in 802.11 PHY header
Anish Natarajeb30aa72018-09-20 16:34:01 +05301780 * @frame_ctrl: frame control field
Amir Patel78824b12019-02-23 10:54:32 +05301781 * @rix: rate index
1782 * @rssi_chain: rssi chain per nss per bw
1783 * @cookie: cookie to used by upper layer
nobelj14531642019-06-25 17:41:55 -07001784 * @user: per user stats in MU-user case
1785 * @nf: noise floor
1786 * @per_chain_rssi: rssi per antenna
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301787 */
1788struct cdp_rx_indication_ppdu {
1789 uint32_t ppdu_id;
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +05301790 uint16_t is_ampdu:1,
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301791 num_mpdu:9,
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +05301792 reserved:6;
1793 uint32_t num_msdu;
Amir Patel78824b12019-02-23 10:54:32 +05301794 uint32_t num_bytes;
Pamidipati, Vijay57a435a2017-10-17 11:03:39 +05301795 uint16_t udp_msdu_count;
1796 uint16_t tcp_msdu_count;
1797 uint16_t other_msdu_count;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301798 uint16_t duration;
1799 uint32_t tid:8,
1800 peer_id:16;
Pamidipati, Vijayd7eb83e2017-09-20 21:19:56 +05301801 uint8_t vdev_id;
1802 uint8_t mac_addr[6];
1803 uint16_t first_data_seq_ctrl;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301804 union {
1805 uint32_t rate_info;
1806 struct {
1807 uint32_t ltf_size:2,
1808 stbc:1,
1809 he_re:1,
1810 bw:4,
1811 nss:4,
1812 mcs:4,
1813 preamble:4,
1814 gi:4,
1815 dcm:1,
1816 ldpc:1,
Pranita Solankeb3cc9b72018-10-16 12:36:49 +05301817 ppdu_type:5;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301818 };
1819 } u;
Amir Patel78824b12019-02-23 10:54:32 +05301820 uint32_t rix;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301821 uint32_t lsig_a;
1822 uint32_t rssi;
Anish Nataraj57614da2018-02-07 23:04:24 +05301823 uint64_t timestamp;
nobelj9ab76e22018-02-13 18:10:54 -08001824 uint32_t length;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301825 uint8_t channel;
nobeljd8039592018-03-13 16:59:42 -07001826 uint8_t beamformed;
Amir Patel02911572018-07-02 13:00:53 +05301827
1828 uint32_t rx_ratekbps;
1829 uint32_t ppdu_rx_rate;
1830
1831 uint32_t retries;
1832 uint32_t rx_byte_count;
Ankit Kumarcd66fff2019-07-02 20:54:44 +05301833 uint16_t rx_ratecode;
Amir Patel02911572018-07-02 13:00:53 +05301834 uint8_t fcs_error_mpdus;
Anish Natarajeb30aa72018-09-20 16:34:01 +05301835 uint16_t frame_ctrl;
Amir Patel1d4ac982019-04-25 11:49:01 +05301836 int8_t rssi_chain[SS_COUNT][MAX_BW];
Amir Patel78824b12019-02-23 10:54:32 +05301837 struct cdp_stats_cookie *cookie;
Amir Patel5a8bbbe2019-07-17 21:59:39 +05301838 struct cdp_rx_su_evm_info evm_info;
1839 uint32_t rx_antenna;
nobelj14531642019-06-25 17:41:55 -07001840 uint8_t num_users;
1841 struct cdp_rx_stats_ppdu_user user[CDP_MU_MAX_USERS];
1842 uint32_t nf;
1843 uint8_t per_chain_rssi[MAX_CHAIN];
1844 uint8_t is_mcast_bcast;
Pamidipati, Vijay038d0902017-07-17 09:53:31 +05301845};
1846
1847/**
1848 * struct cdp_rx_indication_msdu - Rx MSDU info
1849 * @ppdu_id: PPDU to which the MSDU belongs
1850 * @msdu_len: Length of MSDU in bytes
1851 * @ack_frame_rssi: RSSI of the received ACK or BA frame
1852 * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
1853 * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
1854 * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
1855 * @extd: Extended structure containing rate statistics
1856 */
1857struct cdp_rx_indication_msdu {
1858 uint32_t ppdu_id;
1859 uint16_t msdu_len;
1860 uint32_t ack_frame_rssi:8,
1861 resvd0:1,
1862 first_msdu:1,
1863 last_msdu:1,
1864 msdu_part_of_amsdu:1,
1865 msdu_part_of_ampdu:1,
1866 resvd1:19;
1867 struct cdp_rate_stats extd;
1868};
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -07001869
1870/**
1871 * struct cdp_config_params - Propagate configuration parameters to datapath
1872 * @tso_enable: Enable/Disable TSO
1873 * @lro_enable: Enable/Disable LRO
Mohit Khanna16816ae2018-10-30 14:12:03 -07001874 * @gro_enable: Enable/Disable GRO
1875 * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -07001876 * @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
1877 * @napi_enable: Enable/Disable Napi
Mohit Khanna81179cb2018-08-16 20:50:43 -07001878 * @ipa_enable: Flag indicating if IPA is enabled or not
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -07001879 * @tx_flow_stop_queue_threshold: Value to Pause tx queues
1880 * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
1881 * tx queue
Mohit Khannae5a6e942018-11-28 14:22:48 -08001882 * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
1883 * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
1884 * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -07001885 */
1886struct cdp_config_params {
1887 unsigned int tso_enable:1;
1888 unsigned int lro_enable:1;
Mohit Khanna16816ae2018-10-30 14:12:03 -07001889 unsigned int gro_enable:1;
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -07001890 unsigned int flow_steering_enable:1;
1891 unsigned int tcp_udp_checksumoffload:1;
1892 unsigned int napi_enable:1;
Mohit Khanna81179cb2018-08-16 20:50:43 -07001893 unsigned int ipa_enable:1;
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -07001894 /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
1895 uint8_t tx_flow_stop_queue_threshold;
1896 uint8_t tx_flow_start_queue_offset;
Mohit Khannae5a6e942018-11-28 14:22:48 -08001897 uint32_t tx_comp_loop_pkt_limit;
1898 uint32_t rx_reap_loop_pkt_limit;
1899 uint32_t rx_hp_oos_update_limit;
Mohit Khanna81179cb2018-08-16 20:50:43 -07001900
Venkata Sharath Chandra Manchala3e8add82017-07-10 11:59:54 -07001901};
Om Prakash Tripathi03efb6a2017-08-23 22:51:28 +05301902
1903/**
1904 * cdp_txrx_stats_req: stats request wrapper
1905 * used to pass request information to cdp layer
1906 * @stats: type of stats requested
1907 * @param0: opaque argument 0 to be passed to htt
1908 * @param1: opaque argument 1 to be passed to htt
1909 * @param2: opaque argument 2 to be passed to htt
1910 * @param3: opaque argument 3 to be passed to htt
Venkata Sharath Chandra Manchala4face242018-04-23 11:48:28 -07001911 * @mac id: mac_id
Om Prakash Tripathi03efb6a2017-08-23 22:51:28 +05301912 */
1913struct cdp_txrx_stats_req {
1914 enum cdp_stats stats;
1915 uint32_t param0;
1916 uint32_t param1;
1917 uint32_t param2;
1918 uint32_t param3;
Prathyusha Guduri43bb0562018-02-12 18:30:54 +05301919 uint32_t cookie_val;
Venkata Sharath Chandra Manchala4face242018-04-23 11:48:28 -07001920 uint8_t mac_id;
Venkata Sharath Chandra Manchala0cb31982018-03-30 15:55:26 -07001921 char *peer_addr;
Om Prakash Tripathi03efb6a2017-08-23 22:51:28 +05301922};
nobeljd124b742017-10-16 11:59:12 -07001923
1924/**
1925 * struct cdp_monitor_filter - monitor filter info
1926 * @mode: set filter mode
1927 * @fp_mgmt: set Filter Pass MGMT Configuration
1928 * @fp_ctrl: set Filter Pass CTRL Configuration
1929 * @fp_data: set Filter Pass DATA Configuration
1930 * @mo_mgmt: set Monitor Other MGMT Configuration
1931 * @mo_ctrl: set Monitor Other CTRL Configuration
1932 * @mo_data: set Monitor other DATA Configuration
1933 *
1934 */
1935struct cdp_monitor_filter {
1936 uint16_t mode;
1937 uint16_t fp_mgmt;
1938 uint16_t fp_ctrl;
1939 uint16_t fp_data;
1940 uint16_t mo_mgmt;
1941 uint16_t mo_ctrl;
1942 uint16_t mo_data;
1943};
jitiphil60ac9aa2018-10-05 19:54:04 +05301944
1945/**
1946 * cdp_dp_cfg - dp ini config enum
1947 */
1948enum cdp_dp_cfg {
1949 cfg_dp_enable_data_stall,
1950 cfg_dp_enable_ip_tcp_udp_checksum_offload,
1951 cfg_dp_tso_enable,
1952 cfg_dp_lro_enable,
1953 cfg_dp_gro_enable,
1954 cfg_dp_tx_flow_start_queue_offset,
1955 cfg_dp_tx_flow_stop_queue_threshold,
1956 cfg_dp_ipa_uc_tx_buf_size,
1957 cfg_dp_ipa_uc_tx_partition_base,
1958 cfg_dp_ipa_uc_rx_ind_ring_count,
1959 cfg_dp_enable_flow_steering,
1960 cfg_dp_reorder_offload_supported,
1961 cfg_dp_ce_classify_enable,
1962 cfg_dp_disable_intra_bss_fwd,
1963};
Amir Patel78824b12019-02-23 10:54:32 +05301964
1965/**
1966 * struct cdp_peer_cookie - cookie used when creating peer
1967 * @peer_id: peer id
Pavankumar Nandeshwar4c7b81b2019-09-27 11:27:12 +05301968 * @pdev_id: pdev_id
Amir Patel78824b12019-02-23 10:54:32 +05301969 * @mac_addr: MAC address of peer
1970 * @cookie: cookie to be used by consumer
1971 * @ctx: context passed to be used by consumer
1972 */
1973struct cdp_peer_cookie {
Srinivas Girigowda2751b6d2019-02-27 12:28:13 -08001974 uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
Pavankumar Nandeshwar4c7b81b2019-09-27 11:27:12 +05301975 uint8_t peer_id;
Amir Patel78824b12019-02-23 10:54:32 +05301976 uint8_t cookie;
1977 struct cdp_stats_cookie *ctx;
1978};
Sumeet Raoc4fa4df2019-07-05 02:11:19 -07001979
1980/**
1981 * cdp_flow_stats - Per-Flow (5-tuple) statistics
1982 * @msdu_count: number of rx msdus matching this flow
1983 *
1984 * HW also includes msdu_byte_count and timestamp, which
1985 * are not currently tracked in SW.
1986 */
1987struct cdp_flow_stats {
1988 uint32_t msdu_count;
1989};
1990
1991/**
1992 * cdp_flow_fst_operation - RX FST operations allowed
1993 */
1994enum cdp_flow_fst_operation {
1995 CDP_FLOW_FST_ENTRY_ADD,
1996 CDP_FLOW_FST_ENTRY_DEL,
1997 CDP_FLOW_FST_RX_BYPASS_ENABLE,
1998 CDP_FLOW_FST_RX_BYPASS_DISABLE
1999};
2000
2001/**
2002 * cdp_flow_protocol_type - RX FST supported protocol types, mapped to HW spec
2003 */
2004enum cdp_flow_protocol_type {
2005 CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
2006 CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
2007};
2008
2009/**
2010 * cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
2011 * @dest_ip_127_96: destination IP address bit fields 96-127
2012 * @dest_ip_95_64: destination IP address bit fields 64-95
2013 * @dest_ip_63_32: destination IP address bit fields 32-63
2014 * @dest_ip_31_0: destination IP address bit fields 0-31
2015 * @src_ip_127_96: source IP address bit fields 96-127
2016 * @src_ip_95_64: source IP address bit fields 64-95
2017 * @src_ip_63_32: source IP address bit fields 32-63
2018 * @src_ip_31_0: source IP address bit fields 0-31
2019 * @dest_port: destination port of flow
2020 * @src_port: source port of flow
2021 * @l4_protocol: protocol type in flow (TCP/UDP)
2022 */
2023struct cdp_rx_flow_tuple_info {
2024 uint32_t dest_ip_127_96;
2025 uint32_t dest_ip_95_64;
2026 uint32_t dest_ip_63_32;
2027 uint32_t dest_ip_31_0;
2028 uint32_t src_ip_127_96;
2029 uint32_t src_ip_95_64;
2030 uint32_t src_ip_63_32;
2031 uint32_t src_ip_31_0;
2032 uint16_t dest_port;
2033 uint16_t src_port;
2034 uint16_t l4_protocol;
2035};
2036
2037/**
2038 * cdp_rx_flow_info - RX flow info used for addition/deletion
2039 * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
2040 * @op_code: add/delete/enable/disable operation requested
2041 * @flow_tupe_info: structure containing tuple info
2042 * @fse_metadata: metadata to be set in RX flow
2043 */
2044struct cdp_rx_flow_info {
2045 bool is_addr_ipv4;
2046 enum cdp_flow_fst_operation op_code;
2047 struct cdp_rx_flow_tuple_info flow_tuple_info;
2048 uint16_t fse_metadata;
2049};
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +05302050#endif