1 /* 2 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 18 /** 19 * DOC: Define VDEV MLME structure and APIs 20 */ 21 #ifndef _WLAN_VDEV_MLME_H_ 22 #define _WLAN_VDEV_MLME_H_ 23 24 #include <wlan_vdev_mgr_tgt_if_rx_defs.h> 25 #include <wlan_objmgr_vdev_obj.h> 26 #include <wlan_vdev_mlme_api.h> 27 #include <wlan_ext_mlme_obj_types.h> 28 29 struct vdev_mlme_obj; 30 struct cnx_mgr; 31 32 /* Requestor ID for multiple vdev restart */ 33 #define MULTIPLE_VDEV_RESTART_REQ_ID 0x1234 34 35 /* values for vdev_type */ 36 #define WLAN_VDEV_MLME_TYPE_UNKNOWN 0x0 37 #define WLAN_VDEV_MLME_TYPE_AP 0x1 38 #define WLAN_VDEV_MLME_TYPE_STA 0x2 39 #define WLAN_VDEV_MLME_TYPE_IBSS 0x3 40 #define WLAN_VDEV_MLME_TYPE_MONITOR 0x4 41 #define WLAN_VDEV_MLME_TYPE_NAN 0x5 42 #define WLAN_VDEV_MLME_TYPE_OCB 0x6 43 #define WLAN_VDEV_MLME_TYPE_NDI 0x7 44 45 /* values for vdev_subtype */ 46 #define WLAN_VDEV_MLME_SUBTYPE_UNKNOWN 0x0 47 #define WLAN_VDEV_MLME_SUBTYPE_P2P_DEVICE 0x1 48 #define WLAN_VDEV_MLME_SUBTYPE_P2P_CLIENT 0x2 49 #define WLAN_VDEV_MLME_SUBTYPE_P2P_GO 0x3 50 #define WLAN_VDEV_MLME_SUBTYPE_PROXY_STA 0x4 51 #define WLAN_VDEV_MLME_SUBTYPE_MESH 0x5 52 #define WLAN_VDEV_MLME_SUBTYPE_MESH_11S 0x6 53 #define WLAN_VDEV_MLME_SUBTYPE_SMART_MONITOR 0x7 54 55 /* vdev control flags (per bits) */ 56 #define WLAN_VDEV_MLME_FLAGS_NON_MBSSID_AP 0x00000001 57 #define WLAN_VDEV_MLME_FLAGS_TRANSMIT_AP 0x00000002 58 #define WLAN_VDEV_MLME_FLAGS_NON_TRANSMIT_AP 0x00000004 59 #define WLAN_VDEV_MLME_FLAGS_EMA_MODE 0x00000008 60 #define WLAN_VDEV_MLME_FLAGS_MBSS_CMN_PARAM 0x00000010 61 62 /** 63 * struct vdev_mlme_proto_generic - generic mlme proto structure 64 * sent in frames 65 * @dtim_period: frequency of data transmissions per beacon 1-255 66 * @slot_time: slot time 67 * @protection_mode: rts cts protection mode 68 * @beacon_interval: beacon interval 69 * @ldpc: low density parity check value 70 * @nss: number of spatial stream 71 * @nss_2g: 2.4GHz number of spatial stream 72 * @nss_5g: 5GHz number of spatial stream 73 * @tsfadjust: adjusted timer sync value 74 */ 75 struct vdev_mlme_proto_generic { 76 uint8_t dtim_period; 77 uint32_t slot_time; 78 uint32_t protection_mode; 79 uint16_t beacon_interval; 80 uint8_t ldpc; 81 uint8_t nss; 82 uint8_t nss_2g; 83 uint8_t nss_5g; 84 uint64_t tsfadjust; 85 }; 86 87 /** 88 * struct vdev_mlme_proto_ap - ap specific mlme protocol 89 * @mapping_switch_time: Mapping switch time of T2LM 90 */ 91 struct vdev_mlme_proto_ap { 92 uint16_t mapping_switch_time; 93 }; 94 95 /** 96 * struct vdev_mlme_proto_sta - sta specific mlme protocol 97 * @assoc_id: association id of station 98 * @uapsd_cfg: uapsd configuration 99 */ 100 struct vdev_mlme_proto_sta { 101 uint16_t assoc_id; 102 uint16_t uapsd_cfg; 103 }; 104 105 /** 106 * struct vdev_mlme_proto_bss_color - bss color cfg 107 * @flags: proposed for future use cases, currently not used. 108 * @evt_type: bss color collision event. 109 * @current_bss_color: current bss color. 110 * @detection_period_ms: scan interval for both AP and STA mode. 111 * @scan_period_ms: scan period for passive scan to detect collision. 112 * @free_slot_expiry_time_ms: FW to notify host at timer expiry after 113 * which Host will disable the bss color. 114 */ 115 struct vdev_mlme_proto_bss_color { 116 uint32_t flags; 117 uint8_t evt_type; 118 uint32_t current_bss_color; 119 uint32_t detection_period_ms; 120 uint32_t scan_period_ms; 121 uint32_t free_slot_expiry_time_ms; 122 }; 123 124 /** 125 * struct vdev_mlme_vht_info - vdev VHT information 126 * @caps: vht capabilities 127 * @subfer: su beam former capability 128 * @subfee: su beam formee capability 129 * @mubfer: mu beam former capability 130 * @mubfee: mu beam formee capability 131 * @implicit_bf: Implicit BF support 132 * @sounding_dimension: Beamformer number of sounding dimension 133 * @bfee_sts_cap: beam formee STA capability 134 * @allow_vht: vht capability status 135 */ 136 struct vdev_mlme_vht_info { 137 uint32_t caps; 138 uint8_t subfer; 139 uint8_t mubfer; 140 uint8_t subfee; 141 uint8_t mubfee; 142 uint8_t implicit_bf; 143 uint8_t sounding_dimension; 144 uint8_t bfee_sts_cap; 145 bool allow_vht; 146 }; 147 148 /** 149 * struct vdev_mlme_ht_info - vdev HT information 150 * @ht_caps: HT capabilities 151 * @allow_ht: HT capability status 152 */ 153 struct vdev_mlme_ht_info { 154 uint32_t ht_caps; 155 bool allow_ht; 156 }; 157 158 /** 159 * struct vdev_mlme_he_ops_info - vdev mlme HEOPS information 160 * @he_ops: he ops 161 */ 162 struct vdev_mlme_he_ops_info { 163 uint32_t he_ops; 164 }; 165 166 #ifdef WLAN_FEATURE_11BE 167 168 /** 169 * struct vdev_mlme_eht_caps_info - vdev mlme EHT capability information 170 * @eht_maccap_epcspriaccess_support : EPCS Priority Access Supported 171 * @eht_maccap_ehtomctrl_support : EHT OM Control Support 172 * @eht_maccap_trigtxop_sharing_mode1: Triggered TXOP Sharing mode1 Support 173 * @eht_maccap_trigtxop_sharing_mode2: Triggered TXOP Sharing mode2 Support 174 * @eht_maccap_rtwt_support : Restricted TWT Support 175 * @eht_maccap_scs_traffic_description : SCS Traffic Description Support 176 * @eht_maccap_max_mpdu_len : Maximum MPDU Length 177 * @eht_maccap_max_ampdu_len_exp_etn : Maximum A-MPDU Length Exponent Extension 178 * @eht_maccap_trs_support : EHT TRS Support 179 * @eht_maccap_txop_ret_supp_in_txop_mode2: TXOP Return Support In TXOP 180 * Sharing Mode 2 181 * @eht_phycap_reserved : Reserved 182 * @eht_phycap_320mhzin6ghz : Support For 320 MHz In 6 GHz 183 * @eht_phycap_242tonerubwlt20mhz : Support for 242-tone RU In BW Wider Than 184 * 20 MHz 185 * @eht_phycap_ndp4xehtltfand320nsgi : NDP With 4. EHT-LTF And 3.2 .s GI 186 * @eht_phycap_partialbwulmu : Partial Bandwidth UL MU-MIMO 187 * @eht_phycap_subfmr : SU Beamformer 188 * @eht_phycap_subfme : SU Beamformee 189 * @eht_phycap_bfmesslt80mhz : Beamformee SS (<= 80 MHz) 190 * @eht_phycap_bfmess160mhz : Beamformee SS (= 160 MHz) 191 * @eht_phycap_bfmess320mhz : Beamformee SS (= 320 MHz) 192 * @eht_phycap_numsoundlt80mhz : Number Of Sounding Dimensions (<=80 MHz) 193 * @eht_phycap_numsound160mhz : Number Of Sounding Dimensions (=160 MHz) 194 * @eht_phycap_numsound320mhz : Number Of Sounding Dimensions (=320 MHz) 195 * @eht_phycap_ng16sufb : Ng = 16 SU Feedback 196 * @eht_phycap_ng16mufb : Ng = 16 MU Feedback 197 * @eht_phycap_codbk42sufb : Codebook Size {4,2} SU Feedback 198 * @eht_phycap_codbk75mufb : Codebook Size {4,2} MU Feedback 199 * @eht_phycap_trigsubffb : Triggered SU Beamforming Feedback 200 * @eht_phycap_trigmubfpartbwfb : Triggered MU Beamforming Partial B 201 * Feedback 202 * @eht_phycap_trigcqifb : Triggered CQI Feedback 203 * @eht_phycap_partbwdlmumimo : Partial Bandwidth DL MU-MIMO 204 * @eht_phycap_psrsr : PSR-Based SR Support 205 * @eht_phycap_pwrbstfactor : Power Boost Factor Support 206 * @eht_phycap_4xehtltfand800nsgi : EHT MU PPDU With 4xEHT-LTF And 0.8 .s GI 207 * @eht_phycap_maxnc : Max Nc 208 * @eht_phycap_nontrigcqifb : Non-Triggered CQI Feedback 209 * @eht_phycap_tx1024and4096qamls242toneru : Tx 1024-QAM And 4096-QAM < 210 * 242-tone RU Support 211 * @eht_phycap_rx1024and4096qamls242toneru : Rx 1024-QAM And 4096-QAM < 212 * 242-tone RU Support 213 * @eht_phycap_ppethrespresent : PPE Thresholds Present 214 * @eht_phycap_cmnnompktpad : Common Nominal Packet Padding 215 * @eht_phycap_maxnumehtltf : Maximum Number Of Supported EHT-LTFs 216 * @eht_phycap_supmcs15 : Support of MCS 15 217 * @eht_phycap_ehtdupin6ghz : Support Of EHT DUP In 6 GHz 218 * @eht_phycap_20mhzopstarxndpwiderbw : Support For 20 MHz Operating STA 219 * Receiving NDP With Wider Bandwidth 220 * @eht_phycap_nonofdmaulmumimolt80mhz : Non-OFDMA UL MU-MIMO (BW <= 80 MHz) 221 * @eht_phycap_nonofdmaulmumimo160mhz : Non-OFDMA UL MU-MIMO (BW = 160 MHz) 222 * @eht_phycap_nonofdmaulmumimo320mhz : Non-OFDMA UL MU-MIMO (BW = 320 MHz) 223 * @eht_phycap_mubfmrlt80mhz : MU Beamformer (BW <= 80 MHz) 224 * @eht_phycap_mubfmr160mhz : MU Beamformer (BW = 160 MHz) 225 * @eht_phycap_mubfmr320mhz : MU Beamformer (BW = 320 MHz) 226 * @eht_phycap_tb_sounding_feedback_rl: 227 * @eht_phycap_rx1024qamwiderbwdlofdma: 228 * @eht_phycap_rx4096qamwiderbwdlofdma: 229 */ 230 struct vdev_mlme_eht_caps_info { 231 uint32_t eht_maccap_epcspriaccess_support :1, 232 eht_maccap_ehtomctrl_support :1, 233 eht_maccap_trigtxop_sharing_mode1 :1, 234 eht_maccap_trigtxop_sharing_mode2 :1, 235 eht_maccap_rtwt_support :1, 236 eht_maccap_scs_traffic_description :1, 237 eht_maccap_max_mpdu_len :2, 238 eht_maccap_max_ampdu_len_exp_etn :1, 239 eht_maccap_trs_support :1, 240 eht_maccap_txop_ret_supp_in_txop_mode2 :1; 241 uint32_t eht_phycap_reserved :1, 242 eht_phycap_320mhzin6ghz :1, 243 eht_phycap_242tonerubwlt20mhz :1, 244 eht_phycap_ndp4xehtltfand320nsgi :1, 245 eht_phycap_partialbwulmu :1, 246 eht_phycap_subfmr :1, 247 eht_phycap_subfme :1, 248 eht_phycap_bfmesslt80mhz :3, 249 eht_phycap_bfmess160mhz :3, 250 eht_phycap_bfmess320mhz :3, 251 eht_phycap_numsoundlt80mhz :3, 252 eht_phycap_numsound160mhz :3, 253 eht_phycap_numsound320mhz :3, 254 eht_phycap_ng16sufb :1, 255 eht_phycap_ng16mufb :1, 256 eht_phycap_codbk42sufb :1, 257 eht_phycap_codbk75mufb :1, 258 eht_phycap_trigsubffb :1, 259 eht_phycap_trigmubfpartbwfb :1, 260 eht_phycap_trigcqifb :1; 261 uint32_t eht_phycap_partbwdlmumimo :1, 262 eht_phycap_psrsr :1, 263 eht_phycap_pwrbstfactor :1, 264 eht_phycap_4xehtltfand800nsgi :1, 265 eht_phycap_maxnc :4, 266 eht_phycap_nontrigcqifb :1, 267 eht_phycap_tx1024and4096qamls242toneru :1, 268 eht_phycap_rx1024and4096qamls242toneru :1, 269 eht_phycap_ppethrespresent :1, 270 eht_phycap_cmnnompktpad :2, 271 eht_phycap_maxnumehtltf :5, 272 eht_phycap_supmcs15 :4, 273 eht_phycap_ehtdupin6ghz :1, 274 eht_phycap_20mhzopstarxndpwiderbw :1, 275 eht_phycap_nonofdmaulmumimolt80mhz :1, 276 eht_phycap_nonofdmaulmumimo160mhz :1, 277 eht_phycap_nonofdmaulmumimo320mhz :1, 278 eht_phycap_mubfmrlt80mhz :1, 279 eht_phycap_mubfmr160mhz :1, 280 eht_phycap_mubfmr320mhz :1, 281 eht_phycap_tb_sounding_feedback_rl :1; 282 uint32_t eht_phycap_rx1024qamwiderbwdlofdma :1, 283 eht_phycap_rx4096qamwiderbwdlofdma :1; 284 }; 285 286 /** 287 * struct vdev_mlme_eht_ops_info - vdev mlme EHTOPS information 288 * @eht_ops: eht ops 289 */ 290 struct vdev_mlme_eht_ops_info { 291 uint32_t eht_ops; 292 }; 293 #endif 294 295 /** 296 * enum mlme_vdev_dot11_mode - Dot11 mode of the vdev 297 * @MLME_VDEV_DOT11_MODE_AUTO: vdev uses mlme_dot11_mode 298 * @MLME_VDEV_DOT11_MODE_11N: vdev supports 11N mode 299 * @MLME_VDEV_DOT11_MODE_11AC: vdev supports 11AC mode 300 * @MLME_VDEV_DOT11_MODE_11AX: vdev supports 11AX mode 301 * @MLME_VDEV_DOT11_MODE_11BE: vdev supports 11BE mode 302 */ 303 enum mlme_vdev_dot11_mode { 304 MLME_VDEV_DOT11_MODE_AUTO, 305 MLME_VDEV_DOT11_MODE_11N, 306 MLME_VDEV_DOT11_MODE_11AC, 307 MLME_VDEV_DOT11_MODE_11AX, 308 MLME_VDEV_DOT11_MODE_11BE, 309 }; 310 311 /** 312 * struct vdev_mlme_proto - vdev protocol structure holding information 313 * that is used in frames 314 * @vdev_dot11_mode: supported dot11 mode 315 * @generic: generic protocol information 316 * @ap: ap specific protocol information 317 * @sta: sta specific protocol information 318 * @vht_info: vht information 319 * @ht_info: ht capabilities information 320 * @he_ops_info: he ops information 321 * @eht_cap_info: EHT capability information 322 * @eht_ops_info: EHT operation information 323 * @bss_color: 11ax HE BSS Color information 324 */ 325 struct vdev_mlme_proto { 326 enum mlme_vdev_dot11_mode vdev_dot11_mode; 327 struct vdev_mlme_proto_generic generic; 328 struct vdev_mlme_proto_ap ap; 329 struct vdev_mlme_proto_sta sta; 330 struct vdev_mlme_vht_info vht_info; 331 struct vdev_mlme_ht_info ht_info; 332 struct vdev_mlme_he_ops_info he_ops_info; 333 #ifdef WLAN_FEATURE_11BE 334 struct vdev_mlme_eht_caps_info eht_cap_info; 335 struct vdev_mlme_eht_ops_info eht_ops_info; 336 #endif 337 struct vdev_mlme_proto_bss_color bss_color; 338 }; 339 340 /** 341 * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg 342 * @rts_threshold: RTS threshold 343 * @frag_threshold: Fragmentation threshold 344 * @probe_delay: time in msec for delaying to send first probe request 345 * @repeat_probe_time: probe request transmission time 346 * @drop_unencry: drop unencrypted status 347 * @tx_pwrlimit: Tx power limit 348 * @tx_power: Tx power 349 * @minpower: Min power 350 * @maxpower: Max power 351 * @maxregpower: max regulatory power 352 * @antennamax: max antenna 353 * @reg_class_id: reg domain class id 354 * @ampdu: ampdu limit 355 * @amsdu: amsdu limit 356 * @ssid: service set identifier 357 * @ssid_len: ssid length 358 * @type: vdev type 359 * @subtype: vdev subtype 360 * @rx_decap_type: rx decap type 361 * @tx_encap_type: tx encap type 362 * @disable_hw_ack: disable ha ack flag 363 * @bssid: bssid 364 * @phy_mode: phy mode 365 * @special_vdev_mode: indicates special vdev mode 366 * @he_spr_sr_ctrl: Spatial reuse SR control 367 * @he_spr_non_srg_pd_max_offset: Non-SRG PD max offset 368 * @he_spr_srg_max_pd_offset: SRG PD max offset 369 * @he_spr_srg_min_pd_offset: SRG PD min offset 370 * @he_spr_enabled: Spatial reuse enabled or not 371 * @he_spr_disabled_due_conc: spr disabled due to concurrency 372 * @sr_prohibit_enabled: 373 * @srg_bss_color: srg bss color 374 * @srg_partial_bssid: srg partial bssid 375 * @he_curr_non_srg_pd_threshold: current configured NON-SRG PD threshold 376 * @he_curr_srg_pd_threshold: current configured SRG PD threshold 377 * @is_pd_threshold_present: PD threshold is present in SR enable command or not 378 */ 379 struct vdev_mlme_mgmt_generic { 380 uint32_t rts_threshold; 381 uint32_t frag_threshold; 382 uint32_t probe_delay; 383 uint32_t repeat_probe_time; 384 uint32_t drop_unencry; 385 uint32_t tx_pwrlimit; 386 uint8_t tx_power; 387 uint8_t minpower; 388 uint8_t maxpower; 389 uint8_t maxregpower; 390 uint8_t antennamax; 391 uint8_t reg_class_id; 392 uint8_t ampdu; 393 uint8_t amsdu; 394 char ssid[WLAN_SSID_MAX_LEN + 1]; 395 uint8_t ssid_len; 396 uint8_t type; 397 uint8_t subtype; 398 uint8_t rx_decap_type; 399 uint8_t tx_encap_type; 400 bool disable_hw_ack; 401 uint8_t bssid[QDF_MAC_ADDR_SIZE]; 402 uint32_t phy_mode; 403 bool special_vdev_mode; 404 #ifdef WLAN_FEATURE_SR 405 uint8_t he_spr_sr_ctrl; 406 uint8_t he_spr_non_srg_pd_max_offset; 407 uint8_t he_spr_srg_max_pd_offset; 408 uint8_t he_spr_srg_min_pd_offset; 409 bool he_spr_enabled; 410 bool he_spr_disabled_due_conc; 411 bool sr_prohibit_enabled; 412 uint64_t srg_bss_color; 413 uint64_t srg_partial_bssid; 414 int32_t he_curr_non_srg_pd_threshold; 415 int32_t he_curr_srg_pd_threshold; 416 bool is_pd_threshold_present; 417 #endif 418 }; 419 420 /* 421 * struct wlan_vdev_aid_mgr - AID manager 422 * @aid_bitmap: AID bitmap array 423 * @start_aid: start of AID index 424 * @max_aid: Max allowed AID 425 * @ref_cnt: to share AID across VDEVs for MBSSID 426 * 427 * NB: Not using kernel-doc comment since the kernel-doc script 428 * doesn't handle the qdf_bitmap() macro. 429 */ 430 struct wlan_vdev_aid_mgr { 431 qdf_bitmap(aid_bitmap, WLAN_UMAC_MAX_AID); 432 uint16_t start_aid; 433 uint16_t max_aid; 434 qdf_atomic_t ref_cnt; 435 }; 436 437 /** 438 * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg 439 * @hidden_ssid: flag to indicate whether it is hidden ssid 440 * @cac_duration_ms: cac duration in milliseconds 441 * @aid_mgr: AID bitmap mgr 442 * @max_chan_switch_time: Max channel switch time in milliseconds. 443 * @last_bcn_ts_ms: Timestamp (in milliseconds) of the last beacon sent on the 444 * CSA triggered channel. 445 * @is_acs_mode: True if SAP is started in ACS mode 446 */ 447 struct vdev_mlme_mgmt_ap { 448 bool hidden_ssid; 449 uint32_t cac_duration_ms; 450 struct wlan_vdev_aid_mgr *aid_mgr; 451 uint32_t max_chan_switch_time; 452 unsigned long last_bcn_ts_ms; 453 bool is_acs_mode; 454 }; 455 456 /** 457 * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg 458 * @he_mcs_12_13_map: map to indicate mcs12/13 caps of peer&dut 459 */ 460 struct vdev_mlme_mgmt_sta { 461 uint16_t he_mcs_12_13_map; 462 }; 463 464 /** 465 * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters 466 * @bmiss_first_bcnt: bmiss first time 467 * @bmiss_final_bcnt: bmiss final time 468 * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be 469 * inactive 470 * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send 471 * data-null 472 * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT 473 */ 474 struct vdev_mlme_inactivity_params { 475 uint32_t bmiss_first_bcnt; 476 uint32_t bmiss_final_bcnt; 477 uint32_t keepalive_min_idle_inactive_time_secs; 478 uint32_t keepalive_max_idle_inactive_time_secs; 479 uint32_t keepalive_max_unresponsive_time_secs; 480 }; 481 482 /** 483 * enum vdev_ratemask_type - ratemask phy type 484 * @WLAN_VDEV_RATEMASK_TYPE_CCK: phy type CCK 485 * @WLAN_VDEV_RATEMASK_TYPE_HT: phy type ht 486 * @WLAN_VDEV_RATEMASK_TYPE_VHT: phy type vht 487 * @WLAN_VDEV_RATEMASK_TYPE_HE: phy type he 488 * @WLAN_VDEV_RATEMASK_TYPE_MAX: Maximum enumeration 489 */ 490 enum vdev_ratemask_type { 491 WLAN_VDEV_RATEMASK_TYPE_CCK, 492 WLAN_VDEV_RATEMASK_TYPE_HT, 493 WLAN_VDEV_RATEMASK_TYPE_VHT, 494 WLAN_VDEV_RATEMASK_TYPE_HE, 495 WLAN_VDEV_RATEMASK_TYPE_MAX, 496 }; 497 498 /** 499 * struct vdev_ratemask_params - vdev ratemask parameters 500 * @type: ratemask phy type 501 * @lower32: ratemask lower32 bitmask 502 * @higher32: ratemask higher32 bitmask 503 * @lower32_2: ratemask lower32_2 bitmask 504 * @higher32_2: rtaemask higher32_2 bitmask 505 */ 506 struct vdev_ratemask_params { 507 uint32_t lower32; 508 uint32_t higher32; 509 uint32_t lower32_2; 510 uint32_t higher32_2; 511 }; 512 513 /** 514 * struct vdev_mlme_rate_info - vdev mlme rate information 515 * @rate_flags: dynamic bandwidth info 516 * @per_band_tx_mgmt_rate: per band Tx mgmt rate 517 * @max_rate: max bandwidth rate 518 * @tx_mgmt_rate: Tx Mgmt rate 519 * @bcn_tx_rate: beacon Tx rate 520 * @bcn_tx_rate_code: beacon Tx rate code 521 * @rtscts_tx_rate: RTS/CTS Tx rate 522 * @ratemask_params: vdev ratemask params per phy type 523 * @half_rate: Half rate 524 * @quarter_rate: quarter rate 525 */ 526 struct vdev_mlme_rate_info { 527 uint32_t rate_flags; 528 uint32_t per_band_tx_mgmt_rate; 529 uint32_t max_rate; 530 uint32_t tx_mgmt_rate; 531 uint32_t bcn_tx_rate; 532 #ifdef WLAN_BCN_RATECODE_ENABLE 533 uint32_t bcn_tx_rate_code; 534 #endif 535 uint32_t rtscts_tx_rate; 536 struct vdev_ratemask_params ratemask_params[ 537 WLAN_VDEV_RATEMASK_TYPE_MAX]; 538 bool half_rate; 539 bool quarter_rate; 540 }; 541 542 /** 543 * struct vdev_mlme_chainmask_info - vdev mlme chainmask information 544 * @tx_chainmask: Tx chainmask 545 * @rx_chainmask: Rx Chainmask 546 * @num_rx_chain: Num of bits set in Rx chain 547 * @num_tx_chain: Num of bits set in Tx chain 548 */ 549 struct vdev_mlme_chainmask_info { 550 uint8_t tx_chainmask; 551 uint8_t rx_chainmask; 552 uint8_t num_rx_chain; 553 uint8_t num_tx_chain; 554 }; 555 556 /** 557 * struct vdev_mlme_powersave_info - vdev mlme powersave information 558 * @packet_powersave: packet powersave 559 * @max_li_of_moddtim: max mod dtim 560 * @dyndtim_cnt: dynamic dtim count 561 * @listen_interval: listen interval 562 * @moddtim_cnt: mod dtim count 563 */ 564 struct vdev_mlme_powersave_info { 565 uint32_t packet_powersave; 566 uint32_t max_li_of_moddtim; 567 uint32_t dyndtim_cnt; 568 uint32_t listen_interval; 569 uint32_t moddtim_cnt; 570 }; 571 572 /** 573 * struct vdev_mlme_beacon_info - vdev mlme beacon information 574 * @beacon_buffer: buffer allocated for beacon frame 575 * @beacon_offsets: beacon IE's offsets 576 */ 577 struct vdev_mlme_beacon_info { 578 qdf_nbuf_t beacon_buffer; 579 void *beacon_offsets; 580 }; 581 582 /** 583 * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd 584 * @profile_idx: profile index of the connected non-trans ap (mbssid case). 585 * 0 means invalid. 586 * @profile_num: the total profile numbers of non-trans aps (mbssid case). 587 * 0 means non-MBSS AP. 588 * @mbssid_flags: MBSS IE flags indicating vdev type 589 * @vdevid_trans: id of transmitting vdev for MBSS IE 590 * @vdev_bmap: vdev bitmap of VAPs in MBSS group 591 * @is_cmn_param: flag to check mbss common param 592 * @trans_bssid: bssid of transmitted AP (MBSS IE case) 593 * @is_multi_mbssid: Flag to identify multi group mbssid support 594 * @grp_id: Group id of current vdev 595 */ 596 struct vdev_mlme_mbss_11ax { 597 uint32_t profile_idx; 598 uint32_t profile_num; 599 uint32_t mbssid_flags; 600 uint8_t vdevid_trans; 601 unsigned long vdev_bmap; 602 bool is_cmn_param; 603 uint8_t trans_bssid[QDF_MAC_ADDR_SIZE]; 604 bool is_multi_mbssid; 605 uint32_t grp_id; 606 }; 607 608 /** 609 * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg 610 * @generic: generic mgmt information 611 * @ap: ap specific mgmt information 612 * @sta: sta specific mgmt information 613 * @inactivity_params: inactivity parameters 614 * @rate_info: bandwidth rate information 615 * @chainmask_info: Chainmask information 616 * @powersave_info: Power save parameters 617 * @beacon_info: beacon buffer information 618 * @mbss_11ax: MBSS 11ax information 619 */ 620 struct vdev_mlme_mgmt { 621 struct vdev_mlme_mgmt_generic generic; 622 struct vdev_mlme_mgmt_ap ap; 623 struct vdev_mlme_mgmt_sta sta; 624 struct vdev_mlme_inactivity_params inactivity_params; 625 struct vdev_mlme_rate_info rate_info; 626 struct vdev_mlme_chainmask_info chainmask_info; 627 struct vdev_mlme_powersave_info powersave_info; 628 struct vdev_mlme_beacon_info beacon_info; 629 struct vdev_mlme_mbss_11ax mbss_11ax; 630 }; 631 632 /** 633 * enum beacon_update_op - Beacon update op type 634 * @BEACON_INIT: Initialize beacon 635 * @BEACON_REINIT: Re-initialize beacon 636 * @BEACON_UPDATE: Update dynamic fields of beacon 637 * @BEACON_CSA: Enable CSA IE 638 * @BEACON_FREE: Beacon buffer free 639 */ 640 enum beacon_update_op { 641 BEACON_INIT, 642 BEACON_REINIT, 643 BEACON_UPDATE, 644 BEACON_CSA, 645 BEACON_FREE, 646 }; 647 648 /** 649 * enum vdev_cmd_type - Command type 650 * @START_REQ: Start request 651 * @RESTART_REQ: Restart request 652 * @STOP_REQ: STOP request 653 * @DELETE_REQ: DELETE request 654 */ 655 enum vdev_cmd_type { 656 START_REQ, 657 RESTART_REQ, 658 STOP_REQ, 659 DELETE_REQ, 660 }; 661 662 /** 663 * enum vdev_start_resp_type - start respone type 664 * @START_RESPONSE: Start response 665 * @RESTART_RESPONSE: Restart response 666 */ 667 enum vdev_start_resp_type { 668 START_RESPONSE = 0, 669 RESTART_RESPONSE, 670 }; 671 672 /** 673 * struct vdev_mlme_ops - VDEV MLME operation callbacks structure 674 * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params 675 * @mlme_vdev_reset_proto_params: callback to Reset protocol params 676 * @mlme_vdev_start_send: callback to initiate actions of VDEV 677 * MLME start operation 678 * @mlme_vdev_restart_send: callback to initiate actions of VDEV 679 * MLME restart operation 680 * @mlme_vdev_stop_start_send: callback to block start/restart VDEV 681 * request command 682 * @mlme_vdev_start_continue: callback to initiate operations on 683 * LMAC/FW start response 684 * @mlme_vdev_sta_conn_start: callback to initiate STA connection 685 * @mlme_vdev_start_req_failed: 686 * @mlme_vdev_up_send: callback to initiate actions of VDEV 687 * MLME up operation 688 * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving 689 * to UP state 690 * @mlme_vdev_notify_roam_start: callback to initiate roaming 691 * @mlme_vdev_update_beacon: callback to initiate beacon update 692 * @mlme_vdev_disconnect_peers: callback to initiate disconnection of 693 * peers 694 * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer 695 * @mlme_vdev_stop_send: callback to initiate actions of VDEV 696 * MLME stop operation 697 * @mlme_vdev_stop_continue: callback to initiate operations on 698 * LMAC/FW stop response 699 * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS 700 * peer delete completion 701 * @mlme_vdev_down_send: callback to initiate actions of VDEV 702 * MLME down operation 703 * @mlme_vdev_notify_down_complete: 704 * @mlme_vdev_ext_stop_rsp: 705 * @mlme_vdev_ext_start_rsp: 706 * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start 707 * start state exit 708 * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required 709 * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for 710 * vdev mlme peer delete all response 711 * @mlme_vdev_dfs_cac_wait_notify: callback to notify about CAC state 712 * @mlme_vdev_csa_complete: callback to indicate CSA complete 713 * @mlme_vdev_sta_disconn_start: callback to initiate STA disconnection 714 * @mlme_vdev_reconfig_timer_complete: callback to process ml reconfing 715 * operation 716 * @mlme_vdev_notify_mlo_sync_wait_entry: 717 */ 718 struct vdev_mlme_ops { 719 QDF_STATUS (*mlme_vdev_validate_basic_params)( 720 struct vdev_mlme_obj *vdev_mlme, 721 uint16_t event_data_len, void *event_data); 722 QDF_STATUS (*mlme_vdev_reset_proto_params)( 723 struct vdev_mlme_obj *vdev_mlme, 724 uint16_t event_data_len, void *event_data); 725 QDF_STATUS (*mlme_vdev_start_send)( 726 struct vdev_mlme_obj *vdev_mlme, 727 uint16_t event_data_len, void *event_data); 728 QDF_STATUS (*mlme_vdev_restart_send)( 729 struct vdev_mlme_obj *vdev_mlme, 730 uint16_t event_data_len, void *event_data); 731 QDF_STATUS (*mlme_vdev_stop_start_send)( 732 struct vdev_mlme_obj *vdev_mlme, 733 enum vdev_cmd_type type, 734 uint16_t event_data_len, void *event_data); 735 QDF_STATUS (*mlme_vdev_start_continue)( 736 struct vdev_mlme_obj *vdev_mlme, 737 uint16_t event_data_len, void *event_data); 738 QDF_STATUS (*mlme_vdev_sta_conn_start)( 739 struct vdev_mlme_obj *vdev_mlme, 740 uint16_t event_data_len, void *event_data); 741 QDF_STATUS (*mlme_vdev_start_req_failed)( 742 struct vdev_mlme_obj *vdev_mlme, 743 uint16_t event_data_len, void *event_data); 744 QDF_STATUS (*mlme_vdev_up_send)( 745 struct vdev_mlme_obj *vdev_mlme, 746 uint16_t event_data_len, void *event_data); 747 QDF_STATUS (*mlme_vdev_notify_up_complete)( 748 struct vdev_mlme_obj *vdev_mlme, 749 uint16_t event_data_len, void *event_data); 750 QDF_STATUS (*mlme_vdev_notify_roam_start)( 751 struct vdev_mlme_obj *vdev_mlme, 752 uint16_t event_data_len, void *event_data); 753 QDF_STATUS (*mlme_vdev_update_beacon)( 754 struct vdev_mlme_obj *vdev_mlme, 755 enum beacon_update_op op, 756 uint16_t event_data_len, void *event_data); 757 QDF_STATUS (*mlme_vdev_disconnect_peers)( 758 struct vdev_mlme_obj *vdev_mlme, 759 uint16_t event_data_len, void *event_data); 760 QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)( 761 struct vdev_mlme_obj *vdev_mlme, 762 uint16_t event_data_len, void *event_data); 763 QDF_STATUS (*mlme_vdev_stop_send)( 764 struct vdev_mlme_obj *vdev_mlme, 765 uint16_t event_data_len, void *event_data); 766 QDF_STATUS (*mlme_vdev_stop_continue)( 767 struct vdev_mlme_obj *vdev_mlme, 768 uint16_t event_data_len, void *event_data); 769 QDF_STATUS (*mlme_vdev_down_send)( 770 struct vdev_mlme_obj *vdev_mlme, 771 uint16_t event_data_len, void *event_data); 772 QDF_STATUS (*mlme_vdev_notify_down_complete)( 773 struct vdev_mlme_obj *vdev_mlme, 774 uint16_t event_data_len, void *event_data); 775 QDF_STATUS (*mlme_vdev_ext_stop_rsp)( 776 struct vdev_mlme_obj *vdev_mlme, 777 struct vdev_stop_response *rsp); 778 QDF_STATUS (*mlme_vdev_ext_start_rsp)( 779 struct vdev_mlme_obj *vdev_mlme, 780 struct vdev_start_response *rsp); 781 QDF_STATUS (*mlme_vdev_notify_start_state_exit)( 782 struct vdev_mlme_obj *vdev_mlme); 783 QDF_STATUS (*mlme_vdev_is_newchan_no_cac)( 784 struct vdev_mlme_obj *vdev_mlme); 785 QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)( 786 struct vdev_mlme_obj *vdev_mlme, 787 struct peer_delete_all_response *rsp); 788 QDF_STATUS (*mlme_vdev_dfs_cac_wait_notify)( 789 struct vdev_mlme_obj *vdev_mlme); 790 QDF_STATUS (*mlme_vdev_csa_complete)( 791 struct vdev_mlme_obj *vdev_mlme); 792 QDF_STATUS (*mlme_vdev_sta_disconn_start)( 793 struct vdev_mlme_obj *vdev_mlme, 794 uint16_t event_data_len, void *event_data); 795 void (*mlme_vdev_reconfig_timer_complete)( 796 struct vdev_mlme_obj *vdev_mlme); 797 QDF_STATUS (*mlme_vdev_notify_mlo_sync_wait_entry)( 798 struct vdev_mlme_obj *vdev_mlme); 799 }; 800 801 /** 802 * struct vdev_mlme_obj - VDEV MLME component object 803 * @proto: VDEV MLME proto substructure 804 * @mgmt: VDEV MLME mgmt substructure 805 * @sm_lock: VDEV SM lock 806 * @vdev_cmd_lock: VDEV MLME command atomicity 807 * @sm_hdl: VDEV SM handle 808 * @cnx_mgr_ctx: connection manager context, valid for STA and P2P-CLI mode only 809 * @vdev: Pointer to vdev objmgr 810 * @ops: VDEV MLME callback table 811 * @ext_vdev_ptr: VDEV MLME legacy pointer 812 * @reg_tpc_obj: Regulatory transmit power info 813 * @ml_reconfig_timer: VDEV ml reconfig timer 814 * @ml_reconfig_started: Flag to indicate reconfig status for vdev 815 */ 816 struct vdev_mlme_obj { 817 struct vdev_mlme_proto proto; 818 struct vdev_mlme_mgmt mgmt; 819 #ifdef VDEV_SM_LOCK_SUPPORT 820 qdf_spinlock_t sm_lock; 821 qdf_mutex_t vdev_cmd_lock; 822 #endif 823 struct wlan_sm *sm_hdl; 824 union { 825 struct cnx_mgr *cnx_mgr_ctx; 826 }; 827 struct wlan_objmgr_vdev *vdev; 828 struct vdev_mlme_ops *ops; 829 mlme_vdev_ext_t *ext_vdev_ptr; 830 struct reg_tpc_power_info reg_tpc_obj; 831 qdf_timer_t ml_reconfig_timer; 832 bool ml_reconfig_started; 833 }; 834 835 /** 836 * wlan_vdev_mlme_set_ssid() - set ssid 837 * @vdev: VDEV object 838 * @ssid: SSID (input) 839 * @ssid_len: Length of SSID 840 * 841 * API to set the SSID of VDEV 842 * 843 * Caller need to acquire lock with wlan_vdev_obj_lock() 844 * 845 * Return: QDF_STATUS_SUCCESS, if update is done 846 * QDF_STATUS error, if ssid length is > max ssid len 847 */ 848 static inline QDF_STATUS wlan_vdev_mlme_set_ssid( 849 struct wlan_objmgr_vdev *vdev, 850 const uint8_t *ssid, uint8_t ssid_len) 851 { 852 struct vdev_mlme_obj *vdev_mlme; 853 854 /* This API is invoked with lock acquired, do not add log prints */ 855 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 856 if (!vdev_mlme) 857 return QDF_STATUS_E_FAILURE; 858 859 if (ssid_len <= WLAN_SSID_MAX_LEN) { 860 qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len); 861 vdev_mlme->mgmt.generic.ssid_len = ssid_len; 862 } else { 863 vdev_mlme->mgmt.generic.ssid_len = 0; 864 return QDF_STATUS_E_FAILURE; 865 } 866 return QDF_STATUS_SUCCESS; 867 } 868 869 /** 870 * wlan_vdev_mlme_get_ssid() - get ssid 871 * @vdev: VDEV object 872 * @ssid: SSID 873 * @ssid_len: Length of SSID 874 * 875 * API to get the SSID of VDEV, it updates the SSID and its length 876 * in @ssid, @ssid_len respectively 877 * 878 * Caller need to acquire lock with wlan_vdev_obj_lock() 879 * 880 * Return: SUCCESS, if update is done 881 * FAILURE, if ssid length is > max ssid len 882 */ 883 static inline QDF_STATUS wlan_vdev_mlme_get_ssid( 884 struct wlan_objmgr_vdev *vdev, 885 uint8_t *ssid, uint8_t *ssid_len) 886 { 887 struct vdev_mlme_obj *vdev_mlme; 888 889 /* This API is invoked with lock acquired, do not add log prints */ 890 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 891 if (!vdev_mlme) 892 return QDF_STATUS_E_FAILURE; 893 894 if (vdev_mlme->mgmt.generic.ssid_len > 0) { 895 *ssid_len = vdev_mlme->mgmt.generic.ssid_len; 896 qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len); 897 } else { 898 *ssid_len = 0; 899 return QDF_STATUS_E_FAILURE; 900 } 901 return QDF_STATUS_SUCCESS; 902 } 903 904 /** 905 * wlan_vdev_mlme_set_nss() - set NSS 906 * @vdev: VDEV object 907 * @nss: nss configured by user 908 * 909 * API to set the Number of Spatial streams 910 * 911 * Return: void 912 */ 913 static inline void wlan_vdev_mlme_set_nss( 914 struct wlan_objmgr_vdev *vdev, 915 uint8_t nss) 916 { 917 struct vdev_mlme_obj *vdev_mlme; 918 919 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 920 if (!vdev_mlme) 921 return; 922 923 vdev_mlme->proto.generic.nss = nss; 924 } 925 926 /** 927 * wlan_vdev_mlme_get_nss() - get NSS 928 * @vdev: VDEV object 929 * 930 * API to get the Number of Spatial Streams 931 * 932 * Return: nss value 933 */ 934 static inline uint8_t wlan_vdev_mlme_get_nss( 935 struct wlan_objmgr_vdev *vdev) 936 { 937 struct vdev_mlme_obj *vdev_mlme; 938 939 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 940 if (!vdev_mlme) 941 return 0; 942 943 return vdev_mlme->proto.generic.nss; 944 } 945 946 /** 947 * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask 948 * @vdev: VDEV object 949 * @chainmask : chainmask either configured by user or max supported 950 * 951 * API to set the Tx chainmask 952 * 953 * Return: void 954 */ 955 static inline void wlan_vdev_mlme_set_txchainmask( 956 struct wlan_objmgr_vdev *vdev, 957 uint8_t chainmask) 958 { 959 struct vdev_mlme_obj *vdev_mlme; 960 961 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 962 963 if (!vdev_mlme) 964 return; 965 966 vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask; 967 } 968 969 /** 970 * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask 971 * @vdev: VDEV object 972 * 973 * API to get the Tx chainmask 974 * 975 * Return: Tx chainmask either configured by user or max supported 976 */ 977 static inline uint8_t wlan_vdev_mlme_get_txchainmask( 978 struct wlan_objmgr_vdev *vdev) 979 { 980 struct vdev_mlme_obj *vdev_mlme; 981 982 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 983 if (!vdev_mlme) 984 return 0; 985 986 return vdev_mlme->mgmt.chainmask_info.tx_chainmask; 987 } 988 989 /** 990 * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask 991 * @vdev: VDEV object 992 * @chainmask : Rx chainmask either configured by user or max supported 993 * 994 * API to set the Rx chainmask 995 * 996 * Return: void 997 */ 998 static inline void wlan_vdev_mlme_set_rxchainmask( 999 struct wlan_objmgr_vdev *vdev, 1000 uint8_t chainmask) 1001 { 1002 struct vdev_mlme_obj *vdev_mlme; 1003 1004 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1005 if (!vdev_mlme) 1006 return; 1007 1008 vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask; 1009 } 1010 1011 /** 1012 * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask 1013 * @vdev: VDEV object 1014 * 1015 * API to get the Rx chainmask 1016 * 1017 * Return: Rx chainmask either configured by user or max supported 1018 */ 1019 static inline uint8_t wlan_vdev_mlme_get_rxchainmask( 1020 struct wlan_objmgr_vdev *vdev) 1021 { 1022 struct vdev_mlme_obj *vdev_mlme; 1023 1024 /* This API is invoked with lock acquired, do not add log prints */ 1025 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1026 if (!vdev_mlme) 1027 return 0; 1028 1029 return vdev_mlme->mgmt.chainmask_info.rx_chainmask; 1030 } 1031 1032 /** 1033 * wlan_vdev_mlme_set_txpower() - set tx power 1034 * @vdev: VDEV object 1035 * @txpow: tx power either configured by used or max allowed 1036 * 1037 * API to set the tx power 1038 * 1039 * Return: void 1040 */ 1041 static inline void wlan_vdev_mlme_set_txpower( 1042 struct wlan_objmgr_vdev *vdev, 1043 uint8_t txpow) 1044 { 1045 struct vdev_mlme_obj *vdev_mlme; 1046 1047 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1048 if (!vdev_mlme) 1049 return; 1050 1051 vdev_mlme->mgmt.generic.tx_power = txpow; 1052 } 1053 1054 /** 1055 * wlan_vdev_mlme_get_txpower() - get tx power 1056 * @vdev: VDEV object 1057 * 1058 * API to get the tx power 1059 * 1060 * Return: tx power either configured by used or max allowed 1061 */ 1062 static inline uint8_t wlan_vdev_mlme_get_txpower( 1063 struct wlan_objmgr_vdev *vdev) 1064 { 1065 struct vdev_mlme_obj *vdev_mlme; 1066 1067 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1068 if (!vdev_mlme) 1069 return 0; 1070 1071 return vdev_mlme->mgmt.generic.tx_power; 1072 } 1073 1074 /** 1075 * wlan_vdev_mlme_set_maxrate() - set max rate 1076 * @vdev: VDEV object 1077 * @maxrate: configured by used or based on configured mode 1078 * 1079 * API to set the max rate the vdev supports 1080 * 1081 * Return: void 1082 */ 1083 static inline void wlan_vdev_mlme_set_maxrate( 1084 struct wlan_objmgr_vdev *vdev, 1085 uint32_t maxrate) 1086 { 1087 struct vdev_mlme_obj *vdev_mlme; 1088 1089 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1090 if (!vdev_mlme) 1091 return; 1092 1093 vdev_mlme->mgmt.rate_info.max_rate = maxrate; 1094 } 1095 1096 /** 1097 * wlan_vdev_mlme_get_maxrate() - get max rate 1098 * @vdev: VDEV object 1099 * 1100 * API to get the max rate the vdev supports 1101 * 1102 * Return: configured by used or based on configured mode 1103 */ 1104 static inline uint32_t wlan_vdev_mlme_get_maxrate( 1105 struct wlan_objmgr_vdev *vdev) 1106 { 1107 struct vdev_mlme_obj *vdev_mlme; 1108 1109 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1110 if (!vdev_mlme) 1111 return 0; 1112 1113 return vdev_mlme->mgmt.rate_info.max_rate; 1114 } 1115 1116 /** 1117 * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate 1118 * @vdev: VDEV object 1119 * @txmgmtrate: Tx Mgmt rate 1120 * 1121 * API to set Mgmt Tx rate 1122 * 1123 * Return: void 1124 */ 1125 static inline void wlan_vdev_mlme_set_txmgmtrate( 1126 struct wlan_objmgr_vdev *vdev, 1127 uint32_t txmgmtrate) 1128 { 1129 struct vdev_mlme_obj *vdev_mlme; 1130 1131 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1132 if (!vdev_mlme) 1133 return; 1134 1135 vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate; 1136 } 1137 1138 /** 1139 * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate 1140 * @vdev: VDEV object 1141 * 1142 * API to get Mgmt Tx rate 1143 * 1144 * Return: Tx Mgmt rate 1145 */ 1146 static inline uint32_t wlan_vdev_mlme_get_txmgmtrate( 1147 struct wlan_objmgr_vdev *vdev) 1148 { 1149 struct vdev_mlme_obj *vdev_mlme; 1150 1151 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1152 if (!vdev_mlme) 1153 return 0; 1154 1155 return vdev_mlme->mgmt.rate_info.tx_mgmt_rate; 1156 } 1157 1158 /** 1159 * wlan_vdev_mlme_is_special_vdev() - check given vdev is a special vdev 1160 * @vdev: VDEV object 1161 * 1162 * API to check given vdev is a special vdev. 1163 * 1164 * Return: true if given vdev is special vdev, else false 1165 */ 1166 static inline bool wlan_vdev_mlme_is_special_vdev( 1167 struct wlan_objmgr_vdev *vdev) 1168 { 1169 struct vdev_mlme_obj *vdev_mlme; 1170 1171 if (!vdev) 1172 return false; 1173 1174 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1175 if (!vdev_mlme) 1176 return false; 1177 1178 return vdev_mlme->mgmt.generic.special_vdev_mode; 1179 } 1180 1181 #ifdef WLAN_FEATURE_11AX 1182 /** 1183 * wlan_vdev_mlme_set_he_mcs_12_13_map() - set he mcs12/13 map 1184 * @vdev: VDEV object 1185 * @he_mcs_12_13_map: he mcs12/13 map from self&peer 1186 * 1187 * API to set he mcs 12/13 map 1188 * 1189 * Return: void 1190 */ 1191 static inline void wlan_vdev_mlme_set_he_mcs_12_13_map( 1192 struct wlan_objmgr_vdev *vdev, 1193 uint16_t he_mcs_12_13_map) 1194 { 1195 struct vdev_mlme_obj *vdev_mlme; 1196 1197 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1198 if (!vdev_mlme) 1199 return; 1200 1201 vdev_mlme->mgmt.sta.he_mcs_12_13_map = he_mcs_12_13_map; 1202 } 1203 1204 /** 1205 * wlan_vdev_mlme_get_he_mcs_12_13_map() - get he mcs12/13 map 1206 * @vdev: VDEV object 1207 * 1208 * API to get he mcs12/13 support capability 1209 * 1210 * Return: he mcs12/13 map 1211 */ 1212 static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map( 1213 struct wlan_objmgr_vdev *vdev) 1214 { 1215 struct vdev_mlme_obj *vdev_mlme; 1216 1217 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1218 if (!vdev_mlme) 1219 return 0; 1220 1221 return vdev_mlme->mgmt.sta.he_mcs_12_13_map; 1222 } 1223 1224 #ifdef WLAN_FEATURE_SR 1225 /** 1226 * wlan_vdev_mlme_get_sr_ctrl() - get spatial reuse SR control 1227 * @vdev: VDEV object 1228 * 1229 * API to retrieve the spatial reuse SR control from VDEV 1230 * 1231 * Caller need to acquire lock with wlan_vdev_obj_lock() 1232 * 1233 * Return: SR control 1234 */ 1235 static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev) 1236 { 1237 struct vdev_mlme_obj *vdev_mlme; 1238 1239 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1240 if (!vdev_mlme) 1241 return 0; 1242 1243 return vdev_mlme->mgmt.generic.he_spr_sr_ctrl; 1244 } 1245 1246 /** 1247 * wlan_vdev_mlme_get_non_srg_pd_offset() - get spatial reuse non srg pd offset 1248 * @vdev: VDEV object 1249 * 1250 * API to retrieve the spatial reuse pd offset from VDEV 1251 * 1252 * Return: max non srg pd offset 1253 */ 1254 static inline uint8_t wlan_vdev_mlme_get_non_srg_pd_offset( 1255 struct wlan_objmgr_vdev *vdev) 1256 { 1257 struct vdev_mlme_obj *vdev_mlme; 1258 1259 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1260 if (!vdev_mlme) 1261 return 0; 1262 1263 return vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset; 1264 } 1265 1266 /** 1267 * wlan_vdev_mlme_get_he_spr_enabled() - spatial reuse enabled or not 1268 * @vdev: VDEV object 1269 * 1270 * API to check whether the spatial reuse enabled or not 1271 * 1272 * Return: true if Spatial reuse enabled, false if not 1273 */ 1274 static inline bool wlan_vdev_mlme_get_he_spr_enabled( 1275 struct wlan_objmgr_vdev *vdev) 1276 { 1277 struct vdev_mlme_obj *vdev_mlme; 1278 1279 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1280 if (!vdev_mlme) 1281 return false; 1282 1283 return vdev_mlme->mgmt.generic.he_spr_enabled; 1284 } 1285 1286 /** 1287 * wlan_vdev_mlme_is_sr_disable_due_conc() - spatial reuse disabled due 1288 * to concurrency 1289 * @vdev: VDEV object 1290 * 1291 * API to check whether the spatial reuse disabled due to concurrency or not 1292 * 1293 * Caller need to acquire lock with wlan_vdev_obj_lock() 1294 * 1295 * Return: 1296 * true/false: true if spatial reuse disabled due to concurrency else false 1297 */ 1298 static inline 1299 bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev) 1300 { 1301 struct vdev_mlme_obj *vdev_mlme; 1302 1303 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1304 if (!vdev_mlme) 1305 return false; 1306 1307 return vdev_mlme->mgmt.generic.he_spr_disabled_due_conc; 1308 } 1309 1310 /** 1311 * wlan_vdev_mlme_is_sr_prohibit_en() - spatial reuse PD prohibit enabled 1312 * / disabled (HE_SIGA_Val15_Allowed) 1313 * @vdev: VDEV object 1314 * 1315 * API to check whether the spatial reuse PD prohibit is enabled / disabled 1316 * 1317 * Caller need to acquire lock with wlan_vdev_obj_lock() 1318 * 1319 * Return: true/false: Spatial reuse PD prohibit enabled / disabled 1320 */ 1321 static inline 1322 bool wlan_vdev_mlme_is_sr_prohibit_en(struct wlan_objmgr_vdev *vdev) 1323 { 1324 struct vdev_mlme_obj *vdev_mlme; 1325 1326 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1327 if (!vdev_mlme) 1328 return false; 1329 1330 return vdev_mlme->mgmt.generic.sr_prohibit_enabled; 1331 } 1332 1333 /** 1334 * wlan_vdev_mlme_set_sr_ctrl() - set spatial reuse SR control 1335 * @vdev: VDEV object 1336 * @sr_ctrl: value to set 1337 * 1338 * API to set the spatial reuse SR control 1339 * 1340 * Caller need to acquire lock with wlan_vdev_obj_lock() 1341 * 1342 * Return: void 1343 */ 1344 static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev, 1345 uint8_t sr_ctrl) 1346 { 1347 struct vdev_mlme_obj *vdev_mlme; 1348 1349 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1350 if (!vdev_mlme) 1351 return; 1352 1353 vdev_mlme->mgmt.generic.he_spr_sr_ctrl = sr_ctrl; 1354 } 1355 1356 /** 1357 * wlan_vdev_mlme_set_non_srg_pd_offset() - set spatial reuse non srg 1358 * pd max offset 1359 * @vdev: VDEV object 1360 * @non_srg_pd_max_offset: value to set 1361 * 1362 * API to set the spatial reuse pd max offset 1363 * 1364 * Return: void 1365 */ 1366 static inline void 1367 wlan_vdev_mlme_set_non_srg_pd_offset(struct wlan_objmgr_vdev *vdev, 1368 uint8_t non_srg_pd_max_offset) 1369 { 1370 struct vdev_mlme_obj *vdev_mlme; 1371 1372 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1373 if (!vdev_mlme) 1374 return; 1375 1376 vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset = 1377 non_srg_pd_max_offset; 1378 } 1379 1380 /** 1381 * wlan_vdev_mlme_set_he_spr_enabled() - set spatial reuse enabled 1382 * @vdev: VDEV object 1383 * @enable_he_spr: value to set 1384 * 1385 * API to set the spatial reuse enabled 1386 * 1387 * Return: void 1388 */ 1389 static inline void wlan_vdev_mlme_set_he_spr_enabled( 1390 struct wlan_objmgr_vdev *vdev, 1391 bool enable_he_spr) 1392 { 1393 struct vdev_mlme_obj *vdev_mlme; 1394 1395 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1396 if (!vdev_mlme) 1397 return; 1398 1399 vdev_mlme->mgmt.generic.he_spr_enabled = enable_he_spr; 1400 } 1401 1402 /** 1403 * wlan_vdev_mlme_set_sr_disable_due_conc() - set spatial reuse disabled due 1404 * to concurrency 1405 * @vdev: VDEV object 1406 * @he_spr_disabled_due_conc: value to set 1407 * 1408 * API to set the spatial reuse disabled due to concurrency 1409 * 1410 * Caller need to acquire lock with wlan_vdev_obj_lock() 1411 * 1412 * Return: void 1413 */ 1414 static inline 1415 void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev, 1416 bool he_spr_disabled_due_conc) 1417 { 1418 struct vdev_mlme_obj *vdev_mlme; 1419 1420 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1421 if (!vdev_mlme) 1422 return; 1423 1424 vdev_mlme->mgmt.generic.he_spr_disabled_due_conc = 1425 he_spr_disabled_due_conc; 1426 } 1427 1428 /** 1429 * wlan_vdev_mlme_set_sr_prohibit_en() - set spatial reuse PD prohibit enabled 1430 * / disabled (HE_SIGA_Val15_Allowed) 1431 * @vdev: VDEV object 1432 * @sr_prohibit_enabled: True / False - PD Prohibit enabled / disabled 1433 * 1434 * API to set spatial reuse PD prohibit enabled / disabled 1435 * 1436 * Caller need to acquire lock with wlan_vdev_obj_lock() 1437 * 1438 * Return: void 1439 */ 1440 static inline 1441 void wlan_vdev_mlme_set_sr_prohibit_en(struct wlan_objmgr_vdev *vdev, 1442 bool sr_prohibit_enabled) 1443 { 1444 struct vdev_mlme_obj *vdev_mlme; 1445 1446 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1447 if (!vdev_mlme) 1448 return; 1449 1450 vdev_mlme->mgmt.generic.sr_prohibit_enabled = sr_prohibit_enabled; 1451 } 1452 1453 /** 1454 * wlan_vdev_mlme_set_srg_pd_offset() - set spatial reuse SRG pd max/min offset 1455 * @vdev: VDEV object 1456 * @srg_max_pd_offset: SRG max pd offset 1457 * @srg_min_pd_offset: SRG min pd offset 1458 * 1459 * API to set the spatial reuse SRG pd min max offset 1460 * 1461 * Return: void 1462 */ 1463 static inline 1464 void wlan_vdev_mlme_set_srg_pd_offset(struct wlan_objmgr_vdev *vdev, 1465 uint8_t srg_max_pd_offset, 1466 uint8_t srg_min_pd_offset) 1467 { 1468 struct vdev_mlme_obj *vdev_mlme; 1469 1470 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1471 if (!vdev_mlme) 1472 return; 1473 1474 vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset = srg_max_pd_offset; 1475 vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset = srg_min_pd_offset; 1476 } 1477 1478 /** 1479 * wlan_vdev_mlme_get_srg_pd_offset() - get spatial reuse SRG pd min/max offset 1480 * @vdev: VDEV object 1481 * @srg_max_pd_offset: SRG max pd offset 1482 * @srg_min_pd_offset: SRG min pd offset 1483 * 1484 * API to set the spatial reuse SRG pd min max offset 1485 * 1486 * Return: void 1487 */ 1488 static inline 1489 void wlan_vdev_mlme_get_srg_pd_offset(struct wlan_objmgr_vdev *vdev, 1490 uint8_t *srg_max_pd_offset, 1491 uint8_t *srg_min_pd_offset) 1492 { 1493 struct vdev_mlme_obj *vdev_mlme; 1494 1495 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1496 if (!vdev_mlme) 1497 return; 1498 1499 *srg_max_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset; 1500 *srg_min_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset; 1501 } 1502 1503 /** 1504 * wlan_vdev_mlme_set_srg_bss_color_bit_map() - set spatial reuse bss 1505 * color bitmap 1506 * @vdev: VDEV object 1507 * @srg_bss_color: SRG BSS color bitmap 1508 * 1509 * API to set the spatial reuse bss color bit map 1510 * 1511 * Return: void 1512 */ 1513 static inline 1514 void wlan_vdev_mlme_set_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev, 1515 uint64_t srg_bss_color) 1516 { 1517 struct vdev_mlme_obj *vdev_mlme; 1518 1519 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1520 if (!vdev_mlme) 1521 return; 1522 1523 vdev_mlme->mgmt.generic.srg_bss_color = srg_bss_color; 1524 } 1525 1526 /** 1527 * wlan_vdev_mlme_set_srg_partial_bssid_bit_map() - set spatial reuse 1528 * srg partial bitmap 1529 * @vdev: VDEV object 1530 * @srg_partial_bssid: SRG partial BSSID bitmap 1531 * 1532 * API to set the spatial reuse partial bssid bitmap 1533 * 1534 * Return: void 1535 */ 1536 static inline 1537 void wlan_vdev_mlme_set_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev, 1538 uint64_t srg_partial_bssid) 1539 { 1540 struct vdev_mlme_obj *vdev_mlme; 1541 1542 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1543 if (!vdev_mlme) 1544 return; 1545 1546 vdev_mlme->mgmt.generic.srg_partial_bssid = srg_partial_bssid; 1547 } 1548 1549 /** 1550 * wlan_vdev_mlme_get_srg_bss_color_bit_map() - get spatial reuse bss 1551 * colorbitmap 1552 * @vdev: VDEV object 1553 * @srg_bss_color: SRG BSS color bitmap 1554 * 1555 * API to get the spatial reuse bss color bit map 1556 * 1557 * Return: void 1558 */ 1559 static inline 1560 void wlan_vdev_mlme_get_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev, 1561 uint64_t *srg_bss_color) 1562 { 1563 struct vdev_mlme_obj *vdev_mlme; 1564 1565 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1566 if (!vdev_mlme) 1567 return; 1568 1569 *srg_bss_color = vdev_mlme->mgmt.generic.srg_bss_color; 1570 } 1571 1572 /** 1573 * wlan_vdev_mlme_get_srg_partial_bssid_bit_map() - get spatial reuse 1574 * srg partial bitmap 1575 * @vdev: VDEV object 1576 * @srg_partial_bssid: SRG partial BSSID bitmap 1577 * 1578 * API to get the spatial reuse partial bssid bitmap 1579 * 1580 * Return: void 1581 */ 1582 static inline void 1583 wlan_vdev_mlme_get_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev, 1584 uint64_t *srg_partial_bssid) 1585 { 1586 struct vdev_mlme_obj *vdev_mlme; 1587 1588 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1589 if (!vdev_mlme) 1590 return; 1591 1592 *srg_partial_bssid = vdev_mlme->mgmt.generic.srg_partial_bssid; 1593 } 1594 1595 /** 1596 * wlan_vdev_mlme_get_current_non_srg_pd_threshold() - get current non srg pd 1597 * threshold 1598 * @vdev: VDEV object 1599 * @non_srg_pd_threshold: NON-SRG pd threshold 1600 * 1601 * API to get non srg pd threshold 1602 * 1603 * Return: void 1604 */ 1605 static inline void 1606 wlan_vdev_mlme_get_current_non_srg_pd_threshold(struct wlan_objmgr_vdev *vdev, 1607 int32_t *non_srg_pd_threshold) 1608 { 1609 struct vdev_mlme_obj *vdev_mlme; 1610 1611 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1612 if (!vdev_mlme) 1613 return; 1614 1615 *non_srg_pd_threshold = 1616 vdev_mlme->mgmt.generic.he_curr_non_srg_pd_threshold; 1617 } 1618 1619 /** 1620 * wlan_vdev_mlme_get_current_srg_pd_threshold() - get current srg pd threshold 1621 * @vdev: VDEV object 1622 * @srg_pd_threshold: SRG pd threshold 1623 * 1624 * API to get srg pd threshold 1625 * 1626 * Return: void 1627 */ 1628 static inline void 1629 wlan_vdev_mlme_get_current_srg_pd_threshold(struct wlan_objmgr_vdev *vdev, 1630 int32_t *srg_pd_threshold) 1631 { 1632 struct vdev_mlme_obj *vdev_mlme; 1633 1634 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1635 if (!vdev_mlme) 1636 return; 1637 1638 *srg_pd_threshold = 1639 vdev_mlme->mgmt.generic.he_curr_srg_pd_threshold; 1640 } 1641 1642 /** 1643 * wlan_vdev_mlme_set_current_non_srg_pd_threshold() - set current non srg pd 1644 * threshold 1645 * @vdev: VDEV object 1646 * @non_srg_pd_threshold: NON-SRG pd threshold 1647 * 1648 * API to set non srg pd threshold 1649 * 1650 * Return: void 1651 */ 1652 static inline void 1653 wlan_vdev_mlme_set_current_non_srg_pd_threshold(struct wlan_objmgr_vdev *vdev, 1654 int32_t non_srg_pd_threshold) 1655 { 1656 struct vdev_mlme_obj *vdev_mlme; 1657 1658 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1659 if (!vdev_mlme) 1660 return; 1661 1662 vdev_mlme->mgmt.generic.he_curr_non_srg_pd_threshold = 1663 non_srg_pd_threshold; 1664 } 1665 1666 /** 1667 * wlan_vdev_mlme_set_current_srg_pd_threshold() - set current srg pd threshold 1668 * @vdev: VDEV object 1669 * @srg_pd_threshold: SRG pd threshold 1670 * 1671 * API to set srg pd threshold 1672 * 1673 * Return: void 1674 */ 1675 static inline void 1676 wlan_vdev_mlme_set_current_srg_pd_threshold(struct wlan_objmgr_vdev *vdev, 1677 int32_t srg_pd_threshold) 1678 { 1679 struct vdev_mlme_obj *vdev_mlme; 1680 1681 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1682 if (!vdev_mlme) 1683 return; 1684 vdev_mlme->mgmt.generic.he_curr_srg_pd_threshold = 1685 srg_pd_threshold; 1686 } 1687 1688 /** 1689 * wlan_vdev_mlme_set_pd_threshold_present() - set is PD threshold 1690 * present or not. 1691 * @vdev: VDEV object 1692 * @is_pd_threshold_present: is PD threshold present 1693 * 1694 * API to set pd threshold present flag 1695 * 1696 * Return: void 1697 */ 1698 static inline void 1699 wlan_vdev_mlme_set_pd_threshold_present(struct wlan_objmgr_vdev *vdev, 1700 bool is_pd_threshold_present) 1701 { 1702 struct vdev_mlme_obj *vdev_mlme; 1703 1704 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1705 if (!vdev_mlme) 1706 return; 1707 vdev_mlme->mgmt.generic.is_pd_threshold_present = 1708 is_pd_threshold_present; 1709 } 1710 1711 /** 1712 * wlan_vdev_mlme_get_pd_threshold_present() - get is PD threshold 1713 * present or not. 1714 * @vdev: VDEV object 1715 * @is_pd_threshold_present: is PD threshold present 1716 * 1717 * API to get pd threshold present flag 1718 * 1719 * Return: void 1720 */ 1721 static inline void 1722 wlan_vdev_mlme_get_pd_threshold_present(struct wlan_objmgr_vdev *vdev, 1723 bool *is_pd_threshold_present) 1724 { 1725 struct vdev_mlme_obj *vdev_mlme; 1726 1727 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1728 if (!vdev_mlme) { 1729 *is_pd_threshold_present = false; 1730 return; 1731 } 1732 *is_pd_threshold_present = 1733 vdev_mlme->mgmt.generic.is_pd_threshold_present; 1734 } 1735 #else 1736 static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev) 1737 { 1738 return 0; 1739 } 1740 1741 static inline uint8_t wlan_vdev_mlme_get_non_srg_pd_offset( 1742 struct wlan_objmgr_vdev *vdev) 1743 { 1744 return 0; 1745 } 1746 1747 static inline bool wlan_vdev_mlme_get_he_spr_enabled( 1748 struct wlan_objmgr_vdev *vdev) 1749 { 1750 return 0; 1751 } 1752 1753 static inline 1754 bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev) 1755 { 1756 return false; 1757 } 1758 1759 static inline 1760 bool wlan_vdev_mlme_is_sr_prohibit_en(struct wlan_objmgr_vdev *vdev) 1761 { 1762 return false; 1763 } 1764 1765 static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev, 1766 uint8_t sr_ctrl) 1767 { 1768 } 1769 1770 static inline void 1771 wlan_vdev_mlme_set_non_srg_pd_offset(struct wlan_objmgr_vdev *vdev, 1772 uint8_t non_srg_pd_max_offset) 1773 { 1774 } 1775 1776 static inline void wlan_vdev_mlme_set_he_spr_enabled( 1777 struct wlan_objmgr_vdev *vdev, 1778 bool enable_he_spr) 1779 { 1780 } 1781 1782 static inline 1783 void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev, 1784 bool he_spr_disabled_due_conc) 1785 { 1786 } 1787 1788 static inline 1789 void wlan_vdev_mlme_set_sr_prohibit_en(struct wlan_objmgr_vdev *vdev, 1790 bool sr_prohibit_enabled) 1791 { 1792 } 1793 #endif 1794 #else 1795 static inline void wlan_vdev_mlme_set_he_mcs_12_13_map( 1796 struct wlan_objmgr_vdev *vdev, 1797 uint16_t he_mcs_12_13_map) 1798 { 1799 } 1800 1801 static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map( 1802 struct wlan_objmgr_vdev *vdev) 1803 { 1804 return 0; 1805 } 1806 1807 #endif 1808 1809 /** 1810 * wlan_vdev_mlme_set_aid_mgr() - set aid mgr 1811 * @vdev: VDEV object 1812 * @aid_mgr: AID mgr 1813 * 1814 * API to set AID mgr in VDEV MLME cmpt object 1815 * 1816 * Return: void 1817 */ 1818 static inline void wlan_vdev_mlme_set_aid_mgr( 1819 struct wlan_objmgr_vdev *vdev, 1820 struct wlan_vdev_aid_mgr *aid_mgr) 1821 { 1822 struct vdev_mlme_obj *vdev_mlme; 1823 1824 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1825 if (!vdev_mlme) 1826 return; 1827 1828 vdev_mlme->mgmt.ap.aid_mgr = aid_mgr; 1829 } 1830 1831 /** 1832 * wlan_vdev_mlme_get_aid_mgr() - get aid mgr 1833 * @vdev: VDEV object 1834 * 1835 * API to get AID mgr in VDEV MLME cmpt object 1836 * 1837 * Return: aid_mgr 1838 */ 1839 static inline struct wlan_vdev_aid_mgr *wlan_vdev_mlme_get_aid_mgr( 1840 struct wlan_objmgr_vdev *vdev) 1841 { 1842 struct vdev_mlme_obj *vdev_mlme; 1843 1844 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1845 if (!vdev_mlme) 1846 return NULL; 1847 1848 return vdev_mlme->mgmt.ap.aid_mgr; 1849 } 1850 1851 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE 1852 /** 1853 * vdev_mgr_cdp_vdev_attach() - MLME API to attach CDP vdev 1854 * @mlme_obj: pointer to vdev_mlme_obj 1855 * 1856 * Return: QDF_STATUS - Success or Failure 1857 */ 1858 QDF_STATUS vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj); 1859 1860 /** 1861 * vdev_mgr_cdp_vdev_detach() - MLME API to detach CDP vdev 1862 * @mlme_obj: pointer to vdev_mlme_obj 1863 * 1864 * Return: QDF_STATUS - Success or Failure 1865 */ 1866 QDF_STATUS vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj); 1867 #endif 1868 #endif 1869