1 /*
2  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef __CDP_TXRX_MOB_DEF_H
21 #define __CDP_TXRX_MOB_DEF_H
22 #include <sir_types.h>
23 #include <htt.h>
24 
25 #define TX_WMM_AC_NUM	4
26 #define ENABLE_DP_HIST_STATS
27 #define DP_MEMORY_OPT
28 #ifndef CONFIG_BERYLLIUM
29 #define DP_USE_SINGLE_TCL
30 #endif
31 
32 #define DP_RX_DISABLE_NDI_MDNS_FORWARDING
33 
34 #define OL_TXQ_PAUSE_REASON_FW                (1 << 0)
35 #define OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED (1 << 1)
36 #define OL_TXQ_PAUSE_REASON_TX_ABORT          (1 << 2)
37 #define OL_TXQ_PAUSE_REASON_VDEV_STOP         (1 << 3)
38 #define OL_TXQ_PAUSE_REASON_THERMAL_MITIGATION (1 << 4)
39 
40 #define OL_TXRX_INVALID_NUM_PEERS (-1)
41 
42 
43 /* Maximum number of station supported by data path, including BC. */
44 #define WLAN_MAX_STA_COUNT  (HAL_NUM_STA)
45 
46 /* The symbolic station ID return to HDD to specify the packet is bc/mc */
47 #define WLAN_RX_BCMC_STA_ID (WLAN_MAX_STA_COUNT + 1)
48 
49 /* The symbolic station ID return to HDD to specify the packet is
50        to soft-AP itself */
51 #define WLAN_RX_SAP_SELF_STA_ID (WLAN_MAX_STA_COUNT + 2)
52 
53 /* is 802.11 address multicast/broadcast? */
54 #define IEEE80211_IS_MULTICAST(_a)  (*(_a) & 0x01)
55 
56 #define MAX_PEERS 32
57 
58 /*
59  * Bins used for reporting delay histogram:
60  * bin 0:  0 - 10  ms delay
61  * bin 1: 10 - 20  ms delay
62  * bin 2: 20 - 40  ms delay
63  * bin 3: 40 - 80  ms delay
64  * bin 4: 80 - 160 ms delay
65  * bin 5: > 160 ms delay
66  */
67 #define QCA_TX_DELAY_HIST_REPORT_BINS 6
68 
69 /* BA actions */
70 #define IEEE80211_ACTION_BA_ADDBA_REQUEST       0       /* ADDBA request */
71 #define IEEE80211_ACTION_BA_ADDBA_RESPONSE      1       /* ADDBA response */
72 #define IEEE80211_ACTION_BA_DELBA               2       /* DELBA */
73 
74 #define IEEE80211_BA_POLICY_DELAYED      0
75 #define IEEE80211_BA_POLICY_IMMEDIATE    1
76 #define IEEE80211_BA_AMSDU_SUPPORTED     1
77 
78 /**
79  * enum netif_action_type - Type of actions on netif queues
80  * @WLAN_NETIF_ACTION_TYPE_NONE: perform no action
81  * @WLAN_STOP_ALL_NETIF_QUEUE: stop all netif queues
82  * @WLAN_START_ALL_NETIF_QUEUE: start all netif queues
83  * @WLAN_WAKE_ALL_NETIF_QUEUE: wake all netif queues
84  * @WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER: stop all queues and off carrier
85  * @WLAN_START_ALL_NETIF_QUEUE_N_CARRIER: start all queues and on carrier
86  * @WLAN_NETIF_TX_DISABLE: disable tx
87  * @WLAN_NETIF_TX_DISABLE_N_CARRIER: disable tx and off carrier
88  * @WLAN_NETIF_CARRIER_ON: on carrier
89  * @WLAN_NETIF_CARRIER_OFF: off carrier
90  * @WLAN_NETIF_PRIORITY_QUEUE_ON: start priority netif queues
91  * @WLAN_NETIF_PRIORITY_QUEUE_OFF: stop priority netif queues
92  * @WLAN_NETIF_VO_QUEUE_ON: start voice queue
93  * @WLAN_NETIF_VO_QUEUE_OFF: stop voice queue
94  * @WLAN_NETIF_VI_QUEUE_ON: start video queue
95  * @WLAN_NETIF_VI_QUEUE_OFF: stop video queue
96  * @WLAN_NETIF_BE_BK_QUEUE_OFF: start best-effort & background queue
97  * @WLAN_NETIF_BE_BK_QUEUE_ON: stop best-effort & background queue
98  * @WLAN_WAKE_NON_PRIORITY_QUEUE: wake non priority netif queues
99  * @WLAN_STOP_NON_PRIORITY_QUEUE: stop non priority netif queues
100  * @WLAN_NETIF_ACTION_TYPE_MAX: Maximum action
101  */
102 enum netif_action_type {
103 	WLAN_NETIF_ACTION_TYPE_NONE = 0,
104 	WLAN_STOP_ALL_NETIF_QUEUE = 1,
105 	WLAN_START_ALL_NETIF_QUEUE = 2,
106 	WLAN_WAKE_ALL_NETIF_QUEUE = 3,
107 	WLAN_STOP_ALL_NETIF_QUEUE_N_CARRIER = 4,
108 	WLAN_START_ALL_NETIF_QUEUE_N_CARRIER = 5,
109 	WLAN_NETIF_TX_DISABLE = 6,
110 	WLAN_NETIF_TX_DISABLE_N_CARRIER = 7,
111 	WLAN_NETIF_CARRIER_ON = 8,
112 	WLAN_NETIF_CARRIER_OFF = 9,
113 	WLAN_NETIF_PRIORITY_QUEUE_ON = 10,
114 	WLAN_NETIF_PRIORITY_QUEUE_OFF = 11,
115 	WLAN_NETIF_VO_QUEUE_ON = 12,
116 	WLAN_NETIF_VO_QUEUE_OFF = 13,
117 	WLAN_NETIF_VI_QUEUE_ON = 14,
118 	WLAN_NETIF_VI_QUEUE_OFF = 15,
119 	WLAN_NETIF_BE_BK_QUEUE_OFF = 16,
120 	WLAN_NETIF_BE_BK_QUEUE_ON = 17,
121 	WLAN_WAKE_NON_PRIORITY_QUEUE = 18,
122 	WLAN_STOP_NON_PRIORITY_QUEUE = 19,
123 	WLAN_NETIF_ACTION_TYPE_MAX,
124 };
125 
126 /**
127  * enum netif_reason_type - reason for netif queue action
128  * @WLAN_CONTROL_PATH: action from control path
129  * @WLAN_DATA_FLOW_CONTROL: because of flow control
130  * @WLAN_FW_PAUSE: because of firmware pause
131  * @WLAN_TX_ABORT: because of tx abort
132  * @WLAN_VDEV_STOP: because of vdev stop
133  * @WLAN_PEER_UNAUTHORISED: because of peer is unauthorised
134  * @WLAN_THERMAL_MITIGATION: because of thermal mitigation
135  * @WLAN_DATA_FLOW_CONTROL_PRIORITY:
136  * @WLAN_DATA_FLOW_CTRL_BE_BK:
137  * @WLAN_DATA_FLOW_CTRL_VI:
138  * @WLAN_DATA_FLOW_CTRL_VO:
139  * @WLAN_DATA_FLOW_CTRL_PRI:
140  * @WLAN_REASON_TYPE_MAX: maximum reason
141  */
142 enum netif_reason_type {
143 	WLAN_CONTROL_PATH = 1,
144 	WLAN_DATA_FLOW_CONTROL,
145 	WLAN_FW_PAUSE,
146 	WLAN_TX_ABORT,
147 	WLAN_VDEV_STOP,
148 	WLAN_PEER_UNAUTHORISED,
149 	WLAN_THERMAL_MITIGATION,
150 	WLAN_DATA_FLOW_CONTROL_PRIORITY,
151 	WLAN_DATA_FLOW_CTRL_BE_BK,
152 	WLAN_DATA_FLOW_CTRL_VI,
153 	WLAN_DATA_FLOW_CTRL_VO,
154 	WLAN_DATA_FLOW_CTRL_PRI,
155 	WLAN_REASON_TYPE_MAX,
156 };
157 
158 enum ol_rx_err_type {
159 	OL_RX_ERR_DEFRAG_MIC,
160 	OL_RX_ERR_PN,
161 	OL_RX_ERR_UNKNOWN_PEER,
162 	OL_RX_ERR_MALFORMED,
163 	OL_RX_ERR_TKIP_MIC,
164 	OL_RX_ERR_DECRYPT,
165 	OL_RX_ERR_MPDU_LENGTH,
166 	OL_RX_ERR_ENCRYPT_REQUIRED,
167 	OL_RX_ERR_DUP,
168 	OL_RX_ERR_UNKNOWN,
169 	OL_RX_ERR_FCS,
170 	OL_RX_ERR_PRIVACY,
171 	OL_RX_ERR_NONE_FRAG,
172 	OL_RX_ERR_NONE = 0xFF
173 };
174 
175 enum throttle_level {
176 	THROTTLE_LEVEL_0,
177 	THROTTLE_LEVEL_1,
178 	THROTTLE_LEVEL_2,
179 	THROTTLE_LEVEL_3,
180 	THROTTLE_LEVEL_4,
181 	THROTTLE_LEVEL_5,
182 	/* Invalid */
183 	THROTTLE_LEVEL_MAX,
184 };
185 
186 enum {
187 	OL_TX_WMM_AC_BE,
188 	OL_TX_WMM_AC_BK,
189 	OL_TX_WMM_AC_VI,
190 	OL_TX_WMM_AC_VO,
191 	OL_TX_NUM_WMM_AC
192 };
193 
194 /**
195  * enum ol_tx_spec - indicate what non-standard transmission actions to apply
196  * @OL_TX_SPEC_STD: do regular processing
197  * @OL_TX_SPEC_RAW: skip encap + A-MSDU aggr
198  * @OL_TX_SPEC_NO_AGGR: skip encap + all aggr
199  * @OL_TX_SPEC_NO_ENCRYPT: skip encap + encrypt
200  * @OL_TX_SPEC_TSO: TCP segmented
201  * @OL_TX_SPEC_NWIFI_NO_ENCRYPT: skip encrypt for nwifi
202  * @OL_TX_SPEC_NO_FREE: give to cb rather than free
203  *
204  *  Indicate one or more of the following:
205  *    - The tx frame already has a complete 802.11 header.
206  *      Thus, skip 802.3/native-WiFi to 802.11 header encapsulation and
207  *      A-MSDU aggregation.
208  *    - The tx frame should not be aggregated (A-MPDU or A-MSDU)
209  *    - The tx frame is already encrypted - don't attempt encryption.
210  *    - The tx frame is a segment of a TCP jumbo frame.
211  *    - This tx frame should not be unmapped and freed by the txrx layer
212  *      after transmission, but instead given to a registered tx completion
213  *      callback.
214  *  More than one of these specification can apply, though typically
215  *  only a single specification is applied to a tx frame.
216  *  A compound specification can be created, as a bit-OR of these
217  *  specifications.
218  */
219 enum ol_tx_spec {
220 	OL_TX_SPEC_STD = 0x0,   /* do regular processing */
221 	OL_TX_SPEC_RAW = 0x1,   /* skip encap + A-MSDU aggr */
222 	OL_TX_SPEC_NO_AGGR = 0x2,       /* skip encap + all aggr */
223 	OL_TX_SPEC_NO_ENCRYPT = 0x4,    /* skip encap + encrypt */
224 	OL_TX_SPEC_TSO = 0x8,   /* TCP segmented */
225 	OL_TX_SPEC_NWIFI_NO_ENCRYPT = 0x10,     /* skip encrypt for nwifi */
226 	OL_TX_SPEC_NO_FREE = 0x20,      /* give to cb rather than free */
227 };
228 
229 /**
230  * enum peer_debug_id_type - debug ids to track peer get_ref and release_ref
231  * @PEER_DEBUG_ID_OL_INTERNAL: debug id for OL internal usage
232  * @PEER_DEBUG_ID_WMA_PKT_DROP: debug id for wma_is_pkt_drop_candidate API
233  * @PEER_DEBUG_ID_WMA_ADDBA_REQ: debug id for ADDBA request
234  * @PEER_DEBUG_ID_WMA_DELBA_REQ: debug id for DELBA request
235  * @PEER_DEBUG_ID_LIM_SEND_ADDBA_RESP: debug id for send ADDBA response
236  * @PEER_DEBUG_ID_OL_RX_THREAD: debug id for rx thread
237  * @PEER_DEBUG_ID_WMA_CCMP_REPLAY_ATTACK: debug id for CCMP replay
238  * @PEER_DEBUG_ID_WMA_DEL_BSS:debug id for remove BSS
239  * @PEER_DEBUG_ID_WMA_VDEV_STOP_RESP:debug id for vdev stop response handler
240  * @PEER_DEBUG_ID_OL_PEER_MAP:debug id for peer map/unmap
241  * @PEER_DEBUG_ID_OL_PEER_ATTACH: debug id for peer attach/detach
242  * @PEER_DEBUG_ID_OL_TXQ_VDEV_FL: debug id for vdev flush
243  * @PEER_DEBUG_ID_OL_HASH_ERS: debug id for peer find hash erase
244  * @PEER_DEBUG_ID_OL_UNMAP_TIMER_WORK: debug id for peer unmap timer work
245  * @PEER_DEBUG_ID_MAX: debug id MAX
246  *
247  * Unique peer debug IDs to track the callers. Each new usage can add to
248  * this enum list to create a new "PEER_DEBUG_ID_".
249  */
250 enum peer_debug_id_type {
251 	PEER_DEBUG_ID_OL_INTERNAL,
252 	PEER_DEBUG_ID_WMA_PKT_DROP,
253 	PEER_DEBUG_ID_WMA_ADDBA_REQ,
254 	PEER_DEBUG_ID_WMA_DELBA_REQ,
255 	PEER_DEBUG_ID_LIM_SEND_ADDBA_RESP,
256 	PEER_DEBUG_ID_OL_RX_THREAD,
257 	PEER_DEBUG_ID_WMA_CCMP_REPLAY_ATTACK,
258 	PEER_DEBUG_ID_WMA_DEL_BSS,
259 	PEER_DEBUG_ID_WMA_VDEV_STOP_RESP,
260 	PEER_DEBUG_ID_OL_PEER_MAP,
261 	PEER_DEBUG_ID_OL_PEER_ATTACH,
262 	PEER_DEBUG_ID_OL_TXQ_VDEV_FL,
263 	PEER_DEBUG_ID_OL_HASH_ERS,
264 	PEER_DEBUG_ID_OL_UNMAP_TIMER_WORK,
265 	PEER_DEBUG_ID_MAX
266 };
267 
268 /**
269  * enum cdp_peer_bw - Bandwidth types
270  * @CDP_20_MHZ: 20MHz BW
271  * @CDP_40_MHZ: 40MHz BW
272  * @CDP_80_MHZ: 80MHz BW
273  * @CDP_160_MHZ: 160MHz BW
274  * @CDP_80P80_MHZ: 80+80MHz BW
275  * @CDP_5_MHZ: 5MHz BW
276  * @CDP_10_MHZ: 10MHz BW
277  * @CDP_320_MHZ: 320MHz BW
278  * @CDP_BW_INVALID: Invalid BW
279  * @CDP_BW_MAX: Max BW id
280  */
281 enum cdp_peer_bw {
282 	CDP_20_MHZ,
283 	CDP_40_MHZ,
284 	CDP_80_MHZ,
285 	CDP_160_MHZ,
286 	CDP_80P80_MHZ,
287 	CDP_5_MHZ,
288 	CDP_10_MHZ,
289 	CDP_320_MHZ,
290 	CDP_BW_INVALID,
291 	CDP_BW_MAX
292 };
293 
294 /**
295  * struct ol_txrx_desc_type - txrx descriptor type
296  * @is_qos_enabled: is station qos enabled
297  * @is_wapi_supported: is station wapi supported
298  * @peer_addr: peer mac address
299  * @bw: bandwidth of peer connection
300  */
301 struct ol_txrx_desc_type {
302 	uint8_t is_qos_enabled;
303 	uint8_t is_wapi_supported;
304 	struct qdf_mac_addr peer_addr;
305 	enum cdp_peer_bw bw;
306 };
307 
308 /**
309  * struct ol_tx_sched_wrr_ac_specs_t - the wrr ac specs params structure
310  * @wrr_skip_weight: map to ol_tx_sched_wrr_adv_category_info_t.specs.
311  *                            wrr_skip_weight
312  * @credit_threshold: map to ol_tx_sched_wrr_adv_category_info_t.specs.
313  *                            credit_threshold
314  * @send_limit: map to ol_tx_sched_wrr_adv_category_info_t.specs.
315  *                            send_limit
316  * @credit_reserve: map to ol_tx_sched_wrr_adv_category_info_t.specs.
317  *                            credit_reserve
318  * @discard_weight: map to ol_tx_sched_wrr_adv_category_info_t.specs.
319  *                            discard_weight
320  *
321  * This structure is for wrr ac specs params set from user, it will update
322  * its content corresponding to the ol_tx_sched_wrr_adv_category_info_t.specs.
323  */
324 struct ol_tx_sched_wrr_ac_specs_t {
325 	int wrr_skip_weight;
326 	uint32_t credit_threshold;
327 	uint16_t send_limit;
328 	int credit_reserve;
329 	int discard_weight;
330 };
331 
332 /**
333  * struct txrx_pdev_cfg_param_t - configuration information
334  * passed to the data path
335  * @is_full_reorder_offload:
336  * @is_uc_offload_enabled: IPA Micro controller data path offload enable flag
337  * @uc_tx_buffer_count: IPA Micro controller data path offload TX buffer count
338  * @uc_tx_buffer_size: IPA Micro controller data path offload TX buffer size
339  * @uc_rx_indication_ring_count: IPA Micro controller data path offload RX
340  *                               indication ring count
341  * @uc_tx_partition_base: IPA Micro controller data path offload TX partition
342  *                        base
343  * @ip_tcp_udp_checksum_offload: IP, TCP and UDP checksum offload
344  * @nan_ip_tcp_udp_checksum_offload: IP, TCP and UDP checksum offload for NAN
345  *                                   Mode
346  * @p2p_ip_tcp_udp_checksum_offload: IP, TCP and UDP checksum offload for P2P
347  *                                   Mod
348  * @legacy_mode_csum_disable: Checksum offload override flag for Legcay modes
349  * @enable_rxthread: Rx processing in thread from TXRX
350  * @ce_classify_enabled: CE classification enabled through INI
351  * @tx_flow_stop_queue_th: Threshold to stop queue in percentage
352  * @tx_flow_start_queue_offset: Start queue offset in percentage
353  * @del_ack_enable: enable the tcp delay ack feature in the driver
354  * @del_ack_timer_value: timeout if no more tcp ack frames, unit is ms
355  * @del_ack_pkt_count: the maximum number of replaced tcp ack frames
356  * @ac_specs:
357  * @gro_enable:
358  * @tso_enable:
359  * @lro_enable:
360  * @sg_enable:
361  * @enable_data_stall_detection:
362  * @enable_flow_steering:
363  * @disable_intra_bss_fwd:
364  * @bundle_timer_value:
365  * @bundle_size:
366  * @pktlog_buffer_size:
367  */
368 struct txrx_pdev_cfg_param_t {
369 	uint8_t is_full_reorder_offload;
370 	uint8_t is_uc_offload_enabled;
371 	uint32_t uc_tx_buffer_count;
372 	uint32_t uc_tx_buffer_size;
373 	uint32_t uc_rx_indication_ring_count;
374 	uint32_t uc_tx_partition_base;
375 	bool ip_tcp_udp_checksum_offload;
376 	bool nan_ip_tcp_udp_checksum_offload;
377 	bool p2p_ip_tcp_udp_checksum_offload;
378 	bool legacy_mode_csum_disable;
379 	bool enable_rxthread;
380 	bool ce_classify_enabled;
381 #if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_LL_PDEV_TX_FLOW_CONTROL)
382 	uint32_t tx_flow_stop_queue_th;
383 	uint32_t tx_flow_start_queue_offset;
384 #endif
385 
386 #ifdef QCA_SUPPORT_TXRX_DRIVER_TCP_DEL_ACK
387 	bool  del_ack_enable;
388 	uint16_t del_ack_timer_value;
389 	uint16_t del_ack_pkt_count;
390 #endif
391 
392 	struct ol_tx_sched_wrr_ac_specs_t ac_specs[TX_WMM_AC_NUM];
393 	bool gro_enable;
394 	bool tso_enable;
395 	bool lro_enable;
396 	bool sg_enable;
397 	uint32_t enable_data_stall_detection;
398 	bool enable_flow_steering;
399 	bool disable_intra_bss_fwd;
400 
401 #ifdef WLAN_SUPPORT_TXRX_HL_BUNDLE
402 	uint16_t bundle_timer_value;
403 	uint16_t bundle_size;
404 #endif
405 	uint8_t pktlog_buffer_size;
406 };
407 
408 #ifdef IPA_OFFLOAD
409 /**
410  * struct ol_txrx_ipa_resources - Resources needed for IPA
411  * @ce_sr:
412  * @ce_sr_ring_size:
413  * @ce_reg_paddr:
414  * @tx_comp_ring:
415  * @tx_num_alloc_buffer:
416  * @rx_rdy_ring:
417  * @rx_proc_done_idx:
418  * @rx2_rdy_ring:
419  * @rx2_proc_done_idx:
420  * @tx_comp_doorbell_dmaaddr: IPA UC Tx Complete doorbell register paddr
421  * @rx_ready_doorbell_dmaaddr: IPA UC Rx Ready doorbell register paddr
422  * @tx_pipe_handle:
423  * @rx_pipe_handle:
424  */
425 struct ol_txrx_ipa_resources {
426 	qdf_shared_mem_t *ce_sr;
427 	uint32_t ce_sr_ring_size;
428 	qdf_dma_addr_t ce_reg_paddr;
429 
430 	qdf_shared_mem_t *tx_comp_ring;
431 	uint32_t tx_num_alloc_buffer;
432 
433 	qdf_shared_mem_t *rx_rdy_ring;
434 	qdf_shared_mem_t *rx_proc_done_idx;
435 
436 	qdf_shared_mem_t *rx2_rdy_ring;
437 	qdf_shared_mem_t *rx2_proc_done_idx;
438 
439 	/* IPA UC doorbell registers paddr */
440 	qdf_dma_addr_t tx_comp_doorbell_dmaaddr;
441 	qdf_dma_addr_t rx_ready_doorbell_dmaaddr;
442 
443 	uint32_t tx_pipe_handle;
444 	uint32_t rx_pipe_handle;
445 };
446 #endif
447 
448 struct ol_txrx_ocb_chan_info {
449 	uint32_t chan_freq;
450 	uint16_t disable_rx_stats_hdr:1;
451 };
452 
453 /**
454  * struct ol_mic_error_info - carries the information associated with
455  * a MIC error
456  * @vdev_id: virtual device ID
457  * @key_id: Key ID
458  * @pn: packet number
459  * @sa: source address
460  * @da: destination address
461  * @ta: transmitter address
462  */
463 struct ol_mic_error_info {
464 	uint8_t vdev_id;
465 	uint32_t key_id;
466 	uint64_t pn;
467 	uint8_t sa[QDF_MAC_ADDR_SIZE];
468 	uint8_t da[QDF_MAC_ADDR_SIZE];
469 	uint8_t ta[QDF_MAC_ADDR_SIZE];
470 };
471 
472 /**
473  * struct ol_error_info - carries the information associated with an
474  * error indicated by the firmware
475  * @u: union of error information structs
476  * @u.mic_err: MIC error information
477  */
478 struct ol_error_info {
479 	union {
480 		struct ol_mic_error_info mic_err;
481 	} u;
482 };
483 
484 
485 /**
486  * struct ol_txrx_ocb_set_chan - txrx OCB channel info
487  * @ocb_channel_count: Channel count
488  * @ocb_channel_info: OCB channel info
489  */
490 struct ol_txrx_ocb_set_chan {
491 	uint32_t ocb_channel_count;
492 	struct ol_txrx_ocb_chan_info *ocb_channel_info;
493 };
494 
495 /**
496  * struct ol_tx_ac_param_t - WMM parameters
497  * @aifs: Arbitration Inter-Frame Space
498  * @cwmin: Minimum contention window size
499  * @cwmax: Maximum contention window size
500  *
501  * The struct is used to specify information to update TX WMM scheduler.
502  */
503 struct ol_tx_ac_param_t {
504 	uint32_t aifs;
505 	uint32_t cwmin;
506 	uint32_t cwmax;
507 };
508 
509 struct ol_tx_wmm_param_t {
510 	struct ol_tx_ac_param_t ac[OL_TX_NUM_WMM_AC];
511 };
512 
513 struct ieee80211_ba_parameterset {
514 #if _BYTE_ORDER == _BIG_ENDIAN
515 	uint16_t buffersize:10, /* B6-15  buffer size */
516 		 tid:4,       /* B2-5   TID */
517 		 bapolicy:1,  /* B1   block ack policy */
518 		 amsdusupported:1; /* B0   amsdu supported */
519 #else
520 	uint16_t amsdusupported:1,      /* B0   amsdu supported */
521 		 bapolicy:1,  /* B1   block ack policy */
522 		 tid:4,       /* B2-5   TID */
523 		 buffersize:10; /* B6-15  buffer size */
524 #endif
525 } __packed;
526 
527 struct ieee80211_ba_seqctrl {
528 #if _BYTE_ORDER == _BIG_ENDIAN
529 	uint16_t startseqnum:12,        /* B4-15  starting sequence number */
530 		 fragnum:4;   /* B0-3  fragment number */
531 #else
532 	uint16_t fragnum:4,     /* B0-3  fragment number */
533 		 startseqnum:12; /* B4-15  starting sequence number */
534 #endif
535 } __packed;
536 
537 struct ieee80211_delba_parameterset {
538 #if _BYTE_ORDER == _BIG_ENDIAN
539 	uint16_t tid:4,         /* B12-15  tid */
540 		 initiator:1, /* B11     initiator */
541 		 reserved0:11; /* B0-10   reserved */
542 #else
543 	uint16_t reserved0:11,  /* B0-10   reserved */
544 		 initiator:1, /* B11     initiator */
545 		 tid:4;       /* B12-15  tid */
546 #endif
547 } __packed;
548 
549 /**
550  * typedef ol_txrx_vdev_peer_remove_cb() - wma_remove_peer callback
551  * @handle: callback handle
552  * @bssid: BSSID
553  * @vdev_id: virtual device ID
554  * @peer: peer
555  */
556 typedef void (*ol_txrx_vdev_peer_remove_cb)(void *handle, uint8_t *bssid,
557 		uint8_t vdev_id, void *peer);
558 
559 /**
560  * typedef tx_pause_callback() - OSIF function registered with the data path
561  * @vdev_id: virtual device id
562  * @action: tx pause action to take
563  * @reason: reason for the tx pause action
564  */
565 typedef void (*tx_pause_callback)(uint8_t vdev_id,
566 		enum netif_action_type action,
567 		enum netif_reason_type reason);
568 
569 /**
570  * struct ol_rx_inv_peer_params - rx invalid peer data parameters
571  * @vdev_id: Virtual device ID
572  * @ra: RX data receiver MAC address
573  * @ta: RX data transmitter MAC address
574  */
575 struct ol_rx_inv_peer_params {
576 	uint8_t vdev_id;
577 	uint8_t ra[QDF_MAC_ADDR_SIZE];
578 	uint8_t ta[QDF_MAC_ADDR_SIZE];
579 };
580 
581 /**
582  * struct cdp_txrx_ext_stats: dp extended stats
583  * @tx_msdu_enqueue: tx msdu queued to hw
584  * @tx_msdu_overflow: tx msdu overflow
585  * @rx_mpdu_received: rx mpdu processed by hw
586  * @rx_mpdu_delivered: rx mpdu received from hw
587  * @rx_mpdu_error: rx mpdu error count
588  * @rx_mpdu_missed: rx mpdu missed by hw
589  */
590 struct cdp_txrx_ext_stats {
591 	uint32_t tx_msdu_enqueue;
592 	uint32_t tx_msdu_overflow;
593 	uint32_t rx_mpdu_received;
594 	uint32_t rx_mpdu_delivered;
595 	uint32_t rx_mpdu_error;
596 	uint32_t rx_mpdu_missed;
597 };
598 
599 #endif /* __CDP_TXRX_MOB_DEF_H */
600