xref: /wlan-dirver/qca-wifi-host-cmn/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h (revision 2f4b444fb7e689b83a4ab0e7b3b38f0bf4def8e0)
1 /*
2  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _WLAN_MGMT_TXRX_UTILS_API_H_
20 #define _WLAN_MGMT_TXRX_UTILS_API_H_
21 
22 /**
23  * DOC:  wlan_mgmt_txrx_utils_api.h
24  *
25  * management tx/rx layer public API and structures
26  * for umac converged components.
27  *
28  */
29 
30 #include "wlan_objmgr_cmn.h"
31 #include "qdf_nbuf.h"
32 #include "wlan_mgmt_txrx_rx_reo_public_structs.h"
33 
34 #define mgmt_txrx_alert(params...) \
35 	QDF_TRACE_FATAL(QDF_MODULE_ID_MGMT_TXRX, params)
36 #define mgmt_txrx_err(params...) \
37 	QDF_TRACE_ERROR(QDF_MODULE_ID_MGMT_TXRX, params)
38 #define mgmt_txrx_warn(params...) \
39 	QDF_TRACE_WARN(QDF_MODULE_ID_MGMT_TXRX, params)
40 #define mgmt_txrx_notice(params...) \
41 	QDF_TRACE_INFO(QDF_MODULE_ID_MGMT_TXRX, params)
42 #define mgmt_txrx_info(params...) \
43 	QDF_TRACE_INFO(QDF_MODULE_ID_MGMT_TXRX, params)
44 #define mgmt_txrx_debug(params...) \
45 	QDF_TRACE_DEBUG(QDF_MODULE_ID_MGMT_TXRX, params)
46 #define mgmt_txrx_err_rl(params...) \
47 	QDF_TRACE_ERROR_RL(QDF_MODULE_ID_MGMT_TXRX, params)
48 #define mgmt_txrx_debug_rl(params...) \
49 	QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_MGMT_TXRX, params)
50 
51 #define mgmttxrx_nofl_alert(params...) \
52 	QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_MGMT_TXRX, params)
53 #define mgmttxrx_nofl_err(params...) \
54 	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_MGMT_TXRX, params)
55 #define mgmttxrx_nofl_warn(params...) \
56 	QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_MGMT_TXRX, params)
57 #define mgmttxrx_nofl_info(params...) \
58 	QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_MGMT_TXRX, params)
59 #define mgmttxrx_nofl_debug(params...) \
60 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_MGMT_TXRX, params)
61 
62 /**
63  * enum mgmt_subtype - enum of mgmt. subtypes
64  * @MGMT_SUBTYPE_ASSOC_REQ:       association request frame
65  * @MGMT_SUBTYPE_ASSOC_RESP:      association response frame
66  * @MGMT_SUBTYPE_REASSOC_REQ:     reassociation request frame
67  * @MGMT_SUBTYPE_REASSOC_RESP:    reassociation response frame
68  * @MGMT_SUBTYPE_PROBE_REQ:       probe request frame
69  * @MGMT_SUBTYPE_PROBE_RESP:      probe response frame
70  * @MGMT_SUBTYPE_BEACON:          beacon frame
71  * @MGMT_SUBTYPE_ATIM:            ATIM frame
72  * @MGMT_SUBTYPE_DISASSOC:        disassociation frame
73  * @MGMT_SUBTYPE_AUTH:            authentication frame
74  * @MGMT_SUBTYPE_DEAUTH:          deauthentication frame
75  * @MGMT_SUBTYPE_ACTION:          action frame
76  * @MGMT_SUBTYPE_ACTION_NO_ACK:   action no ack frame
77  */
78 enum mgmt_subtype {
79 	MGMT_SUBTYPE_ASSOC_REQ = 0x00,
80 	MGMT_SUBTYPE_ASSOC_RESP = 0x10,
81 	MGMT_SUBTYPE_REASSOC_REQ = 0x20,
82 	MGMT_SUBTYPE_REASSOC_RESP = 0x30,
83 	MGMT_SUBTYPE_PROBE_REQ = 0x40,
84 	MGMT_SUBTYPE_PROBE_RESP = 0x50,
85 	MGMT_SUBTYPE_BEACON = 0x80,
86 	MGMT_SUBTYPE_ATIM = 0x90,
87 	MGMT_SUBTYPE_DISASSOC = 0xa0,
88 	MGMT_SUBTYPE_AUTH = 0xb0,
89 	MGMT_SUBTYPE_DEAUTH = 0xc0,
90 	MGMT_SUBTYPE_ACTION = 0xd0,
91 	MGMT_SUBTYPE_ACTION_NO_ACK = 0xe0,
92 };
93 
94 /**
95  * enum mgmt_action_category - mgmt. action categories
96  * @ACTION_CATEGORY_SPECTRUM_MGMT:  spectrum mgmt. action category
97  * @ACTION_CATEGORY_QOS: qos action category
98  * @ACTION_CATEGORY_DLS: dls action category
99  * @ACTION_CATEGORY_BACK: block ack action category
100  * @ACTION_CATEGORY_PUBLIC: public action category
101  * @ACTION_CATEGORY_RRM: rrm action category
102  * @ACTION_FAST_BSS_TRNST: trnst action category
103  * @ACTION_CATEGORY_HT: ht actipon category
104  * @ACTION_CATEGORY_SA_QUERY: sa query action category
105  * @ACTION_CATEGORY_PROTECTED_DUAL_OF_PUBLIC_ACTION: protected
106  *                           public action category
107  * @ACTION_CATEGORY_WNM: wnm action category
108  * @ACTION_CATEGORY_WNM_UNPROTECTED: wnm protected action category
109  * @ACTION_CATEGORY_TDLS: tdls action category
110  * @ACTION_CATEGORY_MESH_ACTION: mesh action category
111  * @ACTION_CATEGORY_MULTIHOP_ACTION: multihop action category
112  * @ACTION_CATEGORY_SELF_PROTECTED: self protected action category
113  * @ACTION_CATEGORY_DMG: unprotected dmg action category
114  * @ACTION_CATEGORY_WMM: wmm action category
115  * @ACTION_CATEGORY_FST: fst action category
116  * @ACTION_CATEGORY_RVS: robust av streaming action category
117  * @ACTION_CATEGORY_UNPROT_DMG: dmg action category
118  * @ACTION_CATEGORY_VHT: vht action category
119  * @ACTION_CATEGORY_USIG: Unprotected S1G Action frame
120  * @ACTION_CATEGORY_SIG: S1G Action frame
121  * @ACTION_CATEGORY_FLOW_CONTROL: Flow Control Action frame
122  * @ACTION_CATEGORY_CONTROL_RSP_MCS_NEGO: Control Response MCS Negotiation frame
123  * @ACTION_CATEGORY_FIL: FILS Action frame
124  * @ACTION_CATEGORY_CDMG: CDMG Action frame
125  * @ACTION_CATEGORY_CMMG: CMMG Action frame
126  * @ACTION_CATEGORY_GLK: GLK Action frame
127  * @ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED: vendor specific protected
128  *                                             action category
129  * @ACTION_CATEGORY_VENDOR_SPECIFIC: vendor specific action category
130  */
131 enum mgmt_action_category {
132 	ACTION_CATEGORY_SPECTRUM_MGMT = 0,
133 	ACTION_CATEGORY_QOS = 1,
134 	ACTION_CATEGORY_DLS = 2,
135 	ACTION_CATEGORY_BACK = 3,
136 	ACTION_CATEGORY_PUBLIC = 4,
137 	ACTION_CATEGORY_RRM = 5,
138 	ACTION_FAST_BSS_TRNST = 6,
139 	ACTION_CATEGORY_HT = 7,
140 	ACTION_CATEGORY_SA_QUERY = 8,
141 	ACTION_CATEGORY_PROTECTED_DUAL_OF_PUBLIC_ACTION = 9,
142 	ACTION_CATEGORY_WNM = 10,
143 	ACTION_CATEGORY_WNM_UNPROTECTED = 11,
144 	ACTION_CATEGORY_TDLS = 12,
145 	ACTION_CATEGORY_MESH_ACTION = 13,
146 	ACTION_CATEGORY_MULTIHOP_ACTION = 14,
147 	ACTION_CATEGORY_SELF_PROTECTED = 15,
148 	ACTION_CATEGORY_DMG = 16,
149 	ACTION_CATEGORY_WMM = 17,
150 	ACTION_CATEGORY_FST = 18,
151 	ACTION_CATEGORY_RVS = 19,
152 	ACTION_CATEGORY_UNPROT_DMG = 20,
153 	ACTION_CATEGORY_VHT = 21,
154 	ACTION_CATEGORY_USIG = 22,
155 	ACTION_CATEGORY_SIG = 23,
156 	ACTION_CATEGORY_FLOW_CONTROL = 24,
157 	ACTION_CATEGORY_CONTROL_RSP_MCS_NEGO = 25,
158 	ACTION_CATEGORY_FILS = 26,
159 	ACTION_CATEGORY_CDMG = 27,
160 	ACTION_CATEGORY_CMMG = 28,
161 	ACTION_CATEGORY_GLK = 29,
162 	ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
163 	ACTION_CATEGORY_VENDOR_SPECIFIC = 127,
164 };
165 
166 /**
167  * enum spectrum_mgmt_actioncode - spectrum mgmt. action frms
168  * @ACTION_SPCT_MSR_REQ:  spectrum measurement request frame
169  * @ACTION_SPCT_MSR_RPRT: spectrum measurement report frame
170  * @ACTION_SPCT_TPC_REQ: spectrum tpc request frame
171  * @ACTION_SPCT_TPC_RPRT: spectrum tpc report frame
172  * @ACTION_SPCT_CHL_SWITCH: spectrum channel switch frame
173  */
174 enum spectrum_mgmt_actioncode {
175 	ACTION_SPCT_MSR_REQ,
176 	ACTION_SPCT_MSR_RPRT,
177 	ACTION_SPCT_TPC_REQ,
178 	ACTION_SPCT_TPC_RPRT,
179 	ACTION_SPCT_CHL_SWITCH,
180 };
181 
182 /**
183  * enum qos_actioncode - qos action frames
184  * @QOS_ADD_TS_REQ:  qos add ts request frame
185  * @QOS_ADD_TS_RSP: qos add ts response frame
186  * @QOS_DEL_TS_REQ: qos del ts request frame
187  * @QOS_SCHEDULE: qos schecule frame
188  * @QOS_MAP_CONFIGURE: qos map configure frame
189  */
190 enum qos_actioncode {
191 	QOS_ADD_TS_REQ,
192 	QOS_ADD_TS_RSP,
193 	QOS_DEL_TS_REQ,
194 	QOS_SCHEDULE,
195 	QOS_MAP_CONFIGURE,
196 };
197 
198 /**
199  * enum dls_actioncode - dls action frames
200  * @DLS_REQUEST:  dls request frame
201  * @DLS_RESPONSE: dls response frame
202  * @DLS_TEARDOWN: dls teardown frame
203  */
204 enum dls_actioncode {
205 	DLS_REQUEST,
206 	DLS_RESPONSE,
207 	DLS_TEARDOWN,
208 };
209 
210 /**
211  * enum block_ack_actioncode - block ack action frames
212  * @ADDBA_REQUEST:  add block ack request frame
213  * @ADDBA_RESPONSE: add block ack response frame
214  * @DELBA: delete block ack frame
215  */
216 enum block_ack_actioncode {
217 	ADDBA_REQUEST,
218 	ADDBA_RESPONSE,
219 	DELBA,
220 };
221 
222 /**
223  * enum pub_actioncode - public action frames
224  * @PUB_ACTION_2040_BSS_COEXISTENCE:  public 20-40 bss coex action frame
225  * @PUB_ACTION_EXT_CHANNEL_SWITCH_ID: public ext channel switch id action frame
226  * @PUB_ACTION_VENDOR_SPECIFIC: vendor specific public action frame
227  * @PUB_ACTION_GAS_INITIAL_REQUEST: GAS initial request action frame
228  * @PUB_ACTION_GAS_INITIAL_RESPONSE: GAS initial response action frame
229  * @PUB_ACTION_GAS_COMEBACK_REQUEST: GAS comeback request action frame
230  * @PUB_ACTION_GAS_COMEBACK_RESPONSE: GAS comeback respose action frame
231  * @PUB_ACTION_TDLS_DISCRESP: tdls discovery response public action frame
232  */
233 enum pub_actioncode {
234 	PUB_ACTION_2040_BSS_COEXISTENCE = 0,
235 	PUB_ACTION_EXT_CHANNEL_SWITCH_ID = 4,
236 	PUB_ACTION_VENDOR_SPECIFIC = 9,
237 	PUB_ACTION_GAS_INITIAL_REQUEST = 10,
238 	PUB_ACTION_GAS_INITIAL_RESPONSE = 11,
239 	PUB_ACTION_GAS_COMEBACK_REQUEST = 12,
240 	PUB_ACTION_GAS_COMEBACK_RESPONSE = 13,
241 	PUB_ACTION_TDLS_DISCRESP = 14,
242 };
243 
244 /**
245  * enum rrm_actioncode - rrm action frames
246  * @RRM_RADIO_MEASURE_REQ: rrm radio meas. request frame
247  * @RRM_RADIO_MEASURE_RPT: rrm radio meas. report frame
248  * @RRM_LINK_MEASUREMENT_REQ: rrm link meas. request frmae
249  * @RRM_LINK_MEASUREMENT_RPT: rrm link meas. report frame
250  * @RRM_NEIGHBOR_REQ: rrm neighbor request frame
251  * @RRM_NEIGHBOR_RPT: rrm neighbor report frame
252  */
253 enum rrm_actioncode {
254 	RRM_RADIO_MEASURE_REQ,
255 	RRM_RADIO_MEASURE_RPT,
256 	RRM_LINK_MEASUREMENT_REQ,
257 	RRM_LINK_MEASUREMENT_RPT,
258 	RRM_NEIGHBOR_REQ,
259 	RRM_NEIGHBOR_RPT,
260 };
261 
262 /**
263  * enum ft_actioncode - ft action frames
264  * @FT_FAST_BSS_TRNST_REQ: ft request frame
265  * @FT_FAST_BSS_TRNST_RES: ft response frame
266  * @FT_FAST_BSS_TRNST_CONFIRM: ft confirm frame
267  * @FT_FAST_BSS_TRNST_ACK: ft ACK frame
268  */
269 enum ft_actioncode {
270 	FT_FAST_BSS_TRNST_REQ = 1,
271 	FT_FAST_BSS_TRNST_RES,
272 	FT_FAST_BSS_TRNST_CONFIRM,
273 	FT_FAST_BSS_TRNST_ACK,
274 };
275 
276 /**
277  * enum ht_actioncode - ht action frames
278  * @HT_ACTION_NOTIFY_CHANWIDTH: ht notify bw action frame
279  * @HT_ACTION_SMPS: ht smps action frame
280  * @HT_ACTION_PSMP: ht psmp action frame
281  * @HT_ACTION_PCO_PHASE: ht pco phase action frame
282  * @HT_ACTION_CSI: ht csi action frame
283  * @HT_ACTION_NONCOMPRESSED_BF: ht noncompressed bf action frame
284  * @HT_ACTION_COMPRESSED_BF: ht compressed bf action frame
285  * @HT_ACTION_ASEL_IDX_FEEDBACK: ht asel idx feedback action frame
286  */
287 enum ht_actioncode {
288 	HT_ACTION_NOTIFY_CHANWIDTH,
289 	HT_ACTION_SMPS,
290 	HT_ACTION_PSMP,
291 	HT_ACTION_PCO_PHASE,
292 	HT_ACTION_CSI,
293 	HT_ACTION_NONCOMPRESSED_BF,
294 	HT_ACTION_COMPRESSED_BF,
295 	HT_ACTION_ASEL_IDX_FEEDBACK,
296 };
297 
298 /**
299  * enum sa_query_action - sa query action frames
300  * @SA_QUERY_REQUEST: sa query request frame
301  * @SA_QUERY_RESPONSE: sa query response frame
302  */
303 enum sa_query_action {
304 	SA_QUERY_REQUEST,
305 	SA_QUERY_RESPONSE,
306 };
307 
308 /**
309  * enum protected_dual_actioncode - protected dual action frames
310  * @PDPA_GAS_INIT_REQ: pdpa gas init request frame
311  * @PDPA_GAS_INIT_RSP: pdpa gas init response frame
312  * @PDPA_GAS_COMEBACK_REQ: pdpa gas comeback request frame
313  * @PDPA_GAS_COMEBACK_RSP: pdpa gas comeback response frame
314  */
315 enum protected_dual_actioncode {
316 	PDPA_GAS_INIT_REQ = 10,
317 	PDPA_GAS_INIT_RSP = 11,
318 	PDPA_GAS_COMEBACK_REQ = 12,
319 	PDPA_GAS_COMEBACK_RSP = 13,
320 };
321 
322 /**
323  * enum wnm_actioncode - wnm action frames
324  * @WNM_BSS_TM_QUERY: wnm bss tm query frame
325  * @WNM_BSS_TM_REQUEST: wnm bss tm request frame
326  * @WNM_BSS_TM_RESPONSE: wnm bss tm response frame
327  * @WNM_FMS_REQ: wnm fms request frame
328  * @WNM_FMS_RESP: wnm fms response frame
329  * @WNM_TFS_REQ: wnm tfs request frame
330  * @WNM_TFS_RESP: wnm tfs response frame
331  * @WNM_TFS_NOTIFY: wnm tfs notify frame
332  * @WNM_SLEEP_REQ: wnm sleep request frame
333  * @WNM_SLEEP_RESP: wnm sleep response frame
334  * @WNM_TIM_REQ: wnm Tim broadcast request frame
335  * @WNM_TIM_RESP: wnm Tim broadcast response frame
336  * @WNM_NOTIF_REQUEST: wnm notify request frame
337  * @WNM_NOTIF_RESPONSE: wnm notify response frame
338  */
339 enum wnm_actioncode {
340 	WNM_BSS_TM_QUERY = 6,
341 	WNM_BSS_TM_REQUEST = 7,
342 	WNM_BSS_TM_RESPONSE = 8,
343 	WNM_FMS_REQ = 9,
344 	WNM_FMS_RESP = 10,
345 	WNM_TFS_REQ = 13,
346 	WNM_TFS_RESP = 14,
347 	WNM_TFS_NOTIFY = 15,
348 	WNM_SLEEP_REQ = 16,
349 	WNM_SLEEP_RESP = 17,
350 	WNM_TIM_REQ = 18,
351 	WNM_TIM_RESP = 19,
352 	WNM_NOTIF_REQUEST = 26,
353 	WNM_NOTIF_RESPONSE = 27,
354 };
355 
356 /**
357  * enum tdls_actioncode - tdls action frames
358  * @TDLS_SETUP_REQUEST: tdls setup request frame
359  * @TDLS_SETUP_RESPONSE: tdls setup response frame
360  * @TDLS_SETUP_CONFIRM: tdls setup confirm frame
361  * @TDLS_TEARDOWN: tdls teardown frame
362  * @TDLS_PEER_TRAFFIC_INDICATION: tdls peer traffic indication frame
363  * @TDLS_CHANNEL_SWITCH_REQUEST: tdls channel switch req. frame
364  * @TDLS_CHANNEL_SWITCH_RESPONSE: tdls channel switch response frame
365  * @TDLS_PEER_PSM_REQUEST: tdls peer psm request frame
366  * @TDLS_PEER_PSM_RESPONSE: tdls peer psm response frame
367  * @TDLS_PEER_TRAFFIC_RESPONSE: tdls peer traffic response frame
368  * @TDLS_DISCOVERY_REQUEST: tdls discovery request frame
369  */
370 enum tdls_actioncode {
371 	TDLS_SETUP_REQUEST = 0,
372 	TDLS_SETUP_RESPONSE = 1,
373 	TDLS_SETUP_CONFIRM = 2,
374 	TDLS_TEARDOWN = 3,
375 	TDLS_PEER_TRAFFIC_INDICATION = 4,
376 	TDLS_CHANNEL_SWITCH_REQUEST = 5,
377 	TDLS_CHANNEL_SWITCH_RESPONSE = 6,
378 	TDLS_PEER_PSM_REQUEST = 7,
379 	TDLS_PEER_PSM_RESPONSE = 8,
380 	TDLS_PEER_TRAFFIC_RESPONSE = 9,
381 	TDLS_DISCOVERY_REQUEST = 10,
382 	TDLS_DISCOVERY_RESPONSE = 14,
383 };
384 
385 /**
386  * enum mesh_actioncode - mesh action frames
387  * @MESH_ACTION_LINK_METRIC_REPORT: mesh link metric report action frame
388  * @MESH_ACTION_HWMP_PATH_SELECTION: mesh hwmp path selection action frame
389  * @MESH_ACTION_GATE_ANNOUNCEMENT: mesh gate announcement action frame
390  * @MESH_ACTION_CONGESTION_CONTROL_NOTIFICATION: mesh congestion control frame
391  * @MESH_ACTION_MCCA_SETUP_REQUEST: mesh mcca setup request action frame
392  * @MESH_ACTION_MCCA_SETUP_REPLY: mesh mcca setup reply action frame
393  * @MESH_ACTION_MCCA_ADVERTISEMENT_REQUEST: mesh mcca advertisement req. frame
394  * @MESH_ACTION_MCCA_ADVERTISEMENT: mesh mcca advertisement action frame
395  * @MESH_ACTION_MCCA_TEARDOWN: mesh mcca teardown action frame
396  * @MESH_ACTION_TBTT_ADJUSTMENT_REQUEST: mesh tbtt adjustment req. frame
397  * @MESH_ACTION_TBTT_ADJUSTMENT_RESPONSE: mesh tbtt adjustment rsp. frame
398  */
399 enum mesh_actioncode {
400 	MESH_ACTION_LINK_METRIC_REPORT,
401 	MESH_ACTION_HWMP_PATH_SELECTION,
402 	MESH_ACTION_GATE_ANNOUNCEMENT,
403 	MESH_ACTION_CONGESTION_CONTROL_NOTIFICATION,
404 	MESH_ACTION_MCCA_SETUP_REQUEST,
405 	MESH_ACTION_MCCA_SETUP_REPLY,
406 	MESH_ACTION_MCCA_ADVERTISEMENT_REQUEST,
407 	MESH_ACTION_MCCA_ADVERTISEMENT,
408 	MESH_ACTION_MCCA_TEARDOWN,
409 	MESH_ACTION_TBTT_ADJUSTMENT_REQUEST,
410 	MESH_ACTION_TBTT_ADJUSTMENT_RESPONSE,
411 };
412 
413 /**
414  * enum self_protected_actioncode - self protected action frames
415  * @SP_RESERVED: self protected reserved
416  * @SP_MESH_PEERING_OPEN: self protected mesh peering open frame
417  * @SP_MESH_PEERING_CONFIRM: self protected mesh peering confirm frame
418  * @SP_MESH_PEERING_CLOSE: self protected mesh peering close frame
419  * @SP_MGK_INFORM: self protected mgk inform frame
420  * @SP_MGK_ACK: self protected mgk ack frame
421  */
422 enum self_protected_actioncode {
423 	SP_RESERVED,
424 	SP_MESH_PEERING_OPEN,
425 	SP_MESH_PEERING_CONFIRM,
426 	SP_MESH_PEERING_CLOSE,
427 	SP_MGK_INFORM,
428 	SP_MGK_ACK,
429 };
430 
431 /**
432  * enum wmm_actioncode - wmm action frames
433  * @WMM_QOS_SETUP_REQ: wmm qos setup request frame
434  * @WMM_QOS_SETUP_RESP: q wmm qos setup response frame
435  * @WMM_QOS_TEARDOWN:  wmm qos teardown frame
436  */
437 enum wmm_actioncode {
438 	WMM_QOS_SETUP_REQ,
439 	WMM_QOS_SETUP_RESP,
440 	WMM_QOS_TEARDOWN,
441 };
442 
443 /**
444  * enum fst_actioncode - fst action frames
445  * @FST_SETUP_REQ: fst setup request frame
446  * @FST_SETUP_RSP: fst setup response frame
447  * @FST_TEAR_DOWN: fst qos teardown frame
448  * @FST_ACK_REQ:  fst ack frame for request
449  * @FST_ACK_RSP:  fst ack frame for response
450  * @FST_ON_CHANNEL_TUNNEL:  fst on channel tunnel frame
451  */
452 enum fst_actioncode {
453 	FST_SETUP_REQ,
454 	FST_SETUP_RSP,
455 	FST_TEAR_DOWN,
456 	FST_ACK_REQ,
457 	FST_ACK_RSP,
458 	FST_ON_CHANNEL_TUNNEL,
459 };
460 
461 /**
462  * enum rvs_actioncode - Robust av streaming action frames
463  * @SCS_REQ: scs request frame
464  * @SCS_RSP: scs response frame
465  * @GROUP_MEMBERSHIP_REQ:  Group Membership Request frame
466  * @GROUP_MEMBERSHIP_RSP: Group Membership Response frame
467  * @MCSC_REQ: mcsc request frame
468  * @MCSC_RSP: mcsc response frame
469  */
470 enum rvs_actioncode {
471 	SCS_REQ,
472 	SCS_RSP,
473 	GROUP_MEMBERSHIP_REQ,
474 	GROUP_MEMBERSHIP_RSP,
475 	MCSC_REQ,
476 	MCSC_RSP,
477 };
478 
479 /**
480  * enum vht_actioncode - vht action frames
481  * @VHT_ACTION_COMPRESSED_BF: vht compressed bf action frame
482  * @VHT_ACTION_GID_NOTIF: vht gid notification action frame
483  * @VHT_ACTION_OPMODE_NOTIF: vht opmode notification action frame
484  */
485 enum vht_actioncode {
486 	VHT_ACTION_COMPRESSED_BF,
487 	VHT_ACTION_GID_NOTIF,
488 	VHT_ACTION_OPMODE_NOTIF,
489 };
490 
491 /**
492  * struct action_frm_hdr - action frame header
493  * @action_category: action category
494  * @action_code: action code
495  */
496 struct action_frm_hdr {
497 	uint8_t action_category;
498 	uint8_t action_code;
499 };
500 
501 /**
502  * enum mgmt_frame_type - enum of mgmt. frames
503  * @MGMT_FRM_UNSPECIFIED:           unspecified
504  * @MGMT_ASSOC_REQ:                 association request frame
505  * @MGMT_ASSOC_RESP:                association response frame
506  * @MGMT_REASSOC_REQ:               reassociation request frame
507  * @MGMT_REASSOC_RESP:              reassociation response frame
508  * @MGMT_PROBE_REQ:                 probe request frame
509  * @MGMT_PROBE_RESP:                probe response frame
510  * @MGMT_BEACON:                    beacon frame
511  * @MGMT_ATIM:                      ATIM frame
512  * @MGMT_DISASSOC:                  disassociation frame
513  * @MGMT_AUTH:                      authentication frame
514  * @MGMT_DEAUTH:                    deauthentication frame
515  * @MGMT_ACTION_MEAS_REQUEST:       measure channels request action frame
516  * @MGMT_ACTION_MEAS_REPORT:        measure channels response action frame
517  * @MGMT_ACTION_TPC_REQUEST:        transmit power control request action frame
518  * @MGMT_ACTION_TPC_REPORT:         transmit power control response action frame
519  * @MGMT_ACTION_CHAN_SWITCH:        802.11 channel switch announcement frame
520  * @MGMT_ACTION_QOS_ADD_TS_REQ:     qos add ts request frame
521  * @MGMT_ACTION_QOS_ADD_TS_RSP:     qos add ts response frame
522  * @MGMT_ACTION_QOS_DEL_TS_REQ:     qos del ts request frame
523  * @MGMT_ACTION_QOS_SCHEDULE:       qos schedule frame
524  * @MGMT_ACTION_QOS_MAP_CONFIGURE:  qos map configure frame
525  * @MGMT_ACTION_DLS_REQUEST:        DLS request action frame
526  * @MGMT_ACTION_DLS_RESPONSE:       DLS response action frame
527  * @MGMT_ACTION_DLS_TEARDOWN:       DLS taerdown action frame
528  * @MGMT_ACTION_BA_ADDBA_REQUEST:   ADDBA request action frame
529  * @MGMT_ACTION_BA_ADDBA_RESPONSE:  ADDBA response action frame
530  * @MGMT_ACTION_BA_DELBA:           DELBA action frame
531  * @MGMT_ACTION_2040_BSS_COEXISTENCE: 20-40 bss coex action frame
532  * @MGMT_ACTION_CATEGORY_VENDOR_SPECIFIC: category vendor specific action frame
533  * @MGMT_ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED: category vendor specific
534  * protected action frame
535  * @MGMT_ACTION_EXT_CHANNEL_SWITCH_ID: ext channel switch id action frame
536  * @MGMT_ACTION_VENDOR_SPECIFIC:    vendor specific action frame
537  * @MGMT_ACTION_TDLS_DISCRESP:      TDLS discovery response frame
538  * @MGMT_ACTION_RRM_RADIO_MEASURE_REQ: rrm radio meas. req. action frame
539  * @MGMT_ACTION_RRM_RADIO_MEASURE_RPT: rrm radio meas. report action frame
540  * @MGMT_ACTION_RRM_LINK_MEASUREMENT_REQ: rrm link meas. req. action frame
541  * @MGMT_ACTION_RRM_LINK_MEASUREMENT_RPT: rrm link meas. report action frame
542  * @MGMT_ACTION_RRM_NEIGHBOR_REQ: rrm neighbor request action frame
543  * @MGMT_ACTION_RRM_NEIGHBOR_RPT: rrm neighbor response action frame
544  * @MGMT_ACTION_HT_NOTIFY_CHANWIDTH: notify channel width action frame
545  * @MGMT_ACTION_HT_SMPS:            spatial multiplexing power save action frame
546  * @MGMT_ACTION_HT_PSMP:            psmp action frame
547  * @MGMT_ACTION_HT_PCO_PHASE:       pco phase action frame
548  * @MGMT_ACTION_HT_CSI:             CSI action frame
549  * @MGMT_ACTION_HT_NONCOMPRESSED_BF: non-compressed beamforming action frame
550  * @MGMT_ACTION_HT_COMPRESSED_BF:   compressed beamforming action frame
551  * @MGMT_ACTION_HT_ASEL_IDX_FEEDBACK: asel idx feedback action frame
552  * @MGMT_ACTION_SA_QUERY_REQUEST:   SA query request frame
553  * @MGMT_ACTION_SA_QUERY_RESPONSE:  SA query response frame
554  * @MGMT_ACTION_PDPA_GAS_INIT_REQ:  pdpa gas init request action frame
555  * @MGMT_ACTION_PDPA_GAS_INIT_RSP:  pdpa gas init response frame
556  * @MGMT_ACTION_PDPA_GAS_COMEBACK_REQ: pdpa gas comeback req. action frame
557  * @MGMT_ACTION_PDPA_GAS_COMEBACK_RSP: pdpa gas comeback rsp. action frame
558  * @MGMT_ACTION_WNM_BSS_TM_QUERY:   wnm bss tm query action frame
559  * @MGMT_ACTION_WNM_BSS_TM_REQUEST: wnm bss tm request action frame
560  * @MGMT_ACTION_WNM_BSS_TM_RESPONSE: wnm bss tm response action frame
561  * @MGMT_ACTION_WNM_NOTIF_REQUEST:  wnm notification request action frame
562  * @MGMT_ACTION_WNM_NOTIF_RESPONSE: wnm notification response action frame
563  * @MGMT_ACTION_WNM_FMS_REQ:    wnm fms request frame
564  * @MGMT_ACTION_WNM_FMS_RESP:   wnm fms response frame
565  * @MGMT_ACTION_WNM_TFS_REQ:    wnm tfs request frame
566  * @MGMT_ACTION_WNM_TFS_RESP:   wnm tfs response frame
567  * @MGMT_ACTION_WNM_TFS_NOTIFY: wnm tfs notify frame
568  * @MGMT_ACTION_WNM_SLEEP_REQ:  wnm sleep request frame
569  * @MGMT_ACTION_WNM_SLEEP_RESP: wnm sleep response frame
570  * @MGMT_ACTION_WNM_TIM_REQ:    wnm Tim broadcast request frame
571  * @MGMT_ACTION_WNM_TIM_RESP:   wnm Tim broadcast response frame
572  * @MGMT_ACTION_TDLS_SETUP_REQ:     tdls setup request action frame
573  * @MGMT_ACTION_TDLS_SETUP_RSP:     tdls setup response frame
574  * @MGMT_ACTION_TDLS_SETUP_CNF:     tdls setup confirm frame
575  * @MGMT_ACTION_TDLS_TEARDOWN:      tdls teardown frame
576  * @MGMT_ACTION_TDLS_PEER_TRAFFIC_IND: tdls peer traffic indication frame
577  * @MGMT_ACTION_TDLS_CH_SWITCH_REQ: tdls channel switch req. frame
578  * @MGMT_ACTION_TDLS_CH_SWITCH_RSP: tdls channel switch response frame
579  * @MGMT_ACTION_TDLS_PEER_PSM_REQUEST: tdls peer psm request frame
580  * @MGMT_ACTION_TDLS_PEER_PSM_RESPONSE: tdls peer psm response frame
581  * @MGMT_ACTION_TDLS_PEER_TRAFFIC_RSP: tdls peer traffic response frame
582  * @MGMT_ACTION_TDLS_DIS_REQ:       tdls discovery request frame
583  * @MGMT_ACTION_MESH_LINK_METRIC_REPORT: mesh link metric report action frame
584  * @MGMT_ACTION_MESH_HWMP_PATH_SELECTION: mesh hwmp path selection action frame
585  * @MGMT_ACTION_MESH_GATE_ANNOUNCEMENT: mesh gate announcement action frame
586  * @MGMT_ACTION_MESH_CONGESTION_CONTROL_NOTIFICATION: mesh congestion control
587  * @MGMT_ACTION_MESH_MCCA_SETUP_REQUEST: mesh mcca setup request action frame
588  * @MGMT_ACTION_MESH_MCCA_SETUP_REPLY: mesh mcca setup reply action frame
589  * @MGMT_ACTION_MESH_MCCA_ADVERTISEMENT_REQUEST: mesh mcca advertisement req.
590  * @MGMT_ACTION_MESH_MCCA_ADVERTISEMENT: mesh mcca advertisement action frame
591  * @MGMT_ACTION_MESH_MCCA_TEARDOWN: mesh mcca teardown action fram
592  * @MGMT_ACTION_MESH_TBTT_ADJUSTMENT_REQUEST: mesh tbtt adjustment req. frame
593  * @MGMT_ACTION_MESH_TBTT_ADJUSTMENT_RESPONSE: mesh tbtt adjustment rsp. frame
594  * @MGMT_ACTION_SP_MESH_PEERING_OPEN: self protected mesh peering open frame
595  * @MGMT_ACTION_SP_MESH_PEERING_CONFIRM: self protected mesh peering confirm
596  * @MGMT_ACTION_SP_MESH_PEERING_CLOSE: self protected mesh peering close frame
597  * @MGMT_ACTION_SP_MGK_INFORM:   self protected mgk inform frame
598  * @MGMT_ACTION_SP_MGK_ACK:      self protected mgk ack frame
599  * @MGMT_ACTION_WMM_QOS_SETUP_REQ: WMM qos setup request action frame
600  * @MGMT_ACTION_WMM_QOS_SETUP_RESP: WMM qos setup response action frame
601  * @MGMT_ACTION_WMM_QOS_TEARDOWN: WMM qos teardown action frame
602  * @MGMT_ACTION_VHT_COMPRESSED_BF: vht compressed bf action frame
603  * @MGMT_ACTION_VHT_GID_NOTIF:   vht gid notification action frame
604  * @MGMT_ACTION_VHT_OPMODE_NOTIF: vht opmode notification action frame
605  * @MGMT_ACTION_GAS_INITIAL_REQUEST: GAS Initial request action frame
606  * @MGMT_ACTION_GAS_INITIAL_RESPONSE: GAS Initial response action frame
607  * @MGMT_ACTION_GAS_COMEBACK_REQUEST: GAS Comeback request action frame
608  * @MGMT_ACTION_GAS_COMEBACK_RESPONSE: GAS Comeback response action frame
609  * @MGMT_ACTION_FST_SETUP_REQ: FST setup request frame
610  * @MGMT_ACTION_FST_SETUP_RSPA: FST setup response frame
611  * @MGMT_ACTION_FST_TEAR_DOWN: FST qos teardown frame
612  * @MGMT_ACTION_FST_ACK_REQ: FST ack frame for request
613  * @MGMT_ACTION_FST_ACK_RSP: FST ack frame for response
614  * @MGMT_ACTION_FST_ON_CHANNEL_TUNNEL: FST on channel tunnel frame
615  * @MGMT_ACTION_SCS_REQ: SCS request frame
616  * @MGMT_ACTION_SCS_RSP: SCS response frame
617  * @MGMT_ACTION_GROUP_MEMBERSHIP_REQ: group membership request frame
618  * @MGMT_ACTION_GROUP_MEMBERSHIP_RSP: group membership response frame
619  * @MGMT_ACTION_MCSC_REQ: MCSC request frame
620  * @MGMT_ACTION_MCSC_RSP: MCSC response frame
621  * @MGMT_FRAME_TYPE_ALL:         mgmt frame type for all type of frames
622  * @MGMT_CTRL_FRAME: Control Frames
623  * @MGMT_MAX_FRAME_TYPE:         max. mgmt frame types
624  */
625 enum mgmt_frame_type {
626 	MGMT_FRM_UNSPECIFIED = -1,
627 	MGMT_ASSOC_REQ,
628 	MGMT_ASSOC_RESP,
629 	MGMT_REASSOC_REQ,
630 	MGMT_REASSOC_RESP,
631 	MGMT_PROBE_REQ,
632 	MGMT_PROBE_RESP,
633 	MGMT_BEACON,
634 	MGMT_ATIM,
635 	MGMT_DISASSOC,
636 	MGMT_AUTH,
637 	MGMT_DEAUTH,
638 	MGMT_ACTION_MEAS_REQUEST,
639 	MGMT_ACTION_MEAS_REPORT,
640 	MGMT_ACTION_TPC_REQUEST,
641 	MGMT_ACTION_TPC_REPORT,
642 	MGMT_ACTION_CHAN_SWITCH,
643 	MGMT_ACTION_QOS_ADD_TS_REQ,
644 	MGMT_ACTION_QOS_ADD_TS_RSP,
645 	MGMT_ACTION_QOS_DEL_TS_REQ,
646 	MGMT_ACTION_QOS_SCHEDULE,
647 	MGMT_ACTION_QOS_MAP_CONFIGURE,
648 	MGMT_ACTION_DLS_REQUEST,
649 	MGMT_ACTION_DLS_RESPONSE,
650 	MGMT_ACTION_DLS_TEARDOWN,
651 	MGMT_ACTION_BA_ADDBA_REQUEST,
652 	MGMT_ACTION_BA_ADDBA_RESPONSE,
653 	MGMT_ACTION_BA_DELBA,
654 	MGMT_ACTION_2040_BSS_COEXISTENCE,
655 	MGMT_ACTION_CATEGORY_VENDOR_SPECIFIC,
656 	MGMT_ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED,
657 	MGMT_ACTION_EXT_CHANNEL_SWITCH_ID,
658 	MGMT_ACTION_VENDOR_SPECIFIC,
659 	MGMT_ACTION_TDLS_DISCRESP,
660 	MGMT_ACTION_RRM_RADIO_MEASURE_REQ,
661 	MGMT_ACTION_RRM_RADIO_MEASURE_RPT,
662 	MGMT_ACTION_RRM_LINK_MEASUREMENT_REQ,
663 	MGMT_ACTION_RRM_LINK_MEASUREMENT_RPT,
664 	MGMT_ACTION_RRM_NEIGHBOR_REQ,
665 	MGMT_ACTION_RRM_NEIGHBOR_RPT,
666 	MGMT_ACTION_FT_REQUEST,
667 	MGMT_ACTION_FT_RESPONSE,
668 	MGMT_ACTION_FT_CONFIRM,
669 	MGMT_ACTION_FT_ACK,
670 	MGMT_ACTION_HT_NOTIFY_CHANWIDTH,
671 	MGMT_ACTION_HT_SMPS,
672 	MGMT_ACTION_HT_PSMP,
673 	MGMT_ACTION_HT_PCO_PHASE,
674 	MGMT_ACTION_HT_CSI,
675 	MGMT_ACTION_HT_NONCOMPRESSED_BF,
676 	MGMT_ACTION_HT_COMPRESSED_BF,
677 	MGMT_ACTION_HT_ASEL_IDX_FEEDBACK,
678 	MGMT_ACTION_SA_QUERY_REQUEST,
679 	MGMT_ACTION_SA_QUERY_RESPONSE,
680 	MGMT_ACTION_PDPA_GAS_INIT_REQ,
681 	MGMT_ACTION_PDPA_GAS_INIT_RSP,
682 	MGMT_ACTION_PDPA_GAS_COMEBACK_REQ,
683 	MGMT_ACTION_PDPA_GAS_COMEBACK_RSP,
684 	MGMT_ACTION_WNM_BSS_TM_QUERY,
685 	MGMT_ACTION_WNM_BSS_TM_REQUEST,
686 	MGMT_ACTION_WNM_BSS_TM_RESPONSE,
687 	MGMT_ACTION_WNM_NOTIF_REQUEST,
688 	MGMT_ACTION_WNM_NOTIF_RESPONSE,
689 	MGMT_ACTION_WNM_FMS_REQ,
690 	MGMT_ACTION_WNM_FMS_RESP,
691 	MGMT_ACTION_WNM_TFS_REQ,
692 	MGMT_ACTION_WNM_TFS_RESP,
693 	MGMT_ACTION_WNM_TFS_NOTIFY,
694 	MGMT_ACTION_WNM_SLEEP_REQ,
695 	MGMT_ACTION_WNM_SLEEP_RESP,
696 	MGMT_ACTION_WNM_TIM_REQ,
697 	MGMT_ACTION_WNM_TIM_RESP,
698 	MGMT_ACTION_TDLS_SETUP_REQ,
699 	MGMT_ACTION_TDLS_SETUP_RSP,
700 	MGMT_ACTION_TDLS_SETUP_CNF,
701 	MGMT_ACTION_TDLS_TEARDOWN,
702 	MGMT_ACTION_TDLS_PEER_TRAFFIC_IND,
703 	MGMT_ACTION_TDLS_CH_SWITCH_REQ,
704 	MGMT_ACTION_TDLS_CH_SWITCH_RSP,
705 	MGMT_ACTION_TDLS_PEER_PSM_REQUEST,
706 	MGMT_ACTION_TDLS_PEER_PSM_RESPONSE,
707 	MGMT_ACTION_TDLS_PEER_TRAFFIC_RSP,
708 	MGMT_ACTION_TDLS_DIS_REQ,
709 	MGMT_ACTION_MESH_LINK_METRIC_REPORT,
710 	MGMT_ACTION_MESH_HWMP_PATH_SELECTION,
711 	MGMT_ACTION_MESH_GATE_ANNOUNCEMENT,
712 	MGMT_ACTION_MESH_CONGESTION_CONTROL_NOTIFICATION,
713 	MGMT_ACTION_MESH_MCCA_SETUP_REQUEST,
714 	MGMT_ACTION_MESH_MCCA_SETUP_REPLY,
715 	MGMT_ACTION_MESH_MCCA_ADVERTISEMENT_REQUEST,
716 	MGMT_ACTION_MESH_MCCA_ADVERTISEMENT,
717 	MGMT_ACTION_MESH_MCCA_TEARDOWN,
718 	MGMT_ACTION_MESH_TBTT_ADJUSTMENT_REQUEST,
719 	MGMT_ACTION_MESH_TBTT_ADJUSTMENT_RESPONSE,
720 	MGMT_ACTION_SP_MESH_PEERING_OPEN,
721 	MGMT_ACTION_SP_MESH_PEERING_CONFIRM,
722 	MGMT_ACTION_SP_MESH_PEERING_CLOSE,
723 	MGMT_ACTION_SP_MGK_INFORM,
724 	MGMT_ACTION_SP_MGK_ACK,
725 	MGMT_ACTION_WMM_QOS_SETUP_REQ,
726 	MGMT_ACTION_WMM_QOS_SETUP_RESP,
727 	MGMT_ACTION_WMM_QOS_TEARDOWN,
728 	MGMT_ACTION_VHT_COMPRESSED_BF,
729 	MGMT_ACTION_VHT_GID_NOTIF,
730 	MGMT_ACTION_VHT_OPMODE_NOTIF,
731 	MGMT_ACTION_GAS_INITIAL_REQUEST,
732 	MGMT_ACTION_GAS_INITIAL_RESPONSE,
733 	MGMT_ACTION_GAS_COMEBACK_REQUEST,
734 	MGMT_ACTION_GAS_COMEBACK_RESPONSE,
735 	MGMT_ACTION_FST_SETUP_REQ,
736 	MGMT_ACTION_FST_SETUP_RSP,
737 	MGMT_ACTION_FST_TEAR_DOWN,
738 	MGMT_ACTION_FST_ACK_REQ,
739 	MGMT_ACTION_FST_ACK_RSP,
740 	MGMT_ACTION_FST_ON_CHANNEL_TUNNEL,
741 	MGMT_ACTION_SCS_REQ,
742 	MGMT_ACTION_SCS_RSP,
743 	MGMT_ACTION_GROUP_MEMBERSHIP_REQ,
744 	MGMT_ACTION_GROUP_MEMBERSHIP_RSP,
745 	MGMT_ACTION_MCSC_REQ,
746 	MGMT_ACTION_MCSC_RSP,
747 	MGMT_FRAME_TYPE_ALL,
748 	MGMT_CTRL_FRAME,
749 	MGMT_MAX_FRAME_TYPE,
750 };
751 
752 #define WLAN_MGMT_TXRX_HOST_MAX_ANTENNA          4
753 #define WLAN_INVALID_PER_CHAIN_RSSI             0xFF
754 #define WLAN_INVALID_PER_CHAIN_SNR              0x80
755 #define WLAN_NOISE_FLOOR_DBM_DEFAULT            -96
756 /**
757  * struct mgmt_rx_event_params - host mgmt header params
758  * @chan_freq: channel frequency on which this frame is received
759  * @channel: channel on which this frame is received
760  * @snr: snr information used to call rssi
761  * @rssi_ctl[WLAN_MGMT_TXRX_HOST_MAX_ANTENNA]: RSSI of PRI 20MHz for each chain
762  * @rate: Rate kbps
763  * @phy_mode: rx phy mode
764  * @buf_len: length of the frame
765  * @status: rx status. It is a bitfield being used based on below defines
766  *          WMI_HOST_RXERR_CRC = 0x01
767  *          WMI_HOST_RXERR_DECRYPT = 0x08
768  *          WMI_HOST_RXERR_MIC = 0x10
769  *          WMI_HOST_RXERR_KEY_CACHE_MISS = 0x20
770  * @flags: information about the management frame e.g. can give a
771  *         scan source for a scan result mgmt frame
772  * @rssi: combined RSSI, i.e. the sum of the snr + noise floor (dBm units)
773  * @tsf_delta: tsf delta
774  * @pdev_id: pdev id
775  * @rx_params: pointer to other rx params
776  *             (win specific, will be removed in phase 4)
777  * @reo_params: Pointer to MGMT Rx REO params
778  */
779 struct mgmt_rx_event_params {
780 	uint32_t    chan_freq;
781 	uint32_t    channel;
782 	uint32_t    snr;
783 	uint8_t     rssi_ctl[WLAN_MGMT_TXRX_HOST_MAX_ANTENNA];
784 	uint32_t    rate;
785 	enum wlan_phymode    phy_mode;
786 	uint32_t    buf_len;
787 	uint8_t     status;
788 	uint32_t    flags;
789 	int32_t     rssi;
790 	uint32_t    tsf_delta;
791 	uint32_t    tsf_l32;
792 	uint8_t     pdev_id;
793 	void        *rx_params;
794 #ifdef WLAN_MGMT_RX_REO_SUPPORT
795 	struct mgmt_rx_reo_params *reo_params;
796 #endif
797 };
798 
799 #ifdef WLAN_MGMT_RX_REO_SUPPORT
800 static inline
801 struct mgmt_rx_event_params *alloc_mgmt_rx_event_params(void)
802 {
803 	struct mgmt_rx_event_params *rx_params;
804 
805 	rx_params = qdf_mem_malloc(sizeof(struct mgmt_rx_event_params));
806 	if (!rx_params)
807 		return NULL;
808 
809 	rx_params->reo_params =
810 		qdf_mem_malloc(sizeof(struct mgmt_rx_reo_params));
811 
812 	if (!rx_params->reo_params) {
813 		qdf_mem_free(rx_params);
814 		return NULL;
815 	}
816 
817 	return rx_params;
818 }
819 
820 static inline void
821 free_mgmt_rx_event_params(struct mgmt_rx_event_params *rx_params)
822 {
823 	if (rx_params)
824 		qdf_mem_free(rx_params->reo_params);
825 
826 	qdf_mem_free(rx_params);
827 }
828 #else
829 static inline
830 struct mgmt_rx_event_params *alloc_mgmt_rx_event_params(void)
831 {
832 	struct mgmt_rx_event_params *rx_params;
833 
834 	rx_params = qdf_mem_malloc(sizeof(struct mgmt_rx_event_params));
835 	if (!rx_params)
836 		return NULL;
837 
838 	return rx_params;
839 }
840 
841 #define free_mgmt_rx_event_params(rx_params) qdf_mem_free((rx_params))
842 #endif
843 
844 /**
845  * mgmt_tx_download_comp_cb - function pointer for tx download completions.
846  * @context: caller component specific context
847  * @buf: buffer
848  * @free: to free/not free the buffer
849  *
850  * This is the function pointer to be called on tx download completion
851  * if download complete is required.
852  *
853  * Return: QDF_STATUS_SUCCESS - in case of success
854  */
855 typedef QDF_STATUS (*mgmt_tx_download_comp_cb)(void *context,
856 					 qdf_nbuf_t buf, bool free);
857 
858 /**
859  * mgmt_ota_comp_cb - function pointer for tx ota completions.
860  * @context: caller component specific context
861  * @buf: buffer
862  * @status: tx completion status
863  * @tx_compl_params: tx completion params
864  *
865  * This is the function pointer to be called on tx ota completion.
866  *
867  * Return: QDF_STATUS_SUCCESS - in case of success
868  */
869 typedef QDF_STATUS (*mgmt_ota_comp_cb)(void *context, qdf_nbuf_t buf,
870 				 uint32_t status, void *tx_compl_params);
871 
872 /**
873  * mgmt_frame_rx_callback - function pointer for receiving mgmt rx frames
874  * @psoc: psoc context
875  * @peer: peer
876  * @buf: buffer
877  * @mgmt_rx_params: rx params
878  * @frm_type: mgmt rx frame type
879  *
880  * This is the function pointer to be called on receiving mgmt rx frames.
881  *
882  * Return: QDF_STATUS_SUCCESS - in case of success
883  */
884 typedef QDF_STATUS (*mgmt_frame_rx_callback)(
885 			struct wlan_objmgr_psoc *psoc,
886 			struct wlan_objmgr_peer *peer,
887 			qdf_nbuf_t buf,
888 			struct mgmt_rx_event_params *mgmt_rx_params,
889 			enum mgmt_frame_type frm_type);
890 
891 /**
892  * mgmt_frame_fill_peer_cb - Function pointer to fill peer in the buf
893  * @peer: peer
894  * @buf: buffer
895  *
896  * This is the function pointer to be called during drain to fill the
897  * peer into the buf's cb structure.
898  *
899  * Return: QDF_STATUS_SUCCESS - in case of success
900  */
901 typedef QDF_STATUS (*mgmt_frame_fill_peer_cb)(
902 			struct wlan_objmgr_peer *peer,
903 			qdf_nbuf_t buf);
904 
905 /**
906  * struct mgmt_txrx_mgmt_frame_cb_info - frm and corresponding rx cb info
907  * @frm_type:    mgmt frm type
908  * @mgmt_rx_cb:  corresponding rx callback
909  */
910 struct mgmt_txrx_mgmt_frame_cb_info {
911 	enum mgmt_frame_type frm_type;
912 	mgmt_frame_rx_callback mgmt_rx_cb;
913 };
914 
915 
916 /**
917  * wlan_mgmt_txrx_init() - initialize mgmt txrx context.
918  *
919  * This function initializes the mgmt txrx context,
920  * mgmt descriptor pool, etc.
921  *
922  * Return: QDF_STATUS_SUCCESS - in case of success
923  */
924 QDF_STATUS wlan_mgmt_txrx_init(void);
925 
926 /**
927  * wlan_mgmt_txrx_deinit() - deinitialize mgmt txrx context.
928  *
929  * This function deinitializes the mgmt txrx context,
930  * mgmt descriptor pool, etc.
931  *
932  * Return: QDF_STATUS_SUCCESS - in case of success
933  */
934 QDF_STATUS wlan_mgmt_txrx_deinit(void);
935 
936 /**
937  * wlan_mgmt_txrx_mgmt_frame_tx() - transmits mgmt. frame
938  * @peer: peer
939  * @context: caller component specific context
940  * @buf: buffer to be transmitted
941  * @comp_cb: download completion cb function
942  * @ota_cb: post processing cb function
943  * @comp_id: umac component id
944  * @mgmt_tx_params: mgmt tx params
945  *
946  * This function transmits the mgmt. frame to southbound interface.
947  *
948  * Return: QDF_STATUS_SUCCESS - in case of success
949  */
950 QDF_STATUS wlan_mgmt_txrx_mgmt_frame_tx(struct wlan_objmgr_peer *peer,
951 					void *context,
952 					qdf_nbuf_t buf,
953 					mgmt_tx_download_comp_cb tx_comp_cb,
954 					mgmt_ota_comp_cb tx_ota_comp_cb,
955 					enum wlan_umac_comp_id comp_id,
956 					void *mgmt_tx_params);
957 /**
958  * wlan_mgmt_is_rmf_mgmt_action_frame() - API to check action category is rmf
959  * @action_category: action category to check
960  *
961  * Return: true if action category is rmf else false
962  */
963 bool wlan_mgmt_is_rmf_mgmt_action_frame(uint8_t action_category);
964 
965 /**
966  * wlan_mgmt_txrx_beacon_frame_tx() - transmits mgmt. beacon
967  * @psoc: psoc context
968  * @buf: buffer to be transmitted
969  * @comp_id: umac component id
970  *
971  * This function transmits the mgmt. beacon to southbound interface.
972  *
973  * Return: QDF_STATUS_SUCCESS - in case of success
974  */
975 QDF_STATUS wlan_mgmt_txrx_beacon_frame_tx(struct wlan_objmgr_peer *peer,
976 					  qdf_nbuf_t buf,
977 					  enum wlan_umac_comp_id comp_id);
978 
979 #ifdef WLAN_SUPPORT_FILS
980 /**
981  * wlan_mgmt_txrx_fd_action_frame_tx() - transmits mgmt. FD Action frame
982  * @vdev: vdev object
983  * @buf: buffer to be transmitted
984  * @comp_id: umac component id
985  *
986  * This function transmits the FILS Dicovery Action frame to
987  * southbound interface.
988  *
989  * Return: QDF_STATUS_SUCCESS - in case of success
990  */
991 QDF_STATUS wlan_mgmt_txrx_fd_action_frame_tx(struct wlan_objmgr_vdev *vdev,
992 					     qdf_nbuf_t buf,
993 					     enum wlan_umac_comp_id comp_id);
994 #endif /* WLAN_SUPPORT_FILS */
995 
996 /**
997  * wlan_mgmt_txrx_register_rx_cb() - registers the rx cb for mgmt. frames
998  * @psoc: psoc context
999  * @comp_id: umac component id
1000  * @frm_cb_info: pointer to array of structure containing frm type and callback
1001  * @num_entries: num of frames for which cb to be registered
1002  *
1003  * This function registers rx callback for mgmt. frames for
1004  * the corresponding umac component passed in the func.
1005  *
1006  * Return: QDF_STATUS_SUCCESS - in case of success
1007  */
1008 QDF_STATUS wlan_mgmt_txrx_register_rx_cb(
1009 			struct wlan_objmgr_psoc *psoc,
1010 			enum wlan_umac_comp_id comp_id,
1011 			struct mgmt_txrx_mgmt_frame_cb_info *frm_cb_info,
1012 			uint8_t num_entries);
1013 
1014 /**
1015  * wlan_mgmt_txrx_vdev_drain() - Function to drain all mgmt packets
1016  * specific to a vdev
1017  * @vdev: vdev context
1018  * @mgmt_fill_peer_cb: callback func to UMAC to fill peer into buf
1019  * @status: opaque pointer about the status of the pkts passed to UMAC
1020  *
1021  * This function drains all mgmt packets of a vdev. This can be used in the
1022  * event of target going down without sending completions.
1023  *
1024  * Return: QDF_STATUS_SUCCESS - in case of success
1025  */
1026 QDF_STATUS wlan_mgmt_txrx_vdev_drain(
1027 			struct wlan_objmgr_vdev *vdev,
1028 			mgmt_frame_fill_peer_cb mgmt_fill_peer_cb,
1029 			void *status);
1030 
1031 /**
1032  * wlan_mgmt_txrx_deregister_rx_cb() - deregisters the rx cb for mgmt. frames
1033  * @psoc: psoc context
1034  * @comp_id: umac component id
1035  * @frm_cb_info: pointer to array of structure containing frm type and callback
1036  * @num_entries: num of frames for which cb to be deregistered
1037  *
1038  * This function deregisters rx callback for mgmt. frames for
1039  * the corresponding umac component passed in the func.
1040  *
1041  * Return: QDF_STATUS_SUCCESS - in case of success
1042  */
1043 QDF_STATUS wlan_mgmt_txrx_deregister_rx_cb(
1044 			struct wlan_objmgr_psoc *psoc,
1045 			enum wlan_umac_comp_id comp_id,
1046 			struct mgmt_txrx_mgmt_frame_cb_info *frm_cb_info,
1047 			uint8_t num_entries);
1048 
1049 /**
1050  * wlan_mgmt_txrx_psoc_open() - mgmt txrx module psoc open API
1051  * @psoc: psoc context
1052  *
1053  * Return: QDF_STATUS_SUCCESS - in case of success
1054  */
1055 QDF_STATUS wlan_mgmt_txrx_psoc_open(struct wlan_objmgr_psoc *psoc);
1056 
1057 /**
1058  * wlan_mgmt_txrx_psoc_close() - mgmt txrx module psoc close API
1059  * @psoc: psoc context
1060  *
1061  * Return: QDF_STATUS_SUCCESS - in case of success
1062  */
1063 QDF_STATUS wlan_mgmt_txrx_psoc_close(struct wlan_objmgr_psoc *psoc);
1064 
1065 /**
1066  * wlan_mgmt_txrx_pdev_open() - mgmt txrx module pdev open API
1067  * @pdev: pdev context
1068  *
1069  * Return: QDF_STATUS_SUCCESS - in case of success
1070  */
1071 QDF_STATUS wlan_mgmt_txrx_pdev_open(struct wlan_objmgr_pdev *pdev);
1072 
1073 
1074 /**
1075  * wlan_mgmt_txrx_pdev_close() - mgmt txrx module pdev close API
1076  * @pdev: pdev context
1077  *
1078  * Return: QDF_STATUS_SUCCESS - in case of success
1079  */
1080 QDF_STATUS wlan_mgmt_txrx_pdev_close(struct wlan_objmgr_pdev *pdev);
1081 
1082 /**
1083  * wlan_mgmt_txrx_psoc_enable() - mgmt txrx module psoc enable API
1084  * @psoc: psoc context
1085  *
1086  * Return: QDF_STATUS_SUCCESS - in case of success
1087  */
1088 QDF_STATUS wlan_mgmt_txrx_psoc_enable(struct wlan_objmgr_psoc *psoc);
1089 
1090 /**
1091  * wlan_mgmt_txrx_psoc_disable() - mgmt txrx module psoc disable API
1092  * @psoc: psoc context
1093  *
1094  * Return: QDF_STATUS_SUCCESS - in case of success
1095  */
1096 QDF_STATUS wlan_mgmt_txrx_psoc_disable(struct wlan_objmgr_psoc *psoc);
1097 #endif
1098 
1099 
1100