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 25 struct vdev_mlme_obj; 26 27 /* Requestor ID for multiple vdev restart */ 28 #define MULTIPLE_VDEV_RESTART_REQ_ID 0x1234 29 30 /* values for vdev_type */ 31 #define WLAN_VDEV_MLME_TYPE_AP 0x1 32 #define WLAN_VDEV_MLME_TYPE_STA 0x2 33 #define WLAN_VDEV_MLME_TYPE_IBSS 0x3 34 #define WLAN_VDEV_MLME_TYPE_MONITOR 0x4 35 36 /* values for vdev_subtype */ 37 #define WLAN_VDEV_MLME_SUBTYPE_P2P_DEVICE 0x1 38 #define WLAN_VDEV_MLME_SUBTYPE_P2P_CLIENT 0x2 39 #define WLAN_VDEV_MLME_SUBTYPE_P2P_GO 0x3 40 #define WLAN_VDEV_MLME_SUBTYPE_PROXY_STA 0x4 41 #define WLAN_VDEV_MLME_SUBTYPE_MESH 0x5 42 43 /* vdev control flags (per bits) */ 44 #define WLAN_VDEV_MLME_FLAGS_NON_MBSSID_AP 0x00000001 45 #define WLAN_VDEV_MLME_FLAGS_TRANSMIT_AP 0x00000002 46 #define WLAN_VDEV_MLME_FLAGS_NON_TRANSMIT_AP 0x00000004 47 48 /** 49 * struct vdev_mlme_proto_generic - generic mlme proto structure 50 * sent in frames 51 * @dtim_period: frequency of data transmissions per beacon 1-255 52 * @slot_time: slot time 53 * @protection_mode: rts cts protection mode 54 * @beacon_interval: beacon interval 55 * @ldpc: low density parity check value 56 * @nss: number of spatial stream 57 * @nss_2g: 2.4GHz number of spatial stream 58 * @nss_5g: 5GHz number of spatial stream 59 * @tsfadjust: adjusted timer sync value 60 */ 61 struct vdev_mlme_proto_generic { 62 uint8_t dtim_period; 63 uint32_t slot_time; 64 uint32_t protection_mode; 65 uint16_t beacon_interval; 66 uint8_t ldpc; 67 uint8_t nss; 68 uint8_t nss_2g; 69 uint8_t nss_5g; 70 uint64_t tsfadjust; 71 }; 72 73 /** 74 * struct vdev_mlme_proto_ap - ap specific mlme protocol 75 * @. 76 */ 77 struct vdev_mlme_proto_ap { 78 }; 79 80 /** 81 * struct vdev_mlme_proto_sta - sta specific mlme protocol 82 * @assoc_id: association id of station 83 * @uapsd_cfg: uapsd configuration 84 */ 85 struct vdev_mlme_proto_sta { 86 uint16_t assoc_id; 87 uint16_t uapsd_cfg; 88 }; 89 90 /** 91 * struct vdev_mlme_proto_bss_color - bss color cfg 92 * @flags: proposed for future use cases, currently not used. 93 * @evt_type: bss color collision event. 94 * @current_bss_color: current bss color. 95 * @detection_period_ms: scan interval for both AP and STA mode. 96 * @scan_period_ms: scan period for passive scan to detect collision. 97 * @free_slot_expiry_time_ms: FW to notify host at timer expiry after 98 * which Host will disable the bss color. 99 */ 100 struct vdev_mlme_proto_bss_color { 101 uint32_t flags; 102 uint8_t evt_type; 103 uint32_t current_bss_color; 104 uint32_t detection_period_ms; 105 uint32_t scan_period_ms; 106 uint32_t free_slot_expiry_time_ms; 107 }; 108 109 /** 110 * struct vdev_mlme_vht_info - vdev VHT information 111 * @caps: vht capabilities 112 * @subfer: su beam former capability 113 * @subfee: su beam formee capability 114 * @mubfer: mu beam former capability 115 * @mubfee: mu beam formee capability 116 * @implicit_bf: Implicit BF support 117 * @sounding_dimension: Beamformer number of sounding dimension 118 * @en_2gvht: 256 qam status 119 * @allow_vht: vht capability status 120 */ 121 struct vdev_mlme_vht_info { 122 uint32_t caps; 123 uint8_t subfer; 124 uint8_t mubfer; 125 uint8_t subfee; 126 uint8_t mubfee; 127 uint8_t implicit_bf; 128 uint8_t sounding_dimension; 129 uint8_t en_2gvht; 130 bool allow_vht; 131 }; 132 133 /** 134 * struct vdev_mlme_ht_info - vdev HT information 135 * @ht_caps: HT capabilities 136 * @allow_ht: HT capability status 137 */ 138 struct vdev_mlme_ht_info { 139 uint32_t ht_caps; 140 bool allow_ht; 141 }; 142 143 /** 144 * struct vdev_mlme_he_ops_info - vdev mlme HEOPS information 145 * @he_ops: he ops 146 */ 147 struct vdev_mlme_he_ops_info { 148 uint32_t he_ops; 149 }; 150 151 /** 152 * struct vdev_mlme_he_ops_info - vdev protocol structure holding information 153 * that is used in frames 154 * @generic: generic protocol information 155 * @ap: ap specific protocol information 156 * @sta: sta specific protocol information 157 * @vht_info: vht information 158 * @ht_info: ht capabilities information 159 * @he_ops_info: he ops information 160 * @bss_color: 11ax HE BSS Color information 161 */ 162 struct vdev_mlme_proto { 163 struct vdev_mlme_proto_generic generic; 164 struct vdev_mlme_proto_ap ap; 165 struct vdev_mlme_proto_sta sta; 166 struct vdev_mlme_vht_info vht_info; 167 struct vdev_mlme_ht_info ht_info; 168 struct vdev_mlme_he_ops_info he_ops_info; 169 struct vdev_mlme_proto_bss_color bss_color; 170 }; 171 172 /** 173 * struct vdev_mlme_mgmt_generic - generic vdev mlme mgmt cfg 174 * @rts_threshold: RTS threshold 175 * @frag_threshold: Fragmentation threshold 176 * @probe_delay: time in msec for delaying to send first probe request 177 * @repeat_probe_time: probe request transmission time 178 * @drop_unencry: drop unencrypted status 179 * @ tx_pwrlimit: Tx power limit 180 * @tx_power: Tx power 181 * @minpower: Min power 182 * @maxpower: Max power 183 * @maxregpower: max regulatory power 184 * @antennamax: max antenna 185 * @ampdu: ampdu limit 186 * @amsdu: amsdu limit 187 * @ssid: service set identifier 188 * @ssid_len: ssid length 189 * @type: vdev type 190 * @sub_type: vdev subtype 191 * @rx_decap_type: rx decap type 192 * @tx_decap_type: tx decap type 193 * @disable_hw_ack: disable ha ack flag 194 * @chan_flags: channel flags 195 * @chan_flags_ext: extended channel flags 196 * @cfreq0: channel frequency index0 197 * @cfreq1: channel frequency index1 198 * @dfs_set: DFS status flag 199 * @dfs_set_cfreq2: DFS status channel index 200 * @is_chan_passive: channel passive indication flag 201 * @reg_class_id: reg domain class id 202 * @is_11ax_stub_enabled: 11AX stub status indication flag 203 * @nss_2g: 2G spatial streams 204 * @nss_5g: 5G spatial streams 205 * @bssid: bssid 206 */ 207 struct vdev_mlme_mgmt_generic { 208 uint32_t rts_threshold; 209 uint32_t frag_threshold; 210 uint32_t probe_delay; 211 uint32_t repeat_probe_time; 212 uint32_t drop_unencry; 213 uint32_t tx_pwrlimit; 214 uint8_t tx_power; 215 uint8_t minpower; 216 uint8_t maxpower; 217 uint8_t maxregpower; 218 uint8_t antennamax; 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_decap_type; 227 bool disable_hw_ack; 228 uint64_t chan_flags; 229 uint16_t chan_flags_ext; 230 uint32_t cfreq1; 231 uint32_t cfreq2; 232 bool dfs_set; 233 bool dfs_set_cfreq2; 234 bool is_chan_passive; 235 uint8_t reg_class_id; 236 uint8_t is_11ax_stub_enabled; 237 uint8_t nss_2g; 238 uint8_t nss_5g; 239 uint8_t bssid[QDF_MAC_ADDR_SIZE]; 240 }; 241 242 /** 243 * struct vdev_mlme_mgmt_ap - ap specific vdev mlme mgmt cfg 244 * @. 245 */ 246 struct vdev_mlme_mgmt_ap { 247 }; 248 249 /** 250 * struct vdev_mlme_mgmt_sta - sta specific vdev mlme mgmt cfg 251 * @. 252 */ 253 struct vdev_mlme_mgmt_sta { 254 }; 255 256 /** 257 * struct vdev_mlme_inactivity_params - vdev mlme inactivity parameters 258 * @bmiss_first_bcnt: bmiss first time 259 * @bmiss_final_bcnt: bmiss final time 260 * @keepalive_min_idle_inactive_time_secs: min time AP consider STA to be 261 * inactive 262 * @keepalive_max_idle_inactive_time_secs: max inactive idle time for AP to send 263 * data-null 264 * @keepalive_max_unresponsive_time_secs: max time to send WMI_STA_KICKOUT 265 */ 266 struct vdev_mlme_inactivity_params { 267 uint32_t bmiss_first_bcnt; 268 uint32_t bmiss_final_bcnt; 269 uint32_t keepalive_min_idle_inactive_time_secs; 270 uint32_t keepalive_max_idle_inactive_time_secs; 271 uint32_t keepalive_max_unresponsive_time_secs; 272 }; 273 274 /** 275 * struct vdev_mlme_rate_info - vdev mlme rate information 276 * @rate_flags: dynamic bandwidth info 277 * @per_band_tx_mgmt_rate: per band Tx mgmt rate 278 * @max_rate: max bandwidth rate 279 * @tx_mgmt_rate: Tx Mgmt rate 280 * @bcn_tx_rate: beacon Tx rate 281 * @type: Type of ratemask configuration 282 * @lower32: Lower 32 bits in the 1st 64-bit value 283 * @higher32: Higher 32 bits in the 1st 64-bit value 284 * @lower32_2: Lower 32 bits in the 2nd 64-bit value 285 * @half_rate: Half rate 286 * @quarter_rate: quarter rate 287 */ 288 struct vdev_mlme_rate_info { 289 uint32_t rate_flags; 290 uint32_t per_band_tx_mgmt_rate; 291 uint32_t max_rate; 292 uint32_t tx_mgmt_rate; 293 uint32_t bcn_tx_rate; 294 uint8_t type; 295 uint32_t lower32; 296 uint32_t higher32; 297 uint32_t lower32_2; 298 bool half_rate; 299 bool quarter_rate; 300 }; 301 302 /** 303 * struct vdev_mlme_chainmask_info - vdev mlme chainmask information 304 * @tx_chainmask: Tx chainmask 305 * @rx_chainmask: Rx Chainmask 306 * @num_rx_chain: Num of bits set in Rx chain 307 * @num_tx_chain: Num of bits set in Tx chain 308 */ 309 struct vdev_mlme_chainmask_info { 310 uint8_t tx_chainmask; 311 uint8_t rx_chainmask; 312 uint8_t num_rx_chain; 313 uint8_t num_tx_chain; 314 }; 315 316 /** 317 * struct vdev_mlme_powersave_info - vdev mlme powersave information 318 * @packet_powersave: packet powersave 319 * @max_li_of_moddtim: max mod dtim 320 * @dyndtim_cnt: dynamic dtim count 321 * @listen_interval: listen interval 322 * @moddtim_cnt: mod dtim count 323 */ 324 struct vdev_mlme_powersave_info { 325 uint32_t packet_powersave; 326 uint32_t max_li_of_moddtim; 327 uint32_t dyndtim_cnt; 328 uint32_t listen_interval; 329 uint32_t moddtim_cnt; 330 }; 331 332 /** 333 * struct vdev_mlme_beacon_info - vdev mlme beacon information 334 * @beacon_buffer: buffer allocated for beacon frame 335 * @beacon_offsets: beacon IE's offsets 336 */ 337 struct vdev_mlme_beacon_info { 338 qdf_nbuf_t beacon_buffer; 339 void *beacon_offsets; 340 }; 341 342 /** 343 * struct vdev_mlme_mbss_11ax - mbss 11ax fields required for up cmd 344 * @profile_idx: profile index of the connected non-trans ap (mbssid case). 345 * 0 means invalid. 346 * @profile_num: the total profile numbers of non-trans aps (mbssid 347 * case). 348 * 0 means non-MBSS AP. 349 * @mbssid-flags: MBSS IE flags indicating vdev type 350 * @vdevid_trans: id of transmitting vdev for MBSS IE 351 * @trans_bssid: bssid of transmitted AP (MBSS IE case) 352 */ 353 struct vdev_mlme_mbss_11ax { 354 uint32_t profile_idx; 355 uint32_t profile_num; 356 uint32_t mbssid_flags; 357 uint8_t vdevid_trans; 358 uint8_t trans_bssid[QDF_MAC_ADDR_SIZE]; 359 }; 360 361 /** 362 * struct vdev_mlme_mgmt - vdev mlme mgmt related cfg 363 * @generic: generic mgmt information 364 * @ap: ap specific mgmt information 365 * @sta: sta specific mgmt information 366 * @inactivity_params: inactivity parameters 367 * @rate_info: bandwidth rate information 368 * @chainmask_info: Chainmask information 369 * @powersave_info: Power save parameters 370 * @beacon_info: beacon buffer information 371 * @mbss_11ax: MBSS 11ax information 372 */ 373 struct vdev_mlme_mgmt { 374 struct vdev_mlme_mgmt_generic generic; 375 struct vdev_mlme_mgmt_ap ap; 376 struct vdev_mlme_mgmt_sta sta; 377 struct vdev_mlme_inactivity_params inactivity_params; 378 struct vdev_mlme_rate_info rate_info; 379 struct vdev_mlme_chainmask_info chainmask_info; 380 struct vdev_mlme_powersave_info powersave_info; 381 struct vdev_mlme_beacon_info beacon_info; 382 struct vdev_mlme_mbss_11ax mbss_11ax; 383 }; 384 385 /** 386 * enum beacon_update_op - Beacon update op type 387 * @BEACON_INIT: Initialize beacon 388 * @BEACON_REINIT: Re-initialize beacon 389 * @BEACON_UPDATE: Update dynamic fields of beacon 390 * @BEACON_CSA: Enable CSA IE 391 * @BEACON_FREE: Beacon buffer free 392 */ 393 enum beacon_update_op { 394 BEACON_INIT, 395 BEACON_REINIT, 396 BEACON_UPDATE, 397 BEACON_CSA, 398 BEACON_FREE, 399 }; 400 401 /** 402 * enum vdev_cmd_type - Command type 403 * @START_REQ: Start request 404 * @RESTART_REQ: Restart request 405 * @STOP_REQ: STOP request 406 * @DELETE_REQ: DELETE request 407 */ 408 enum vdev_cmd_type { 409 START_REQ, 410 RESTART_REQ, 411 STOP_REQ, 412 DELETE_REQ, 413 }; 414 415 /** 416 * enum vdev_start_resp_type - start respone type 417 * @START_RESPONSE: Start response 418 * @RESTART_RESPONSE: Restart response 419 */ 420 enum vdev_start_resp_type { 421 START_RESPONSE = 0, 422 RESTART_RESPONSE, 423 }; 424 425 /** 426 * enum vdev_rsp_type - Response type 427 * @START_RSP: Start Response 428 * @RESTART_RSP: Restart Response 429 * @STOP_RSP: STOP Response 430 * @DELETE_RSP: DELETE Response 431 */ 432 enum vdev_rsp_type { 433 START_RSP = 0, 434 RESTART_RSP, 435 STOP_RSP, 436 DELETE_RSP, 437 }; 438 439 /** 440 * struct vdev_mlme_ops - VDEV MLME operation callbacks structure 441 * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params 442 * @mlme_vdev_reset_proto_params: callback to Reset protocol params 443 * @mlme_vdev_start_send: callback to initiate actions of VDEV 444 * MLME start operation 445 * @mlme_vdev_restart_send: callback to initiate actions of VDEV 446 * MLME restart operation 447 * @mlme_vdev_stop_start_send: callback to block start/restart VDEV 448 * request command 449 * @mlme_vdev_start_continue: callback to initiate operations on 450 * LMAC/FW start response 451 * @mlme_vdev_up_send: callback to initiate actions of VDEV 452 * MLME up operation 453 * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving 454 * to UP state 455 * @mlme_vdev_notify_roam_start: callback to initiate roaming 456 * @mlme_vdev_update_beacon: callback to initiate beacon update 457 * @mlme_vdev_disconnect_peers: callback to initiate disconnection of 458 * peers 459 * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer 460 * @mlme_vdev_stop_send: callback to initiate actions of VDEV 461 * MLME stop operation 462 * @mlme_vdev_stop_continue: callback to initiate operations on 463 * LMAC/FW stop response 464 * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS 465 * peer delete completion 466 * @mlme_vdev_down_send: callback to initiate actions of VDEV 467 * MLME down operation 468 */ 469 struct vdev_mlme_ops { 470 QDF_STATUS (*mlme_vdev_validate_basic_params)( 471 struct vdev_mlme_obj *vdev_mlme, 472 uint16_t event_data_len, void *event_data); 473 QDF_STATUS (*mlme_vdev_reset_proto_params)( 474 struct vdev_mlme_obj *vdev_mlme, 475 uint16_t event_data_len, void *event_data); 476 QDF_STATUS (*mlme_vdev_start_send)( 477 struct vdev_mlme_obj *vdev_mlme, 478 uint16_t event_data_len, void *event_data); 479 QDF_STATUS (*mlme_vdev_restart_send)( 480 struct vdev_mlme_obj *vdev_mlme, 481 uint16_t event_data_len, void *event_data); 482 QDF_STATUS (*mlme_vdev_stop_start_send)( 483 struct vdev_mlme_obj *vdev_mlme, 484 enum vdev_cmd_type type, 485 uint16_t event_data_len, void *event_data); 486 QDF_STATUS (*mlme_vdev_start_continue)( 487 struct vdev_mlme_obj *vdev_mlme, 488 uint16_t event_data_len, void *event_data); 489 QDF_STATUS (*mlme_vdev_sta_conn_start)( 490 struct vdev_mlme_obj *vdev_mlme, 491 uint16_t event_data_len, void *event_data); 492 QDF_STATUS (*mlme_vdev_start_req_failed)( 493 struct vdev_mlme_obj *vdev_mlme, 494 uint16_t event_data_len, void *event_data); 495 QDF_STATUS (*mlme_vdev_up_send)( 496 struct vdev_mlme_obj *vdev_mlme, 497 uint16_t event_data_len, void *event_data); 498 QDF_STATUS (*mlme_vdev_notify_up_complete)( 499 struct vdev_mlme_obj *vdev_mlme, 500 uint16_t event_data_len, void *event_data); 501 QDF_STATUS (*mlme_vdev_notify_roam_start)( 502 struct vdev_mlme_obj *vdev_mlme, 503 uint16_t event_data_len, void *event_data); 504 QDF_STATUS (*mlme_vdev_update_beacon)( 505 struct vdev_mlme_obj *vdev_mlme, 506 enum beacon_update_op op, 507 uint16_t event_data_len, void *event_data); 508 QDF_STATUS (*mlme_vdev_disconnect_peers)( 509 struct vdev_mlme_obj *vdev_mlme, 510 uint16_t event_data_len, void *event_data); 511 QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)( 512 struct vdev_mlme_obj *vdev_mlme, 513 uint16_t event_data_len, void *event_data); 514 QDF_STATUS (*mlme_vdev_stop_send)( 515 struct vdev_mlme_obj *vdev_mlme, 516 uint16_t event_data_len, void *event_data); 517 QDF_STATUS (*mlme_vdev_stop_continue)( 518 struct vdev_mlme_obj *vdev_mlme, 519 uint16_t event_data_len, void *event_data); 520 QDF_STATUS (*mlme_vdev_down_send)( 521 struct vdev_mlme_obj *vdev_mlme, 522 uint16_t event_data_len, void *event_data); 523 QDF_STATUS (*mlme_vdev_notify_down_complete)( 524 struct vdev_mlme_obj *vdev_mlme, 525 uint16_t event_data_len, void *event_data); 526 QDF_STATUS (*mlme_vdev_ext_delete_rsp)( 527 struct vdev_mlme_obj *vdev_mlme, 528 struct vdev_delete_response *rsp); 529 QDF_STATUS (*mlme_vdev_ext_stop_rsp)( 530 struct vdev_mlme_obj *vdev_mlme, 531 struct vdev_stop_response *rsp); 532 QDF_STATUS (*mlme_vdev_ext_start_rsp)( 533 struct vdev_mlme_obj *vdev_mlme, 534 struct vdev_start_response *rsp); 535 }; 536 537 /** 538 * struct vdev_mlme_obj - VDEV MLME component object 539 * @proto: VDEV MLME proto substructure 540 * @mgmt: VDEV MLME mgmt substructure 541 * @sm_lock: VDEV SM lock 542 * @vdev_cmd_lock: VDEV MLME command atomicity 543 * @sm_hdl: VDEV SM handle 544 * @vdev: Pointer to vdev objmgr 545 * @ops: VDEV MLME callback table 546 * @ext_vdev_ptr: VDEV MLME legacy pointer 547 * @vdev_rt: VDEV response timer 548 */ 549 struct vdev_mlme_obj { 550 struct vdev_mlme_proto proto; 551 struct vdev_mlme_mgmt mgmt; 552 #ifdef VDEV_SM_LOCK_SUPPORT 553 qdf_spinlock_t sm_lock; 554 qdf_mutex_t vdev_cmd_lock; 555 #endif 556 struct wlan_sm *sm_hdl; 557 struct wlan_objmgr_vdev *vdev; 558 struct vdev_mlme_ops *ops; 559 void *ext_vdev_ptr; 560 struct vdev_response_timer vdev_rt; 561 }; 562 563 /** 564 * mlme_vdev_validate_basic_params - Validate basic params 565 * @vdev_mlme_obj: VDEV MLME comp object 566 * @event_data_len: data size 567 * @event_data: event data 568 * 569 * API validate MLME VDEV basic parameters 570 * 571 * Return: SUCCESS on successful validation 572 * FAILURE, if any parameter is not initialized 573 */ 574 static inline QDF_STATUS mlme_vdev_validate_basic_params( 575 struct vdev_mlme_obj *vdev_mlme, 576 uint16_t event_data_len, void *event_data) 577 { 578 QDF_STATUS ret = QDF_STATUS_SUCCESS; 579 580 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_validate_basic_params) 581 ret = vdev_mlme->ops->mlme_vdev_validate_basic_params( 582 vdev_mlme, event_data_len, event_data); 583 584 return ret; 585 } 586 587 /** 588 * mlme_vdev_reset_proto_params - Reset VDEV protocol params 589 * @vdev_mlme_obj: VDEV MLME comp object 590 * @event_data_len: data size 591 * @event_data: event data 592 * 593 * API resets the protocol params fo vdev 594 * 595 * Return: SUCCESS on successful reset 596 * FAILURE, if it fails due to any 597 */ 598 static inline QDF_STATUS mlme_vdev_reset_proto_params( 599 struct vdev_mlme_obj *vdev_mlme, 600 uint16_t event_data_len, void *event_data) 601 { 602 QDF_STATUS ret = QDF_STATUS_SUCCESS; 603 604 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_reset_proto_params) 605 ret = vdev_mlme->ops->mlme_vdev_reset_proto_params( 606 vdev_mlme, event_data_len, event_data); 607 608 return ret; 609 } 610 611 /** 612 * mlme_vdev_start_send - Invokes VDEV start operation 613 * @vdev_mlme_obj: VDEV MLME comp object 614 * @event_data_len: data size 615 * @event_data: event data 616 * 617 * API invokes VDEV start operation 618 * 619 * Return: SUCCESS on successful completion of start operation 620 * FAILURE, if it fails due to any 621 */ 622 static inline QDF_STATUS mlme_vdev_start_send( 623 struct vdev_mlme_obj *vdev_mlme, 624 uint16_t event_data_len, void *event_data) 625 { 626 QDF_STATUS ret = QDF_STATUS_SUCCESS; 627 628 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_send) 629 ret = vdev_mlme->ops->mlme_vdev_start_send( 630 vdev_mlme, event_data_len, event_data); 631 632 return ret; 633 } 634 635 /** 636 * mlme_vdev_restart_send - Invokes VDEV restart operation 637 * @vdev_mlme_obj: VDEV MLME comp object 638 * @event_data_len: data size 639 * @event_data: event data 640 * 641 * API invokes VDEV restart operation 642 * 643 * Return: SUCCESS on successful completion of restart operation 644 * FAILURE, if it fails due to any 645 */ 646 static inline QDF_STATUS mlme_vdev_restart_send( 647 struct vdev_mlme_obj *vdev_mlme, 648 uint16_t event_data_len, void *event_data) 649 { 650 QDF_STATUS ret = QDF_STATUS_SUCCESS; 651 652 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_restart_send) 653 ret = vdev_mlme->ops->mlme_vdev_restart_send( 654 vdev_mlme, event_data_len, event_data); 655 656 return ret; 657 } 658 659 /** 660 * mlme_vdev_stop_start_send - Invoke block VDEV restart operation 661 * @vdev_mlme_obj: VDEV MLME comp object 662 * @restart: restart req/start req 663 * @event_data_len: data size 664 * @event_data: event data 665 * 666 * API invokes stops pending VDEV restart operation 667 * 668 * Return: SUCCESS alsways 669 */ 670 static inline QDF_STATUS mlme_vdev_stop_start_send( 671 struct vdev_mlme_obj *vdev_mlme, 672 uint8_t restart, 673 uint16_t event_data_len, void *event_data) 674 { 675 QDF_STATUS ret = QDF_STATUS_SUCCESS; 676 677 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_start_send) 678 ret = vdev_mlme->ops->mlme_vdev_stop_start_send( 679 vdev_mlme, restart, event_data_len, event_data); 680 681 return ret; 682 } 683 684 /** 685 * mlme_vdev_start_continue - VDEV start response handling 686 * @vdev_mlme_obj: VDEV MLME comp object 687 * @event_data_len: data size 688 * @event_data: event data 689 * 690 * API invokes VDEV start response actions 691 * 692 * Return: SUCCESS on successful completion of start response operation 693 * FAILURE, if it fails due to any 694 */ 695 static inline QDF_STATUS mlme_vdev_start_continue( 696 struct vdev_mlme_obj *vdev_mlme, 697 uint16_t event_data_len, void *event_data) 698 { 699 QDF_STATUS ret = QDF_STATUS_SUCCESS; 700 701 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_continue) 702 ret = vdev_mlme->ops->mlme_vdev_start_continue( 703 vdev_mlme, event_data_len, event_data); 704 705 return ret; 706 } 707 708 /** 709 * mlme_vdev_start_req_failed - Invoke Station VDEV connection, if it pause 710 * @vdev_mlme_obj: VDEV MLME comp object 711 * @event_data_len: data size 712 * @event_data: event data 713 * 714 * API invokes on START fail response 715 * 716 * Return: SUCCESS on successful invocation of callback 717 * FAILURE, if it fails due to any 718 */ 719 static inline QDF_STATUS mlme_vdev_start_req_failed( 720 struct vdev_mlme_obj *vdev_mlme, 721 uint16_t event_data_len, void *event_data) 722 { 723 QDF_STATUS ret = QDF_STATUS_SUCCESS; 724 725 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_req_failed) 726 ret = vdev_mlme->ops->mlme_vdev_start_req_failed( 727 vdev_mlme, event_data_len, event_data); 728 729 return ret; 730 } 731 732 /** 733 * mlme_vdev_sta_conn_start - Invoke Station VDEV connection, if it pause 734 * @vdev_mlme_obj: VDEV MLME comp object 735 * @event_data_len: data size 736 * @event_data: event data 737 * 738 * API invokes connection SM to start station connection 739 * 740 * Return: SUCCESS on successful invocation of connection sm 741 * FAILURE, if it fails due to any 742 */ 743 static inline QDF_STATUS mlme_vdev_sta_conn_start( 744 struct vdev_mlme_obj *vdev_mlme, 745 uint16_t event_data_len, void *event_data) 746 { 747 QDF_STATUS ret = QDF_STATUS_SUCCESS; 748 749 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_sta_conn_start) 750 ret = vdev_mlme->ops->mlme_vdev_sta_conn_start( 751 vdev_mlme, event_data_len, event_data); 752 753 return ret; 754 } 755 756 /** 757 * mlme_vdev_up_send - VDEV up operation 758 * @vdev_mlme_obj: VDEV MLME comp object 759 * @event_data_len: data size 760 * @event_data: event data 761 * 762 * API invokes VDEV up operations 763 * 764 * Return: SUCCESS on successful completion of up operation 765 * FAILURE, if it fails due to any 766 */ 767 static inline QDF_STATUS mlme_vdev_up_send( 768 struct vdev_mlme_obj *vdev_mlme, 769 uint16_t event_data_len, void *event_data) 770 { 771 QDF_STATUS ret = QDF_STATUS_SUCCESS; 772 773 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_up_send) 774 ret = vdev_mlme->ops->mlme_vdev_up_send( 775 vdev_mlme, event_data_len, event_data); 776 777 return ret; 778 } 779 780 /** 781 * mlme_vdev_notify_up_complete - VDEV up state transition notification 782 * @vdev_mlme_obj: VDEV MLME comp object 783 * @event_data_len: data size 784 * @event_data: event data 785 * 786 * API notifies MLME on moving to UP state 787 * 788 * Return: SUCCESS on successful completion of up notification 789 * FAILURE, if it fails due to any 790 */ 791 static inline 792 QDF_STATUS mlme_vdev_notify_up_complete(struct vdev_mlme_obj *vdev_mlme, 793 uint16_t event_data_len, 794 void *event_data) 795 { 796 QDF_STATUS ret = QDF_STATUS_SUCCESS; 797 798 if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_up_complete) 799 ret = vdev_mlme->ops->mlme_vdev_notify_up_complete( 800 vdev_mlme, event_data_len, event_data); 801 802 return ret; 803 } 804 805 /** 806 * mlme_vdev_notify_roam_start - VDEV Roaming notification 807 * @vdev_mlme_obj: VDEV MLME comp object 808 * @event_len: data size 809 * @event_data: event data 810 * 811 * API notifies MLME on roaming 812 * 813 * Return: SUCCESS on successful completion of up notification 814 * FAILURE, if it fails due to any 815 */ 816 static inline 817 QDF_STATUS mlme_vdev_notify_roam_start(struct vdev_mlme_obj *vdev_mlme, 818 uint16_t event_len, void *event_data) 819 { 820 QDF_STATUS ret = QDF_STATUS_SUCCESS; 821 822 if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_roam_start) 823 ret = vdev_mlme->ops->mlme_vdev_notify_roam_start(vdev_mlme, 824 event_len, 825 event_data); 826 827 return ret; 828 } 829 830 /** 831 * mlme_vdev_update_beacon - Updates beacon 832 * @vdev_mlme_obj: VDEV MLME comp object 833 * @op: beacon update type 834 * @event_data_len: data size 835 * @event_data: event data 836 * 837 * API updates/allocates/frees the beacon 838 * 839 * Return: SUCCESS on successful update of beacon 840 * FAILURE, if it fails due to any 841 */ 842 static inline 843 QDF_STATUS mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme, 844 enum beacon_update_op op, 845 uint16_t event_data_len, void *event_data) 846 { 847 QDF_STATUS ret = QDF_STATUS_SUCCESS; 848 849 if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_update_beacon) 850 ret = vdev_mlme->ops->mlme_vdev_update_beacon(vdev_mlme, op, 851 event_data_len, event_data); 852 853 return ret; 854 } 855 856 /** 857 * mlme_vdev_disconnect_peers - Disconnect peers 858 * @vdev_mlme_obj: VDEV MLME comp object 859 * @event_data_len: data size 860 * @event_data: event data 861 * 862 * API trigger stations disconnection with AP VDEV or AP disconnection with STA 863 * VDEV 864 * 865 * Return: SUCCESS on successful invocation of station disconnection 866 * FAILURE, if it fails due to any 867 */ 868 static inline QDF_STATUS mlme_vdev_disconnect_peers( 869 struct vdev_mlme_obj *vdev_mlme, 870 uint16_t event_data_len, void *event_data) 871 { 872 QDF_STATUS ret = QDF_STATUS_SUCCESS; 873 874 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_disconnect_peers) 875 ret = vdev_mlme->ops->mlme_vdev_disconnect_peers( 876 vdev_mlme, event_data_len, event_data); 877 878 return ret; 879 } 880 881 /** 882 * mlme_vdev_dfs_cac_timer_stop - Stop CAC timer 883 * @vdev_mlme_obj: VDEV MLME comp object 884 * @event_data_len: data size 885 * @event_data: event data 886 * 887 * API stops the CAC timer through DFS API 888 * 889 * Return: SUCCESS on successful CAC timer stop 890 * FAILURE, if it fails due to any 891 */ 892 static inline QDF_STATUS mlme_vdev_dfs_cac_timer_stop( 893 struct vdev_mlme_obj *vdev_mlme, 894 uint16_t event_data_len, void *event_data) 895 { 896 QDF_STATUS ret = QDF_STATUS_SUCCESS; 897 898 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop) 899 ret = vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop( 900 vdev_mlme, event_data_len, event_data); 901 902 return ret; 903 } 904 905 /** 906 * mlme_vdev_stop_send - Invokes VDEV stop operation 907 * @vdev_mlme_obj: VDEV MLME comp object 908 * @event_data_len: data size 909 * @event_data: event data 910 * 911 * API invokes VDEV stop operation 912 * 913 * Return: SUCCESS on successful completion of stop operation 914 * FAILURE, if it fails due to any 915 */ 916 static inline QDF_STATUS mlme_vdev_stop_send( 917 struct vdev_mlme_obj *vdev_mlme, 918 uint16_t event_data_len, void *event_data) 919 { 920 QDF_STATUS ret = QDF_STATUS_SUCCESS; 921 922 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_send) 923 ret = vdev_mlme->ops->mlme_vdev_stop_send( 924 vdev_mlme, event_data_len, event_data); 925 926 return ret; 927 } 928 929 /** 930 * mlme_vdev_stop_continue - VDEV stop response handling 931 * @vdev_mlme_obj: VDEV MLME comp object 932 * @event_data_len: data size 933 * @event_data: event data 934 * 935 * API invokes VDEV stop response actions 936 * 937 * Return: SUCCESS on successful completion of stop response operation 938 * FAILURE, if it fails due to any 939 */ 940 static inline QDF_STATUS mlme_vdev_stop_continue( 941 struct vdev_mlme_obj *vdev_mlme, 942 uint16_t event_data_len, void *event_data) 943 { 944 QDF_STATUS ret = QDF_STATUS_SUCCESS; 945 946 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_continue) 947 ret = vdev_mlme->ops->mlme_vdev_stop_continue(vdev_mlme, 948 event_data_len, 949 event_data); 950 951 return ret; 952 } 953 954 /** 955 * mlme_vdev_down_send - VDEV down operation 956 * @vdev_mlme_obj: VDEV MLME comp object 957 * @event_data_len: data size 958 * @event_data: event data 959 * 960 * API invokes VDEV down operation 961 * 962 * Return: SUCCESS on successful completion of VDEV down operation 963 * FAILURE, if it fails due to any 964 */ 965 static inline QDF_STATUS mlme_vdev_down_send( 966 struct vdev_mlme_obj *vdev_mlme, 967 uint16_t event_data_len, void *event_data) 968 { 969 QDF_STATUS ret = QDF_STATUS_SUCCESS; 970 971 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_down_send) 972 ret = vdev_mlme->ops->mlme_vdev_down_send( 973 vdev_mlme, event_data_len, event_data); 974 975 return ret; 976 } 977 978 /** 979 * mlme_vdev_notify_down_complete - VDEV init state transition notification 980 * @vdev_mlme_obj: VDEV MLME comp object 981 * @event_data_len: data size 982 * @event_data: event data 983 * 984 * API notifies MLME on moving to INIT state 985 * 986 * Return: SUCCESS on successful completion of down notification 987 * FAILURE, if it fails due to any 988 */ 989 static inline QDF_STATUS mlme_vdev_notify_down_complete( 990 struct vdev_mlme_obj *vdev_mlme, 991 uint16_t event_data_len, void *event_data) 992 { 993 QDF_STATUS ret = QDF_STATUS_SUCCESS; 994 995 if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_notify_down_complete) 996 ret = vdev_mlme->ops->mlme_vdev_notify_down_complete( 997 vdev_mlme, event_data_len, event_data); 998 999 return ret; 1000 } 1001 1002 #endif 1003