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