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