xref: /wlan-driver/qcacld-3.0/components/dp/dispatcher/inc/wlan_dp_public_struct.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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  * DOC: Contains DP public data structure definitions.
20  *
21  */
22 
23 #ifndef _WLAN_DP_PUBLIC_STRUCT_H_
24 #define _WLAN_DP_PUBLIC_STRUCT_H_
25 
26 #include "wlan_cmn.h"
27 #include "wlan_objmgr_cmn.h"
28 #include "wlan_objmgr_global_obj.h"
29 #include "qdf_status.h"
30 #include <wlan_nlink_common.h>
31 #include <qca_vendor.h>
32 #include <ani_system_defs.h>
33 #include "cdp_txrx_ops.h"
34 #include <qdf_defer.h>
35 #include <qdf_types.h>
36 #include "wlan_dp_rx_thread.h"
37 
38 #define DP_MAX_SUBTYPES_TRACKED	4
39 
40 enum dp_rx_offld_flush_cb {
41 	DP_RX_FLUSH_LRO,
42 	DP_RX_FLUSH_THREAD,
43 	DP_RX_FLUSH_NAPI,
44 };
45 
46 enum dp_nbuf_push_type {
47 	DP_NBUF_PUSH_NI,
48 	DP_NBUF_PUSH_NAPI,
49 	DP_NBUF_PUSH_BH_DISABLE,
50 	DP_NBUF_PUSH_SIMPLE,
51 };
52 
53 /**
54  * struct dp_eapol_stats - eapol debug stats count
55  * @eapol_m1_count: eapol m1 count
56  * @eapol_m2_count: eapol m2 count
57  * @eapol_m3_count: eapol m3 count
58  * @eapol_m4_count: eapol m4 count
59  * @tx_dropped: no of tx frames dropped by host
60  * @tx_noack_cnt: no of frames for which there is no ack
61  * @rx_delivered: no. of frames delivered to network stack
62  * @rx_refused: no of frames not delivered to network stack
63  */
64 struct dp_eapol_stats {
65 	uint16_t eapol_m1_count;
66 	uint16_t eapol_m2_count;
67 	uint16_t eapol_m3_count;
68 	uint16_t eapol_m4_count;
69 	uint16_t tx_dropped[DP_MAX_SUBTYPES_TRACKED];
70 	uint16_t tx_noack_cnt[DP_MAX_SUBTYPES_TRACKED];
71 	uint16_t rx_delivered[DP_MAX_SUBTYPES_TRACKED];
72 	uint16_t rx_refused[DP_MAX_SUBTYPES_TRACKED];
73 };
74 
75 /**
76  * struct dp_dhcp_stats - dhcp debug stats count
77  * @dhcp_dis_count: dhcp discovery count
78  * @dhcp_off_count: dhcp offer count
79  * @dhcp_req_count: dhcp request count
80  * @dhcp_ack_count: dhcp ack count
81  * @tx_dropped: no of tx frames dropped by host
82  * @tx_noack_cnt: no of frames for which there is no ack
83  * @rx_delivered: no. of frames delivered to network stack
84  * @rx_refused: no of frames not delivered to network stack
85  */
86 struct dp_dhcp_stats {
87 	uint16_t dhcp_dis_count;
88 	uint16_t dhcp_off_count;
89 	uint16_t dhcp_req_count;
90 	uint16_t dhcp_ack_count;
91 	uint16_t tx_dropped[DP_MAX_SUBTYPES_TRACKED];
92 	uint16_t tx_noack_cnt[DP_MAX_SUBTYPES_TRACKED];
93 	uint16_t rx_delivered[DP_MAX_SUBTYPES_TRACKED];
94 	uint16_t rx_refused[DP_MAX_SUBTYPES_TRACKED];
95 };
96 
97 #ifdef TX_MULTIQ_PER_AC
98 #define TX_GET_QUEUE_IDX(ac, off) (((ac) * TX_QUEUES_PER_AC) + (off))
99 #define TX_QUEUES_PER_AC 4
100 #else
101 #define TX_GET_QUEUE_IDX(ac, off) (ac)
102 #define TX_QUEUES_PER_AC 1
103 #endif
104 
105 /** Number of Tx Queues */
106 #if defined(QCA_LL_TX_FLOW_CONTROL_V2) || \
107 	defined(QCA_HL_NETDEV_FLOW_CONTROL) || \
108 	defined(QCA_LL_PDEV_TX_FLOW_CONTROL)
109 /* Only one HI_PRIO queue */
110 #define NUM_TX_QUEUES (4 * TX_QUEUES_PER_AC + 1)
111 #else
112 #define NUM_TX_QUEUES (4 * TX_QUEUES_PER_AC)
113 #endif
114 
115 #ifndef NUM_CPUS
116 #ifdef QCA_CONFIG_SMP
117 #define NUM_CPUS NR_CPUS
118 #else
119 #define NUM_CPUS 1
120 #endif
121 #endif
122 
123 /**
124  * struct dp_arp_stats - arp debug stats count
125  * @tx_arp_req_count: no. of arp req received from network stack
126  * @rx_arp_rsp_count: no. of arp res received from FW
127  * @tx_dropped: no. of arp req dropped at hdd layer
128  * @rx_dropped: no. of arp res dropped
129  * @rx_delivered: no. of arp res delivered to network stack
130  * @rx_refused: no of arp rsp refused (not delivered) to network stack
131  * @tx_host_fw_sent: no of arp req sent by FW OTA
132  * @rx_host_drop_reorder: no of arp res dropped by host
133  * @rx_fw_cnt: no of arp res received by FW
134  * @tx_ack_cnt: no of arp req acked by FW
135  */
136 struct dp_arp_stats {
137 	uint16_t tx_arp_req_count;
138 	uint16_t rx_arp_rsp_count;
139 	uint16_t tx_dropped;
140 	uint16_t rx_dropped;
141 	uint16_t rx_delivered;
142 	uint16_t rx_refused;
143 	uint16_t tx_host_fw_sent;
144 	uint16_t rx_host_drop_reorder;
145 	uint16_t rx_fw_cnt;
146 	uint16_t tx_ack_cnt;
147 };
148 
149 /**
150  * struct dp_set_arp_stats_params - set/reset arp stats
151  * @vdev_id: session id
152  * @flag: enable/disable stats
153  * @pkt_type: type of packet(1 - arp)
154  * @ip_addr: subnet ipv4 address in case of encrypted packets
155  * @pkt_type_bitmap: pkt bitmap
156  * @tcp_src_port: tcp src port for pkt tracking
157  * @tcp_dst_port: tcp dst port for pkt tracking
158  * @icmp_ipv4: target ipv4 address to track ping packets
159  * @reserved: reserved
160  */
161 struct dp_set_arp_stats_params {
162 	uint32_t vdev_id;
163 	uint8_t flag;
164 	uint8_t pkt_type;
165 	uint32_t ip_addr;
166 	uint32_t pkt_type_bitmap;
167 	uint32_t tcp_src_port;
168 	uint32_t tcp_dst_port;
169 	uint32_t icmp_ipv4;
170 	uint32_t reserved;
171 };
172 
173 /**
174  * struct dp_get_arp_stats_params - get arp stats from firmware
175  * @pkt_type: packet type(1 - ARP)
176  * @vdev_id: session id
177  */
178 struct dp_get_arp_stats_params {
179 	uint8_t pkt_type;
180 	uint32_t vdev_id;
181 };
182 
183 /**
184  * struct dp_dns_stats - dns debug stats count
185  * @tx_dns_req_count: no. of dns query received from network stack
186  * @rx_dns_rsp_count: no. of dns res received from FW
187  * @tx_dropped: no. of dns query dropped at hdd layer
188  * @rx_delivered: no. of dns res delivered to network stack
189  * @rx_refused: no of dns res refused (not delivered) to network stack
190  * @tx_host_fw_sent: no of dns query sent by FW OTA
191  * @rx_host_drop: no of dns res dropped by host
192  * @tx_ack_cnt: no of dns req acked by FW
193  */
194 struct dp_dns_stats {
195 	uint16_t tx_dns_req_count;
196 	uint16_t rx_dns_rsp_count;
197 	uint16_t tx_dropped;
198 	uint16_t rx_delivered;
199 	uint16_t rx_refused;
200 	uint16_t tx_host_fw_sent;
201 	uint16_t rx_host_drop;
202 	uint16_t tx_ack_cnt;
203 };
204 
205 /**
206  * struct dp_tcp_stats - tcp debug stats count
207  * @tx_tcp_syn_count: no. of tcp syn received from network stack
208  * @tx_tcp_ack_count: no. of tcp ack received from network stack
209  * @rx_tcp_syn_ack_count: no. of tcp syn ack received from FW
210  * @tx_tcp_syn_dropped: no. of tcp syn dropped at hdd layer
211  * @tx_tcp_ack_dropped: no. of tcp ack dropped at hdd layer
212  * @rx_delivered: no. of tcp syn ack delivered to network stack
213  * @rx_refused: no of tcp syn ack refused (not delivered) to network stack
214  * @tx_tcp_syn_host_fw_sent: no of tcp syn sent by FW OTA
215  * @tx_tcp_ack_host_fw_sent: no of tcp ack sent by FW OTA
216  * @rx_host_drop: no of tcp syn ack dropped by host
217  * @rx_fw_cnt: no of tcp res received by FW
218  * @tx_tcp_syn_ack_cnt: no of tcp syn acked by FW
219  * @tx_tcp_ack_ack_cnt: no of tcp ack acked by FW
220  * @is_tcp_syn_ack_rcv: flag to check tcp syn ack received or not
221  * @is_tcp_ack_sent: flag to check tcp ack sent or not
222  */
223 struct dp_tcp_stats {
224 	uint16_t tx_tcp_syn_count;
225 	uint16_t tx_tcp_ack_count;
226 	uint16_t rx_tcp_syn_ack_count;
227 	uint16_t tx_tcp_syn_dropped;
228 	uint16_t tx_tcp_ack_dropped;
229 	uint16_t rx_delivered;
230 	uint16_t rx_refused;
231 	uint16_t tx_tcp_syn_host_fw_sent;
232 	uint16_t tx_tcp_ack_host_fw_sent;
233 	uint16_t rx_host_drop;
234 	uint16_t rx_fw_cnt;
235 	uint16_t tx_tcp_syn_ack_cnt;
236 	uint16_t tx_tcp_ack_ack_cnt;
237 	bool is_tcp_syn_ack_rcv;
238 	bool is_tcp_ack_sent;
239 
240 };
241 
242 /**
243  * struct dp_icmpv4_stats - icmpv4 debug stats count
244  * @tx_icmpv4_req_count: no. of icmpv4 req received from network stack
245  * @rx_icmpv4_rsp_count: no. of icmpv4 res received from FW
246  * @tx_dropped: no. of icmpv4 req dropped at hdd layer
247  * @rx_delivered: no. of icmpv4 res delivered to network stack
248  * @rx_refused: no of icmpv4 res refused (not delivered) to network stack
249  * @tx_host_fw_sent: no of icmpv4 req sent by FW OTA
250  * @rx_host_drop: no of icmpv4 res dropped by host
251  * @rx_fw_cnt: no of icmpv4 res received by FW
252  * @tx_ack_cnt: no of icmpv4 req acked by FW
253  */
254 struct dp_icmpv4_stats {
255 	uint16_t tx_icmpv4_req_count;
256 	uint16_t rx_icmpv4_rsp_count;
257 	uint16_t tx_dropped;
258 	uint16_t rx_delivered;
259 	uint16_t rx_refused;
260 	uint16_t tx_host_fw_sent;
261 	uint16_t rx_host_drop;
262 	uint16_t rx_fw_cnt;
263 	uint16_t tx_ack_cnt;
264 };
265 
266 /**
267  * struct dp_rsp_stats - arp packet stats
268  * @vdev_id: session id
269  * @arp_req_enqueue: fw tx count
270  * @arp_req_tx_success: tx ack count
271  * @arp_req_tx_failure: tx ack fail count
272  * @arp_rsp_recvd: rx fw count
273  * @out_of_order_arp_rsp_drop_cnt: out of order count
274  * @dad_detected: dad detected
275  * @connect_status: connection status
276  * @ba_session_establishment_status: BA session status
277  * @connect_stats_present: connectivity stats present or not
278  * @tcp_ack_recvd: tcp syn ack's count
279  * @icmpv4_rsp_recvd: icmpv4 responses count
280  */
281 struct dp_rsp_stats {
282 	uint32_t vdev_id;
283 	uint32_t arp_req_enqueue;
284 	uint32_t arp_req_tx_success;
285 	uint32_t arp_req_tx_failure;
286 	uint32_t arp_rsp_recvd;
287 	uint32_t out_of_order_arp_rsp_drop_cnt;
288 	uint32_t dad_detected;
289 	uint32_t connect_status;
290 	uint32_t ba_session_establishment_status;
291 	bool connect_stats_present;
292 	uint32_t tcp_ack_recvd;
293 	uint32_t icmpv4_rsp_recvd;
294 };
295 
296 /**
297  * struct dp_txrx_soc_attach_params - SoC attach params
298  * @dp_ol_if_ops: DP ol_if ops
299  * @target_psoc: target psoc
300  * @target_type: Target type
301  */
302 struct dp_txrx_soc_attach_params {
303 	struct ol_if_ops *dp_ol_if_ops;
304 	void *target_psoc;
305 	uint32_t target_type;
306 };
307 
308 struct dp_tx_rx_stats {
309 	struct {
310 		/* start_xmit stats */
311 		__u32    tx_called;
312 		__u32    tx_dropped;
313 		__u32    tx_orphaned;
314 		__u32    tx_classified_ac[WLAN_MAX_AC];
315 		__u32    tx_dropped_ac[WLAN_MAX_AC];
316 #ifdef TX_MULTIQ_PER_AC
317 		/* Neither valid socket nor skb->hash */
318 		uint32_t inv_sk_and_skb_hash;
319 		/* skb->hash already calculated */
320 		uint32_t qselect_existing_skb_hash;
321 		/* valid tx queue id in socket */
322 		uint32_t qselect_sk_tx_map;
323 		/* skb->hash calculated in select queue */
324 		uint32_t qselect_skb_hash_calc;
325 #endif
326 		/* rx stats */
327 		__u32 rx_packets;
328 		__u32 rx_dropped;
329 		__u32 rx_delivered;
330 		__u32 rx_refused;
331 	} per_cpu[NUM_CPUS];
332 
333 	qdf_atomic_t rx_usolict_arp_n_mcast_drp;
334 
335 	/* rx gro */
336 	__u32 rx_aggregated;
337 	__u32 rx_gro_dropped;
338 	__u32 rx_non_aggregated;
339 	__u32 rx_gro_flush_skip;
340 	__u32 rx_gro_low_tput_flush;
341 
342 	/* txflow stats */
343 	bool     is_txflow_paused;
344 	__u32    txflow_pause_cnt;
345 	__u32    txflow_unpause_cnt;
346 	__u32    txflow_timer_cnt;
347 
348 	/*tx timeout stats*/
349 	__u32 tx_timeout_cnt;
350 	__u32 cont_txtimeout_cnt;
351 	u64 last_txtimeout;
352 };
353 
354 /**
355  * struct dp_dhcp_ind - DHCP Start/Stop indication message
356  * @dhcp_start: Is DHCP start idication
357  * @device_mode: Mode of the device(ex:STA, AP)
358  * @intf_mac_addr: MAC address of the interface
359  * @peer_mac_addr: MAC address of the connected peer
360  */
361 struct dp_dhcp_ind {
362 	bool dhcp_start;
363 	uint8_t device_mode;
364 	struct qdf_mac_addr intf_mac_addr;
365 	struct qdf_mac_addr peer_mac_addr;
366 };
367 
368 /**
369  * struct dp_mic_error_info - mic error info in dp
370  * @ta_mac_addr: transmitter mac address
371  * @multicast: Flag for multicast
372  * @key_id: Key ID
373  * @tsc: Sequence number
374  * @vdev_id: vdev id
375  *
376  */
377 struct dp_mic_error_info {
378 	struct qdf_mac_addr ta_mac_addr;
379 	bool multicast;
380 	uint8_t key_id;
381 	uint8_t tsc[SIR_CIPHER_SEQ_CTR_SIZE];
382 	uint16_t vdev_id;
383 };
384 
385 enum dp_mic_work_status {
386 	DP_MIC_UNINITIALIZED,
387 	DP_MIC_INITIALIZED,
388 	DP_MIC_SCHEDULED,
389 	DP_MIC_DISABLED
390 };
391 
392 /**
393  * struct dp_mic_work - mic work info in dp
394  * @work: mic error work
395  * @status: sattus of mic error work
396  * @info: Pointer to mic error information
397  * @lock: lock to synchronixe mic error work
398  *
399  */
400 struct dp_mic_work {
401 	qdf_work_t work;
402 	enum dp_mic_work_status status;
403 	struct dp_mic_error_info *info;
404 	qdf_spinlock_t lock;
405 };
406 
407 enum dp_nud_state {
408 	DP_NUD_NONE,
409 	DP_NUD_INCOMPLETE,
410 	DP_NUD_REACHABLE,
411 	DP_NUD_STALE,
412 	DP_NUD_DELAY,
413 	DP_NUD_PROBE,
414 	DP_NUD_FAILED,
415 	DP_NUD_NOARP,
416 	DP_NUD_PERMANENT,
417 	DP_NUD_STATE_INVALID
418 };
419 
420 struct opaque_hdd_callback_handle;
421 /*
422  * typedef hdd_cb_handle - HDD Handle
423  *
424  * Handle to the HDD.  The HDD handle is given to the DP component from the
425  * HDD during start modules.  The HDD handle is an input to all HDD function
426  * calls and represents an opaque handle to the HDD instance that is
427  * tied to the DP context
428  *
429  * The HDD must be able to derive it's internal instance structure
430  * pointer through this handle.
431  *
432  * NOTE WELL: struct opaque_hdd_callback_handle is not defined anywhere. This
433  * reference is used to help ensure that a hdd_cb_handle is never used
434  * where a different handle type is expected
435  */
436 typedef struct opaque_hdd_callback_handle *hdd_cb_handle;
437 
438 /**
439  * enum bus_bw_level - bus bandwidth vote levels
440  *
441  * @BUS_BW_LEVEL_NONE: No vote for bus bandwidth
442  * @BUS_BW_LEVEL_1: vote for level-1 bus bandwidth
443  * @BUS_BW_LEVEL_2: vote for level-2 bus bandwidth
444  * @BUS_BW_LEVEL_3: vote for level-3 bus bandwidth
445  * @BUS_BW_LEVEL_4: vote for level-4 bus bandwidth
446  * @BUS_BW_LEVEL_5: vote for level-5 bus bandwidth
447  * @BUS_BW_LEVEL_6: vote for level-6 bus bandwidth
448  * @BUS_BW_LEVEL_7: vote for level-7 bus bandwidth
449  * @BUS_BW_LEVEL_8: vote for level-8 bus bandwidth
450  * @BUS_BW_LEVEL_9: vote for level-9 bus bandwidth
451  * @BUS_BW_LEVEL_MAX: vote for max level bus bandwidth
452  */
453 enum bus_bw_level {
454 	BUS_BW_LEVEL_NONE,
455 	BUS_BW_LEVEL_1,
456 	BUS_BW_LEVEL_2,
457 	BUS_BW_LEVEL_3,
458 	BUS_BW_LEVEL_4,
459 	BUS_BW_LEVEL_5,
460 	BUS_BW_LEVEL_6,
461 	BUS_BW_LEVEL_7,
462 	BUS_BW_LEVEL_8,
463 	BUS_BW_LEVEL_9,
464 	BUS_BW_LEVEL_MAX,
465 };
466 
467 #define BUS_BW_LEVEL_RESUME BUS_BW_LEVEL_3
468 
469 /**
470  * enum tput_level - throughput levels
471  *
472  * @TPUT_LEVEL_NONE: No throughput
473  * @TPUT_LEVEL_IDLE: idle throughtput level
474  * @TPUT_LEVEL_LOW: low throughput level
475  * @TPUT_LEVEL_MEDIUM: medium throughtput level
476  * @TPUT_LEVEL_HIGH: high throughput level
477  * @TPUT_LEVEL_MID_HIGH: mid high throughput level
478  * @TPUT_LEVEL_VERY_HIGH: very high throughput level
479  * @TPUT_LEVEL_ULTRA_HIGH: ultra high throughput level
480  * @TPUT_LEVEL_SUPER_HIGH: super high throughput level
481  * @TPUT_LEVEL_MAX: maximum throughput level
482  */
483 enum tput_level {
484 	TPUT_LEVEL_NONE,
485 	TPUT_LEVEL_IDLE,
486 	TPUT_LEVEL_LOW,
487 	TPUT_LEVEL_MEDIUM,
488 	TPUT_LEVEL_HIGH,
489 	TPUT_LEVEL_MID_HIGH,
490 	TPUT_LEVEL_VERY_HIGH,
491 	TPUT_LEVEL_ULTRA_HIGH,
492 	TPUT_LEVEL_SUPER_HIGH,
493 	TPUT_LEVEL_MAX,
494 };
495 
496 /**
497  * enum bbm_non_per_flag - Non persistent policy related flag
498  *
499  * @BBM_APPS_RESUME: system resume flag
500  * @BBM_APPS_SUSPEND: system suspend flag
501  * @BBM_FLAG_MAX: maximum flag
502  */
503 enum bbm_non_per_flag {
504 	BBM_APPS_RESUME,
505 	BBM_APPS_SUSPEND,
506 	BBM_FLAG_MAX,
507 };
508 
509 /**
510  * enum bbm_policy - BBM policy
511  *
512  * @BBM_DRIVER_MODE_POLICY: driver mode policy
513  * @BBM_TPUT_POLICY: throughput policy
514  * @BBM_USER_POLICY: user policy
515  * @BBM_NON_PERSISTENT_POLICY: non persistent policy. For example, bus resume
516  *  sets the bus bw level to LEVEL_3 if any adapter is connected but
517  *  this is only a one time setting and is not persistent. This bus bw level
518  *  is set without taking other policy vote levels into consideration.
519  * @BBM_SELECT_TABLE_POLICY: policy where bus bw table is selected based on
520  *  the latency level.
521  * @BBM_MAX_POLICY: max policy
522  */
523 enum bbm_policy {
524 	BBM_DRIVER_MODE_POLICY,
525 	BBM_TPUT_POLICY,
526 	BBM_USER_POLICY,
527 	BBM_NON_PERSISTENT_POLICY,
528 	BBM_SELECT_TABLE_POLICY,
529 	BBM_MAX_POLICY,
530 };
531 
532 /**
533  * enum wlm_ll_level - WLM latency levels
534  *
535  * @WLM_LL_NORMAL: normal latency level
536  * @WLM_LL_LOW: low latency level
537  * @WLM_LL_MAX: max latency level
538  */
539 enum wlm_ll_level {
540 	WLM_LL_NORMAL,
541 	WLM_LL_LOW,
542 	WLM_LL_MAX,
543 };
544 
545 /**
546  * union bbm_policy_info - BBM policy specific info. Only one of the value
547  *  would be valid based on the BBM policy.
548  *
549  * @driver_mode: global driver mode. valid for BBM_DRIVER_MODE_POLICY.
550  * @flag: BBM non persistent flag. valid for BBM_NON_PERSISTENT_POLICY.
551  * @tput_level: throughput level. valid for BBM_TPUT_POLICY.
552  * @wlm_level: latency level. valid for BBM_WLM_POLICY.
553  * @user_level: user bus bandwidth vote. valid for BBM_USER_POLICY.
554  * @set: set or reset user level. valid for BBM_USER_POLICY.
555  * @usr: user specific info
556  */
557 union bbm_policy_info {
558 	enum QDF_GLOBAL_MODE driver_mode;
559 	enum bbm_non_per_flag flag;
560 	enum tput_level tput_level;
561 	enum wlm_ll_level wlm_level;
562 	struct {
563 		enum bus_bw_level user_level;
564 		bool set;
565 	} usr;
566 };
567 
568 /**
569  * struct bbm_params: BBM params
570  *
571  * @policy: BBM policy
572  * @policy_info: policy related info
573  */
574 struct bbm_params {
575 	enum bbm_policy policy;
576 	union bbm_policy_info policy_info;
577 };
578 
579 /**
580  * union wlan_tp_data: union of TCP msg for Tx and Rx Dir
581  * @tx_tp_data: msg to TCP for Tx Dir
582  * @rx_tp_data: msg to TCP for Rx Dir
583  */
584 union wlan_tp_data {
585 	struct wlan_tx_tp_data tx_tp_data;
586 	struct wlan_rx_tp_data rx_tp_data;
587 };
588 
589 /**
590  * struct wlan_dp_psoc_callbacks - struct containing callback
591  * to non-converged driver
592  * @callback_ctx : Opaque callback context
593  * @dp_get_netdev_by_vdev_mac: Callback to get netdev from vdev mac address
594  * @dp_get_tx_flow_low_watermark: Callback to get TX flow low watermark info
595  * @dp_get_tx_resource: Callback to check tx resources and take action
596  * @dp_get_tsf_time: Callback to get TSF time
597  * @dp_tsf_timestamp_rx: Callback to set rx packet timestamp
598  * @dp_nbuf_push_pkt: Callback to push rx pkt to network
599  * @dp_rx_napi_gro_flush: OS IF Callback to GRO RX/flush function.
600  * @dp_rx_thread_napi_gro_flush: OS IF Callback to do gro flush
601  * @dp_rx_napi_gro_receive: OS IF Callback for GRO RX receive function.
602  * @dp_lro_rx_cb: OS IF Callback for LRO receive function
603  * @dp_gro_rx_legacy_get_napi: Callback to get napi in legacy gro case
604  * @dp_register_rx_offld_flush_cb: OS IF Callback to get rx offld flush cb
605  * @dp_rx_check_qdisc_configured: OS IF Callback to check if any ingress qdisc
606  * configured
607  * @dp_is_gratuitous_arp_unsolicited_na: OS IF Callback to check gratuitous arp
608  * unsolicited na
609  * @dp_send_rx_pkt_over_nl: OS IF Callback to send rx pkt over nl
610  * @dp_disable_rx_ol_for_low_tput: Callback to disable Rx offload in low TPUT
611  * scenario
612  * @wlan_dp_sta_get_dot11mode: Callback to get dot11 mode
613  * @wlan_dp_get_ap_client_count: Callback to get client count connected to AP
614  * @wlan_dp_sta_ndi_connected: Callback to get NDI connected status
615  * @dp_any_adapter_connected: Callback to check if any adapter is connected
616  * @dp_send_svc_nlink_msg: Callback API to send svc nlink message
617  * @osif_dp_send_tcp_param_update_event: OS IF callback to send TCP param
618  * @dp_send_mscs_action_frame: Callback to send MSCS action frame
619  * @dp_pm_qos_add_request: Callback to send add pm qos request
620  * @dp_pm_qos_remove_request: Callback to send remove pm qos request
621  * @dp_pm_qos_update_request: Callback to send update pm qos request
622  * @dp_pld_remove_pm_qos: Callback to send remove pld pm qos request
623  * @dp_pld_request_pm_qos: Callback to send pld pm qos request
624  * @dp_pktlog_enable_disable:Callback to set packet log
625  * @dp_is_roaming_in_progress:Callback to check if roaming is in progress
626  * @dp_is_ap_active:Callback to check if AP is active
627  * @dp_napi_apply_throughput_policy:Callback to apply NAPI throughput policy
628  * @wlan_dp_display_tx_multiq_stats: Callback to display Tx Mulit queue stats
629  * @wlan_dp_display_netif_queue_history: Callback to display Netif queue
630  * history
631  * @osif_dp_process_mic_error: osif callback to process MIC error
632  * @dp_is_link_adapter: Callback API to check if adapter is link adapter
633  * @os_if_dp_nud_stats_info: osif callback to print nud stats info
634  * @dp_get_pause_map: Callback API to get pause map count
635  * @dp_nud_failure_work: Callback API to handle NUD failuire work
636  * @link_monitoring_cb: Callback API to handle link speed change
637  */
638 struct wlan_dp_psoc_callbacks {
639 	hdd_cb_handle callback_ctx;
640 
641 	qdf_netdev_t (*dp_get_netdev_by_vdev_mac)(struct qdf_mac_addr *mac_addr);
642 	unsigned int (*dp_get_tx_flow_low_watermark)(hdd_cb_handle cb_ctx,
643 						     qdf_netdev_t netdev);
644 	void (*dp_get_tx_resource)(uint8_t link_id_id,
645 				   struct qdf_mac_addr *mac_addr);
646 	void (*dp_get_tsf_time)(qdf_netdev_t netdev, uint64_t input_time,
647 				uint64_t *tsf_time);
648 	void (*dp_tsf_timestamp_rx)(hdd_cb_handle ctx, qdf_nbuf_t nbuf);
649 
650 	QDF_STATUS (*dp_nbuf_push_pkt)(qdf_nbuf_t nbuf,
651 				       enum dp_nbuf_push_type type);
652 
653 	QDF_STATUS (*dp_rx_napi_gro_flush)(qdf_napi_struct *napi_to_use,
654 					   qdf_nbuf_t nbuf,
655 					   uint8_t *force_flush);
656 	void
657 	(*dp_rx_thread_napi_gro_flush)(qdf_napi_struct *napi,
658 				       enum dp_rx_gro_flush_code flush_code);
659 	QDF_STATUS (*dp_rx_napi_gro_receive)(qdf_napi_struct *napi_to_use,
660 					     qdf_nbuf_t nbuf);
661 
662 	QDF_STATUS (*dp_lro_rx_cb)(qdf_netdev_t netdev, qdf_nbuf_t nbuf);
663 
664 	qdf_napi_struct *(*dp_gro_rx_legacy_get_napi)(qdf_nbuf_t nbuf,
665 						      bool enable_rx_thread);
666 
667 	void (*dp_register_rx_offld_flush_cb)(enum dp_rx_offld_flush_cb type);
668 
669 	QDF_STATUS (*dp_rx_check_qdisc_configured)(qdf_netdev_t dev,
670 						   uint32_t prio);
671 
672 	bool (*dp_is_gratuitous_arp_unsolicited_na)(qdf_nbuf_t nbuf);
673 
674 	bool (*dp_send_rx_pkt_over_nl)(qdf_netdev_t dev, uint8_t *addr,
675 				       qdf_nbuf_t nbuf, bool unecrypted);
676 	bool
677 	(*wlan_dp_sta_get_dot11mode)(hdd_cb_handle context, qdf_netdev_t netdev,
678 				     enum qca_wlan_802_11_mode *dot11_mode);
679 	bool (*wlan_dp_get_ap_client_count)(hdd_cb_handle context,
680 					    qdf_netdev_t netdev,
681 					    uint16_t *client_count);
682 	bool (*wlan_dp_sta_ndi_connected)(hdd_cb_handle context,
683 					  qdf_netdev_t netdev);
684 	bool (*dp_any_adapter_connected)(hdd_cb_handle context);
685 	void (*dp_send_svc_nlink_msg)(int radio, int type, void *data, int len);
686 
687 	void
688 	(*osif_dp_send_tcp_param_update_event)(struct wlan_objmgr_psoc *psoc,
689 					       union wlan_tp_data *data,
690 					       uint8_t dir);
691 	void (*dp_send_mscs_action_frame)(hdd_cb_handle context,
692 					  qdf_netdev_t netdev);
693 	void (*dp_pm_qos_add_request)(hdd_cb_handle context);
694 	void (*dp_pm_qos_remove_request)(hdd_cb_handle context);
695 	void (*dp_pm_qos_update_request)(hdd_cb_handle context,
696 					 cpumask_t *mask);
697 	void (*dp_pld_remove_pm_qos)(hdd_cb_handle context);
698 	void (*dp_pld_request_pm_qos)(hdd_cb_handle context);
699 	int (*dp_pktlog_enable_disable)(hdd_cb_handle context,
700 					bool enable_disable_flag,
701 					uint8_t user_triggered, int size);
702 	bool (*dp_is_roaming_in_progress)(hdd_cb_handle context);
703 	bool (*dp_is_ap_active)(hdd_cb_handle context, qdf_netdev_t netdev);
704 	void (*dp_disable_rx_ol_for_low_tput)(hdd_cb_handle context,
705 					      bool disable);
706 	int (*dp_napi_apply_throughput_policy)(hdd_cb_handle context,
707 					       uint64_t tx_packets,
708 					       uint64_t rx_packets);
709 	void (*wlan_dp_display_tx_multiq_stats)(hdd_cb_handle context,
710 						qdf_netdev_t netdev);
711 	void (*wlan_dp_display_netif_queue_history)(hdd_cb_handle context,
712 				enum qdf_stats_verbosity_level verb_lvl);
713 	void (*osif_dp_process_mic_error)(struct dp_mic_error_info *info,
714 					  struct wlan_objmgr_vdev *vdev);
715 	bool (*dp_is_link_adapter)(hdd_cb_handle context, uint8_t vdev_id);
716 	void (*os_if_dp_nud_stats_info)(struct wlan_objmgr_vdev *vdev);
717 	uint32_t (*dp_get_pause_map)(hdd_cb_handle context, qdf_netdev_t dev);
718 	void (*dp_nud_failure_work)(hdd_cb_handle context, qdf_netdev_t dev);
719 	void (*link_monitoring_cb)(struct wlan_objmgr_psoc *psoc,
720 				   uint8_t vdev_id,
721 				   bool is_link_speed_good);
722 };
723 
724 /**
725  * struct wlan_dp_psoc_sb_ops - struct containing callback
726  * to south bound APIs. callbacks to call traget_if APIs
727  * @dp_arp_stats_register_event_handler: Callback to register
728  * arp stas WMI handle
729  * @dp_arp_stats_unregister_event_handler: Callback to unregister
730  * arp stas WMI handle
731  * @dp_get_arp_req_stats: Callback to get arp stats
732  * @dp_set_arp_req_stats: Callback to  set arp stats
733  * @arp_request_ctx: ARP request context
734  * @dp_lro_config_cmd: Callback to  send LRO config command
735  * @dp_send_dhcp_ind: Callback to send DHCP indication
736  */
737 struct wlan_dp_psoc_sb_ops {
738 	/*TODO to add target if TX ops*/
739 	QDF_STATUS (*dp_arp_stats_register_event_handler)(struct wlan_objmgr_psoc *psoc);
740 	QDF_STATUS (*dp_arp_stats_unregister_event_handler)(struct wlan_objmgr_psoc *psoc);
741 	QDF_STATUS (*dp_get_arp_req_stats)(struct wlan_objmgr_psoc *psoc,
742 					   struct dp_get_arp_stats_params *req_buf);
743 	QDF_STATUS (*dp_set_arp_req_stats)(struct wlan_objmgr_psoc *psoc,
744 					   struct dp_set_arp_stats_params *req_buf);
745 	void *arp_request_ctx;
746 	QDF_STATUS (*dp_lro_config_cmd)(struct wlan_objmgr_psoc *psoc,
747 					struct cdp_lro_hash_config *dp_lro_cmd);
748 	QDF_STATUS (*dp_send_dhcp_ind)(uint16_t vdev_id,
749 				       struct dp_dhcp_ind *dhcp_ind);
750 };
751 
752 /**
753  * struct wlan_dp_psoc_nb_ops - struct containing callback
754  * to north bound APIs. callbacks APIs to be called by target_if APIs
755  * @osif_dp_get_arp_stats_evt: Callback called on receiving arp stats event
756  */
757 struct wlan_dp_psoc_nb_ops {
758 	/*TODO to add target if RX ops*/
759 	void (*osif_dp_get_arp_stats_evt)(struct wlan_objmgr_psoc *psoc,
760 					  struct dp_rsp_stats *rsp);
761 };
762 
763 /**
764  * struct wlan_dp_user_config - DP component user config
765  * @ipa_enable: IPA enabled/disabled config
766  * @arp_connectivity_map: ARP connectiviy map
767  */
768 struct wlan_dp_user_config {
769 	bool ipa_enable;
770 	uint32_t arp_connectivity_map;
771 };
772 
773 /**
774  * struct dp_traffic_end_indication - Traffic end indication
775  * @enabled: Feature enabled/disabled config
776  * @def_dscp: Default DSCP value in regular packets in traffic
777  * @spl_dscp: Special DSCP value to be used by packet to mark
778  *            end of data stream
779  */
780 struct dp_traffic_end_indication {
781 	bool enabled;
782 	uint8_t def_dscp;
783 	uint8_t spl_dscp;
784 };
785 #endif /* end  of _WLAN_DP_PUBLIC_STRUCT_H_ */
786