xref: /wlan-dirver/qca-wifi-host-cmn/umac/mlme/include/wlan_vdev_mlme.h (revision dd4dc88b837a295134aa9869114a2efee0f4894b)
1 /*
2  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 /**
18  * DOC: Define VDEV MLME structure and APIs
19  */
20 #ifndef _WLAN_VDEV_MLME_H_
21 #define _WLAN_VDEV_MLME_H_
22 
23 #include <wlan_vdev_mgr_tgt_if_rx_defs.h>
24 #include <wlan_objmgr_vdev_obj.h>
25 #include <wlan_vdev_mlme_api.h>
26 
27 struct vdev_mlme_obj;
28 
29 /* Requestor ID for multiple vdev restart */
30 #define MULTIPLE_VDEV_RESTART_REQ_ID 0x1234
31 
32 /* values for vdev_type */
33 #define WLAN_VDEV_MLME_TYPE_AP   0x1
34 #define WLAN_VDEV_MLME_TYPE_STA  0x2
35 #define WLAN_VDEV_MLME_TYPE_IBSS 0x3
36 #define WLAN_VDEV_MLME_TYPE_MONITOR 0x4
37 
38 /* values for vdev_subtype */
39 #define WLAN_VDEV_MLME_SUBTYPE_P2P_DEVICE 0x1
40 #define WLAN_VDEV_MLME_SUBTYPE_P2P_CLIENT 0x2
41 #define WLAN_VDEV_MLME_SUBTYPE_P2P_GO 0x3
42 #define WLAN_VDEV_MLME_SUBTYPE_PROXY_STA 0x4
43 #define WLAN_VDEV_MLME_SUBTYPE_MESH 0x5
44 
45 /* vdev control flags (per bits) */
46 #define WLAN_VDEV_MLME_FLAGS_NON_MBSSID_AP      0x00000001
47 #define WLAN_VDEV_MLME_FLAGS_TRANSMIT_AP        0x00000002
48 #define WLAN_VDEV_MLME_FLAGS_NON_TRANSMIT_AP    0x00000004
49 
50 /**
51  * struct vdev_mlme_proto_generic - generic mlme proto structure
52  * sent in frames
53  * @dtim_period: frequency of data transmissions per beacon 1-255
54  * @slot_time: slot time
55  * @protection_mode: rts cts protection mode
56  * @beacon_interval: beacon interval
57  * @ldpc: low density parity check value
58  * @nss: number of spatial stream
59  * @nss_2g: 2.4GHz number of spatial stream
60  * @nss_5g: 5GHz number of spatial stream
61  * @tsfadjust: adjusted timer sync value
62  */
63 struct vdev_mlme_proto_generic {
64 	uint8_t dtim_period;
65 	uint32_t slot_time;
66 	uint32_t protection_mode;
67 	uint16_t beacon_interval;
68 	uint8_t ldpc;
69 	uint8_t nss;
70 	uint8_t nss_2g;
71 	uint8_t nss_5g;
72 	uint64_t tsfadjust;
73 };
74 
75 /**
76  * struct vdev_mlme_proto_ap - ap specific mlme protocol
77  * @.
78  */
79 struct vdev_mlme_proto_ap {
80 };
81 
82 /**
83  * struct vdev_mlme_proto_sta - sta specific mlme protocol
84  * @assoc_id: association id of station
85  * @uapsd_cfg: uapsd configuration
86  */
87 struct vdev_mlme_proto_sta {
88 	uint16_t assoc_id;
89 	uint16_t uapsd_cfg;
90 };
91 
92 /**
93  * struct vdev_mlme_proto_bss_color - bss color cfg
94  * @flags: proposed for future use cases, currently not used.
95  * @evt_type: bss color collision event.
96  * @current_bss_color: current bss color.
97  * @detection_period_ms: scan interval for both AP and STA mode.
98  * @scan_period_ms: scan period for passive scan to detect collision.
99  * @free_slot_expiry_time_ms: FW to notify host at timer expiry after
100  *                            which Host will disable the bss color.
101  */
102 struct vdev_mlme_proto_bss_color {
103 	uint32_t flags;
104 	uint8_t  evt_type;
105 	uint32_t current_bss_color;
106 	uint32_t detection_period_ms;
107 	uint32_t scan_period_ms;
108 	uint32_t free_slot_expiry_time_ms;
109 };
110 
111 /**
112  * struct vdev_mlme_vht_info - vdev VHT information
113  * @caps: vht capabilities
114  * @subfer: su beam former capability
115  * @subfee: su beam formee capability
116  * @mubfer: mu beam former capability
117  * @mubfee: mu beam formee capability
118  * @implicit_bf: Implicit BF support
119  * @sounding_dimension: Beamformer number of sounding dimension
120  * @bfee_sts_cap: beam formee STA capability
121  * @allow_vht: vht capability status
122  */
123 struct vdev_mlme_vht_info {
124 	uint32_t caps;
125 	uint8_t  subfer;
126 	uint8_t  mubfer;
127 	uint8_t  subfee;
128 	uint8_t  mubfee;
129 	uint8_t  implicit_bf;
130 	uint8_t  sounding_dimension;
131 	uint8_t  bfee_sts_cap;
132 	bool     allow_vht;
133 };
134 
135 /**
136  * struct vdev_mlme_ht_info - vdev HT information
137  * @ht_caps: HT capabilities
138  * @allow_ht: HT capability status
139  */
140 struct vdev_mlme_ht_info {
141 	uint32_t ht_caps;
142 	bool     allow_ht;
143 };
144 
145 /**
146  * struct vdev_mlme_he_ops_info - vdev mlme HEOPS information
147  * @he_ops: he ops
148  */
149 struct vdev_mlme_he_ops_info {
150 	uint32_t he_ops;
151 };
152 
153 /**
154  * struct vdev_mlme_he_ops_info - vdev protocol structure holding information
155  * that is used in frames
156  * @generic: generic protocol information
157  * @ap: ap specific protocol information
158  * @sta: sta specific protocol information
159  * @vht_info: vht information
160  * @ht_info: ht capabilities information
161  * @he_ops_info: he ops information
162  * @bss_color: 11ax HE BSS Color information
163  */
164 struct vdev_mlme_proto {
165 	struct vdev_mlme_proto_generic generic;
166 	struct vdev_mlme_proto_ap ap;
167 	struct vdev_mlme_proto_sta sta;
168 	struct vdev_mlme_vht_info vht_info;
169 	struct vdev_mlme_ht_info ht_info;
170 	struct vdev_mlme_he_ops_info he_ops_info;
171 	struct vdev_mlme_proto_bss_color bss_color;
172 };
173 
174 /**
175  * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg
176  * @rts_threshold: RTS threshold
177  * @frag_threshold: Fragmentation threshold
178  * @probe_delay: time in msec for delaying to send first probe request
179  * @repeat_probe_time: probe request transmission time
180  * @drop_unencry: drop unencrypted status
181  * @ tx_pwrlimit: Tx power limit
182  * @tx_power: Tx power
183  * @minpower: Min power
184  * @maxpower: Max power
185  * @maxregpower: max regulatory power
186  * @antennamax: max antenna
187  * @reg_class_id: reg domain class id
188  * @ampdu: ampdu limit
189  * @amsdu: amsdu limit
190  * @ssid: service set identifier
191  * @ssid_len: ssid length
192  * @type: vdev type
193  * @sub_type: vdev subtype
194  * @rx_decap_type: rx decap type
195  * @tx_decap_type: tx decap type
196  * @disable_hw_ack: disable ha ack flag
197  * @bssid: bssid
198  * @phy_mode: phy mode
199  */
200 struct vdev_mlme_mgmt_generic {
201 	uint32_t rts_threshold;
202 	uint32_t frag_threshold;
203 	uint32_t probe_delay;
204 	uint32_t repeat_probe_time;
205 	uint32_t drop_unencry;
206 	uint32_t tx_pwrlimit;
207 	uint8_t tx_power;
208 	uint8_t minpower;
209 	uint8_t maxpower;
210 	uint8_t maxregpower;
211 	uint8_t antennamax;
212 	uint8_t reg_class_id;
213 	uint8_t ampdu;
214 	uint8_t amsdu;
215 	char ssid[WLAN_SSID_MAX_LEN + 1];
216 	uint8_t ssid_len;
217 	uint8_t type;
218 	uint8_t subtype;
219 	uint8_t rx_decap_type;
220 	uint8_t tx_decap_type;
221 	bool disable_hw_ack;
222 	uint8_t bssid[QDF_MAC_ADDR_SIZE];
223 	uint32_t phy_mode;
224 };
225 
226 /**
227  * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg
228  * @.
229  */
230 struct vdev_mlme_mgmt_ap {
231 };
232 
233 /**
234  * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg
235  * @.
236  */
237 struct vdev_mlme_mgmt_sta {
238 };
239 
240 /**
241  * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters
242  * @bmiss_first_bcnt: bmiss first time
243  * @bmiss_final_bcnt: bmiss final time
244  * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be
245  * inactive
246  * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send
247  * data-null
248  * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT
249  */
250 struct vdev_mlme_inactivity_params {
251 	uint32_t bmiss_first_bcnt;
252 	uint32_t bmiss_final_bcnt;
253 	uint32_t keepalive_min_idle_inactive_time_secs;
254 	uint32_t keepalive_max_idle_inactive_time_secs;
255 	uint32_t keepalive_max_unresponsive_time_secs;
256 };
257 
258 /**
259  * struct vdev_mlme_rate_info - vdev mlme rate information
260  * @rate_flags: dynamic bandwidth info
261  * @per_band_tx_mgmt_rate: per band Tx mgmt rate
262  * @max_rate: max bandwidth rate
263  * @tx_mgmt_rate: Tx Mgmt rate
264  * @bcn_tx_rate: beacon Tx rate
265  * @type: Type of ratemask configuration
266  * @lower32: Lower 32 bits in the 1st 64-bit value
267  * @higher32: Higher 32 bits in the 1st 64-bit value
268  * @lower32_2: Lower 32 bits in the 2nd 64-bit value
269  * @half_rate: Half rate
270  * @quarter_rate: quarter rate
271  */
272 struct vdev_mlme_rate_info {
273 	uint32_t rate_flags;
274 	uint32_t per_band_tx_mgmt_rate;
275 	uint32_t max_rate;
276 	uint32_t tx_mgmt_rate;
277 	uint32_t bcn_tx_rate;
278 	uint8_t  type;
279 	uint32_t lower32;
280 	uint32_t higher32;
281 	uint32_t lower32_2;
282 	bool     half_rate;
283 	bool     quarter_rate;
284 };
285 
286 /**
287  * struct vdev_mlme_chainmask_info - vdev mlme chainmask information
288  * @tx_chainmask: Tx chainmask
289  * @rx_chainmask: Rx Chainmask
290  * @num_rx_chain: Num of bits set in Rx chain
291  * @num_tx_chain: Num of bits set in Tx chain
292  */
293 struct vdev_mlme_chainmask_info {
294 	uint8_t tx_chainmask;
295 	uint8_t rx_chainmask;
296 	uint8_t num_rx_chain;
297 	uint8_t num_tx_chain;
298 };
299 
300 /**
301  * struct vdev_mlme_powersave_info - vdev mlme powersave information
302  * @packet_powersave: packet powersave
303  * @max_li_of_moddtim: max mod dtim
304  * @dyndtim_cnt: dynamic dtim count
305  * @listen_interval: listen interval
306  * @moddtim_cnt: mod dtim count
307  */
308 struct vdev_mlme_powersave_info {
309 	uint32_t packet_powersave;
310 	uint32_t max_li_of_moddtim;
311 	uint32_t dyndtim_cnt;
312 	uint32_t listen_interval;
313 	uint32_t moddtim_cnt;
314 };
315 
316 /**
317  * struct vdev_mlme_beacon_info - vdev mlme beacon information
318  * @beacon_buffer: buffer allocated for beacon frame
319  * @beacon_offsets: beacon IE's offsets
320  */
321 struct vdev_mlme_beacon_info {
322 	qdf_nbuf_t beacon_buffer;
323 	void *beacon_offsets;
324 };
325 
326 /**
327  * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd
328  * @profile_idx: profile index of the connected non-trans ap (mbssid case).
329  *              0  means invalid.
330  * @profile_num: the total profile numbers of non-trans aps (mbssid
331  * case).
332  *              0 means non-MBSS AP.
333  * @mbssid-flags: MBSS IE flags indicating vdev type
334  * @vdevid_trans: id of transmitting vdev for MBSS IE
335  * @trans_bssid: bssid of transmitted AP (MBSS IE case)
336  */
337 struct vdev_mlme_mbss_11ax {
338 	uint32_t profile_idx;
339 	uint32_t profile_num;
340 	uint32_t mbssid_flags;
341 	uint8_t vdevid_trans;
342 	uint8_t trans_bssid[QDF_MAC_ADDR_SIZE];
343 };
344 
345 /**
346  * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg
347  * @generic: generic mgmt information
348  * @ap: ap specific mgmt information
349  * @sta: sta specific mgmt information
350  * @inactivity_params: inactivity parameters
351  * @rate_info: bandwidth rate information
352  * @chainmask_info: Chainmask information
353  * @powersave_info: Power save parameters
354  * @beacon_info: beacon buffer information
355  * @mbss_11ax: MBSS 11ax information
356  */
357 struct vdev_mlme_mgmt {
358 	struct vdev_mlme_mgmt_generic generic;
359 	struct vdev_mlme_mgmt_ap ap;
360 	struct vdev_mlme_mgmt_sta sta;
361 	struct vdev_mlme_inactivity_params inactivity_params;
362 	struct vdev_mlme_rate_info rate_info;
363 	struct vdev_mlme_chainmask_info chainmask_info;
364 	struct vdev_mlme_powersave_info powersave_info;
365 	struct vdev_mlme_beacon_info beacon_info;
366 	struct vdev_mlme_mbss_11ax mbss_11ax;
367 };
368 
369 /**
370  * enum beacon_update_op - Beacon update op type
371  * @BEACON_INIT:      Initialize beacon
372  * @BEACON_REINIT:    Re-initialize beacon
373  * @BEACON_UPDATE:    Update dynamic fields of beacon
374  * @BEACON_CSA:       Enable CSA IE
375  * @BEACON_FREE:      Beacon buffer free
376  */
377 enum beacon_update_op {
378 	BEACON_INIT,
379 	BEACON_REINIT,
380 	BEACON_UPDATE,
381 	BEACON_CSA,
382 	BEACON_FREE,
383 };
384 
385 /**
386  * enum vdev_cmd_type - Command type
387  * @START_REQ:      Start request
388  * @RESTART_REQ:    Restart request
389  * @STOP_REQ: STOP request
390  * @DELETE_REQ: DELETE request
391  */
392 enum vdev_cmd_type {
393 	START_REQ,
394 	RESTART_REQ,
395 	STOP_REQ,
396 	DELETE_REQ,
397 };
398 
399 /**
400  * enum vdev_start_resp_type - start respone type
401  * @START_RESPONSE:  Start response
402  * @RESTART_RESPONSE: Restart response
403  */
404 enum vdev_start_resp_type {
405 	START_RESPONSE = 0,
406 	RESTART_RESPONSE,
407 };
408 
409 /**
410  * struct vdev_mlme_ops - VDEV MLME operation callbacks structure
411  * @mlme_vdev_validate_basic_params:    callback to validate VDEV basic params
412  * @mlme_vdev_reset_proto_params:       callback to Reset protocol params
413  * @mlme_vdev_start_send:               callback to initiate actions of VDEV
414  *                                      MLME start operation
415  * @mlme_vdev_restart_send:             callback to initiate actions of VDEV
416  *                                      MLME restart operation
417  * @mlme_vdev_stop_start_send:          callback to block start/restart VDEV
418  *                                      request command
419  * @mlme_vdev_start_continue:           callback to initiate operations on
420  *                                      LMAC/FW start response
421  * @mlme_vdev_up_send:                  callback to initiate actions of VDEV
422  *                                      MLME up operation
423  * @mlme_vdev_notify_up_complete:       callback to notify VDEV MLME on moving
424  *                                      to UP state
425  * @mlme_vdev_notify_roam_start:        callback to initiate roaming
426  * @mlme_vdev_update_beacon:            callback to initiate beacon update
427  * @mlme_vdev_disconnect_peers:         callback to initiate disconnection of
428  *                                      peers
429  * @mlme_vdev_dfs_cac_timer_stop:       callback to stop the DFS CAC timer
430  * @mlme_vdev_stop_send:                callback to initiate actions of VDEV
431  *                                      MLME stop operation
432  * @mlme_vdev_stop_continue:            callback to initiate operations on
433  *                                      LMAC/FW stop response
434  * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS
435  *                                      peer delete completion
436  * @mlme_vdev_down_send:                callback to initiate actions of VDEV
437  *                                      MLME down operation
438  * @mlme_vdev_notify_start_state_exit:  callback to notify on vdev start
439  *                                      start state exit
440  * @mlme_vdev_is_newchan_no_cac:        callback to check CAC is required
441  */
442 struct vdev_mlme_ops {
443 	QDF_STATUS (*mlme_vdev_validate_basic_params)(
444 				struct vdev_mlme_obj *vdev_mlme,
445 				uint16_t event_data_len, void *event_data);
446 	QDF_STATUS (*mlme_vdev_reset_proto_params)(
447 				struct vdev_mlme_obj *vdev_mlme,
448 				uint16_t event_data_len, void *event_data);
449 	QDF_STATUS (*mlme_vdev_start_send)(
450 				struct vdev_mlme_obj *vdev_mlme,
451 				uint16_t event_data_len, void *event_data);
452 	QDF_STATUS (*mlme_vdev_restart_send)(
453 				struct vdev_mlme_obj *vdev_mlme,
454 				uint16_t event_data_len, void *event_data);
455 	QDF_STATUS (*mlme_vdev_stop_start_send)(
456 				struct vdev_mlme_obj *vdev_mlme,
457 				enum vdev_cmd_type type,
458 				uint16_t event_data_len, void *event_data);
459 	QDF_STATUS (*mlme_vdev_start_continue)(
460 				struct vdev_mlme_obj *vdev_mlme,
461 				uint16_t event_data_len, void *event_data);
462 	QDF_STATUS (*mlme_vdev_sta_conn_start)(
463 				struct vdev_mlme_obj *vdev_mlme,
464 				uint16_t event_data_len, void *event_data);
465 	QDF_STATUS (*mlme_vdev_start_req_failed)(
466 				struct vdev_mlme_obj *vdev_mlme,
467 				uint16_t event_data_len, void *event_data);
468 	QDF_STATUS (*mlme_vdev_up_send)(
469 				struct vdev_mlme_obj *vdev_mlme,
470 				uint16_t event_data_len, void *event_data);
471 	QDF_STATUS (*mlme_vdev_notify_up_complete)(
472 				struct vdev_mlme_obj *vdev_mlme,
473 				uint16_t event_data_len, void *event_data);
474 	QDF_STATUS (*mlme_vdev_notify_roam_start)(
475 				struct vdev_mlme_obj *vdev_mlme,
476 				uint16_t event_data_len, void *event_data);
477 	QDF_STATUS (*mlme_vdev_update_beacon)(
478 				struct vdev_mlme_obj *vdev_mlme,
479 				enum beacon_update_op op,
480 				uint16_t event_data_len, void *event_data);
481 	QDF_STATUS (*mlme_vdev_disconnect_peers)(
482 				struct vdev_mlme_obj *vdev_mlme,
483 				uint16_t event_data_len, void *event_data);
484 	QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)(
485 				struct vdev_mlme_obj *vdev_mlme,
486 				uint16_t event_data_len, void *event_data);
487 	QDF_STATUS (*mlme_vdev_stop_send)(
488 				struct vdev_mlme_obj *vdev_mlme,
489 				uint16_t event_data_len, void *event_data);
490 	QDF_STATUS (*mlme_vdev_stop_continue)(
491 				struct vdev_mlme_obj *vdev_mlme,
492 				uint16_t event_data_len, void *event_data);
493 	QDF_STATUS (*mlme_vdev_down_send)(
494 				struct vdev_mlme_obj *vdev_mlme,
495 				uint16_t event_data_len, void *event_data);
496 	QDF_STATUS (*mlme_vdev_notify_down_complete)(
497 				struct vdev_mlme_obj *vdev_mlme,
498 				uint16_t event_data_len, void *event_data);
499 	QDF_STATUS (*mlme_vdev_ext_delete_rsp)(
500 				struct vdev_mlme_obj *vdev_mlme,
501 				struct vdev_delete_response *rsp);
502 	QDF_STATUS (*mlme_vdev_ext_stop_rsp)(
503 				struct vdev_mlme_obj *vdev_mlme,
504 				struct vdev_stop_response *rsp);
505 	QDF_STATUS (*mlme_vdev_ext_start_rsp)(
506 				struct vdev_mlme_obj *vdev_mlme,
507 				struct vdev_start_response *rsp);
508 	QDF_STATUS (*mlme_vdev_notify_start_state_exit)(
509 				struct vdev_mlme_obj *vdev_mlme);
510 	QDF_STATUS (*mlme_vdev_is_newchan_no_cac)(
511 				struct vdev_mlme_obj *vdev_mlme);
512 };
513 
514 /**
515  * struct vdev_mlme_obj - VDEV MLME component object
516  * @proto: VDEV MLME proto substructure
517  * @mgmt: VDEV MLME mgmt substructure
518  * @sm_lock:              VDEV SM lock
519  * @vdev_cmd_lock:        VDEV MLME command atomicity
520  * @sm_hdl:               VDEV SM handle
521  * @vdev: Pointer to vdev objmgr
522  * @ops:                  VDEV MLME callback table
523  * @ext_vdev_ptr:         VDEV MLME legacy pointer
524  * @vdev_rt: VDEV response timer
525  */
526 struct vdev_mlme_obj {
527 	struct vdev_mlme_proto proto;
528 	struct vdev_mlme_mgmt  mgmt;
529 #ifdef VDEV_SM_LOCK_SUPPORT
530 	qdf_spinlock_t sm_lock;
531 	qdf_mutex_t vdev_cmd_lock;
532 #endif
533 	struct wlan_sm *sm_hdl;
534 	struct wlan_objmgr_vdev *vdev;
535 	struct vdev_mlme_ops *ops;
536 	void *ext_vdev_ptr;
537 	struct vdev_response_timer vdev_rt;
538 };
539 
540 /**
541  * mlme_vdev_validate_basic_params - Validate basic params
542  * @vdev_mlme_obj:  VDEV MLME comp object
543  * @event_data_len: data size
544  * @event_data: event data
545  *
546  * API validate MLME VDEV basic parameters
547  *
548  * Return: SUCCESS on successful validation
549  *         FAILURE, if any parameter is not initialized
550  */
551 static inline QDF_STATUS mlme_vdev_validate_basic_params(
552 				struct vdev_mlme_obj *vdev_mlme,
553 				uint16_t event_data_len, void *event_data)
554 {
555 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
556 
557 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_validate_basic_params)
558 		ret = vdev_mlme->ops->mlme_vdev_validate_basic_params(
559 					vdev_mlme, event_data_len, event_data);
560 
561 	return ret;
562 }
563 
564 /**
565  * mlme_vdev_reset_proto_params - Reset VDEV protocol params
566  * @vdev_mlme_obj:  VDEV MLME comp object
567  * @event_data_len: data size
568  * @event_data: event data
569  *
570  * API resets the protocol params fo vdev
571  *
572  * Return: SUCCESS on successful reset
573  *         FAILURE, if it fails due to any
574  */
575 static inline QDF_STATUS mlme_vdev_reset_proto_params(
576 				struct vdev_mlme_obj *vdev_mlme,
577 				uint16_t event_data_len, void *event_data)
578 {
579 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
580 
581 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_reset_proto_params)
582 		ret = vdev_mlme->ops->mlme_vdev_reset_proto_params(
583 					vdev_mlme, event_data_len, event_data);
584 
585 	return ret;
586 }
587 
588 /**
589  * mlme_vdev_start_send - Invokes VDEV start operation
590  * @vdev_mlme_obj:  VDEV MLME comp object
591  * @event_data_len: data size
592  * @event_data: event data
593  *
594  * API invokes VDEV start operation
595  *
596  * Return: SUCCESS on successful completion of start operation
597  *         FAILURE, if it fails due to any
598  */
599 static inline QDF_STATUS mlme_vdev_start_send(
600 				struct vdev_mlme_obj *vdev_mlme,
601 				uint16_t event_data_len, void *event_data)
602 {
603 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
604 
605 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_send)
606 		ret = vdev_mlme->ops->mlme_vdev_start_send(
607 					vdev_mlme, event_data_len, event_data);
608 
609 	return ret;
610 }
611 
612 /**
613  * mlme_vdev_restart_send - Invokes VDEV restart operation
614  * @vdev_mlme_obj:  VDEV MLME comp object
615  * @event_data_len: data size
616  * @event_data: event data
617  *
618  * API invokes VDEV restart operation
619  *
620  * Return: SUCCESS on successful completion of restart operation
621  *         FAILURE, if it fails due to any
622  */
623 static inline QDF_STATUS mlme_vdev_restart_send(
624 				struct vdev_mlme_obj *vdev_mlme,
625 				uint16_t event_data_len, void *event_data)
626 {
627 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
628 
629 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_restart_send)
630 		ret = vdev_mlme->ops->mlme_vdev_restart_send(
631 					vdev_mlme, event_data_len, event_data);
632 
633 	return ret;
634 }
635 
636 /**
637  * mlme_vdev_stop_start_send - Invoke block VDEV restart operation
638  * @vdev_mlme_obj:  VDEV MLME comp object
639  * @restart: restart req/start req
640  * @event_data_len: data size
641  * @event_data: event data
642  *
643  * API invokes stops pending VDEV restart operation
644  *
645  * Return: SUCCESS alsways
646  */
647 static inline QDF_STATUS mlme_vdev_stop_start_send(
648 				struct vdev_mlme_obj *vdev_mlme,
649 				uint8_t restart,
650 				uint16_t event_data_len, void *event_data)
651 {
652 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
653 
654 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_start_send)
655 		ret = vdev_mlme->ops->mlme_vdev_stop_start_send(
656 				vdev_mlme, restart, event_data_len, event_data);
657 
658 	return ret;
659 }
660 
661 /**
662  * mlme_vdev_start_continue - VDEV start response handling
663  * @vdev_mlme_obj:  VDEV MLME comp object
664  * @event_data_len: data size
665  * @event_data: event data
666  *
667  * API invokes VDEV start response actions
668  *
669  * Return: SUCCESS on successful completion of start response operation
670  *         FAILURE, if it fails due to any
671  */
672 static inline QDF_STATUS mlme_vdev_start_continue(
673 				struct vdev_mlme_obj *vdev_mlme,
674 				uint16_t event_data_len, void *event_data)
675 {
676 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
677 
678 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_continue)
679 		ret = vdev_mlme->ops->mlme_vdev_start_continue(
680 					vdev_mlme, event_data_len, event_data);
681 
682 	return ret;
683 }
684 
685 /**
686  * mlme_vdev_start_req_failed - Invoke Station VDEV connection, if it pause
687  * @vdev_mlme_obj:  VDEV MLME comp object
688  * @event_data_len: data size
689  * @event_data: event data
690  *
691  * API invokes on START fail response
692  *
693  * Return: SUCCESS on successful invocation of callback
694  *         FAILURE, if it fails due to any
695  */
696 static inline QDF_STATUS mlme_vdev_start_req_failed(
697 				struct vdev_mlme_obj *vdev_mlme,
698 				uint16_t event_data_len, void *event_data)
699 {
700 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
701 
702 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_req_failed)
703 		ret = vdev_mlme->ops->mlme_vdev_start_req_failed(
704 					vdev_mlme, event_data_len, event_data);
705 
706 	return ret;
707 }
708 
709 /**
710  * mlme_vdev_sta_conn_start - Invoke Station VDEV connection, if it pause
711  * @vdev_mlme_obj:  VDEV MLME comp object
712  * @event_data_len: data size
713  * @event_data: event data
714  *
715  * API invokes connection SM to start station connection
716  *
717  * Return: SUCCESS on successful invocation of connection sm
718  *         FAILURE, if it fails due to any
719  */
720 static inline QDF_STATUS mlme_vdev_sta_conn_start(
721 				struct vdev_mlme_obj *vdev_mlme,
722 				uint16_t event_data_len, void *event_data)
723 {
724 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
725 
726 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_sta_conn_start)
727 		ret = vdev_mlme->ops->mlme_vdev_sta_conn_start(
728 					vdev_mlme, event_data_len, event_data);
729 
730 	return ret;
731 }
732 
733 /**
734  * mlme_vdev_up_send - VDEV up operation
735  * @vdev_mlme_obj:  VDEV MLME comp object
736  * @event_data_len: data size
737  * @event_data: event data
738  *
739  * API invokes VDEV up operations
740  *
741  * Return: SUCCESS on successful completion of up operation
742  *         FAILURE, if it fails due to any
743  */
744 static inline QDF_STATUS mlme_vdev_up_send(
745 				struct vdev_mlme_obj *vdev_mlme,
746 				uint16_t event_data_len, void *event_data)
747 {
748 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
749 
750 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_up_send)
751 		ret = vdev_mlme->ops->mlme_vdev_up_send(
752 					vdev_mlme, event_data_len, event_data);
753 
754 	return ret;
755 }
756 
757 /**
758  * mlme_vdev_notify_up_complete - VDEV up state transition notification
759  * @vdev_mlme_obj:  VDEV MLME comp object
760  * @event_data_len: data size
761  * @event_data: event data
762  *
763  * API notifies MLME on moving to UP state
764  *
765  * Return: SUCCESS on successful completion of up notification
766  *         FAILURE, if it fails due to any
767  */
768 static inline
769 QDF_STATUS mlme_vdev_notify_up_complete(struct vdev_mlme_obj *vdev_mlme,
770 					uint16_t event_data_len,
771 					void *event_data)
772 {
773 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
774 
775 	if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_up_complete)
776 		ret = vdev_mlme->ops->mlme_vdev_notify_up_complete(
777 					vdev_mlme, event_data_len, event_data);
778 
779 	return ret;
780 }
781 
782 /**
783  * mlme_vdev_notify_roam_start - VDEV Roaming notification
784  * @vdev_mlme_obj:  VDEV MLME comp object
785  * @event_len: data size
786  * @event_data: event data
787  *
788  * API notifies MLME on roaming
789  *
790  * Return: SUCCESS on successful completion of up notification
791  *         FAILURE, if it fails due to any
792  */
793 static inline
794 QDF_STATUS mlme_vdev_notify_roam_start(struct vdev_mlme_obj *vdev_mlme,
795 				       uint16_t event_len, void *event_data)
796 {
797 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
798 
799 	if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_roam_start)
800 		ret = vdev_mlme->ops->mlme_vdev_notify_roam_start(vdev_mlme,
801 								  event_len,
802 								  event_data);
803 
804 	return ret;
805 }
806 
807 /**
808  * mlme_vdev_update_beacon - Updates beacon
809  * @vdev_mlme_obj:  VDEV MLME comp object
810  * @op: beacon update type
811  * @event_data_len: data size
812  * @event_data: event data
813  *
814  * API updates/allocates/frees the beacon
815  *
816  * Return: SUCCESS on successful update of beacon
817  *         FAILURE, if it fails due to any
818  */
819 static inline
820 QDF_STATUS mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme,
821 				   enum beacon_update_op op,
822 				   uint16_t event_data_len, void *event_data)
823 {
824 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
825 
826 	if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_update_beacon)
827 		ret = vdev_mlme->ops->mlme_vdev_update_beacon(vdev_mlme, op,
828 						event_data_len, event_data);
829 
830 	return ret;
831 }
832 
833 /**
834  * mlme_vdev_disconnect_peers - Disconnect peers
835  * @vdev_mlme_obj:  VDEV MLME comp object
836  * @event_data_len: data size
837  * @event_data: event data
838  *
839  * API trigger stations disconnection with AP VDEV or AP disconnection with STA
840  * VDEV
841  *
842  * Return: SUCCESS on successful invocation of station disconnection
843  *         FAILURE, if it fails due to any
844  */
845 static inline QDF_STATUS mlme_vdev_disconnect_peers(
846 				struct vdev_mlme_obj *vdev_mlme,
847 				uint16_t event_data_len, void *event_data)
848 {
849 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
850 
851 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_disconnect_peers)
852 		ret = vdev_mlme->ops->mlme_vdev_disconnect_peers(
853 					vdev_mlme, event_data_len, event_data);
854 
855 	return ret;
856 }
857 
858 /**
859  * mlme_vdev_dfs_cac_timer_stop - Stop CAC timer
860  * @vdev_mlme_obj:  VDEV MLME comp object
861  * @event_data_len: data size
862  * @event_data: event data
863  *
864  * API stops the CAC timer through DFS API
865  *
866  * Return: SUCCESS on successful CAC timer stop
867  *         FAILURE, if it fails due to any
868  */
869 static inline QDF_STATUS mlme_vdev_dfs_cac_timer_stop(
870 				struct vdev_mlme_obj *vdev_mlme,
871 				uint16_t event_data_len, void *event_data)
872 {
873 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
874 
875 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop)
876 		ret = vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop(
877 					vdev_mlme, event_data_len, event_data);
878 
879 	return ret;
880 }
881 
882 /**
883  * mlme_vdev_stop_send - Invokes VDEV stop operation
884  * @vdev_mlme_obj:  VDEV MLME comp object
885  * @event_data_len: data size
886  * @event_data: event data
887  *
888  * API invokes VDEV stop operation
889  *
890  * Return: SUCCESS on successful completion of stop operation
891  *         FAILURE, if it fails due to any
892  */
893 static inline QDF_STATUS mlme_vdev_stop_send(
894 				struct vdev_mlme_obj *vdev_mlme,
895 				uint16_t event_data_len, void *event_data)
896 {
897 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
898 
899 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_send)
900 		ret = vdev_mlme->ops->mlme_vdev_stop_send(
901 					vdev_mlme, event_data_len, event_data);
902 
903 	return ret;
904 }
905 
906 /**
907  * mlme_vdev_stop_continue - VDEV stop response handling
908  * @vdev_mlme_obj:  VDEV MLME comp object
909  * @event_data_len: data size
910  * @event_data: event data
911  *
912  * API invokes VDEV stop response actions
913  *
914  * Return: SUCCESS on successful completion of stop response operation
915  *         FAILURE, if it fails due to any
916  */
917 static inline QDF_STATUS mlme_vdev_stop_continue(
918 				struct vdev_mlme_obj *vdev_mlme,
919 				uint16_t event_data_len, void *event_data)
920 {
921 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
922 
923 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_continue)
924 		ret = vdev_mlme->ops->mlme_vdev_stop_continue(vdev_mlme,
925 							      event_data_len,
926 							      event_data);
927 
928 	return ret;
929 }
930 
931 /**
932  * mlme_vdev_down_send - VDEV down operation
933  * @vdev_mlme_obj:  VDEV MLME comp object
934  * @event_data_len: data size
935  * @event_data: event data
936  *
937  * API invokes VDEV down operation
938  *
939  * Return: SUCCESS on successful completion of VDEV down operation
940  *         FAILURE, if it fails due to any
941  */
942 static inline QDF_STATUS mlme_vdev_down_send(
943 				struct vdev_mlme_obj *vdev_mlme,
944 				uint16_t event_data_len, void *event_data)
945 {
946 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
947 
948 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_down_send)
949 		ret = vdev_mlme->ops->mlme_vdev_down_send(
950 					vdev_mlme, event_data_len, event_data);
951 
952 	return ret;
953 }
954 
955 /**
956  * mlme_vdev_notify_down_complete - VDEV init state transition notification
957  * @vdev_mlme_obj:  VDEV MLME comp object
958  * @event_data_len: data size
959  * @event_data: event data
960  *
961  * API notifies MLME on moving to INIT state
962  *
963  * Return: SUCCESS on successful completion of down notification
964  *         FAILURE, if it fails due to any
965  */
966 static inline QDF_STATUS mlme_vdev_notify_down_complete(
967 				struct vdev_mlme_obj *vdev_mlme,
968 				uint16_t event_data_len, void *event_data)
969 {
970 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
971 
972 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_notify_down_complete)
973 		ret = vdev_mlme->ops->mlme_vdev_notify_down_complete(
974 					vdev_mlme, event_data_len, event_data);
975 
976 	return ret;
977 }
978 
979 /**
980  * mlme_vdev_notify_start_state_exit - VDEV SM start state exit notification
981  * @vdev_mlme_obj:  VDEV MLME comp object
982  *
983  * API notifies on start state exit
984  *
985  * Return: SUCCESS on successful completion of notification
986  *         FAILURE, if it fails due to any
987  */
988 static inline QDF_STATUS mlme_vdev_notify_start_state_exit(
989 				struct vdev_mlme_obj *vdev_mlme)
990 {
991 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
992 
993 	if ((vdev_mlme->ops) &&
994 	    vdev_mlme->ops->mlme_vdev_notify_start_state_exit)
995 		ret = vdev_mlme->ops->mlme_vdev_notify_start_state_exit(
996 								vdev_mlme);
997 
998 	return ret;
999 }
1000 
1001 /**
1002  * mlme_vdev_is_newchan_no_cac - Checks new channel requires CAC
1003  * @vdev_mlme_obj:  VDEV MLME comp object
1004  *
1005  * API checks whether Channel needs CAC period,
1006  * if yes, it moves to SUSPEND_RESTART to disconnect stations before
1007  * sending RESTART to FW, otherwise, it moves to RESTART_PROGRESS substate
1008  *
1009  * Return: SUCCESS to move to RESTART_PROGRESS substate
1010  *         FAILURE, move to SUSPEND_RESTART state
1011  */
1012 static inline QDF_STATUS mlme_vdev_is_newchan_no_cac(
1013 				struct vdev_mlme_obj *vdev_mlme)
1014 {
1015 	QDF_STATUS ret = QDF_STATUS_SUCCESS;
1016 
1017 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_is_newchan_no_cac)
1018 		ret = vdev_mlme->ops->mlme_vdev_is_newchan_no_cac(vdev_mlme);
1019 
1020 	return ret;
1021 }
1022 
1023 #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
1024 /**
1025  * wlan_vdev_mlme_set_ssid() - set ssid
1026  * @vdev: VDEV object
1027  * @ssid: SSID (input)
1028  * @ssid_len: Length of SSID
1029  *
1030  * API to set the SSID of VDEV
1031  *
1032  * Caller need to acquire lock with wlan_vdev_obj_lock()
1033  *
1034  * Return: SUCCESS, if update is done
1035  *          FAILURE, if ssid length is > max ssid len
1036  */
1037 static inline QDF_STATUS wlan_vdev_mlme_set_ssid(
1038 				struct wlan_objmgr_vdev *vdev,
1039 				const uint8_t *ssid, uint8_t ssid_len)
1040 {
1041 	struct vdev_mlme_obj *vdev_mlme;
1042 
1043 	/* This API is invoked with lock acquired, do not add log prints */
1044 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1045 	if (!vdev_mlme)
1046 		return QDF_STATUS_E_FAILURE;
1047 
1048 	if (ssid_len <= WLAN_SSID_MAX_LEN) {
1049 		qdf_mem_copy(vdev_mlme->mgmt.generic.ssid, ssid, ssid_len);
1050 		vdev_mlme->mgmt.generic.ssid_len = ssid_len;
1051 	} else {
1052 		vdev_mlme->mgmt.generic.ssid_len = 0;
1053 		return QDF_STATUS_E_FAILURE;
1054 	}
1055 	return QDF_STATUS_SUCCESS;
1056 }
1057 
1058 /**
1059  * wlan_vdev_mlme_get_ssid() - get ssid
1060  * @vdev: VDEV object
1061  * @ssid: SSID
1062  * @ssid_len: Length of SSID
1063  *
1064  * API to get the SSID of VDEV, it updates the SSID and its length
1065  * in @ssid, @ssid_len respectively
1066  *
1067  * Caller need to acquire lock with wlan_vdev_obj_lock()
1068  *
1069  * Return: SUCCESS, if update is done
1070  *          FAILURE, if ssid length is > max ssid len
1071  */
1072 static inline QDF_STATUS wlan_vdev_mlme_get_ssid(
1073 				struct wlan_objmgr_vdev *vdev,
1074 				 uint8_t *ssid, uint8_t *ssid_len)
1075 {
1076 	struct vdev_mlme_obj *vdev_mlme;
1077 
1078 	/* This API is invoked with lock acquired, do not add log prints */
1079 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1080 	if (!vdev_mlme)
1081 		return QDF_STATUS_E_FAILURE;
1082 
1083 	if (vdev_mlme->mgmt.generic.ssid_len > 0) {
1084 		*ssid_len = vdev_mlme->mgmt.generic.ssid_len;
1085 		qdf_mem_copy(ssid, vdev_mlme->mgmt.generic.ssid, *ssid_len);
1086 	} else {
1087 		*ssid_len = 0;
1088 		return QDF_STATUS_E_FAILURE;
1089 	}
1090 	return QDF_STATUS_SUCCESS;
1091 }
1092 
1093 /**
1094  * wlan_vdev_mlme_set_nss() - set NSS
1095  * @vdev: VDEV object
1096  * @nss: nss configured by user
1097  *
1098  * API to set the Number of Spatial streams
1099  *
1100  * Return: void
1101  */
1102 static inline void wlan_vdev_mlme_set_nss(
1103 				struct wlan_objmgr_vdev *vdev,
1104 				uint8_t nss)
1105 {
1106 	struct vdev_mlme_obj *vdev_mlme;
1107 
1108 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1109 	if (!vdev_mlme)
1110 		return;
1111 
1112 	vdev_mlme->proto.generic.nss = nss;
1113 }
1114 
1115 /**
1116  * wlan_vdev_mlme_get_nss() - get NSS
1117  * @vdev: VDEV object
1118  *
1119  * API to get the Number of Spatial Streams
1120  *
1121  * Return:
1122  * @nss: nss value
1123  */
1124 static inline uint8_t wlan_vdev_mlme_get_nss(
1125 				struct wlan_objmgr_vdev *vdev)
1126 {
1127 	struct vdev_mlme_obj *vdev_mlme;
1128 
1129 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1130 	if (!vdev_mlme)
1131 		return 0;
1132 
1133 	return vdev_mlme->proto.generic.nss;
1134 }
1135 
1136 /**
1137  * wlan_vdev_mlme_set_txchainmask() - set Tx chainmask
1138  * @vdev: VDEV object
1139  * @chainmask : chainmask either configured by user or max supported
1140  *
1141  * API to set the Tx chainmask
1142  *
1143  * Return: void
1144  */
1145 static inline void wlan_vdev_mlme_set_txchainmask(
1146 				struct wlan_objmgr_vdev *vdev,
1147 				uint8_t chainmask)
1148 {
1149 	struct vdev_mlme_obj *vdev_mlme;
1150 
1151 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1152 
1153 	if (!vdev_mlme)
1154 		return;
1155 
1156 	vdev_mlme->mgmt.chainmask_info.tx_chainmask = chainmask;
1157 }
1158 
1159 /**
1160  * wlan_vdev_mlme_get_txchainmask() - get Tx chainmask
1161  * @vdev: VDEV object
1162  *
1163  * API to get the Tx chainmask
1164  *
1165  * Return:
1166  * @chainmask : Tx chainmask either configured by user or max supported
1167  */
1168 static inline uint8_t wlan_vdev_mlme_get_txchainmask(
1169 				struct wlan_objmgr_vdev *vdev)
1170 {
1171 	struct vdev_mlme_obj *vdev_mlme;
1172 
1173 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1174 	if (!vdev_mlme)
1175 		return 0;
1176 
1177 	return vdev_mlme->mgmt.chainmask_info.tx_chainmask;
1178 }
1179 
1180 /**
1181  * wlan_vdev_mlme_set_rxchainmask() - set Rx chainmask
1182  * @vdev: VDEV object
1183  * @chainmask : Rx chainmask either configured by user or max supported
1184  *
1185  * API to set the Rx chainmask
1186  *
1187  * Return: void
1188  */
1189 static inline void wlan_vdev_mlme_set_rxchainmask(
1190 				struct wlan_objmgr_vdev *vdev,
1191 				uint8_t chainmask)
1192 {
1193 	struct vdev_mlme_obj *vdev_mlme;
1194 
1195 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1196 	if (!vdev_mlme)
1197 		return;
1198 
1199 	vdev_mlme->mgmt.chainmask_info.rx_chainmask = chainmask;
1200 }
1201 
1202 /**
1203  * wlan_vdev_mlme_get_rxchainmask() - get Rx chainmask
1204  * @vdev: VDEV object
1205  *
1206  * API to get the Rx chainmask
1207  *
1208  * Return:
1209  * @chainmask : Rx chainmask either configured by user or max supported
1210  */
1211 static inline uint8_t wlan_vdev_mlme_get_rxchainmask(
1212 				struct wlan_objmgr_vdev *vdev)
1213 {
1214 	struct vdev_mlme_obj *vdev_mlme;
1215 
1216 	/* This API is invoked with lock acquired, do not add log prints */
1217 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1218 	if (!vdev_mlme)
1219 		return 0;
1220 
1221 	return vdev_mlme->mgmt.chainmask_info.rx_chainmask;
1222 }
1223 
1224 /**
1225  * wlan_vdev_mlme_set_txpower() - set tx power
1226  * @vdev: VDEV object
1227  * @txpow: tx power either configured by used or max allowed
1228  *
1229  * API to set the tx power
1230  *
1231  * Return: void
1232  */
1233 static inline void wlan_vdev_mlme_set_txpower(
1234 					struct wlan_objmgr_vdev *vdev,
1235 					uint8_t txpow)
1236 {
1237 	struct vdev_mlme_obj *vdev_mlme;
1238 
1239 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1240 	if (!vdev_mlme)
1241 		return;
1242 
1243 	vdev_mlme->mgmt.generic.tx_power = txpow;
1244 }
1245 
1246 /**
1247  * wlan_vdev_mlme_get_txpower() - get tx power
1248  * @vdev: VDEV object
1249  *
1250  * API to get the tx power
1251  *
1252  * Return:
1253  * @txpow: tx power either configured by used or max allowed
1254  */
1255 static inline uint8_t wlan_vdev_mlme_get_txpower(
1256 				struct wlan_objmgr_vdev *vdev)
1257 {
1258 	struct vdev_mlme_obj *vdev_mlme;
1259 
1260 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1261 	if (!vdev_mlme)
1262 		return 0;
1263 
1264 	return vdev_mlme->mgmt.generic.tx_power;
1265 }
1266 
1267 /**
1268  * wlan_vdev_mlme_set_maxrate() - set max rate
1269  * @vdev: VDEV object
1270  * @maxrate: configured by used or based on configured mode
1271  *
1272  * API to set the max rate the vdev supports
1273  *
1274  * Return: void
1275  */
1276 static inline void wlan_vdev_mlme_set_maxrate(
1277 				struct wlan_objmgr_vdev *vdev,
1278 				uint32_t maxrate)
1279 {
1280 	struct vdev_mlme_obj *vdev_mlme;
1281 
1282 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1283 	if (!vdev_mlme)
1284 		return;
1285 
1286 	vdev_mlme->mgmt.rate_info.max_rate = maxrate;
1287 }
1288 
1289 /**
1290  * wlan_vdev_mlme_get_maxrate() - get max rate
1291  * @vdev: VDEV object
1292  *
1293  * API to get the max rate the vdev supports
1294  *
1295  * Return:
1296  * @maxrate: configured by used or based on configured mode
1297  */
1298 static inline uint32_t wlan_vdev_mlme_get_maxrate(
1299 				struct wlan_objmgr_vdev *vdev)
1300 {
1301 	struct vdev_mlme_obj *vdev_mlme;
1302 
1303 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1304 	if (!vdev_mlme)
1305 		return 0;
1306 
1307 	return vdev_mlme->mgmt.rate_info.max_rate;
1308 }
1309 
1310 /**
1311  * wlan_vdev_mlme_set_txmgmtrate() - set txmgmtrate
1312  * @vdev: VDEV object
1313  * @txmgmtrate: Tx Mgmt rate
1314  *
1315  * API to set Mgmt Tx rate
1316  *
1317  * Return: void
1318  */
1319 static inline void wlan_vdev_mlme_set_txmgmtrate(
1320 				struct wlan_objmgr_vdev *vdev,
1321 				uint32_t txmgmtrate)
1322 {
1323 	struct vdev_mlme_obj *vdev_mlme;
1324 
1325 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
1326 	if (!vdev_mlme)
1327 		return;
1328 
1329 	vdev_mlme->mgmt.rate_info.tx_mgmt_rate = txmgmtrate;
1330 }
1331 
1332 /**
1333  * wlan_vdev_mlme_get_txmgmtrate() - get txmgmtrate
1334  * @vdev: VDEV object
1335  *
1336  * API to get Mgmt Tx rate
1337  *
1338  * Return:
1339  * @txmgmtrate: Tx Mgmt rate
1340  */
1341 static inline uint32_t wlan_vdev_mlme_get_txmgmtrate(
1342 				struct wlan_objmgr_vdev *vdev)
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 0;
1349 
1350 	return vdev_mlme->mgmt.rate_info.tx_mgmt_rate;
1351 }
1352 #endif /* CMN_VDEV_MGR_TGT_IF_ENABLE */
1353 #endif
1354