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 * @is_sap_go_moved_1st_on_csa: Indicates if STA receives 367 * CSA to a DFS channel 368 * @he_spr_sr_ctrl: Spatial reuse SR control 369 * @he_spr_non_srg_pd_max_offset: Non-SRG PD max offset 370 * @he_spr_srg_max_pd_offset: SRG PD max offset 371 * @he_spr_srg_min_pd_offset: SRG PD min offset 372 * @he_spr_enabled: Spatial reuse enabled or not 373 * @he_spr_disabled_due_conc: spr disabled due to concurrency 374 * @sr_prohibit_enabled: 375 * @srg_bss_color: srg bss color 376 * @srg_partial_bssid: srg partial bssid 377 * @he_curr_non_srg_pd_threshold: current configured NON-SRG PD threshold 378 * @he_curr_srg_pd_threshold: current configured SRG PD threshold 379 * @is_pd_threshold_present: PD threshold is present in SR enable command or not 380 */ 381 struct vdev_mlme_mgmt_generic { 382 uint32_t rts_threshold; 383 uint32_t frag_threshold; 384 uint32_t probe_delay; 385 uint32_t repeat_probe_time; 386 uint32_t drop_unencry; 387 uint32_t tx_pwrlimit; 388 uint8_t tx_power; 389 uint8_t minpower; 390 uint8_t maxpower; 391 uint8_t maxregpower; 392 uint8_t antennamax; 393 uint8_t reg_class_id; 394 uint16_t ampdu; 395 uint8_t amsdu; 396 char ssid[WLAN_SSID_MAX_LEN + 1]; 397 uint8_t ssid_len; 398 uint8_t type; 399 uint8_t subtype; 400 uint8_t rx_decap_type; 401 uint8_t tx_encap_type; 402 bool disable_hw_ack; 403 uint8_t bssid[QDF_MAC_ADDR_SIZE]; 404 uint32_t phy_mode; 405 bool special_vdev_mode; 406 bool is_sap_go_moved_1st_on_csa; 407 #ifdef WLAN_FEATURE_SR 408 uint8_t he_spr_sr_ctrl; 409 uint8_t he_spr_non_srg_pd_max_offset; 410 uint8_t he_spr_srg_max_pd_offset; 411 uint8_t he_spr_srg_min_pd_offset; 412 bool he_spr_enabled; 413 bool he_spr_disabled_due_conc; 414 bool sr_prohibit_enabled; 415 uint64_t srg_bss_color; 416 uint64_t srg_partial_bssid; 417 int32_t he_curr_non_srg_pd_threshold; 418 int32_t he_curr_srg_pd_threshold; 419 bool is_pd_threshold_present; 420 #endif 421 }; 422 423 /* 424 * struct wlan_vdev_aid_mgr - AID manager 425 * @aid_bitmap: AID bitmap array 426 * @start_aid: start of AID index 427 * @max_aid: Max allowed AID 428 * @ref_cnt: to share AID across VDEVs for MBSSID 429 * 430 * NB: Not using kernel-doc comment since the kernel-doc script 431 * doesn't handle the qdf_bitmap() macro. 432 */ 433 struct wlan_vdev_aid_mgr { 434 qdf_bitmap(aid_bitmap, WLAN_UMAC_MAX_AID); 435 uint16_t start_aid; 436 uint16_t max_aid; 437 qdf_atomic_t ref_cnt; 438 }; 439 440 /** 441 * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg 442 * @hidden_ssid: flag to indicate whether it is hidden ssid 443 * @cac_duration_ms: cac duration in milliseconds 444 * @aid_mgr: AID bitmap mgr 445 * @max_chan_switch_time: Max channel switch time in milliseconds. 446 * @last_bcn_ts_ms: Timestamp (in milliseconds) of the last beacon sent on the 447 * CSA triggered channel. 448 * @is_acs_mode: True if SAP is started in ACS mode 449 */ 450 struct vdev_mlme_mgmt_ap { 451 bool hidden_ssid; 452 uint32_t cac_duration_ms; 453 struct wlan_vdev_aid_mgr *aid_mgr; 454 uint32_t max_chan_switch_time; 455 unsigned long last_bcn_ts_ms; 456 bool is_acs_mode; 457 }; 458 459 /** 460 * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg 461 * @he_mcs_12_13_map: map to indicate mcs12/13 caps of peer&dut 462 */ 463 struct vdev_mlme_mgmt_sta { 464 uint16_t he_mcs_12_13_map; 465 }; 466 467 /** 468 * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters 469 * @bmiss_first_bcnt: bmiss first time 470 * @bmiss_final_bcnt: bmiss final time 471 * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be 472 * inactive 473 * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send 474 * data-null 475 * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT 476 */ 477 struct vdev_mlme_inactivity_params { 478 uint32_t bmiss_first_bcnt; 479 uint32_t bmiss_final_bcnt; 480 uint32_t keepalive_min_idle_inactive_time_secs; 481 uint32_t keepalive_max_idle_inactive_time_secs; 482 uint32_t keepalive_max_unresponsive_time_secs; 483 }; 484 485 /** 486 * enum vdev_ratemask_type - ratemask phy type 487 * @WLAN_VDEV_RATEMASK_TYPE_CCK: phy type CCK 488 * @WLAN_VDEV_RATEMASK_TYPE_HT: phy type ht 489 * @WLAN_VDEV_RATEMASK_TYPE_VHT: phy type vht 490 * @WLAN_VDEV_RATEMASK_TYPE_HE: phy type he 491 * @WLAN_VDEV_RATEMASK_TYPE_MAX: Maximum enumeration 492 */ 493 enum vdev_ratemask_type { 494 WLAN_VDEV_RATEMASK_TYPE_CCK, 495 WLAN_VDEV_RATEMASK_TYPE_HT, 496 WLAN_VDEV_RATEMASK_TYPE_VHT, 497 WLAN_VDEV_RATEMASK_TYPE_HE, 498 WLAN_VDEV_RATEMASK_TYPE_MAX, 499 }; 500 501 /** 502 * struct vdev_ratemask_params - vdev ratemask parameters 503 * @type: ratemask phy type 504 * @lower32: ratemask lower32 bitmask 505 * @higher32: ratemask higher32 bitmask 506 * @lower32_2: ratemask lower32_2 bitmask 507 * @higher32_2: rtaemask higher32_2 bitmask 508 */ 509 struct vdev_ratemask_params { 510 uint32_t lower32; 511 uint32_t higher32; 512 uint32_t lower32_2; 513 uint32_t higher32_2; 514 }; 515 516 /** 517 * struct vdev_mlme_rate_info - vdev mlme rate information 518 * @rate_flags: dynamic bandwidth info 519 * @per_band_tx_mgmt_rate: per band Tx mgmt rate 520 * @max_rate: max bandwidth rate 521 * @tx_mgmt_rate: Tx Mgmt rate 522 * @bcn_tx_rate: beacon Tx rate 523 * @bcn_tx_rate_code: beacon Tx rate code 524 * @rtscts_tx_rate: RTS/CTS Tx rate 525 * @ratemask_params: vdev ratemask params per phy type 526 * @half_rate: Half rate 527 * @quarter_rate: quarter rate 528 */ 529 struct vdev_mlme_rate_info { 530 uint32_t rate_flags; 531 uint32_t per_band_tx_mgmt_rate; 532 uint32_t max_rate; 533 uint32_t tx_mgmt_rate; 534 uint32_t bcn_tx_rate; 535 #ifdef WLAN_BCN_RATECODE_ENABLE 536 uint32_t bcn_tx_rate_code; 537 #endif 538 uint32_t rtscts_tx_rate; 539 struct vdev_ratemask_params ratemask_params[ 540 WLAN_VDEV_RATEMASK_TYPE_MAX]; 541 bool half_rate; 542 bool quarter_rate; 543 }; 544 545 /** 546 * struct vdev_mlme_chainmask_info - vdev mlme chainmask information 547 * @tx_chainmask: Tx chainmask 548 * @rx_chainmask: Rx Chainmask 549 * @num_rx_chain: Num of bits set in Rx chain 550 * @num_tx_chain: Num of bits set in Tx chain 551 */ 552 struct vdev_mlme_chainmask_info { 553 uint8_t tx_chainmask; 554 uint8_t rx_chainmask; 555 uint8_t num_rx_chain; 556 uint8_t num_tx_chain; 557 }; 558 559 /** 560 * struct vdev_mlme_powersave_info - vdev mlme powersave information 561 * @packet_powersave: packet powersave 562 * @max_li_of_moddtim: max mod dtim 563 * @dyndtim_cnt: dynamic dtim count 564 * @listen_interval: listen interval 565 * @moddtim_cnt: mod dtim count 566 */ 567 struct vdev_mlme_powersave_info { 568 uint32_t packet_powersave; 569 uint32_t max_li_of_moddtim; 570 uint32_t dyndtim_cnt; 571 uint32_t listen_interval; 572 uint32_t moddtim_cnt; 573 }; 574 575 /** 576 * struct vdev_mlme_beacon_info - vdev mlme beacon information 577 * @beacon_buffer: buffer allocated for beacon frame 578 * @beacon_offsets: beacon IE's offsets 579 */ 580 struct vdev_mlme_beacon_info { 581 qdf_nbuf_t beacon_buffer; 582 void *beacon_offsets; 583 }; 584 585 /** 586 * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd 587 * @profile_idx: profile index of the connected non-trans ap (mbssid case). 588 * 0 means invalid. 589 * @profile_num: the total profile numbers of non-trans aps (mbssid case). 590 * 0 means non-MBSS AP. 591 * @mbssid_flags: MBSS IE flags indicating vdev type 592 * @vdevid_trans: id of transmitting vdev for MBSS IE 593 * @vdev_bmap: vdev bitmap of VAPs in MBSS group 594 * @is_cmn_param: flag to check mbss common param 595 * @trans_bssid: bssid of transmitted AP (MBSS IE case) 596 * @is_multi_mbssid: Flag to identify multi group mbssid support 597 * @grp_id: Group id of current vdev 598 */ 599 struct vdev_mlme_mbss_11ax { 600 uint32_t profile_idx; 601 uint32_t profile_num; 602 uint32_t mbssid_flags; 603 uint8_t vdevid_trans; 604 unsigned long vdev_bmap; 605 bool is_cmn_param; 606 uint8_t trans_bssid[QDF_MAC_ADDR_SIZE]; 607 bool is_multi_mbssid; 608 uint32_t grp_id; 609 }; 610 611 /** 612 * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg 613 * @generic: generic mgmt information 614 * @ap: ap specific mgmt information 615 * @sta: sta specific mgmt information 616 * @inactivity_params: inactivity parameters 617 * @rate_info: bandwidth rate information 618 * @chainmask_info: Chainmask information 619 * @powersave_info: Power save parameters 620 * @beacon_info: beacon buffer information 621 * @mbss_11ax: MBSS 11ax information 622 */ 623 struct vdev_mlme_mgmt { 624 struct vdev_mlme_mgmt_generic generic; 625 struct vdev_mlme_mgmt_ap ap; 626 struct vdev_mlme_mgmt_sta sta; 627 struct vdev_mlme_inactivity_params inactivity_params; 628 struct vdev_mlme_rate_info rate_info; 629 struct vdev_mlme_chainmask_info chainmask_info; 630 struct vdev_mlme_powersave_info powersave_info; 631 struct vdev_mlme_beacon_info beacon_info; 632 struct vdev_mlme_mbss_11ax mbss_11ax; 633 }; 634 635 /** 636 * enum beacon_update_op - Beacon update op type 637 * @BEACON_INIT: Initialize beacon 638 * @BEACON_REINIT: Re-initialize beacon 639 * @BEACON_UPDATE: Update dynamic fields of beacon 640 * @BEACON_CSA: Enable CSA IE 641 * @BEACON_FREE: Beacon buffer free 642 */ 643 enum beacon_update_op { 644 BEACON_INIT, 645 BEACON_REINIT, 646 BEACON_UPDATE, 647 BEACON_CSA, 648 BEACON_FREE, 649 }; 650 651 /** 652 * enum vdev_cmd_type - Command type 653 * @START_REQ: Start request 654 * @RESTART_REQ: Restart request 655 * @STOP_REQ: STOP request 656 * @DELETE_REQ: DELETE request 657 */ 658 enum vdev_cmd_type { 659 START_REQ, 660 RESTART_REQ, 661 STOP_REQ, 662 DELETE_REQ, 663 }; 664 665 /** 666 * enum vdev_start_resp_type - start respone type 667 * @START_RESPONSE: Start response 668 * @RESTART_RESPONSE: Restart response 669 */ 670 enum vdev_start_resp_type { 671 START_RESPONSE = 0, 672 RESTART_RESPONSE, 673 }; 674 675 /** 676 * struct vdev_mlme_ops - VDEV MLME operation callbacks structure 677 * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params 678 * @mlme_vdev_reset_proto_params: callback to Reset protocol params 679 * @mlme_vdev_start_send: callback to initiate actions of VDEV 680 * MLME start operation 681 * @mlme_vdev_restart_send: callback to initiate actions of VDEV 682 * MLME restart operation 683 * @mlme_vdev_stop_start_send: callback to block start/restart VDEV 684 * request command 685 * @mlme_vdev_start_continue: callback to initiate operations on 686 * LMAC/FW start response 687 * @mlme_vdev_sta_conn_start: callback to initiate STA connection 688 * @mlme_vdev_start_req_failed: 689 * @mlme_vdev_up_send: callback to initiate actions of VDEV 690 * MLME up operation 691 * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving 692 * to UP state 693 * @mlme_vdev_notify_roam_start: callback to initiate roaming 694 * @mlme_vdev_update_beacon: callback to initiate beacon update 695 * @mlme_vdev_disconnect_peers: callback to initiate disconnection of 696 * peers 697 * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer 698 * @mlme_vdev_stop_send: callback to initiate actions of VDEV 699 * MLME stop operation 700 * @mlme_vdev_stop_continue: callback to initiate operations on 701 * LMAC/FW stop response 702 * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS 703 * peer delete completion 704 * @mlme_vdev_down_send: callback to initiate actions of VDEV 705 * MLME down operation 706 * @mlme_vdev_notify_down_complete: 707 * @mlme_vdev_ext_stop_rsp: 708 * @mlme_vdev_ext_start_rsp: 709 * @mlme_vdev_notify_start_state_exit: callback to notify on vdev start 710 * start state exit 711 * @mlme_vdev_is_newchan_no_cac: callback to check CAC is required 712 * @mlme_vdev_ext_peer_delete_all_rsp: callback to initiate actions for 713 * vdev mlme peer delete all response 714 * @mlme_vdev_dfs_cac_wait_notify: callback to notify about CAC state 715 * @mlme_vdev_csa_complete: callback to indicate CSA complete 716 * @mlme_vdev_sta_disconn_start: callback to initiate STA disconnection 717 * @mlme_vdev_reconfig_notify: callback to notify ml reconfing link 718 * delete start operation after receive 719 * the first ml reconfig IE 720 * @mlme_vdev_reconfig_timer_complete: callback to process ml reconfing 721 * operation 722 * @mlme_vdev_notify_mlo_sync_wait_entry: 723 */ 724 struct vdev_mlme_ops { 725 QDF_STATUS (*mlme_vdev_validate_basic_params)( 726 struct vdev_mlme_obj *vdev_mlme, 727 uint16_t event_data_len, void *event_data); 728 QDF_STATUS (*mlme_vdev_reset_proto_params)( 729 struct vdev_mlme_obj *vdev_mlme, 730 uint16_t event_data_len, void *event_data); 731 QDF_STATUS (*mlme_vdev_start_send)( 732 struct vdev_mlme_obj *vdev_mlme, 733 uint16_t event_data_len, void *event_data); 734 QDF_STATUS (*mlme_vdev_restart_send)( 735 struct vdev_mlme_obj *vdev_mlme, 736 uint16_t event_data_len, void *event_data); 737 QDF_STATUS (*mlme_vdev_stop_start_send)( 738 struct vdev_mlme_obj *vdev_mlme, 739 enum vdev_cmd_type type, 740 uint16_t event_data_len, void *event_data); 741 QDF_STATUS (*mlme_vdev_start_continue)( 742 struct vdev_mlme_obj *vdev_mlme, 743 uint16_t event_data_len, void *event_data); 744 QDF_STATUS (*mlme_vdev_sta_conn_start)( 745 struct vdev_mlme_obj *vdev_mlme, 746 uint16_t event_data_len, void *event_data); 747 QDF_STATUS (*mlme_vdev_start_req_failed)( 748 struct vdev_mlme_obj *vdev_mlme, 749 uint16_t event_data_len, void *event_data); 750 QDF_STATUS (*mlme_vdev_up_send)( 751 struct vdev_mlme_obj *vdev_mlme, 752 uint16_t event_data_len, void *event_data); 753 QDF_STATUS (*mlme_vdev_notify_up_complete)( 754 struct vdev_mlme_obj *vdev_mlme, 755 uint16_t event_data_len, void *event_data); 756 QDF_STATUS (*mlme_vdev_notify_roam_start)( 757 struct vdev_mlme_obj *vdev_mlme, 758 uint16_t event_data_len, void *event_data); 759 QDF_STATUS (*mlme_vdev_update_beacon)( 760 struct vdev_mlme_obj *vdev_mlme, 761 enum beacon_update_op op, 762 uint16_t event_data_len, void *event_data); 763 QDF_STATUS (*mlme_vdev_disconnect_peers)( 764 struct vdev_mlme_obj *vdev_mlme, 765 uint16_t event_data_len, void *event_data, 766 bool discon_legacy_only); 767 QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)( 768 struct vdev_mlme_obj *vdev_mlme, 769 uint16_t event_data_len, void *event_data); 770 QDF_STATUS (*mlme_vdev_stop_send)( 771 struct vdev_mlme_obj *vdev_mlme, 772 uint16_t event_data_len, void *event_data); 773 QDF_STATUS (*mlme_vdev_stop_continue)( 774 struct vdev_mlme_obj *vdev_mlme, 775 uint16_t event_data_len, void *event_data); 776 QDF_STATUS (*mlme_vdev_down_send)( 777 struct vdev_mlme_obj *vdev_mlme, 778 uint16_t event_data_len, void *event_data); 779 QDF_STATUS (*mlme_vdev_notify_down_complete)( 780 struct vdev_mlme_obj *vdev_mlme, 781 uint16_t event_data_len, void *event_data); 782 QDF_STATUS (*mlme_vdev_ext_stop_rsp)( 783 struct vdev_mlme_obj *vdev_mlme, 784 struct vdev_stop_response *rsp); 785 QDF_STATUS (*mlme_vdev_ext_start_rsp)( 786 struct vdev_mlme_obj *vdev_mlme, 787 struct vdev_start_response *rsp); 788 QDF_STATUS (*mlme_vdev_notify_start_state_exit)( 789 struct vdev_mlme_obj *vdev_mlme); 790 QDF_STATUS (*mlme_vdev_is_newchan_no_cac)( 791 struct vdev_mlme_obj *vdev_mlme); 792 QDF_STATUS (*mlme_vdev_ext_peer_delete_all_rsp)( 793 struct vdev_mlme_obj *vdev_mlme, 794 struct peer_delete_all_response *rsp); 795 QDF_STATUS (*mlme_vdev_dfs_cac_wait_notify)( 796 struct vdev_mlme_obj *vdev_mlme); 797 QDF_STATUS (*mlme_vdev_csa_complete)( 798 struct vdev_mlme_obj *vdev_mlme); 799 QDF_STATUS (*mlme_vdev_sta_disconn_start)( 800 struct vdev_mlme_obj *vdev_mlme, 801 uint16_t event_data_len, void *event_data); 802 QDF_STATUS (*mlme_vdev_reconfig_notify)( 803 struct vdev_mlme_obj *vdev_mlme, 804 uint16_t *tbtt_count, uint16_t bcn_int); 805 void (*mlme_vdev_reconfig_timer_complete)( 806 struct vdev_mlme_obj *vdev_mlme); 807 QDF_STATUS (*mlme_vdev_notify_mlo_sync_wait_entry)( 808 struct vdev_mlme_obj *vdev_mlme); 809 }; 810 811 /** 812 * struct vdev_mlme_obj - VDEV MLME component object 813 * @proto: VDEV MLME proto substructure 814 * @mgmt: VDEV MLME mgmt substructure 815 * @sm_lock: VDEV SM lock 816 * @vdev_cmd_lock: VDEV MLME command atomicity 817 * @sm_hdl: VDEV SM handle 818 * @cnx_mgr_ctx: connection manager context, valid for STA and P2P-CLI mode only 819 * @vdev: Pointer to vdev objmgr 820 * @ops: VDEV MLME callback table 821 * @ext_vdev_ptr: VDEV MLME legacy pointer 822 * @reg_tpc_obj: Regulatory transmit power info 823 * @ml_reconfig_timer: VDEV ml reconfig timer 824 * @ml_reconfig_started: Flag to indicate reconfig status for vdev 825 */ 826 struct vdev_mlme_obj { 827 struct vdev_mlme_proto proto; 828 struct vdev_mlme_mgmt mgmt; 829 #ifdef VDEV_SM_LOCK_SUPPORT 830 qdf_spinlock_t sm_lock; 831 qdf_mutex_t vdev_cmd_lock; 832 #endif 833 struct wlan_sm *sm_hdl; 834 union { 835 struct cnx_mgr *cnx_mgr_ctx; 836 }; 837 struct wlan_objmgr_vdev *vdev; 838 struct vdev_mlme_ops *ops; 839 mlme_vdev_ext_t *ext_vdev_ptr; 840 struct reg_tpc_power_info reg_tpc_obj; 841 qdf_timer_t ml_reconfig_timer; 842 bool ml_reconfig_started; 843 }; 844 845 /** 846 * wlan_vdev_mlme_set_ssid() - set ssid 847 * @vdev: VDEV object 848 * @ssid: SSID (input) 849 * @ssid_len: Length of SSID 850 * 851 * API to set the SSID of VDEV 852 * 853 * Caller need to acquire lock with wlan_vdev_obj_lock() 854 * 855 * Return: QDF_STATUS_SUCCESS, if update is done 856 * QDF_STATUS error, if ssid length is > max ssid len 857 */ 858 static inline QDF_STATUS wlan_vdev_mlme_set_ssid( 859 struct wlan_objmgr_vdev *vdev, 860 const uint8_t *ssid, uint8_t ssid_len) 861 { 862 struct vdev_mlme_obj *vdev_mlme; 863 864 /* This API is invoked with lock acquired, do not add log prints */ 865 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 866 if (!vdev_mlme) 867 return QDF_STATUS_E_FAILURE; 868 869 if (ssid_len <= WLAN_SSID_MAX_LEN) { 870 qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len); 871 vdev_mlme->mgmt.generic.ssid_len = ssid_len; 872 } else { 873 vdev_mlme->mgmt.generic.ssid_len = 0; 874 return QDF_STATUS_E_FAILURE; 875 } 876 return QDF_STATUS_SUCCESS; 877 } 878 879 /** 880 * wlan_vdev_mlme_get_ssid() - get ssid 881 * @vdev: VDEV object 882 * @ssid: SSID 883 * @ssid_len: Length of SSID 884 * 885 * API to get the SSID of VDEV, it updates the SSID and its length 886 * in @ssid, @ssid_len respectively 887 * 888 * Caller need to acquire lock with wlan_vdev_obj_lock() 889 * 890 * Return: SUCCESS, if update is done 891 * FAILURE, if ssid length is > max ssid len 892 */ 893 static inline QDF_STATUS wlan_vdev_mlme_get_ssid( 894 struct wlan_objmgr_vdev *vdev, 895 uint8_t *ssid, uint8_t *ssid_len) 896 { 897 struct vdev_mlme_obj *vdev_mlme; 898 899 /* This API is invoked with lock acquired, do not add log prints */ 900 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 901 if (!vdev_mlme) 902 return QDF_STATUS_E_FAILURE; 903 904 if (vdev_mlme->mgmt.generic.ssid_len > 0) { 905 *ssid_len = vdev_mlme->mgmt.generic.ssid_len; 906 qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len); 907 } else { 908 *ssid_len = 0; 909 return QDF_STATUS_E_FAILURE; 910 } 911 return QDF_STATUS_SUCCESS; 912 } 913 914 /** 915 * wlan_vdev_mlme_set_nss() - set NSS 916 * @vdev: VDEV object 917 * @nss: nss configured by user 918 * 919 * API to set the Number of Spatial streams 920 * 921 * Return: void 922 */ 923 static inline void wlan_vdev_mlme_set_nss( 924 struct wlan_objmgr_vdev *vdev, 925 uint8_t nss) 926 { 927 struct vdev_mlme_obj *vdev_mlme; 928 929 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 930 if (!vdev_mlme) 931 return; 932 933 vdev_mlme->proto.generic.nss = nss; 934 } 935 936 /** 937 * wlan_vdev_mlme_get_nss() - get NSS 938 * @vdev: VDEV object 939 * 940 * API to get the Number of Spatial Streams 941 * 942 * Return: nss value 943 */ 944 static inline uint8_t wlan_vdev_mlme_get_nss( 945 struct wlan_objmgr_vdev *vdev) 946 { 947 struct vdev_mlme_obj *vdev_mlme; 948 949 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 950 if (!vdev_mlme) 951 return 0; 952 953 return vdev_mlme->proto.generic.nss; 954 } 955 956 /** 957 * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask 958 * @vdev: VDEV object 959 * @chainmask : chainmask either configured by user or max supported 960 * 961 * API to set the Tx chainmask 962 * 963 * Return: void 964 */ 965 static inline void wlan_vdev_mlme_set_txchainmask( 966 struct wlan_objmgr_vdev *vdev, 967 uint8_t chainmask) 968 { 969 struct vdev_mlme_obj *vdev_mlme; 970 971 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 972 973 if (!vdev_mlme) 974 return; 975 976 vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask; 977 } 978 979 /** 980 * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask 981 * @vdev: VDEV object 982 * 983 * API to get the Tx chainmask 984 * 985 * Return: Tx chainmask either configured by user or max supported 986 */ 987 static inline uint8_t wlan_vdev_mlme_get_txchainmask( 988 struct wlan_objmgr_vdev *vdev) 989 { 990 struct vdev_mlme_obj *vdev_mlme; 991 992 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 993 if (!vdev_mlme) 994 return 0; 995 996 return vdev_mlme->mgmt.chainmask_info.tx_chainmask; 997 } 998 999 /** 1000 * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask 1001 * @vdev: VDEV object 1002 * @chainmask : Rx chainmask either configured by user or max supported 1003 * 1004 * API to set the Rx chainmask 1005 * 1006 * Return: void 1007 */ 1008 static inline void wlan_vdev_mlme_set_rxchainmask( 1009 struct wlan_objmgr_vdev *vdev, 1010 uint8_t chainmask) 1011 { 1012 struct vdev_mlme_obj *vdev_mlme; 1013 1014 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1015 if (!vdev_mlme) 1016 return; 1017 1018 vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask; 1019 } 1020 1021 /** 1022 * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask 1023 * @vdev: VDEV object 1024 * 1025 * API to get the Rx chainmask 1026 * 1027 * Return: Rx chainmask either configured by user or max supported 1028 */ 1029 static inline uint8_t wlan_vdev_mlme_get_rxchainmask( 1030 struct wlan_objmgr_vdev *vdev) 1031 { 1032 struct vdev_mlme_obj *vdev_mlme; 1033 1034 /* This API is invoked with lock acquired, do not add log prints */ 1035 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1036 if (!vdev_mlme) 1037 return 0; 1038 1039 return vdev_mlme->mgmt.chainmask_info.rx_chainmask; 1040 } 1041 1042 /** 1043 * wlan_vdev_mlme_set_txpower() - set tx power 1044 * @vdev: VDEV object 1045 * @txpow: tx power either configured by used or max allowed 1046 * 1047 * API to set the tx power 1048 * 1049 * Return: void 1050 */ 1051 static inline void wlan_vdev_mlme_set_txpower( 1052 struct wlan_objmgr_vdev *vdev, 1053 uint8_t txpow) 1054 { 1055 struct vdev_mlme_obj *vdev_mlme; 1056 1057 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1058 if (!vdev_mlme) 1059 return; 1060 1061 vdev_mlme->mgmt.generic.tx_power = txpow; 1062 } 1063 1064 /** 1065 * wlan_vdev_mlme_get_txpower() - get tx power 1066 * @vdev: VDEV object 1067 * 1068 * API to get the tx power 1069 * 1070 * Return: tx power either configured by used or max allowed 1071 */ 1072 static inline uint8_t wlan_vdev_mlme_get_txpower( 1073 struct wlan_objmgr_vdev *vdev) 1074 { 1075 struct vdev_mlme_obj *vdev_mlme; 1076 1077 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1078 if (!vdev_mlme) 1079 return 0; 1080 1081 return vdev_mlme->mgmt.generic.tx_power; 1082 } 1083 1084 /** 1085 * wlan_vdev_mlme_set_maxrate() - set max rate 1086 * @vdev: VDEV object 1087 * @maxrate: configured by used or based on configured mode 1088 * 1089 * API to set the max rate the vdev supports 1090 * 1091 * Return: void 1092 */ 1093 static inline void wlan_vdev_mlme_set_maxrate( 1094 struct wlan_objmgr_vdev *vdev, 1095 uint32_t maxrate) 1096 { 1097 struct vdev_mlme_obj *vdev_mlme; 1098 1099 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1100 if (!vdev_mlme) 1101 return; 1102 1103 vdev_mlme->mgmt.rate_info.max_rate = maxrate; 1104 } 1105 1106 /** 1107 * wlan_vdev_mlme_get_maxrate() - get max rate 1108 * @vdev: VDEV object 1109 * 1110 * API to get the max rate the vdev supports 1111 * 1112 * Return: configured by used or based on configured mode 1113 */ 1114 static inline uint32_t wlan_vdev_mlme_get_maxrate( 1115 struct wlan_objmgr_vdev *vdev) 1116 { 1117 struct vdev_mlme_obj *vdev_mlme; 1118 1119 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1120 if (!vdev_mlme) 1121 return 0; 1122 1123 return vdev_mlme->mgmt.rate_info.max_rate; 1124 } 1125 1126 /** 1127 * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate 1128 * @vdev: VDEV object 1129 * @txmgmtrate: Tx Mgmt rate 1130 * 1131 * API to set Mgmt Tx rate 1132 * 1133 * Return: void 1134 */ 1135 static inline void wlan_vdev_mlme_set_txmgmtrate( 1136 struct wlan_objmgr_vdev *vdev, 1137 uint32_t txmgmtrate) 1138 { 1139 struct vdev_mlme_obj *vdev_mlme; 1140 1141 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1142 if (!vdev_mlme) 1143 return; 1144 1145 vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate; 1146 } 1147 1148 /** 1149 * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate 1150 * @vdev: VDEV object 1151 * 1152 * API to get Mgmt Tx rate 1153 * 1154 * Return: Tx Mgmt rate 1155 */ 1156 static inline uint32_t wlan_vdev_mlme_get_txmgmtrate( 1157 struct wlan_objmgr_vdev *vdev) 1158 { 1159 struct vdev_mlme_obj *vdev_mlme; 1160 1161 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1162 if (!vdev_mlme) 1163 return 0; 1164 1165 return vdev_mlme->mgmt.rate_info.tx_mgmt_rate; 1166 } 1167 1168 /** 1169 * wlan_vdev_mlme_is_special_vdev() - check given vdev is a special vdev 1170 * @vdev: VDEV object 1171 * 1172 * API to check given vdev is a special vdev. 1173 * 1174 * Return: true if given vdev is special vdev, else false 1175 */ 1176 static inline bool wlan_vdev_mlme_is_special_vdev( 1177 struct wlan_objmgr_vdev *vdev) 1178 { 1179 struct vdev_mlme_obj *vdev_mlme; 1180 1181 if (!vdev) 1182 return false; 1183 1184 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1185 if (!vdev_mlme) 1186 return false; 1187 1188 return vdev_mlme->mgmt.generic.special_vdev_mode; 1189 } 1190 1191 /** 1192 * wlan_vdev_mlme_is_sap_go_move_before_sta() - check if SAP / GO 1193 * moved to new channel before STA's movement upon receiving CSA 1194 * 1195 * @vdev: VDEV object 1196 * 1197 * API to check in STA+SAP/GO SCC concurrency, whether SAP / GO moved before 1198 * STA's movement on receiving CSA from peer AP to connected STA. 1199 * 1200 * Return: true if SAP / GO moved before STA else false 1201 */ 1202 static inline 1203 bool wlan_vdev_mlme_is_sap_go_move_before_sta(struct wlan_objmgr_vdev *vdev) 1204 { 1205 struct vdev_mlme_obj *vdev_mlme; 1206 1207 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1208 if (!vdev_mlme) 1209 return false; 1210 1211 return vdev_mlme->mgmt.generic.is_sap_go_moved_1st_on_csa; 1212 } 1213 1214 /** 1215 * wlan_vdev_mlme_set_sap_go_move_before_sta() - Set flag if SAP / GO 1216 * moves to new channel before STA's movement upon receiving CSA 1217 * 1218 * @vdev: VDEV object 1219 * @sap_go_moved_before_sta: Flag to indicate True when SAP / GO 1220 * moves before STA 1221 * 1222 * API to set True in STA+SAP/GO SCC concurrency, when SAP / GO moves before 1223 * STA's movement on receiving CSA from peer AP to connected STA. 1224 * 1225 * Return: void 1226 */ 1227 static inline 1228 void wlan_vdev_mlme_set_sap_go_move_before_sta(struct wlan_objmgr_vdev *vdev, 1229 bool sap_go_moved_before_sta) 1230 { 1231 struct vdev_mlme_obj *vdev_mlme; 1232 1233 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1234 if (!vdev_mlme) 1235 return; 1236 1237 vdev_mlme->mgmt.generic.is_sap_go_moved_1st_on_csa = 1238 sap_go_moved_before_sta; 1239 } 1240 1241 #ifdef WLAN_FEATURE_11AX 1242 /** 1243 * wlan_vdev_mlme_set_he_mcs_12_13_map() - set he mcs12/13 map 1244 * @vdev: VDEV object 1245 * @he_mcs_12_13_map: he mcs12/13 map from self&peer 1246 * 1247 * API to set he mcs 12/13 map 1248 * 1249 * Return: void 1250 */ 1251 static inline void wlan_vdev_mlme_set_he_mcs_12_13_map( 1252 struct wlan_objmgr_vdev *vdev, 1253 uint16_t he_mcs_12_13_map) 1254 { 1255 struct vdev_mlme_obj *vdev_mlme; 1256 1257 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1258 if (!vdev_mlme) 1259 return; 1260 1261 vdev_mlme->mgmt.sta.he_mcs_12_13_map = he_mcs_12_13_map; 1262 } 1263 1264 /** 1265 * wlan_vdev_mlme_get_he_mcs_12_13_map() - get he mcs12/13 map 1266 * @vdev: VDEV object 1267 * 1268 * API to get he mcs12/13 support capability 1269 * 1270 * Return: he mcs12/13 map 1271 */ 1272 static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map( 1273 struct wlan_objmgr_vdev *vdev) 1274 { 1275 struct vdev_mlme_obj *vdev_mlme; 1276 1277 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1278 if (!vdev_mlme) 1279 return 0; 1280 1281 return vdev_mlme->mgmt.sta.he_mcs_12_13_map; 1282 } 1283 1284 #ifdef WLAN_FEATURE_SR 1285 /** 1286 * wlan_vdev_mlme_get_sr_ctrl() - get spatial reuse SR control 1287 * @vdev: VDEV object 1288 * 1289 * API to retrieve the spatial reuse SR control from VDEV 1290 * 1291 * Caller need to acquire lock with wlan_vdev_obj_lock() 1292 * 1293 * Return: SR control 1294 */ 1295 static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev) 1296 { 1297 struct vdev_mlme_obj *vdev_mlme; 1298 1299 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1300 if (!vdev_mlme) 1301 return 0; 1302 1303 return vdev_mlme->mgmt.generic.he_spr_sr_ctrl; 1304 } 1305 1306 /** 1307 * wlan_vdev_mlme_get_non_srg_pd_offset() - get spatial reuse non srg pd offset 1308 * @vdev: VDEV object 1309 * 1310 * API to retrieve the spatial reuse pd offset from VDEV 1311 * 1312 * Return: max non srg pd offset 1313 */ 1314 static inline uint8_t wlan_vdev_mlme_get_non_srg_pd_offset( 1315 struct wlan_objmgr_vdev *vdev) 1316 { 1317 struct vdev_mlme_obj *vdev_mlme; 1318 1319 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1320 if (!vdev_mlme) 1321 return 0; 1322 1323 return vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset; 1324 } 1325 1326 /** 1327 * wlan_vdev_mlme_get_he_spr_enabled() - spatial reuse enabled or not 1328 * @vdev: VDEV object 1329 * 1330 * API to check whether the spatial reuse enabled or not 1331 * 1332 * Return: true if Spatial reuse enabled, false if not 1333 */ 1334 static inline bool wlan_vdev_mlme_get_he_spr_enabled( 1335 struct wlan_objmgr_vdev *vdev) 1336 { 1337 struct vdev_mlme_obj *vdev_mlme; 1338 1339 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1340 if (!vdev_mlme) 1341 return false; 1342 1343 return vdev_mlme->mgmt.generic.he_spr_enabled; 1344 } 1345 1346 /** 1347 * wlan_vdev_mlme_is_sr_disable_due_conc() - spatial reuse disabled due 1348 * to concurrency 1349 * @vdev: VDEV object 1350 * 1351 * API to check whether the spatial reuse disabled due to concurrency or not 1352 * 1353 * Caller need to acquire lock with wlan_vdev_obj_lock() 1354 * 1355 * Return: 1356 * true/false: true if spatial reuse disabled due to concurrency else false 1357 */ 1358 static inline 1359 bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev) 1360 { 1361 struct vdev_mlme_obj *vdev_mlme; 1362 1363 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1364 if (!vdev_mlme) 1365 return false; 1366 1367 return vdev_mlme->mgmt.generic.he_spr_disabled_due_conc; 1368 } 1369 1370 /** 1371 * wlan_vdev_mlme_is_sr_prohibit_en() - spatial reuse PD prohibit enabled 1372 * / disabled (HE_SIGA_Val15_Allowed) 1373 * @vdev: VDEV object 1374 * 1375 * API to check whether the spatial reuse PD prohibit is enabled / disabled 1376 * 1377 * Caller need to acquire lock with wlan_vdev_obj_lock() 1378 * 1379 * Return: true/false: Spatial reuse PD prohibit enabled / disabled 1380 */ 1381 static inline 1382 bool wlan_vdev_mlme_is_sr_prohibit_en(struct wlan_objmgr_vdev *vdev) 1383 { 1384 struct vdev_mlme_obj *vdev_mlme; 1385 1386 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1387 if (!vdev_mlme) 1388 return false; 1389 1390 return vdev_mlme->mgmt.generic.sr_prohibit_enabled; 1391 } 1392 1393 /** 1394 * wlan_vdev_mlme_set_sr_ctrl() - set spatial reuse SR control 1395 * @vdev: VDEV object 1396 * @sr_ctrl: value to set 1397 * 1398 * API to set the spatial reuse SR control 1399 * 1400 * Caller need to acquire lock with wlan_vdev_obj_lock() 1401 * 1402 * Return: void 1403 */ 1404 static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev, 1405 uint8_t sr_ctrl) 1406 { 1407 struct vdev_mlme_obj *vdev_mlme; 1408 1409 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1410 if (!vdev_mlme) 1411 return; 1412 1413 vdev_mlme->mgmt.generic.he_spr_sr_ctrl = sr_ctrl; 1414 } 1415 1416 /** 1417 * wlan_vdev_mlme_set_non_srg_pd_offset() - set spatial reuse non srg 1418 * pd max offset 1419 * @vdev: VDEV object 1420 * @non_srg_pd_max_offset: value to set 1421 * 1422 * API to set the spatial reuse pd max offset 1423 * 1424 * Return: void 1425 */ 1426 static inline void 1427 wlan_vdev_mlme_set_non_srg_pd_offset(struct wlan_objmgr_vdev *vdev, 1428 uint8_t non_srg_pd_max_offset) 1429 { 1430 struct vdev_mlme_obj *vdev_mlme; 1431 1432 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1433 if (!vdev_mlme) 1434 return; 1435 1436 vdev_mlme->mgmt.generic.he_spr_non_srg_pd_max_offset = 1437 non_srg_pd_max_offset; 1438 } 1439 1440 /** 1441 * wlan_vdev_mlme_set_he_spr_enabled() - set spatial reuse enabled 1442 * @vdev: VDEV object 1443 * @enable_he_spr: value to set 1444 * 1445 * API to set the spatial reuse enabled 1446 * 1447 * Return: void 1448 */ 1449 static inline void wlan_vdev_mlme_set_he_spr_enabled( 1450 struct wlan_objmgr_vdev *vdev, 1451 bool enable_he_spr) 1452 { 1453 struct vdev_mlme_obj *vdev_mlme; 1454 1455 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1456 if (!vdev_mlme) 1457 return; 1458 1459 vdev_mlme->mgmt.generic.he_spr_enabled = enable_he_spr; 1460 } 1461 1462 /** 1463 * wlan_vdev_mlme_set_sr_disable_due_conc() - set spatial reuse disabled due 1464 * to concurrency 1465 * @vdev: VDEV object 1466 * @he_spr_disabled_due_conc: value to set 1467 * 1468 * API to set the spatial reuse disabled due to concurrency 1469 * 1470 * Caller need to acquire lock with wlan_vdev_obj_lock() 1471 * 1472 * Return: void 1473 */ 1474 static inline 1475 void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev, 1476 bool he_spr_disabled_due_conc) 1477 { 1478 struct vdev_mlme_obj *vdev_mlme; 1479 1480 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1481 if (!vdev_mlme) 1482 return; 1483 1484 vdev_mlme->mgmt.generic.he_spr_disabled_due_conc = 1485 he_spr_disabled_due_conc; 1486 } 1487 1488 /** 1489 * wlan_vdev_mlme_set_sr_prohibit_en() - set spatial reuse PD prohibit enabled 1490 * / disabled (HE_SIGA_Val15_Allowed) 1491 * @vdev: VDEV object 1492 * @sr_prohibit_enabled: True / False - PD Prohibit enabled / disabled 1493 * 1494 * API to set spatial reuse PD prohibit enabled / disabled 1495 * 1496 * Caller need to acquire lock with wlan_vdev_obj_lock() 1497 * 1498 * Return: void 1499 */ 1500 static inline 1501 void wlan_vdev_mlme_set_sr_prohibit_en(struct wlan_objmgr_vdev *vdev, 1502 bool sr_prohibit_enabled) 1503 { 1504 struct vdev_mlme_obj *vdev_mlme; 1505 1506 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1507 if (!vdev_mlme) 1508 return; 1509 1510 vdev_mlme->mgmt.generic.sr_prohibit_enabled = sr_prohibit_enabled; 1511 } 1512 1513 /** 1514 * wlan_vdev_mlme_set_srg_pd_offset() - set spatial reuse SRG pd max/min offset 1515 * @vdev: VDEV object 1516 * @srg_max_pd_offset: SRG max pd offset 1517 * @srg_min_pd_offset: SRG min pd offset 1518 * 1519 * API to set the spatial reuse SRG pd min max offset 1520 * 1521 * Return: void 1522 */ 1523 static inline 1524 void wlan_vdev_mlme_set_srg_pd_offset(struct wlan_objmgr_vdev *vdev, 1525 uint8_t srg_max_pd_offset, 1526 uint8_t srg_min_pd_offset) 1527 { 1528 struct vdev_mlme_obj *vdev_mlme; 1529 1530 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1531 if (!vdev_mlme) 1532 return; 1533 1534 vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset = srg_max_pd_offset; 1535 vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset = srg_min_pd_offset; 1536 } 1537 1538 /** 1539 * wlan_vdev_mlme_get_srg_pd_offset() - get spatial reuse SRG pd min/max offset 1540 * @vdev: VDEV object 1541 * @srg_max_pd_offset: SRG max pd offset 1542 * @srg_min_pd_offset: SRG min pd offset 1543 * 1544 * API to set the spatial reuse SRG pd min max offset 1545 * 1546 * Return: void 1547 */ 1548 static inline 1549 void wlan_vdev_mlme_get_srg_pd_offset(struct wlan_objmgr_vdev *vdev, 1550 uint8_t *srg_max_pd_offset, 1551 uint8_t *srg_min_pd_offset) 1552 { 1553 struct vdev_mlme_obj *vdev_mlme; 1554 1555 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1556 if (!vdev_mlme) 1557 return; 1558 1559 *srg_max_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_max_pd_offset; 1560 *srg_min_pd_offset = vdev_mlme->mgmt.generic.he_spr_srg_min_pd_offset; 1561 } 1562 1563 /** 1564 * wlan_vdev_mlme_set_srg_bss_color_bit_map() - set spatial reuse bss 1565 * color bitmap 1566 * @vdev: VDEV object 1567 * @srg_bss_color: SRG BSS color bitmap 1568 * 1569 * API to set the spatial reuse bss color bit map 1570 * 1571 * Return: void 1572 */ 1573 static inline 1574 void wlan_vdev_mlme_set_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev, 1575 uint64_t srg_bss_color) 1576 { 1577 struct vdev_mlme_obj *vdev_mlme; 1578 1579 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1580 if (!vdev_mlme) 1581 return; 1582 1583 vdev_mlme->mgmt.generic.srg_bss_color = srg_bss_color; 1584 } 1585 1586 /** 1587 * wlan_vdev_mlme_set_srg_partial_bssid_bit_map() - set spatial reuse 1588 * srg partial bitmap 1589 * @vdev: VDEV object 1590 * @srg_partial_bssid: SRG partial BSSID bitmap 1591 * 1592 * API to set the spatial reuse partial bssid bitmap 1593 * 1594 * Return: void 1595 */ 1596 static inline 1597 void wlan_vdev_mlme_set_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev, 1598 uint64_t srg_partial_bssid) 1599 { 1600 struct vdev_mlme_obj *vdev_mlme; 1601 1602 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1603 if (!vdev_mlme) 1604 return; 1605 1606 vdev_mlme->mgmt.generic.srg_partial_bssid = srg_partial_bssid; 1607 } 1608 1609 /** 1610 * wlan_vdev_mlme_get_srg_bss_color_bit_map() - get spatial reuse bss 1611 * colorbitmap 1612 * @vdev: VDEV object 1613 * @srg_bss_color: SRG BSS color bitmap 1614 * 1615 * API to get the spatial reuse bss color bit map 1616 * 1617 * Return: void 1618 */ 1619 static inline 1620 void wlan_vdev_mlme_get_srg_bss_color_bit_map(struct wlan_objmgr_vdev *vdev, 1621 uint64_t *srg_bss_color) 1622 { 1623 struct vdev_mlme_obj *vdev_mlme; 1624 1625 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1626 if (!vdev_mlme) 1627 return; 1628 1629 *srg_bss_color = vdev_mlme->mgmt.generic.srg_bss_color; 1630 } 1631 1632 /** 1633 * wlan_vdev_mlme_get_srg_partial_bssid_bit_map() - get spatial reuse 1634 * srg partial bitmap 1635 * @vdev: VDEV object 1636 * @srg_partial_bssid: SRG partial BSSID bitmap 1637 * 1638 * API to get the spatial reuse partial bssid bitmap 1639 * 1640 * Return: void 1641 */ 1642 static inline void 1643 wlan_vdev_mlme_get_srg_partial_bssid_bit_map(struct wlan_objmgr_vdev *vdev, 1644 uint64_t *srg_partial_bssid) 1645 { 1646 struct vdev_mlme_obj *vdev_mlme; 1647 1648 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1649 if (!vdev_mlme) 1650 return; 1651 1652 *srg_partial_bssid = vdev_mlme->mgmt.generic.srg_partial_bssid; 1653 } 1654 1655 /** 1656 * wlan_vdev_mlme_get_current_non_srg_pd_threshold() - get current non srg pd 1657 * threshold 1658 * @vdev: VDEV object 1659 * @non_srg_pd_threshold: NON-SRG pd threshold 1660 * 1661 * API to get non srg pd threshold 1662 * 1663 * Return: void 1664 */ 1665 static inline void 1666 wlan_vdev_mlme_get_current_non_srg_pd_threshold(struct wlan_objmgr_vdev *vdev, 1667 int32_t *non_srg_pd_threshold) 1668 { 1669 struct vdev_mlme_obj *vdev_mlme; 1670 1671 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1672 if (!vdev_mlme) 1673 return; 1674 1675 *non_srg_pd_threshold = 1676 vdev_mlme->mgmt.generic.he_curr_non_srg_pd_threshold; 1677 } 1678 1679 /** 1680 * wlan_vdev_mlme_get_current_srg_pd_threshold() - get current srg pd threshold 1681 * @vdev: VDEV object 1682 * @srg_pd_threshold: SRG pd threshold 1683 * 1684 * API to get srg pd threshold 1685 * 1686 * Return: void 1687 */ 1688 static inline void 1689 wlan_vdev_mlme_get_current_srg_pd_threshold(struct wlan_objmgr_vdev *vdev, 1690 int32_t *srg_pd_threshold) 1691 { 1692 struct vdev_mlme_obj *vdev_mlme; 1693 1694 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1695 if (!vdev_mlme) 1696 return; 1697 1698 *srg_pd_threshold = 1699 vdev_mlme->mgmt.generic.he_curr_srg_pd_threshold; 1700 } 1701 1702 /** 1703 * wlan_vdev_mlme_set_current_non_srg_pd_threshold() - set current non srg pd 1704 * threshold 1705 * @vdev: VDEV object 1706 * @non_srg_pd_threshold: NON-SRG pd threshold 1707 * 1708 * API to set non srg pd threshold 1709 * 1710 * Return: void 1711 */ 1712 static inline void 1713 wlan_vdev_mlme_set_current_non_srg_pd_threshold(struct wlan_objmgr_vdev *vdev, 1714 int32_t non_srg_pd_threshold) 1715 { 1716 struct vdev_mlme_obj *vdev_mlme; 1717 1718 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1719 if (!vdev_mlme) 1720 return; 1721 1722 vdev_mlme->mgmt.generic.he_curr_non_srg_pd_threshold = 1723 non_srg_pd_threshold; 1724 } 1725 1726 /** 1727 * wlan_vdev_mlme_set_current_srg_pd_threshold() - set current srg pd threshold 1728 * @vdev: VDEV object 1729 * @srg_pd_threshold: SRG pd threshold 1730 * 1731 * API to set srg pd threshold 1732 * 1733 * Return: void 1734 */ 1735 static inline void 1736 wlan_vdev_mlme_set_current_srg_pd_threshold(struct wlan_objmgr_vdev *vdev, 1737 int32_t srg_pd_threshold) 1738 { 1739 struct vdev_mlme_obj *vdev_mlme; 1740 1741 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1742 if (!vdev_mlme) 1743 return; 1744 vdev_mlme->mgmt.generic.he_curr_srg_pd_threshold = 1745 srg_pd_threshold; 1746 } 1747 1748 /** 1749 * wlan_vdev_mlme_set_pd_threshold_present() - set is PD threshold 1750 * present or not. 1751 * @vdev: VDEV object 1752 * @is_pd_threshold_present: is PD threshold present 1753 * 1754 * API to set pd threshold present flag 1755 * 1756 * Return: void 1757 */ 1758 static inline void 1759 wlan_vdev_mlme_set_pd_threshold_present(struct wlan_objmgr_vdev *vdev, 1760 bool is_pd_threshold_present) 1761 { 1762 struct vdev_mlme_obj *vdev_mlme; 1763 1764 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1765 if (!vdev_mlme) 1766 return; 1767 vdev_mlme->mgmt.generic.is_pd_threshold_present = 1768 is_pd_threshold_present; 1769 } 1770 1771 /** 1772 * wlan_vdev_mlme_get_pd_threshold_present() - get is PD threshold 1773 * present or not. 1774 * @vdev: VDEV object 1775 * @is_pd_threshold_present: is PD threshold present 1776 * 1777 * API to get pd threshold present flag 1778 * 1779 * Return: void 1780 */ 1781 static inline void 1782 wlan_vdev_mlme_get_pd_threshold_present(struct wlan_objmgr_vdev *vdev, 1783 bool *is_pd_threshold_present) 1784 { 1785 struct vdev_mlme_obj *vdev_mlme; 1786 1787 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1788 if (!vdev_mlme) { 1789 *is_pd_threshold_present = false; 1790 return; 1791 } 1792 *is_pd_threshold_present = 1793 vdev_mlme->mgmt.generic.is_pd_threshold_present; 1794 } 1795 #else 1796 static inline uint8_t wlan_vdev_mlme_get_sr_ctrl(struct wlan_objmgr_vdev *vdev) 1797 { 1798 return 0; 1799 } 1800 1801 static inline uint8_t wlan_vdev_mlme_get_non_srg_pd_offset( 1802 struct wlan_objmgr_vdev *vdev) 1803 { 1804 return 0; 1805 } 1806 1807 static inline bool wlan_vdev_mlme_get_he_spr_enabled( 1808 struct wlan_objmgr_vdev *vdev) 1809 { 1810 return 0; 1811 } 1812 1813 static inline 1814 bool wlan_vdev_mlme_is_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev) 1815 { 1816 return false; 1817 } 1818 1819 static inline 1820 bool wlan_vdev_mlme_is_sr_prohibit_en(struct wlan_objmgr_vdev *vdev) 1821 { 1822 return false; 1823 } 1824 1825 static inline void wlan_vdev_mlme_set_sr_ctrl(struct wlan_objmgr_vdev *vdev, 1826 uint8_t sr_ctrl) 1827 { 1828 } 1829 1830 static inline void 1831 wlan_vdev_mlme_set_non_srg_pd_offset(struct wlan_objmgr_vdev *vdev, 1832 uint8_t non_srg_pd_max_offset) 1833 { 1834 } 1835 1836 static inline void wlan_vdev_mlme_set_he_spr_enabled( 1837 struct wlan_objmgr_vdev *vdev, 1838 bool enable_he_spr) 1839 { 1840 } 1841 1842 static inline 1843 void wlan_vdev_mlme_set_sr_disable_due_conc(struct wlan_objmgr_vdev *vdev, 1844 bool he_spr_disabled_due_conc) 1845 { 1846 } 1847 1848 static inline 1849 void wlan_vdev_mlme_set_sr_prohibit_en(struct wlan_objmgr_vdev *vdev, 1850 bool sr_prohibit_enabled) 1851 { 1852 } 1853 #endif 1854 #else 1855 static inline void wlan_vdev_mlme_set_he_mcs_12_13_map( 1856 struct wlan_objmgr_vdev *vdev, 1857 uint16_t he_mcs_12_13_map) 1858 { 1859 } 1860 1861 static inline uint16_t wlan_vdev_mlme_get_he_mcs_12_13_map( 1862 struct wlan_objmgr_vdev *vdev) 1863 { 1864 return 0; 1865 } 1866 1867 #endif 1868 1869 /** 1870 * wlan_vdev_mlme_set_aid_mgr() - set aid mgr 1871 * @vdev: VDEV object 1872 * @aid_mgr: AID mgr 1873 * 1874 * API to set AID mgr in VDEV MLME cmpt object 1875 * 1876 * Return: void 1877 */ 1878 static inline void wlan_vdev_mlme_set_aid_mgr( 1879 struct wlan_objmgr_vdev *vdev, 1880 struct wlan_vdev_aid_mgr *aid_mgr) 1881 { 1882 struct vdev_mlme_obj *vdev_mlme; 1883 1884 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1885 if (!vdev_mlme) 1886 return; 1887 1888 vdev_mlme->mgmt.ap.aid_mgr = aid_mgr; 1889 } 1890 1891 /** 1892 * wlan_vdev_mlme_get_aid_mgr() - get aid mgr 1893 * @vdev: VDEV object 1894 * 1895 * API to get AID mgr in VDEV MLME cmpt object 1896 * 1897 * Return: aid_mgr 1898 */ 1899 static inline struct wlan_vdev_aid_mgr *wlan_vdev_mlme_get_aid_mgr( 1900 struct wlan_objmgr_vdev *vdev) 1901 { 1902 struct vdev_mlme_obj *vdev_mlme; 1903 1904 vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev); 1905 if (!vdev_mlme) 1906 return NULL; 1907 1908 return vdev_mlme->mgmt.ap.aid_mgr; 1909 } 1910 1911 #ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE 1912 /** 1913 * vdev_mgr_cdp_vdev_attach() - MLME API to attach CDP vdev 1914 * @mlme_obj: pointer to vdev_mlme_obj 1915 * 1916 * Return: QDF_STATUS - Success or Failure 1917 */ 1918 QDF_STATUS vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj); 1919 1920 /** 1921 * vdev_mgr_cdp_vdev_detach() - MLME API to detach CDP vdev 1922 * @mlme_obj: pointer to vdev_mlme_obj 1923 * 1924 * Return: QDF_STATUS - Success or Failure 1925 */ 1926 QDF_STATUS vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj); 1927 #endif 1928 #endif 1929