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