Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
| 19 | /** |
| 20 | * DOC: Define VDEV MLME structure and APIs |
| 21 | */ |
| 22 | #ifndef _WLAN_VDEV_MLME_H_ |
| 23 | #define _WLAN_VDEV_MLME_H_ |
| 24 | |
| 25 | struct vdev_mlme_obj; |
| 26 | |
| 27 | /** |
| 28 | * struct vdev_mlme_proto - VDEV protocol strucutre |
| 29 | */ |
| 30 | struct vdev_mlme_proto { |
| 31 | }; |
| 32 | |
| 33 | /** |
| 34 | * enum beacon_update_op - Beacon update op type |
| 35 | * @BEACON_INIT: Initialize beacon |
| 36 | * @BEACON_REINIT: Re-initialize beacon |
| 37 | * @BEACON_UPDATE: Update dynamic fields of beacon |
| 38 | * @BEACON_CSA: Enable CSA IE |
| 39 | * @BEACON_FREE: Beacon buffer free |
| 40 | */ |
| 41 | enum beacon_update_op { |
| 42 | BEACON_INIT, |
| 43 | BEACON_REINIT, |
| 44 | BEACON_UPDATE, |
| 45 | BEACON_CSA, |
| 46 | BEACON_FREE, |
| 47 | }; |
| 48 | |
| 49 | /** |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 50 | * enum vdev_cmd_type - Command type |
| 51 | * @START_REQ: Start request |
| 52 | * @RESTART_REQ: Restart request |
| 53 | */ |
| 54 | enum vdev_cmd_type { |
| 55 | START_REQ, |
| 56 | RESTART_REQ, |
| 57 | }; |
| 58 | |
| 59 | /** |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 60 | * struct vdev_mlme_ops - VDEV MLME operation callbacks strucutre |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 61 | * @mlme_vdev_validate_basic_params: callback to validate VDEV basic params |
| 62 | * @mlme_vdev_reset_proto_params: callback to Reset protocol params |
| 63 | * @mlme_vdev_start_send: callback to initiate actions of VDEV |
| 64 | * MLME start operation |
| 65 | * @mlme_vdev_restart_send: callback to initiate actions of VDEV |
| 66 | * MLME restart operation |
| 67 | * @mlme_vdev_stop_start_send: callback to block start/restart VDEV |
| 68 | * request command |
| 69 | * @mlme_vdev_start_continue: callback to initiate operations on |
| 70 | * LMAC/FW start response |
| 71 | * @mlme_vdev_up_send: callback to initiate actions of VDEV |
| 72 | * MLME up operation |
| 73 | * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving |
| 74 | * to UP state |
Sandeep Puligilla | 0a4d67b | 2018-10-19 15:32:08 -0700 | [diff] [blame^] | 75 | * @mlme_vdev_notify_roam_start: callback to initiate roaming |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 76 | * @mlme_vdev_update_beacon: callback to initiate beacon update |
| 77 | * @mlme_vdev_disconnect_peers: callback to initiate disconnection of |
| 78 | * peers |
| 79 | * @mlme_vdev_dfs_cac_timer_stop: callback to stop the DFS CAC timer |
| 80 | * @mlme_vdev_stop_send: callback to initiate actions of VDEV |
| 81 | * MLME stop operation |
| 82 | * @mlme_vdev_stop_continue: callback to initiate operations on |
| 83 | * LMAC/FW stop response |
| 84 | * @mlme_vdev_bss_peer_delete_continue: callback to initiate operations on BSS |
| 85 | * peer delete completion |
| 86 | * @mlme_vdev_down_send: callback to initiate actions of VDEV |
| 87 | * MLME down operation |
| 88 | * @mlme_vdev_legacy_hdl_create: callback to invoke creation of legacy |
| 89 | * vdev object |
| 90 | * @mlme_vdev_legacy_hdl_post_create: callback to invoke post creation actions |
| 91 | * of legacy vdev object |
| 92 | * @mlme_vdev_legacy_hdl_destroy: callback to invoke destroy of legacy |
| 93 | * vdev object |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 94 | */ |
| 95 | struct vdev_mlme_ops { |
| 96 | QDF_STATUS (*mlme_vdev_validate_basic_params)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 97 | struct vdev_mlme_obj *vdev_mlme, |
| 98 | uint16_t event_data_len, void *event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 99 | QDF_STATUS (*mlme_vdev_reset_proto_params)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 100 | struct vdev_mlme_obj *vdev_mlme, |
| 101 | uint16_t event_data_len, void *event_data); |
| 102 | QDF_STATUS (*mlme_vdev_start_send)( |
| 103 | struct vdev_mlme_obj *vdev_mlme, |
| 104 | uint16_t event_data_len, void *event_data); |
| 105 | QDF_STATUS (*mlme_vdev_restart_send)( |
| 106 | struct vdev_mlme_obj *vdev_mlme, |
| 107 | uint16_t event_data_len, void *event_data); |
| 108 | QDF_STATUS (*mlme_vdev_stop_start_send)( |
| 109 | struct vdev_mlme_obj *vdev_mlme, |
| 110 | enum vdev_cmd_type type, |
| 111 | uint16_t event_data_len, void *event_data); |
| 112 | QDF_STATUS (*mlme_vdev_start_continue)( |
| 113 | struct vdev_mlme_obj *vdev_mlme, |
| 114 | uint16_t event_data_len, void *event_data); |
| 115 | QDF_STATUS (*mlme_vdev_sta_conn_start)( |
| 116 | struct vdev_mlme_obj *vdev_mlme, |
| 117 | uint16_t event_data_len, void *event_data); |
| 118 | QDF_STATUS (*mlme_vdev_start_req_failed)( |
| 119 | struct vdev_mlme_obj *vdev_mlme, |
| 120 | uint16_t event_data_len, void *event_data); |
| 121 | QDF_STATUS (*mlme_vdev_up_send)( |
| 122 | struct vdev_mlme_obj *vdev_mlme, |
| 123 | uint16_t event_data_len, void *event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 124 | QDF_STATUS (*mlme_vdev_notify_up_complete)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 125 | struct vdev_mlme_obj *vdev_mlme, |
| 126 | uint16_t event_data_len, void *event_data); |
Sandeep Puligilla | 0a4d67b | 2018-10-19 15:32:08 -0700 | [diff] [blame^] | 127 | QDF_STATUS (*mlme_vdev_notify_roam_start)( |
| 128 | struct vdev_mlme_obj *vdev_mlme, |
| 129 | uint16_t event_data_len, void *event_data); |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 130 | QDF_STATUS (*mlme_vdev_update_beacon)( |
| 131 | struct vdev_mlme_obj *vdev_mlme, |
| 132 | enum beacon_update_op op, |
| 133 | uint16_t event_data_len, void *event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 134 | QDF_STATUS (*mlme_vdev_disconnect_peers)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 135 | struct vdev_mlme_obj *vdev_mlme, |
| 136 | uint16_t event_data_len, void *event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 137 | QDF_STATUS (*mlme_vdev_dfs_cac_timer_stop)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 138 | struct vdev_mlme_obj *vdev_mlme, |
| 139 | uint16_t event_data_len, void *event_data); |
| 140 | QDF_STATUS (*mlme_vdev_stop_send)( |
| 141 | struct vdev_mlme_obj *vdev_mlme, |
| 142 | uint16_t event_data_len, void *event_data); |
| 143 | QDF_STATUS (*mlme_vdev_stop_continue)( |
| 144 | struct vdev_mlme_obj *vdev_mlme, |
| 145 | uint16_t event_data_len, void *event_data); |
| 146 | QDF_STATUS (*mlme_vdev_down_send)( |
| 147 | struct vdev_mlme_obj *vdev_mlme, |
| 148 | uint16_t event_data_len, void *event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 149 | QDF_STATUS (*mlme_vdev_notify_down_complete)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 150 | struct vdev_mlme_obj *vdev_mlme, |
| 151 | uint16_t event_data_len, void *event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 152 | QDF_STATUS (*mlme_vdev_legacy_hdl_create)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 153 | struct vdev_mlme_obj *vdev_mlme); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 154 | QDF_STATUS (*mlme_vdev_legacy_hdl_post_create)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 155 | struct vdev_mlme_obj *vdev_mlme); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 156 | QDF_STATUS (*mlme_vdev_legacy_hdl_destroy)( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 157 | struct vdev_mlme_obj *vdev_mlme); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 158 | |
| 159 | }; |
| 160 | |
| 161 | /** |
| 162 | * struct vdev_mlme_obj - VDEV MLME component object |
| 163 | * @vdev_proto: VDEV MLME proto substructure |
| 164 | * @sm_lock: VDEV SM lock |
| 165 | * @sm_hdl: VDEV SM handle |
| 166 | * @ops: VDEV MLME callback table |
| 167 | * @legacy_vdev_ptr: VDEV MLME legacy pointer |
| 168 | */ |
| 169 | struct vdev_mlme_obj { |
| 170 | struct vdev_mlme_proto vdev_proto; |
| 171 | #ifdef VDEV_SM_LOCK_SUPPORT |
| 172 | qdf_spinlock_t sm_lock; |
| 173 | #endif |
| 174 | struct wlan_sm *sm_hdl; |
| 175 | struct wlan_objmgr_vdev *vdev; |
| 176 | struct vdev_mlme_ops *ops; |
| 177 | void *legacy_vdev_ptr; |
| 178 | }; |
| 179 | |
| 180 | /** |
| 181 | * mlme_vdev_validate_basic_params - Validate basic params |
| 182 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 183 | * @event_data_len: data size |
| 184 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 185 | * |
| 186 | * API validate MLME VDEV basic parameters |
| 187 | * |
| 188 | * Return: SUCCESS on successful validation |
| 189 | * FAILURE, if any parameter is not initialized |
| 190 | */ |
| 191 | static inline QDF_STATUS mlme_vdev_validate_basic_params( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 192 | struct vdev_mlme_obj *vdev_mlme, |
| 193 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 194 | { |
| 195 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 196 | |
| 197 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_validate_basic_params) |
| 198 | ret = vdev_mlme->ops->mlme_vdev_validate_basic_params( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 199 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 200 | |
| 201 | return ret; |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * mlme_vdev_reset_proto_params - Reset VDEV protocol params |
| 206 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 207 | * @event_data_len: data size |
| 208 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 209 | * |
| 210 | * API resets the protocol params fo vdev |
| 211 | * |
| 212 | * Return: SUCCESS on successful reset |
| 213 | * FAILURE, if it fails due to any |
| 214 | */ |
| 215 | static inline QDF_STATUS mlme_vdev_reset_proto_params( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 216 | struct vdev_mlme_obj *vdev_mlme, |
| 217 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 218 | { |
| 219 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 220 | |
| 221 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_reset_proto_params) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 222 | ret = vdev_mlme->ops->mlme_vdev_reset_proto_params( |
| 223 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 224 | |
| 225 | return ret; |
| 226 | } |
| 227 | |
| 228 | /** |
| 229 | * mlme_vdev_start_send - Invokes VDEV start operation |
| 230 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 231 | * @event_data_len: data size |
| 232 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 233 | * |
| 234 | * API invokes VDEV start operation |
| 235 | * |
| 236 | * Return: SUCCESS on successful completion of start operation |
| 237 | * FAILURE, if it fails due to any |
| 238 | */ |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 239 | static inline QDF_STATUS mlme_vdev_start_send( |
| 240 | struct vdev_mlme_obj *vdev_mlme, |
| 241 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 242 | { |
| 243 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 244 | |
| 245 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_send) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 246 | ret = vdev_mlme->ops->mlme_vdev_start_send( |
| 247 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 248 | |
| 249 | return ret; |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * mlme_vdev_restart_send - Invokes VDEV restart operation |
| 254 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 255 | * @event_data_len: data size |
| 256 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 257 | * |
| 258 | * API invokes VDEV restart operation |
| 259 | * |
| 260 | * Return: SUCCESS on successful completion of restart operation |
| 261 | * FAILURE, if it fails due to any |
| 262 | */ |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 263 | static inline QDF_STATUS mlme_vdev_restart_send( |
| 264 | struct vdev_mlme_obj *vdev_mlme, |
| 265 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 266 | { |
| 267 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 268 | |
| 269 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_restart_send) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 270 | ret = vdev_mlme->ops->mlme_vdev_restart_send( |
| 271 | vdev_mlme, event_data_len, event_data); |
| 272 | |
| 273 | return ret; |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * mlme_vdev_stop_start_send - Invoke block VDEV restart operation |
| 278 | * @vdev_mlme_obj: VDEV MLME comp object |
| 279 | * @restart: restart req/start req |
| 280 | * @event_data_len: data size |
| 281 | * @event_data: event data |
| 282 | * |
| 283 | * API invokes stops pending VDEV restart operation |
| 284 | * |
| 285 | * Return: SUCCESS alsways |
| 286 | */ |
| 287 | static inline QDF_STATUS mlme_vdev_stop_start_send( |
| 288 | struct vdev_mlme_obj *vdev_mlme, |
| 289 | uint8_t restart, |
| 290 | uint16_t event_data_len, void *event_data) |
| 291 | { |
| 292 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 293 | |
| 294 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_start_send) |
| 295 | ret = vdev_mlme->ops->mlme_vdev_stop_start_send( |
| 296 | vdev_mlme, restart, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 297 | |
| 298 | return ret; |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * mlme_vdev_start_continue - VDEV start response handling |
| 303 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 304 | * @event_data_len: data size |
| 305 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 306 | * |
| 307 | * API invokes VDEV start response actions |
| 308 | * |
| 309 | * Return: SUCCESS on successful completion of start response operation |
| 310 | * FAILURE, if it fails due to any |
| 311 | */ |
| 312 | static inline QDF_STATUS mlme_vdev_start_continue( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 313 | struct vdev_mlme_obj *vdev_mlme, |
| 314 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 315 | { |
| 316 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 317 | |
| 318 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_continue) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 319 | ret = vdev_mlme->ops->mlme_vdev_start_continue( |
| 320 | vdev_mlme, event_data_len, event_data); |
| 321 | |
| 322 | return ret; |
| 323 | } |
| 324 | |
| 325 | /** |
| 326 | * mlme_vdev_start_req_failed - Invoke Station VDEV connection, if it pause |
| 327 | * @vdev_mlme_obj: VDEV MLME comp object |
| 328 | * @event_data_len: data size |
| 329 | * @event_data: event data |
| 330 | * |
| 331 | * API invokes on START fail response |
| 332 | * |
| 333 | * Return: SUCCESS on successful invocation of callback |
| 334 | * FAILURE, if it fails due to any |
| 335 | */ |
| 336 | static inline QDF_STATUS mlme_vdev_start_req_failed( |
| 337 | struct vdev_mlme_obj *vdev_mlme, |
| 338 | uint16_t event_data_len, void *event_data) |
| 339 | { |
| 340 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 341 | |
| 342 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_start_req_failed) |
| 343 | ret = vdev_mlme->ops->mlme_vdev_start_req_failed( |
| 344 | vdev_mlme, event_data_len, event_data); |
| 345 | |
| 346 | return ret; |
| 347 | } |
| 348 | |
| 349 | /** |
| 350 | * mlme_vdev_sta_conn_start - Invoke Station VDEV connection, if it pause |
| 351 | * @vdev_mlme_obj: VDEV MLME comp object |
| 352 | * @event_data_len: data size |
| 353 | * @event_data: event data |
| 354 | * |
| 355 | * API invokes connection SM to start station connection |
| 356 | * |
| 357 | * Return: SUCCESS on successful invocation of connection sm |
| 358 | * FAILURE, if it fails due to any |
| 359 | */ |
| 360 | static inline QDF_STATUS mlme_vdev_sta_conn_start( |
| 361 | struct vdev_mlme_obj *vdev_mlme, |
| 362 | uint16_t event_data_len, void *event_data) |
| 363 | { |
| 364 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 365 | |
| 366 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_sta_conn_start) |
| 367 | ret = vdev_mlme->ops->mlme_vdev_sta_conn_start( |
| 368 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 369 | |
| 370 | return ret; |
| 371 | } |
| 372 | |
| 373 | /** |
| 374 | * mlme_vdev_up_send - VDEV up operation |
| 375 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 376 | * @event_data_len: data size |
| 377 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 378 | * |
| 379 | * API invokes VDEV up operations |
| 380 | * |
| 381 | * Return: SUCCESS on successful completion of up operation |
| 382 | * FAILURE, if it fails due to any |
| 383 | */ |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 384 | static inline QDF_STATUS mlme_vdev_up_send( |
| 385 | struct vdev_mlme_obj *vdev_mlme, |
| 386 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 387 | { |
| 388 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 389 | |
| 390 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_up_send) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 391 | ret = vdev_mlme->ops->mlme_vdev_up_send( |
| 392 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 393 | |
| 394 | return ret; |
| 395 | } |
| 396 | |
| 397 | /** |
| 398 | * mlme_vdev_notify_up_complete - VDEV up state transition notification |
| 399 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 400 | * @event_data_len: data size |
| 401 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 402 | * |
| 403 | * API notifies MLME on moving to UP state |
| 404 | * |
| 405 | * Return: SUCCESS on successful completion of up notification |
| 406 | * FAILURE, if it fails due to any |
| 407 | */ |
Sandeep Puligilla | 0a4d67b | 2018-10-19 15:32:08 -0700 | [diff] [blame^] | 408 | static inline |
| 409 | QDF_STATUS mlme_vdev_notify_up_complete(struct vdev_mlme_obj *vdev_mlme, |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 410 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 411 | { |
| 412 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 413 | |
Sandeep Puligilla | 0a4d67b | 2018-10-19 15:32:08 -0700 | [diff] [blame^] | 414 | if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_up_complete) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 415 | ret = vdev_mlme->ops->mlme_vdev_notify_up_complete( |
| 416 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 417 | |
| 418 | return ret; |
| 419 | } |
| 420 | |
| 421 | /** |
Sandeep Puligilla | 0a4d67b | 2018-10-19 15:32:08 -0700 | [diff] [blame^] | 422 | * mlme_vdev_notify_roam_start - VDEV Roaming notification |
| 423 | * @vdev_mlme_obj: VDEV MLME comp object |
| 424 | * @event_len: data size |
| 425 | * @event_data: event data |
| 426 | * |
| 427 | * API notifies MLME on roaming |
| 428 | * |
| 429 | * Return: SUCCESS on successful completion of up notification |
| 430 | * FAILURE, if it fails due to any |
| 431 | */ |
| 432 | static inline |
| 433 | QDF_STATUS mlme_vdev_notify_roam_start(struct vdev_mlme_obj *vdev_mlme, |
| 434 | uint16_t event_len, void *event_data) |
| 435 | { |
| 436 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 437 | |
| 438 | if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_roam_start) |
| 439 | ret = vdev_mlme->ops->mlme_vdev_notify_roam_start(vdev_mlme, |
| 440 | event_len, |
| 441 | event_data); |
| 442 | |
| 443 | return ret; |
| 444 | } |
| 445 | |
| 446 | /** |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 447 | * mlme_vdev_update_beacon - Updates beacon |
| 448 | * @vdev_mlme_obj: VDEV MLME comp object |
| 449 | * @op: beacon update type |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 450 | * @event_data_len: data size |
| 451 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 452 | * |
| 453 | * API updates/allocates/frees the beacon |
| 454 | * |
| 455 | * Return: SUCCESS on successful update of beacon |
| 456 | * FAILURE, if it fails due to any |
| 457 | */ |
Sandeep Puligilla | 0a4d67b | 2018-10-19 15:32:08 -0700 | [diff] [blame^] | 458 | static inline |
| 459 | QDF_STATUS mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme, |
| 460 | enum beacon_update_op op, |
| 461 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 462 | { |
| 463 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 464 | |
Sandeep Puligilla | 0a4d67b | 2018-10-19 15:32:08 -0700 | [diff] [blame^] | 465 | if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_update_beacon) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 466 | ret = vdev_mlme->ops->mlme_vdev_update_beacon(vdev_mlme, op, |
| 467 | event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 468 | |
| 469 | return ret; |
| 470 | } |
| 471 | |
| 472 | /** |
| 473 | * mlme_vdev_disconnect_peers - Disconnect peers |
| 474 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 475 | * @event_data_len: data size |
| 476 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 477 | * |
| 478 | * API trigger stations disconnection with AP VDEV or AP disconnection with STA |
| 479 | * VDEV |
| 480 | * |
| 481 | * Return: SUCCESS on successful invocation of station disconnection |
| 482 | * FAILURE, if it fails due to any |
| 483 | */ |
| 484 | static inline QDF_STATUS mlme_vdev_disconnect_peers( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 485 | struct vdev_mlme_obj *vdev_mlme, |
| 486 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 487 | { |
| 488 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 489 | |
| 490 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_disconnect_peers) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 491 | ret = vdev_mlme->ops->mlme_vdev_disconnect_peers( |
| 492 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 493 | |
| 494 | return ret; |
| 495 | } |
| 496 | |
| 497 | /** |
| 498 | * mlme_vdev_dfs_cac_timer_stop - Stop CAC timer |
| 499 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 500 | * @event_data_len: data size |
| 501 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 502 | * |
| 503 | * API stops the CAC timer through DFS API |
| 504 | * |
| 505 | * Return: SUCCESS on successful CAC timer stop |
| 506 | * FAILURE, if it fails due to any |
| 507 | */ |
| 508 | static inline QDF_STATUS mlme_vdev_dfs_cac_timer_stop( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 509 | struct vdev_mlme_obj *vdev_mlme, |
| 510 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 511 | { |
| 512 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 513 | |
| 514 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 515 | ret = vdev_mlme->ops->mlme_vdev_dfs_cac_timer_stop( |
| 516 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 517 | |
| 518 | return ret; |
| 519 | } |
| 520 | |
| 521 | /** |
| 522 | * mlme_vdev_stop_send - Invokes VDEV stop operation |
| 523 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 524 | * @event_data_len: data size |
| 525 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 526 | * |
| 527 | * API invokes VDEV stop operation |
| 528 | * |
| 529 | * Return: SUCCESS on successful completion of stop operation |
| 530 | * FAILURE, if it fails due to any |
| 531 | */ |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 532 | static inline QDF_STATUS mlme_vdev_stop_send( |
| 533 | struct vdev_mlme_obj *vdev_mlme, |
| 534 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 535 | { |
| 536 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 537 | |
| 538 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_send) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 539 | ret = vdev_mlme->ops->mlme_vdev_stop_send( |
| 540 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 541 | |
| 542 | return ret; |
| 543 | } |
| 544 | |
| 545 | /** |
| 546 | * mlme_vdev_stop_continue - VDEV stop response handling |
| 547 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 548 | * @event_data_len: data size |
| 549 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 550 | * |
| 551 | * API invokes VDEV stop response actions |
| 552 | * |
| 553 | * Return: SUCCESS on successful completion of stop response operation |
| 554 | * FAILURE, if it fails due to any |
| 555 | */ |
| 556 | static inline QDF_STATUS mlme_vdev_stop_continue( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 557 | struct vdev_mlme_obj *vdev_mlme, |
| 558 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 559 | { |
| 560 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 561 | |
| 562 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_stop_continue) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 563 | ret = vdev_mlme->ops->mlme_vdev_stop_continue(vdev_mlme, |
| 564 | event_data_len, |
| 565 | event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 566 | |
| 567 | return ret; |
| 568 | } |
| 569 | |
| 570 | /** |
| 571 | * mlme_vdev_down_send - VDEV down operation |
| 572 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 573 | * @event_data_len: data size |
| 574 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 575 | * |
| 576 | * API invokes VDEV down operation |
| 577 | * |
| 578 | * Return: SUCCESS on successful completion of VDEV down operation |
| 579 | * FAILURE, if it fails due to any |
| 580 | */ |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 581 | static inline QDF_STATUS mlme_vdev_down_send( |
| 582 | struct vdev_mlme_obj *vdev_mlme, |
| 583 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 584 | { |
| 585 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 586 | |
| 587 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_down_send) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 588 | ret = vdev_mlme->ops->mlme_vdev_down_send( |
| 589 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 590 | |
| 591 | return ret; |
| 592 | } |
| 593 | |
| 594 | /** |
| 595 | * mlme_vdev_notify_down_complete - VDEV init state transition notification |
| 596 | * @vdev_mlme_obj: VDEV MLME comp object |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 597 | * @event_data_len: data size |
| 598 | * @event_data: event data |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 599 | * |
| 600 | * API notifies MLME on moving to INIT state |
| 601 | * |
| 602 | * Return: SUCCESS on successful completion of down notification |
| 603 | * FAILURE, if it fails due to any |
| 604 | */ |
| 605 | static inline QDF_STATUS mlme_vdev_notify_down_complete( |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 606 | struct vdev_mlme_obj *vdev_mlme, |
| 607 | uint16_t event_data_len, void *event_data) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 608 | { |
| 609 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 610 | |
| 611 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_notify_down_complete) |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 612 | ret = vdev_mlme->ops->mlme_vdev_notify_down_complete( |
| 613 | vdev_mlme, event_data_len, event_data); |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 614 | |
| 615 | return ret; |
| 616 | } |
| 617 | |
| 618 | /** |
| 619 | * mlme_vdev_legacy_hdl_create - VDEV legacy pointer allocation |
| 620 | * @vdev_mlme_obj: VDEV MLME comp object |
| 621 | * |
| 622 | * API invokes legacy pointer allocation and initialization |
| 623 | * |
| 624 | * Return: SUCCESS on successful creation of legacy handle |
| 625 | * FAILURE, if it fails due to any |
| 626 | */ |
| 627 | static inline QDF_STATUS mlme_vdev_legacy_hdl_create( |
| 628 | struct vdev_mlme_obj *vdev_mlme) |
| 629 | { |
| 630 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 631 | |
| 632 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_legacy_hdl_create) |
| 633 | ret = vdev_mlme->ops->mlme_vdev_legacy_hdl_create(vdev_mlme); |
| 634 | |
| 635 | return ret; |
| 636 | } |
| 637 | |
| 638 | /** |
| 639 | * mlme_vdev_legacy_hdl_post_create - VDEV post legacy pointer allocation |
| 640 | * @vdev_mlme_obj: VDEV MLME comp object |
| 641 | * |
| 642 | * API invokes post legacy pointer allocation operation |
| 643 | * |
| 644 | * Return: SUCCESS on successful creation of legacy handle |
| 645 | * FAILURE, if it fails due to any |
| 646 | */ |
| 647 | static inline QDF_STATUS mlme_vdev_legacy_hdl_post_create( |
| 648 | struct vdev_mlme_obj *vdev_mlme) |
| 649 | { |
| 650 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 651 | |
Srinivas Pitla | 9071347 | 2018-08-06 17:09:48 +0530 | [diff] [blame] | 652 | if ((vdev_mlme->ops) && |
| 653 | vdev_mlme->ops->mlme_vdev_legacy_hdl_post_create) |
Srinivas Pitla | be8dac4 | 2018-06-14 16:05:03 +0530 | [diff] [blame] | 654 | ret = vdev_mlme->ops->mlme_vdev_legacy_hdl_post_create( |
| 655 | vdev_mlme); |
| 656 | |
| 657 | return ret; |
| 658 | } |
| 659 | |
| 660 | /** |
| 661 | * mlme_vdev_legacy_hdl_destroy - VDEV legacy pointer free |
| 662 | * @vdev_mlme_obj: VDEV MLME comp object |
| 663 | * |
| 664 | * API invokes legacy pointer free |
| 665 | * |
| 666 | * Return: SUCCESS on successful free of legacy handle |
| 667 | * FAILURE, if it fails due to any |
| 668 | */ |
| 669 | static inline QDF_STATUS mlme_vdev_legacy_hdl_destroy( |
| 670 | struct vdev_mlme_obj *vdev_mlme) |
| 671 | { |
| 672 | QDF_STATUS ret = QDF_STATUS_SUCCESS; |
| 673 | |
| 674 | if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_legacy_hdl_destroy) |
| 675 | ret = vdev_mlme->ops->mlme_vdev_legacy_hdl_destroy(vdev_mlme); |
| 676 | |
| 677 | return ret; |
| 678 | } |
| 679 | |
| 680 | #endif |