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