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