Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Yue Ma | 3432160 | 2019-12-23 12:39:20 -0800 | [diff] [blame] | 2 | * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 19 | #ifndef WMA_INTERNAL_H |
| 20 | #define WMA_INTERNAL_H |
Venkata Sharath Chandra Manchala | 0d44d45 | 2016-11-23 17:48:15 -0800 | [diff] [blame] | 21 | #include <cdp_txrx_handle.h> |
Deepak Dhamdhere | e2dd544 | 2016-05-27 15:05:51 -0700 | [diff] [blame] | 22 | #if !defined(REMOVE_PKT_LOG) |
| 23 | #include "pktlog_ac.h" |
| 24 | #endif |
| 25 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 26 | /* ################### defines ################### */ |
| 27 | /* |
| 28 | * TODO: Following constant should be shared by firwmare in |
| 29 | * wmi_unified.h. This will be done once wmi_unified.h is updated. |
| 30 | */ |
| 31 | #define WMI_PEER_STATE_AUTHORIZED 0x2 |
| 32 | |
| 33 | #define WMA_2_4_GHZ_MAX_FREQ 3000 |
mukul sharma | 72c8b22 | 2015-09-04 17:02:01 +0530 | [diff] [blame] | 34 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 35 | /*AR9888/AR6320 noise floor approx value |
| 36 | * similar to the mentioned the WMA |
| 37 | */ |
| 38 | #define WMA_TGT_NOISE_FLOOR_DBM (-96) |
Yeshwanth Sriram Guntuka | 14ab04c | 2018-09-21 15:06:49 +0530 | [diff] [blame] | 39 | #define WMA_INVALID_PER_CHAIN_SNR (0x80) |
| 40 | #define WMA_INVALID_PER_CHAIN_RSSI (0xFF) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 41 | |
| 42 | /* |
| 43 | * Make sure that link monitor and keep alive |
| 44 | * default values should be in sync with CFG. |
| 45 | */ |
| 46 | #define WMA_LINK_MONITOR_DEFAULT_TIME_SECS 10 |
| 47 | #define WMA_KEEP_ALIVE_DEFAULT_TIME_SECS 5 |
| 48 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 49 | /* The maximum number of patterns that can be transmitted by the firmware |
| 50 | * and maximum patterns size. |
| 51 | */ |
jsreekum | ac44b92 | 2018-06-12 20:18:39 +0530 | [diff] [blame] | 52 | #ifndef WMA_MAXNUM_PERIODIC_TX_PTRNS |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 53 | #define WMA_MAXNUM_PERIODIC_TX_PTRNS 6 |
jsreekum | ac44b92 | 2018-06-12 20:18:39 +0530 | [diff] [blame] | 54 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 55 | |
Kiran Kumar Lokere | 80734c0 | 2018-12-16 22:48:14 -0800 | [diff] [blame] | 56 | #define WMA_WMM_EXPO_TO_VAL(val) ((1 << (val)) - 1) |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 57 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 58 | #define MAX_HT_MCS_IDX 8 |
| 59 | #define MAX_VHT_MCS_IDX 10 |
Jingxiang Ge | f1d8159 | 2019-10-20 12:03:22 +0800 | [diff] [blame] | 60 | #ifdef WLAN_FEATURE_11AX |
| 61 | #define MAX_HE_MCS_IDX 12 |
| 62 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | #define INVALID_MCS_IDX 255 |
| 64 | |
Jingxiang Ge | f1d8159 | 2019-10-20 12:03:22 +0800 | [diff] [blame] | 65 | #define IS_MCS_HAS_DCM_RATE(val) \ |
| 66 | ((val) == 0 || (val) == 1 || \ |
| 67 | (val) == 3 || (val) == 4) |
| 68 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 69 | #define LINK_STATUS_LEGACY 0 |
| 70 | #define LINK_STATUS_VHT 0x1 |
| 71 | #define LINK_STATUS_MIMO 0x2 |
| 72 | #define LINK_SUPPORT_VHT 0x4 |
| 73 | #define LINK_SUPPORT_MIMO 0x8 |
| 74 | |
| 75 | #define LINK_RATE_VHT 0x3 |
| 76 | |
| 77 | #define MAX_ENTRY_HOLD_REQ_QUEUE 2 |
Krishna Kumaar Natarajan | a5c53bd | 2015-10-27 11:48:27 -0700 | [diff] [blame] | 78 | #define MAX_ENTRY_VDEV_RESP_QUEUE 10 |
| 79 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 80 | /** |
| 81 | * struct index_data_rate_type - non vht data rate type |
Ryan Hsu | 6139d2d | 2015-11-04 17:29:00 -0800 | [diff] [blame] | 82 | * @mcs_index: mcs rate index |
| 83 | * @ht20_rate: HT20 supported rate table |
| 84 | * @ht40_rate: HT40 supported rate table |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 85 | */ |
| 86 | struct index_data_rate_type { |
Ryan Hsu | 6139d2d | 2015-11-04 17:29:00 -0800 | [diff] [blame] | 87 | uint8_t mcs_index; |
| 88 | uint16_t ht20_rate[2]; |
| 89 | uint16_t ht40_rate[2]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 90 | }; |
| 91 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 92 | /** |
| 93 | * struct index_vht_data_rate_type - vht data rate type |
Ryan Hsu | 6139d2d | 2015-11-04 17:29:00 -0800 | [diff] [blame] | 94 | * @mcs_index: mcs rate index |
| 95 | * @ht20_rate: VHT20 supported rate table |
| 96 | * @ht40_rate: VHT40 supported rate table |
| 97 | * @ht80_rate: VHT80 supported rate table |
Liangwei Dong | 73fdb0d | 2019-12-13 15:01:00 +0800 | [diff] [blame] | 98 | * @ht160_rate: VHT160 supported rate table |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 99 | */ |
| 100 | struct index_vht_data_rate_type { |
Ryan Hsu | 6139d2d | 2015-11-04 17:29:00 -0800 | [diff] [blame] | 101 | uint8_t mcs_index; |
| 102 | uint16_t ht20_rate[2]; |
| 103 | uint16_t ht40_rate[2]; |
| 104 | uint16_t ht80_rate[2]; |
Liangwei Dong | 73fdb0d | 2019-12-13 15:01:00 +0800 | [diff] [blame] | 105 | uint16_t ht160_rate[2]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 106 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 107 | |
Jingxiang Ge | f1d8159 | 2019-10-20 12:03:22 +0800 | [diff] [blame] | 108 | #ifdef WLAN_FEATURE_11AX |
| 109 | #define MAX_HE_DCM_INDEX 2 |
| 110 | /** |
| 111 | * struct index_he_data_rate_type - he data rate type |
| 112 | * @beacon_rate_index: Beacon rate index |
| 113 | * @supported_he80_rate: he80 rate |
| 114 | * @supported_he40_rate: he40 rate |
| 115 | * @supported_he20_rate: he20 rate |
Liangwei Dong | 3b2fd85 | 2019-12-11 17:12:55 +0800 | [diff] [blame] | 116 | * @supported_he160_rate: he160 rate |
Jingxiang Ge | f1d8159 | 2019-10-20 12:03:22 +0800 | [diff] [blame] | 117 | */ |
| 118 | struct index_he_data_rate_type { |
| 119 | uint8_t beacon_rate_index; |
| 120 | uint16_t supported_he20_rate[MAX_HE_DCM_INDEX][3]; |
| 121 | uint16_t supported_he40_rate[MAX_HE_DCM_INDEX][3]; |
| 122 | uint16_t supported_he80_rate[MAX_HE_DCM_INDEX][3]; |
Liangwei Dong | 3b2fd85 | 2019-12-11 17:12:55 +0800 | [diff] [blame] | 123 | uint16_t supported_he160_rate[MAX_HE_DCM_INDEX][3]; |
Jingxiang Ge | f1d8159 | 2019-10-20 12:03:22 +0800 | [diff] [blame] | 124 | }; |
| 125 | #endif |
| 126 | |
Jeff Johnson | dab5860 | 2018-07-14 15:30:24 -0700 | [diff] [blame] | 127 | struct wifi_scan_cmd_req_params; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 128 | /* |
| 129 | * wma_main.c functions declarations |
| 130 | */ |
| 131 | |
Abhishek Singh | 2d775fd | 2017-08-18 10:51:33 +0530 | [diff] [blame] | 132 | /** |
| 133 | * wma_send_msg_by_priority() - Send wma message to PE with priority. |
| 134 | * @wma_handle: wma handle |
| 135 | * @msg_type: message type |
| 136 | * @body_ptr: message body ptr |
| 137 | * @body_val: message body value |
| 138 | * @is_high_priority: if msg is high priority |
| 139 | * |
| 140 | * Return: none |
| 141 | */ |
| 142 | void wma_send_msg_by_priority(tp_wma_handle wma_handle, uint16_t msg_type, |
| 143 | void *body_ptr, uint32_t body_val, bool is_high_priority); |
| 144 | |
| 145 | /** |
| 146 | * wma_send_msg() - Send wma message to PE. |
| 147 | * @wma_handle: wma handle |
| 148 | * @msg_type: message type |
| 149 | * @body_ptr: message body ptr |
| 150 | * @body_val: message body value |
| 151 | * |
| 152 | * Return: none |
| 153 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 154 | void wma_send_msg(tp_wma_handle wma_handle, uint16_t msg_type, |
| 155 | void *body_ptr, uint32_t body_val); |
| 156 | |
Abhishek Singh | 2d775fd | 2017-08-18 10:51:33 +0530 | [diff] [blame] | 157 | /** |
| 158 | * wma_send_msg_high_priority() - Send wma message to PE with high priority. |
| 159 | * @wma_handle: wma handle |
| 160 | * @msg_type: message type |
| 161 | * @body_ptr: message body ptr |
| 162 | * @body_val: message body value |
| 163 | * |
| 164 | * Return: none |
| 165 | */ |
| 166 | void wma_send_msg_high_priority(tp_wma_handle wma_handle, uint16_t msg_type, |
| 167 | void *body_ptr, uint32_t body_val); |
| 168 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 169 | void wma_data_tx_ack_comp_hdlr(void *wma_context, |
Nirav Shah | cbc6d72 | 2016-03-01 16:24:53 +0530 | [diff] [blame] | 170 | qdf_nbuf_t netbuf, int32_t status); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 171 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 172 | QDF_STATUS wma_set_ppsconfig(uint8_t vdev_id, uint16_t pps_param, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 173 | int value); |
| 174 | |
| 175 | /* |
| 176 | * wma_scan_roam.c functions declarations |
| 177 | */ |
| 178 | |
| 179 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
| 180 | void wma_process_roam_invoke(WMA_HANDLE handle, |
| 181 | struct wma_roam_invoke_cmd *roaminvoke); |
| 182 | |
| 183 | void wma_process_roam_synch_fail(WMA_HANDLE handle, |
| 184 | struct roam_offload_synch_fail *synch_fail); |
| 185 | |
| 186 | int wma_roam_synch_event_handler(void *handle, uint8_t *event, |
| 187 | uint32_t len); |
Padma, Santhosh Kumar | aa2433e | 2017-10-06 14:34:46 +0530 | [diff] [blame] | 188 | |
Srikanth Marepalli | 6a87278 | 2020-01-24 18:12:05 +0530 | [diff] [blame] | 189 | #ifdef WLAN_FEATURE_FIPS |
| 190 | /** |
| 191 | * wma_register_pmkid_req_event_handler() - Register pmkid request event handler |
| 192 | * @wma_handle: wma_handle |
| 193 | * |
| 194 | * This function register pmkid request event handler. |
| 195 | */ |
| 196 | void wma_register_pmkid_req_event_handler(tp_wma_handle wma_handle); |
| 197 | |
| 198 | /** |
| 199 | * wma_roam_pmkid_request_event_handler() - Handles roam pmkid request event |
| 200 | * @handle: wma_handle |
| 201 | * @event: pmkid request event data pointer |
| 202 | * @len: length of the data |
| 203 | * |
| 204 | * Handles pmkid request event from firmware which is triggered after roam |
| 205 | * candidate selection. |
| 206 | */ |
| 207 | int wma_roam_pmkid_request_event_handler(void *handle, |
| 208 | uint8_t *event, |
| 209 | uint32_t len); |
| 210 | #else |
| 211 | static inline void |
| 212 | wma_register_pmkid_req_event_handler(tp_wma_handle wma_handle) |
| 213 | { |
| 214 | } |
Srikanth Marepalli | 7221331 | 2019-12-20 16:11:02 +0530 | [diff] [blame] | 215 | |
| 216 | static inline int |
| 217 | wma_roam_pmkid_request_event_handler(void *handle, |
| 218 | uint8_t *event, |
| 219 | uint32_t len) |
| 220 | { |
| 221 | return 0; |
| 222 | } |
Srikanth Marepalli | 6a87278 | 2020-01-24 18:12:05 +0530 | [diff] [blame] | 223 | #endif /* WLAN_FEATURE_FIPS */ |
| 224 | |
Padma, Santhosh Kumar | aa2433e | 2017-10-06 14:34:46 +0530 | [diff] [blame] | 225 | /** |
Pragaspathi Thilagaraj | 7a7163b | 2019-07-14 22:47:09 +0530 | [diff] [blame] | 226 | * wma_roam_auth_offload_event_handler() - Handle LFR-3.0 Roam authentication |
| 227 | * offload event. |
| 228 | * @handle: wma_handle |
| 229 | * @event: rso auth offload event data pointer |
| 230 | * @len: length of the data |
| 231 | * |
| 232 | * Handles roam authentication offload event from firmware which is triggered |
| 233 | * after roam candidate selection. |
| 234 | */ |
| 235 | int wma_roam_auth_offload_event_handler(WMA_HANDLE handle, uint8_t *event, |
| 236 | uint32_t len); |
| 237 | |
| 238 | /** |
Pragaspathi Thilagaraj | 5292e0a | 2019-11-29 17:36:30 +0530 | [diff] [blame] | 239 | * wma_roam_stats_event_handler() - Handle the WMI_ROAM_STATS_EVENTID |
| 240 | * from target |
| 241 | * @handle: wma_handle |
| 242 | * @event: roam debug stats event data pointer |
| 243 | * @len: length of the data |
| 244 | * |
| 245 | * This function handles the roam debug stats from the target and logs it |
| 246 | * to kmsg. This WMI_ROAM_STATS_EVENTID event is received whenever roam |
| 247 | * scan trigger happens or when neighbor report is sent by the firmware. |
| 248 | * |
| 249 | * Return: Success or Failure status |
| 250 | */ |
| 251 | int wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, |
| 252 | uint32_t len); |
| 253 | |
| 254 | /** |
Sandeep Puligilla | 3746d5d | 2018-10-23 16:01:11 -0700 | [diff] [blame] | 255 | * wma_mlme_roam_synch_event_handler_cb() - roam synch event handler |
| 256 | * @handle: wma handle |
| 257 | * @event: event data |
| 258 | * @len: length of data |
| 259 | * |
| 260 | * This function is roam synch event handler. It sends roam |
| 261 | * indication for upper layer. |
| 262 | * |
| 263 | * Return: Success or Failure status |
| 264 | */ |
| 265 | int wma_mlme_roam_synch_event_handler_cb(void *handle, uint8_t *event, |
| 266 | uint32_t len); |
| 267 | |
| 268 | /** |
Padma, Santhosh Kumar | aa2433e | 2017-10-06 14:34:46 +0530 | [diff] [blame] | 269 | * wma_roam_synch_frame_event_handler() - roam synch frame event handler |
| 270 | * @handle: wma handle |
| 271 | * @event: event data |
| 272 | * @len: length of data |
| 273 | * |
| 274 | * This function is roam synch frame event handler. |
| 275 | * |
| 276 | * Return: Success or Failure status |
| 277 | */ |
| 278 | int wma_roam_synch_frame_event_handler(void *handle, uint8_t *event, |
| 279 | uint32_t len); |
Ashish Kumar Dhanotiya | 0213793 | 2019-02-26 21:43:32 +0530 | [diff] [blame] | 280 | #else |
| 281 | static inline int wma_mlme_roam_synch_event_handler_cb(void *handle, |
| 282 | uint8_t *event, |
| 283 | uint32_t len) |
| 284 | { |
| 285 | return 0; |
| 286 | } |
Pragaspathi Thilagaraj | 5292e0a | 2019-11-29 17:36:30 +0530 | [diff] [blame] | 287 | |
| 288 | static inline int |
| 289 | wma_roam_stats_event_handler(WMA_HANDLE handle, uint8_t *event, |
| 290 | uint32_t len) |
| 291 | { |
| 292 | return 0; |
| 293 | } |
Srikanth Marepalli | 7221331 | 2019-12-20 16:11:02 +0530 | [diff] [blame] | 294 | |
| 295 | static inline int |
| 296 | wma_roam_pmkid_request_event_handler(void *handle, |
| 297 | uint8_t *event, |
| 298 | uint32_t len) |
| 299 | { |
| 300 | return 0; |
| 301 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 302 | #endif |
| 303 | |
Abhishek Ambure | 5e9b6a4 | 2020-02-12 21:32:35 +0530 | [diff] [blame] | 304 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
| 305 | /** |
| 306 | * wma_roam_scan_chan_list_event_handler() - roam scan chan list event handler |
| 307 | * @handle: wma handle |
| 308 | * @event: pointer to fw event |
| 309 | * @len: length of event |
| 310 | * |
| 311 | * Return: Success or Failure status |
| 312 | */ |
| 313 | int wma_roam_scan_chan_list_event_handler(WMA_HANDLE handle, |
| 314 | uint8_t *event, |
| 315 | uint32_t len); |
| 316 | #else |
| 317 | static inline int |
| 318 | wma_roam_scan_chan_list_event_handler(WMA_HANDLE handle, uint8_t *event, |
| 319 | uint32_t len) |
| 320 | { |
| 321 | return 0; |
| 322 | } |
| 323 | #endif |
| 324 | |
Kapil Gupta | 5cda225 | 2016-12-29 18:44:26 +0530 | [diff] [blame] | 325 | /** |
| 326 | * wma_update_per_roam_config() -per roam config parameter updation to FW |
| 327 | * @handle: wma handle |
| 328 | * @req_buf: per roam config parameters |
| 329 | * |
| 330 | * Return: none |
| 331 | */ |
| 332 | void wma_update_per_roam_config(WMA_HANDLE handle, |
| 333 | struct wmi_per_roam_config_req *req_buf); |
| 334 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 335 | QDF_STATUS wma_update_channel_list(WMA_HANDLE handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 336 | tSirUpdateChanList *chan_list); |
| 337 | |
| 338 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 339 | QDF_STATUS wma_roam_scan_fill_self_caps(tp_wma_handle wma_handle, |
Himanshu Agarwal | b56ad2e | 2016-07-19 15:43:09 +0530 | [diff] [blame] | 340 | roam_offload_param * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 341 | roam_offload_params, |
Jeff Johnson | e6da4b0 | 2019-02-06 22:22:04 -0800 | [diff] [blame] | 342 | struct roam_offload_scan_req *roam_req); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 343 | #endif |
| 344 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 345 | QDF_STATUS wma_roam_scan_offload_mode(tp_wma_handle wma_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 346 | wmi_start_scan_cmd_fixed_param * |
| 347 | scan_cmd_fp, |
Jeff Johnson | e6da4b0 | 2019-02-06 22:22:04 -0800 | [diff] [blame] | 348 | struct roam_offload_scan_req *roam_req, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 349 | uint32_t mode, uint32_t vdev_id); |
| 350 | |
Varun Reddy Yeturu | 061d4d6 | 2017-07-20 09:39:32 -0700 | [diff] [blame] | 351 | /** |
| 352 | * wma_roam_scan_mawc_params() - send roam scan mode request to fw |
| 353 | * @wma_handle: wma handle |
| 354 | * @roam_req: roam request param |
| 355 | * |
| 356 | * Fill the MAWC roaming parameters and send |
| 357 | * WMI_ROAM_CONFIGURE_MAWC_CMDID TLV to firmware. |
| 358 | * |
| 359 | * Return: QDF status |
| 360 | */ |
| 361 | QDF_STATUS wma_roam_scan_mawc_params(tp_wma_handle wma_handle, |
Jeff Johnson | e6da4b0 | 2019-02-06 22:22:04 -0800 | [diff] [blame] | 362 | struct roam_offload_scan_req *roam_req); |
Varun Reddy Yeturu | 061d4d6 | 2017-07-20 09:39:32 -0700 | [diff] [blame] | 363 | |
Jeff Johnson | e6da4b0 | 2019-02-06 22:22:04 -0800 | [diff] [blame] | 364 | /** |
| 365 | * wma_roam_scan_offload_rssi_threshold() - set scan offload rssi threashold |
| 366 | * @wma_handle: wma handle |
| 367 | * @roam_req: Roaming request buffer |
| 368 | * |
| 369 | * Send WMI_ROAM_SCAN_RSSI_THRESHOLD TLV to firmware |
| 370 | * |
| 371 | * Return: QDF status |
| 372 | */ |
| 373 | QDF_STATUS |
| 374 | wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle, |
| 375 | struct roam_offload_scan_req *roam_req); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 376 | |
Pragaspathi Thilagaraj | 2b8ea35 | 2019-04-12 02:23:50 +0530 | [diff] [blame] | 377 | QDF_STATUS |
| 378 | wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle, |
| 379 | struct roam_offload_scan_req *roam_req); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 380 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 381 | QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 382 | uint32_t vdev_id, |
| 383 | int32_t rssi_change_thresh, |
| 384 | uint32_t bcn_rssi_weight, |
| 385 | uint32_t hirssi_delay_btw_scans); |
| 386 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 387 | QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 388 | uint8_t chan_count, |
Tushnim Bhattacharyya | 42299b8 | 2019-09-01 18:03:54 -0700 | [diff] [blame] | 389 | uint32_t *chan_freq_list, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 390 | uint8_t list_type, uint32_t vdev_id); |
| 391 | |
Pragaspathi Thilagaraj | 7a1a08e | 2019-05-29 01:20:29 +0530 | [diff] [blame] | 392 | A_UINT32 e_csr_auth_type_to_rsn_authmode(enum csr_akm_type authtype, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 393 | eCsrEncryptionType encr); |
| 394 | |
| 395 | A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr); |
| 396 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 397 | void wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle, |
Jeff Johnson | 9f18aa7 | 2018-12-02 12:05:12 -0800 | [diff] [blame] | 398 | struct mac_context *mac, |
Jeff Johnson | e6da4b0 | 2019-02-06 22:22:04 -0800 | [diff] [blame] | 399 | struct roam_offload_scan_req *roam_req, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 400 | wmi_start_scan_cmd_fixed_param * |
| 401 | scan_params); |
| 402 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 403 | QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 404 | A_INT32 first_bcnt, |
| 405 | A_UINT32 final_bcnt, uint32_t vdev_id); |
| 406 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 407 | QDF_STATUS wma_roam_scan_offload_command(tp_wma_handle wma_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | uint32_t command, uint32_t vdev_id); |
| 409 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 410 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
| 411 | void wma_set_ric_req(tp_wma_handle wma, void *msg, uint8_t is_add_ts); |
| 412 | #endif |
| 413 | |
| 414 | #ifdef FEATURE_WLAN_EXTSCAN |
| 415 | |
| 416 | int wma_extscan_start_stop_event_handler(void *handle, |
| 417 | uint8_t *cmd_param_info, |
| 418 | uint32_t len); |
| 419 | |
| 420 | int wma_extscan_operations_event_handler(void *handle, |
| 421 | uint8_t *cmd_param_info, |
| 422 | uint32_t len); |
| 423 | |
| 424 | int wma_extscan_table_usage_event_handler(void *handle, |
| 425 | uint8_t *cmd_param_info, |
| 426 | uint32_t len); |
| 427 | |
| 428 | int wma_extscan_capabilities_event_handler(void *handle, |
| 429 | uint8_t *cmd_param_info, |
| 430 | uint32_t len); |
| 431 | |
| 432 | int wma_extscan_hotlist_match_event_handler(void *handle, |
| 433 | uint8_t *cmd_param_info, |
| 434 | uint32_t len); |
| 435 | |
| 436 | int wma_extscan_cached_results_event_handler(void *handle, |
| 437 | uint8_t *cmd_param_info, |
| 438 | uint32_t len); |
| 439 | |
| 440 | int wma_extscan_change_results_event_handler(void *handle, |
| 441 | uint8_t *cmd_param_info, |
| 442 | uint32_t len); |
| 443 | |
| 444 | int wma_passpoint_match_event_handler(void *handle, |
| 445 | uint8_t *cmd_param_info, |
| 446 | uint32_t len); |
| 447 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 448 | #endif |
| 449 | |
Pragaspathi Thilagaraj | 30251ec | 2018-12-18 17:22:57 +0530 | [diff] [blame] | 450 | int wma_handle_btm_blacklist_event(void *handle, uint8_t *cmd_param_info, |
| 451 | uint32_t len); |
| 452 | |
Wen Gong | 7952fbd | 2018-04-18 11:27:23 +0800 | [diff] [blame] | 453 | #ifdef FEATURE_WLAN_EXTSCAN |
| 454 | int wma_extscan_wow_event_callback(void *handle, void *event, uint32_t len); |
| 455 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 456 | void wma_register_extscan_event_handler(tp_wma_handle wma_handle); |
| 457 | |
Jeff Johnson | dab5860 | 2018-07-14 15:30:24 -0700 | [diff] [blame] | 458 | /** |
| 459 | * wma_start_extscan() - start extscan command to fw. |
| 460 | * @wma: wma handle |
| 461 | * @params: extscan command request params |
| 462 | * |
| 463 | * This function sends start extscan request to fw. |
| 464 | * |
| 465 | * Return: QDF Status. |
| 466 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 467 | QDF_STATUS wma_start_extscan(tp_wma_handle wma, |
Jeff Johnson | dab5860 | 2018-07-14 15:30:24 -0700 | [diff] [blame] | 468 | struct wifi_scan_cmd_req_params *pstart); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 469 | |
Jeff Johnson | 7272ea7 | 2018-07-15 17:22:27 -0700 | [diff] [blame] | 470 | /** |
| 471 | * wma_stop_extscan() - stop extscan command to fw. |
| 472 | * @wma: wma handle |
| 473 | * @params: stop scan command request params |
| 474 | * |
| 475 | * This function sends stop extscan request to fw. |
| 476 | * |
| 477 | * Return: QDF Status. |
| 478 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 479 | QDF_STATUS wma_stop_extscan(tp_wma_handle wma, |
Jeff Johnson | 7272ea7 | 2018-07-15 17:22:27 -0700 | [diff] [blame] | 480 | struct extscan_stop_req_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 481 | |
Jeff Johnson | 1148cb0 | 2018-07-13 23:14:32 -0700 | [diff] [blame] | 482 | /** |
| 483 | * wma_extscan_start_hotlist_monitor() - start hotlist monitor |
| 484 | * @wma: wma handle |
| 485 | * @params: hotlist request params |
| 486 | * |
| 487 | * This function configures hotlist monitor in fw. |
| 488 | * |
| 489 | * Return: QDF status |
| 490 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 491 | QDF_STATUS wma_extscan_start_hotlist_monitor(tp_wma_handle wma, |
Jeff Johnson | 1148cb0 | 2018-07-13 23:14:32 -0700 | [diff] [blame] | 492 | struct extscan_bssid_hotlist_set_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 493 | |
Jeff Johnson | 9743eb7 | 2018-07-14 10:30:04 -0700 | [diff] [blame] | 494 | /** |
| 495 | * wma_extscan_stop_hotlist_monitor() - stop hotlist monitor |
| 496 | * @wma: wma handle |
| 497 | * @params: hotlist request params |
| 498 | * |
| 499 | * This function configures hotlist monitor to stop in fw. |
| 500 | * |
| 501 | * Return: QDF status |
| 502 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 503 | QDF_STATUS wma_extscan_stop_hotlist_monitor(tp_wma_handle wma, |
Jeff Johnson | 9743eb7 | 2018-07-14 10:30:04 -0700 | [diff] [blame] | 504 | struct extscan_bssid_hotlist_reset_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 505 | |
Jeff Johnson | b43ed03 | 2018-07-16 06:59:21 -0700 | [diff] [blame] | 506 | /** |
| 507 | * wma_extscan_start_change_monitor() - send start change monitor cmd |
| 508 | * @wma: wma handle |
| 509 | * @params: change monitor request params |
| 510 | * |
| 511 | * This function sends start change monitor request to fw. |
| 512 | * |
| 513 | * Return: QDF status |
| 514 | */ |
| 515 | QDF_STATUS |
| 516 | wma_extscan_start_change_monitor(tp_wma_handle wma, |
| 517 | struct extscan_set_sig_changereq_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 518 | |
Jeff Johnson | 0c8dbc3 | 2018-07-16 22:10:48 -0700 | [diff] [blame] | 519 | /** |
| 520 | * wma_extscan_stop_change_monitor() - send stop change monitor cmd |
| 521 | * @wma: wma handle |
| 522 | * @params: change monitor request params |
| 523 | * |
| 524 | * This function sends stop change monitor request to fw. |
| 525 | * |
| 526 | * Return: QDF status |
| 527 | */ |
| 528 | QDF_STATUS |
| 529 | wma_extscan_stop_change_monitor(tp_wma_handle wma, |
| 530 | struct extscan_capabilities_reset_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 531 | |
Jeff Johnson | 2ba6009 | 2018-07-17 08:19:37 -0700 | [diff] [blame] | 532 | /** |
| 533 | * wma_extscan_get_cached_results() - extscan get cached results |
| 534 | * @wma: wma handle |
| 535 | * @params: cached results parameters |
| 536 | * |
| 537 | * This function send request to fw to get cached results. |
| 538 | * |
| 539 | * Return: QDF status |
| 540 | */ |
| 541 | QDF_STATUS |
| 542 | wma_extscan_get_cached_results(tp_wma_handle wma, |
| 543 | struct extscan_cached_result_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 544 | |
Jeff Johnson | fed9a73 | 2018-07-18 12:18:03 -0700 | [diff] [blame] | 545 | /** |
| 546 | * wma_extscan_get_capabilities() - extscan get capabilities |
| 547 | * @wma: wma handle |
| 548 | * @params: get capabilities params |
| 549 | * |
| 550 | * This function sends request to fw to get extscan capabilities. |
| 551 | * |
| 552 | * Return: QDF status |
| 553 | */ |
| 554 | QDF_STATUS |
| 555 | wma_extscan_get_capabilities(tp_wma_handle wma, |
| 556 | struct extscan_capabilities_params *params); |
| 557 | |
Jeff Johnson | 360135b | 2018-07-18 20:51:47 -0700 | [diff] [blame] | 558 | /** |
| 559 | * wma_set_epno_network_list() - set epno network list |
| 560 | * @wma: WMA handle |
| 561 | * @req: epno config params request structure |
| 562 | * |
| 563 | * This function reads the incoming epno config request structure |
| 564 | * and constructs the WMI message to the firmware. |
| 565 | * |
| 566 | * Return: 0 on success, error number otherwise |
| 567 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 568 | QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma, |
Jeff Johnson | 360135b | 2018-07-18 20:51:47 -0700 | [diff] [blame] | 569 | struct wifi_enhanced_pno_params *req); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 570 | |
Jeff Johnson | 2a7f101 | 2018-07-19 07:21:06 -0700 | [diff] [blame] | 571 | /** |
| 572 | * wma_set_passpoint_network_list() - set passpoint network list |
| 573 | * @wma: WMA handle |
| 574 | * @params: passpoint network request structure |
| 575 | * |
| 576 | * This function sends the passpoint configs down to the firmware |
| 577 | * |
| 578 | * Return: QDF_STATUS enumeration |
| 579 | */ |
| 580 | QDF_STATUS |
| 581 | wma_set_passpoint_network_list(tp_wma_handle wma, |
| 582 | struct wifi_passpoint_req_param *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 583 | |
Jeff Johnson | 2a7f101 | 2018-07-19 07:21:06 -0700 | [diff] [blame] | 584 | /** |
| 585 | * wma_reset_passpoint_network_list() - reset passpoint network list |
| 586 | * @wma: WMA handle |
| 587 | * @params: passpoint network request structure |
| 588 | * |
| 589 | * This function sends down WMI command with network id set to wildcard id. |
| 590 | * firmware shall clear all the config entries |
| 591 | * |
| 592 | * Return: QDF_STATUS enumeration |
| 593 | */ |
| 594 | QDF_STATUS |
| 595 | wma_reset_passpoint_network_list(tp_wma_handle wma, |
| 596 | struct wifi_passpoint_req_param *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 597 | #endif |
| 598 | |
Jeff Johnson | 9d45f33 | 2019-01-29 08:42:00 -0800 | [diff] [blame] | 599 | /** |
| 600 | * wma_scan_probe_setoui() - set scan probe OUI |
| 601 | * @wma: wma handle |
| 602 | * @set_oui: OUI parameters |
| 603 | * |
| 604 | * set scan probe OUI parameters in firmware |
| 605 | * |
| 606 | * Return: QDF status |
| 607 | */ |
| 608 | QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, |
| 609 | struct scan_mac_oui *set_oui); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 610 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 611 | void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id); |
| 612 | |
| 613 | int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf, |
| 614 | uint32_t len); |
| 615 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 616 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
Varun Reddy Yeturu | d5939f8 | 2015-12-24 18:14:02 -0800 | [diff] [blame] | 617 | void wma_process_roam_synch_complete(WMA_HANDLE handle, uint8_t vdev_id); |
| 618 | static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma, |
| 619 | uint8_t vdev_id) |
| 620 | { |
| 621 | return wma->interfaces[vdev_id].roam_synch_in_progress; |
| 622 | } |
| 623 | #else |
| 624 | static inline bool wma_is_roam_synch_in_progress(tp_wma_handle wma, |
| 625 | uint8_t vdev_id) |
| 626 | { |
| 627 | return false; |
| 628 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 629 | #endif |
| 630 | |
| 631 | /* |
| 632 | * wma_dev_if.c functions declarations |
| 633 | */ |
| 634 | |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 635 | /** |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 636 | * wma_find_vdev_id_by_addr() - find vdev_id from mac address |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 637 | * @wma: wma handle |
| 638 | * @addr: mac address |
| 639 | * @vdev_id: return vdev_id |
| 640 | * |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 641 | * Return: SUCCESS or FAILURE |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 642 | */ |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 643 | QDF_STATUS wma_find_vdev_id_by_addr(tp_wma_handle wma, uint8_t *addr, |
| 644 | uint8_t *vdev_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 645 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 646 | bool wma_is_vdev_in_ap_mode(tp_wma_handle wma, uint8_t vdev_id); |
| 647 | |
| 648 | #ifdef QCA_IBSS_SUPPORT |
Abhishek Ambure | 8ed62cb | 2019-09-11 19:03:57 +0530 | [diff] [blame] | 649 | /** |
| 650 | * wma_is_vdev_in_ibss_mode() - check that vdev is in ibss mode or not |
| 651 | * @wma: wma handle |
| 652 | * @vdev_id: vdev id |
| 653 | * |
| 654 | * Helper function to know whether given vdev id |
| 655 | * is in IBSS mode or not. |
| 656 | * |
| 657 | * Return: True/False |
| 658 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 659 | bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id); |
Abhishek Ambure | 8ed62cb | 2019-09-11 19:03:57 +0530 | [diff] [blame] | 660 | |
| 661 | /** |
| 662 | * wma_adjust_ibss_heart_beat_timer() - set ibss heart beat timer in fw. |
| 663 | * @wma: wma handle |
| 664 | * @vdev_id: vdev id |
| 665 | * @peer_num_delta: peer number delta value |
| 666 | * |
| 667 | * Return: none |
| 668 | */ |
| 669 | void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma, |
| 670 | uint8_t vdev_id, |
| 671 | int8_t peer_num_delta); |
| 672 | |
| 673 | /** |
| 674 | * wma_set_ibss_pwrsave_params() - set ibss power save parameter to fw |
| 675 | * @wma: wma handle |
| 676 | * @vdev_id: vdev id |
| 677 | * |
| 678 | * Return: 0 for success or error code. |
| 679 | */ |
| 680 | QDF_STATUS |
| 681 | wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id); |
| 682 | |
| 683 | /** |
| 684 | * wma_ibss_peer_info_event_handler() - IBSS peer info event handler |
| 685 | * @handle: wma handle |
| 686 | * @data: event data |
| 687 | * @len: length of data |
| 688 | * |
| 689 | * This function handles IBSS peer info event from FW. |
| 690 | * |
| 691 | * Return: 0 for success or error code |
| 692 | */ |
| 693 | int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data, |
| 694 | uint32_t len); |
Houston Hoffman | 79b4af2 | 2015-10-06 12:01:08 -0700 | [diff] [blame] | 695 | #else |
| 696 | /** |
| 697 | * wma_is_vdev_in_ibss_mode(): dummy function |
| 698 | * @wma: wma handle |
| 699 | * @vdev_id: vdev id |
| 700 | * |
| 701 | * Return false since no vdev can be in ibss mode without ibss support |
| 702 | */ |
| 703 | static inline |
Mahesh Kumar Kalikot Veetil | 32e4fc7 | 2016-09-09 17:05:22 -0700 | [diff] [blame] | 704 | bool wma_is_vdev_in_ibss_mode(tp_wma_handle wma, uint8_t vdev_id) |
Houston Hoffman | 79b4af2 | 2015-10-06 12:01:08 -0700 | [diff] [blame] | 705 | { |
| 706 | return false; |
| 707 | } |
Abhishek Ambure | 8ed62cb | 2019-09-11 19:03:57 +0530 | [diff] [blame] | 708 | |
| 709 | /** |
| 710 | * wma_adjust_ibss_heart_beat_timer() - set ibss heart beat timer in fw. |
| 711 | * @wma: wma handle |
| 712 | * @vdev_id: vdev id |
| 713 | * @peer_num_delta: peer number delta value |
| 714 | * |
| 715 | * This function is dummy |
| 716 | * |
| 717 | * Return: none |
| 718 | */ |
| 719 | static inline void |
| 720 | wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma, |
| 721 | uint8_t vdev_id, |
| 722 | int8_t peer_num_delta) |
| 723 | { |
| 724 | } |
| 725 | |
| 726 | /** |
| 727 | * wma_ibss_peer_info_event_handler() - IBSS peer info event handler |
| 728 | * @handle: wma handle |
| 729 | * @data: event data |
| 730 | * @len: length of data |
| 731 | * |
| 732 | * This function is dummy |
| 733 | * |
| 734 | * Return: 0 for success or error code |
| 735 | */ |
| 736 | static inline int |
| 737 | wma_ibss_peer_info_event_handler(void *handle, uint8_t *data, |
| 738 | uint32_t len) |
| 739 | { |
| 740 | return 0; |
| 741 | } |
Abhishek Ambure | 27f9830 | 2019-09-25 20:00:36 +0530 | [diff] [blame] | 742 | |
| 743 | /** |
| 744 | * wma_set_ibss_pwrsave_params() - set ibss power save parameter to fw |
| 745 | * @wma: wma handle |
| 746 | * @vdev_id: vdev id |
| 747 | * |
| 748 | * This function is dummy |
| 749 | * |
| 750 | * Return: 0 for success or error code. |
| 751 | */ |
| 752 | static inline QDF_STATUS |
| 753 | wma_set_ibss_pwrsave_params(tp_wma_handle wma, uint8_t vdev_id) |
| 754 | { |
| 755 | return QDF_STATUS_SUCCESS; |
| 756 | } |
Abhishek Ambure | 8ed62cb | 2019-09-11 19:03:57 +0530 | [diff] [blame] | 757 | #endif /* QCA_IBSS_SUPPORT */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 758 | |
| 759 | /** |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 760 | * wma_get_vdev_bssid() - Get BSSID from mlme_obj |
| 761 | * @vdev - pointer to vdev |
| 762 | * |
| 763 | * This API is used to get BSSID stored in vdev mlme object. |
| 764 | * |
| 765 | * Return: pointer to bssid on success else NULL. |
| 766 | */ |
| 767 | uint8_t *wma_get_vdev_bssid(struct wlan_objmgr_vdev *vdev); |
| 768 | |
| 769 | /** |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 770 | * wma_find_bssid_by_vdev_id() - Get the BSS ID corresponding to the vdev ID |
| 771 | * @wma - wma handle |
| 772 | * @vdev_id - vdev ID |
| 773 | * |
| 774 | * Return: Returns pointer to bssid on success, |
| 775 | * otherwise returns NULL. |
| 776 | */ |
| 777 | static inline uint8_t *wma_find_bssid_by_vdev_id(tp_wma_handle wma, |
| 778 | uint8_t vdev_id) |
| 779 | { |
| 780 | if (vdev_id >= wma->max_bssid) |
| 781 | return NULL; |
| 782 | |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 783 | return wma_get_vdev_bssid(wma->interfaces[vdev_id].vdev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 784 | } |
| 785 | |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 786 | /** |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 787 | * wma_find_vdev_id_by_bssid() - Get the corresponding vdev_id from BSSID |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 788 | * @wma - wma handle |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 789 | * @bssid - bssid address |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 790 | * @vdev_id - vdev ID |
| 791 | * |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 792 | * Return: SUCCESS or FAILURE. |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 793 | */ |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 794 | QDF_STATUS wma_find_vdev_id_by_bssid(tp_wma_handle wma, uint8_t *bssid, |
| 795 | uint8_t *vdev_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 796 | |
Abhishek Ambure | cbef144 | 2019-06-10 17:15:00 +0530 | [diff] [blame] | 797 | /** |
| 798 | * wma_vdev_detach() - send vdev delete command to fw |
| 799 | * @wma_handle: wma handle |
| 800 | * @pdel_vdev_req_param: del vdev params |
| 801 | * |
| 802 | * Return: QDF status |
| 803 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 804 | QDF_STATUS wma_vdev_detach(tp_wma_handle wma_handle, |
Abhishek Ambure | cbef144 | 2019-06-10 17:15:00 +0530 | [diff] [blame] | 805 | struct del_vdev_params *pdel_vdev_req_param); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 806 | |
Govind Singh | d76a5b0 | 2016-03-08 15:12:14 +0530 | [diff] [blame] | 807 | QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 808 | uint32_t param_id, uint32_t param_value); |
Rajeev Kumar Sirasanagandla | e5787e2 | 2018-10-25 21:10:34 +0530 | [diff] [blame] | 809 | |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 810 | QDF_STATUS wma_remove_peer(tp_wma_handle wma, uint8_t *mac_addr, |
| 811 | uint8_t vdev_id, bool roam_synch_in_progress); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 812 | |
Rakshith Suresh Patkar | 5f9efa3 | 2019-02-04 13:26:56 +0530 | [diff] [blame] | 813 | QDF_STATUS wma_peer_unmap_conf_send(tp_wma_handle wma, |
| 814 | struct send_peer_unmap_conf_params *msg); |
| 815 | |
Vevek Venkatesan | 2d88a6b | 2019-10-04 19:03:10 +0530 | [diff] [blame] | 816 | QDF_STATUS wma_create_peer(tp_wma_handle wma, |
| 817 | uint8_t peer_addr[QDF_MAC_ADDR_SIZE], |
| 818 | uint32_t peer_type, uint8_t vdev_id, |
| 819 | bool roam_synch_in_progress); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 820 | |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 821 | /** |
| 822 | * wma_send_del_bss_response() - send delete bss resp |
| 823 | * @wma: wma handle |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 824 | * @resp: pointer to del bss response |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 825 | * |
| 826 | * Return: none |
| 827 | */ |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 828 | void wma_send_del_bss_response(tp_wma_handle wma, struct del_bss_resp *resp); |
Abhishek Singh | caa6185 | 2018-09-12 15:50:04 +0530 | [diff] [blame] | 829 | |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 830 | /** |
Abhishek Singh | fb5b4d3 | 2018-12-06 11:53:08 +0530 | [diff] [blame] | 831 | * __wma_handle_vdev_stop_rsp() - vdev stop response handler |
Abhishek Ambure | 09905d7 | 2019-08-08 19:45:55 +0530 | [diff] [blame] | 832 | * @resp_event: pointer to response received |
Abhishek Singh | 2904a6a | 2018-08-30 17:45:59 +0530 | [diff] [blame] | 833 | * |
| 834 | * Return: QDF_STATUS_SUCCESS for success or QDF_ERROR code |
| 835 | */ |
| 836 | QDF_STATUS |
Abhishek Ambure | 09905d7 | 2019-08-08 19:45:55 +0530 | [diff] [blame] | 837 | __wma_handle_vdev_stop_rsp(struct vdev_stop_response *resp_event); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 838 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 839 | void wma_hold_req_timer(void *data); |
| 840 | struct wma_target_req *wma_fill_hold_req(tp_wma_handle wma, |
| 841 | uint8_t vdev_id, uint32_t msg_type, |
| 842 | uint8_t type, void *params, |
| 843 | uint32_t timeout); |
| 844 | |
Abhishek Ambure | 8ed62cb | 2019-09-11 19:03:57 +0530 | [diff] [blame] | 845 | /** |
| 846 | * wma_add_bss() - Add BSS request to fw as per opmode |
| 847 | * @wma: wma handle |
| 848 | * @params: add bss params |
| 849 | * |
| 850 | * Return: none |
| 851 | */ |
Jianmin Zhu | f07aa51 | 2019-08-09 18:20:17 +0800 | [diff] [blame] | 852 | void wma_add_bss(tp_wma_handle wma, struct bss_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 853 | |
Abhishek Ambure | 8ed62cb | 2019-09-11 19:03:57 +0530 | [diff] [blame] | 854 | /** |
| 855 | * wma_add_sta() - process add sta request as per opmode |
| 856 | * @wma: wma handle |
| 857 | * @add_Sta: add sta params |
| 858 | * |
| 859 | * Return: none |
| 860 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 861 | void wma_add_sta(tp_wma_handle wma, tpAddStaParams add_sta); |
| 862 | |
Abhishek Ambure | 8ed62cb | 2019-09-11 19:03:57 +0530 | [diff] [blame] | 863 | /** |
| 864 | * wma_delete_sta() - process del sta request as per opmode |
| 865 | * @wma: wma handle |
| 866 | * @del_sta: delete sta params |
| 867 | * |
| 868 | * Return: none |
| 869 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 870 | void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta); |
| 871 | |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 872 | /** |
| 873 | * wma_delete_bss() - process delete bss request from upper layer |
| 874 | * @wma: wma handle |
| 875 | * @vdev_id: vdev id |
| 876 | * |
| 877 | * Return: none |
| 878 | */ |
| 879 | void wma_delete_bss(tp_wma_handle wma, uint8_t vdev_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 880 | |
| 881 | int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type); |
| 882 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 883 | /** |
| 884 | * wma_set_vdev_intrabss_fwd() - set intra_fwd value to wni_in. |
| 885 | * @wma_handle: wma handle |
| 886 | * @pdis_intra_fwd: Pointer to DisableIntraBssFwd struct |
| 887 | * |
| 888 | * Return: none |
| 889 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 890 | void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle, |
| 891 | tpDisableIntraBssFwd pdis_intra_fwd); |
| 892 | |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 893 | /** |
| 894 | * wma_delete_bss_ho_fail() - process delete bss request for handoff failure |
| 895 | * @wma: wma handle |
| 896 | * @vdev_id: vdev id |
| 897 | * |
| 898 | * Delete BSS in case of ROAM_HO_FAIL processing is handled separately in |
| 899 | * this routine. It needs to be done without sending any commands to firmware |
| 900 | * because firmware has already stopped and deleted peer and vdev is down. |
| 901 | * Relevant logic is aggregated from other routines. It changes the host |
| 902 | * data structures without sending VDEV_STOP, PEER_FLUSH_TIDS, PEER_DELETE |
| 903 | * and VDEV_DOWN commands to firmware. |
| 904 | * |
| 905 | * Return: none |
| 906 | */ |
| 907 | void wma_delete_bss_ho_fail(tp_wma_handle wma, uint8_t vdev_id); |
Deepak Dhamdhere | 2dae1bd | 2016-10-27 10:58:29 -0700 | [diff] [blame] | 908 | |
Jiachao Wu | 712d4fd | 2017-08-23 16:52:34 +0800 | [diff] [blame] | 909 | uint32_t wma_get_bcn_rate_code(uint16_t rate); |
| 910 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 911 | /* |
| 912 | * wma_mgmt.c functions declarations |
| 913 | */ |
Liangwei Dong | 03e080c | 2019-07-02 17:06:39 +0800 | [diff] [blame] | 914 | #ifdef WLAN_WMI_BCN |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 915 | int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len); |
Harprit Chhabada | 98225f6 | 2018-12-11 15:29:55 -0800 | [diff] [blame] | 916 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 917 | |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 918 | /** |
| 919 | * wma_peer_sta_kickout_event_handler() - kickout event handler |
| 920 | * @handle: wma handle |
| 921 | * @event: event data |
| 922 | * @len: data length |
| 923 | * |
| 924 | * Kickout event is received from firmware on observing beacon miss |
| 925 | * It handles kickout event for different modes and indicate to |
| 926 | * upper layers. |
| 927 | * |
| 928 | * Return: 0 for success or error code |
| 929 | */ |
Krunal Soni | bd7e893 | 2018-10-03 11:14:51 -0700 | [diff] [blame] | 930 | int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event, |
| 931 | uint32_t len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 932 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 933 | /** |
| 934 | * wma_unified_bcntx_status_event_handler() - beacon tx status event handler |
| 935 | * @handle: wma handle |
| 936 | * @cmd_param_info: event data |
| 937 | * @len: data length |
| 938 | * |
| 939 | * WMI Handler for WMI_OFFLOAD_BCN_TX_STATUS_EVENTID event from firmware. |
| 940 | * This event is generated by FW when the beacon transmission is offloaded |
| 941 | * and the host performs beacon template modification using WMI_BCN_TMPL_CMDID |
| 942 | * The FW generates this event when the first successful beacon transmission |
| 943 | * after template update |
| 944 | * |
| 945 | * Return: 0 for success or error code |
| 946 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 947 | int wma_unified_bcntx_status_event_handler(void *handle, |
| 948 | uint8_t *cmd_param_info, |
| 949 | uint32_t len); |
| 950 | |
mukul sharma | 72c8b22 | 2015-09-04 17:02:01 +0530 | [diff] [blame] | 951 | void wma_set_sta_sa_query_param(tp_wma_handle wma, |
| 952 | uint8_t vdev_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 953 | |
| 954 | void wma_set_sta_keep_alive(tp_wma_handle wma, uint8_t vdev_id, |
| 955 | uint32_t method, uint32_t timeperiod, |
| 956 | uint8_t *hostv4addr, uint8_t *destv4addr, |
| 957 | uint8_t *destmac); |
| 958 | |
| 959 | int wma_vdev_install_key_complete_event_handler(void *handle, |
| 960 | uint8_t *event, |
| 961 | uint32_t len); |
| 962 | |
Abhishek Singh | 8d92ea7 | 2019-10-22 12:18:12 +0530 | [diff] [blame] | 963 | /** |
| 964 | * wma_objmgr_set_peer_mlme_phymode() - set phymode to peer object |
| 965 | * @wma: wma handle |
| 966 | * @mac_addr: mac addr of peer |
| 967 | * @phymode: phymode value to set |
| 968 | * |
| 969 | * Return: None |
| 970 | */ |
| 971 | void wma_objmgr_set_peer_mlme_phymode(tp_wma_handle wma, uint8_t *mac_addr, |
| 972 | enum wlan_phymode phymode); |
| 973 | |
Govind Singh | b30d4c0 | 2016-03-24 11:01:23 +0530 | [diff] [blame] | 974 | QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 975 | tSirNwType nw_type, |
| 976 | tpAddStaParams params); |
| 977 | |
Himanshu Agarwal | 009f157 | 2016-03-09 17:26:02 +0530 | [diff] [blame] | 978 | QDF_STATUS wmi_unified_vdev_set_gtx_cfg_send(wmi_unified_t wmi_handle, |
| 979 | uint32_t if_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 980 | gtx_config_t *gtx_info); |
| 981 | |
| 982 | void wma_update_protection_mode(tp_wma_handle wma, uint8_t vdev_id, |
| 983 | uint8_t llbcoexist); |
| 984 | |
| 985 | void wma_process_update_beacon_params(tp_wma_handle wma, |
| 986 | tUpdateBeaconParams *bcn_params); |
| 987 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 988 | /** |
| 989 | * wma_update_rts_params() - update cfg parameters to target |
| 990 | * @wma: wma handle |
| 991 | * @value: rts_threshold |
| 992 | * |
| 993 | * Return: none |
| 994 | */ |
Harprit Chhabada | bec6de4 | 2018-09-10 10:21:15 -0700 | [diff] [blame] | 995 | void wma_update_rts_params(tp_wma_handle wma, uint32_t value); |
| 996 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 997 | /** |
| 998 | * wma_update_frag_params() - update cfg parameters to target |
| 999 | * @wma: wma handle |
| 1000 | * @value: frag_threshold |
| 1001 | * |
| 1002 | * Return: none |
| 1003 | */ |
Harprit Chhabada | bec6de4 | 2018-09-10 10:21:15 -0700 | [diff] [blame] | 1004 | void wma_update_frag_params(tp_wma_handle wma, uint32_t value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1005 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1006 | QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1007 | tEdcaParams *edca_params); |
| 1008 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1009 | /** |
| 1010 | * wma_tbttoffset_update_event_handler() - tbtt offset update handler |
| 1011 | * @handle: wma handle |
| 1012 | * @event: event buffer |
| 1013 | * @len: data length |
| 1014 | * |
| 1015 | * Return: 0 for success or error code |
| 1016 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1017 | int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event, |
| 1018 | uint32_t len); |
| 1019 | |
| 1020 | void wma_send_probe_rsp_tmpl(tp_wma_handle wma, |
| 1021 | tpSendProbeRespParams probe_rsp_info); |
| 1022 | |
Abhishek Singh | dfa69c3 | 2018-08-30 15:39:34 +0530 | [diff] [blame] | 1023 | /** |
| 1024 | * wma_set_ap_vdev_up() - send vdev up req |
| 1025 | * @wma: wma handle |
| 1026 | * @vdev_id: vdev id |
| 1027 | * |
Abhishek Singh | 3d30a3b | 2018-09-12 15:49:18 +0530 | [diff] [blame] | 1028 | * Return: QDF_STATUS |
Abhishek Singh | dfa69c3 | 2018-08-30 15:39:34 +0530 | [diff] [blame] | 1029 | */ |
Abhishek Singh | 3d30a3b | 2018-09-12 15:49:18 +0530 | [diff] [blame] | 1030 | QDF_STATUS wma_set_ap_vdev_up(tp_wma_handle wma, uint8_t vdev_id); |
Abhishek Singh | dfa69c3 | 2018-08-30 15:39:34 +0530 | [diff] [blame] | 1031 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1032 | void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info); |
| 1033 | |
| 1034 | void wma_set_keepalive_req(tp_wma_handle wma, |
Jeff Johnson | 562ccad | 2019-02-06 22:10:24 -0800 | [diff] [blame] | 1035 | struct keep_alive_req *keepalive); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1036 | |
Sreelakshmi Konamki | 58c7243 | 2016-11-09 17:06:44 +0530 | [diff] [blame] | 1037 | void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id, |
| 1038 | int32_t rssi); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1039 | |
| 1040 | void wma_process_update_opmode(tp_wma_handle wma_handle, |
| 1041 | tUpdateVHTOpMode *update_vht_opmode); |
| 1042 | |
| 1043 | void wma_process_update_rx_nss(tp_wma_handle wma_handle, |
| 1044 | tUpdateRxNss *update_rx_nss); |
| 1045 | |
| 1046 | void wma_process_update_membership(tp_wma_handle wma_handle, |
| 1047 | tUpdateMembership *membership); |
| 1048 | |
| 1049 | void wma_process_update_userpos(tp_wma_handle wma_handle, |
| 1050 | tUpdateUserPos *userpos); |
| 1051 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1052 | /* |
| 1053 | * wma_power.c functions declarations |
| 1054 | */ |
| 1055 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1056 | /** |
| 1057 | * wma_enable_sta_ps_mode() - enable sta powersave params in fw |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1058 | * @ps_req: power save request |
| 1059 | * |
| 1060 | * Return: none |
| 1061 | */ |
gaurank kathpalia | e7bd432 | 2020-01-29 09:07:55 +0530 | [diff] [blame] | 1062 | void wma_enable_sta_ps_mode(tpEnablePsParams ps_req); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1063 | |
Govind Singh | d76a5b0 | 2016-03-08 15:12:14 +0530 | [diff] [blame] | 1064 | QDF_STATUS wma_unified_set_sta_ps_param(wmi_unified_t wmi_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1065 | uint32_t vdev_id, uint32_t param, |
| 1066 | uint32_t value); |
| 1067 | |
Govind Singh | d76a5b0 | 2016-03-08 15:12:14 +0530 | [diff] [blame] | 1068 | QDF_STATUS wma_set_ap_peer_uapsd(tp_wma_handle wma, uint32_t vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1069 | uint8_t *peer_addr, uint8_t uapsd_value, |
| 1070 | uint8_t max_sp); |
| 1071 | |
| 1072 | void wma_update_edca_params_for_ac(tSirMacEdcaParamRecord *edca_param, |
Kiran Kumar Lokere | 27026ae | 2018-03-09 11:38:19 -0800 | [diff] [blame] | 1073 | struct wmi_host_wme_vparams *wmm_param, |
| 1074 | int ac, bool mu_edca_param); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1075 | |
| 1076 | void wma_set_tx_power(WMA_HANDLE handle, |
| 1077 | tMaxTxPowerParams *tx_pwr_params); |
| 1078 | |
| 1079 | void wma_set_max_tx_power(WMA_HANDLE handle, |
| 1080 | tMaxTxPowerParams *tx_pwr_params); |
| 1081 | |
gaurank kathpalia | e7bd432 | 2020-01-29 09:07:55 +0530 | [diff] [blame] | 1082 | void wma_disable_sta_ps_mode(tpDisablePsParams ps_req); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1083 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1084 | /** |
Abhishek Ambure | bf230ab | 2020-04-17 11:16:36 +0530 | [diff] [blame] | 1085 | * wma_send_max_tx_pwrlmt() - send max tx power limit to fw |
| 1086 | * @handle: wma handle |
| 1087 | * @vdev_id: vdev id |
| 1088 | * |
| 1089 | * Return: none |
| 1090 | */ |
| 1091 | void wma_send_max_tx_pwrlmt(WMA_HANDLE handle, uint8_t vdev_id); |
| 1092 | |
| 1093 | /** |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1094 | * wma_enable_uapsd_mode() - enable uapsd mode in fw |
| 1095 | * @wma: wma handle |
| 1096 | * @ps_req: power save request |
| 1097 | * |
| 1098 | * Return: none |
| 1099 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1100 | void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req); |
| 1101 | |
Manikandan Mohan | 1dd8b5d | 2017-04-18 15:54:09 -0700 | [diff] [blame] | 1102 | void wma_disable_uapsd_mode(tp_wma_handle wma, tpDisableUapsdParams ps_req); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1103 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1104 | QDF_STATUS wma_get_temperature(tp_wma_handle wma_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1105 | |
| 1106 | int wma_pdev_temperature_evt_handler(void *handle, uint8_t *event, |
| 1107 | uint32_t len); |
| 1108 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1109 | QDF_STATUS wma_process_tx_power_limits(WMA_HANDLE handle, |
Jeff Johnson | 19ce8d0 | 2019-02-08 22:56:23 -0800 | [diff] [blame] | 1110 | struct tx_power_limit *ptxlim); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1111 | |
| 1112 | void wma_update_noa(struct beacon_info *beacon, |
| 1113 | struct p2p_sub_element_noa *noa_ie); |
| 1114 | |
| 1115 | void wma_update_probe_resp_noa(tp_wma_handle wma_handle, |
| 1116 | struct p2p_sub_element_noa *noa_ie); |
| 1117 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1118 | void wma_process_set_mimops_req(tp_wma_handle wma_handle, |
| 1119 | tSetMIMOPS *mimops); |
| 1120 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1121 | QDF_STATUS wma_set_mimops(tp_wma_handle wma, uint8_t vdev_id, int value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1122 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1123 | QDF_STATUS wma_notify_modem_power_state(void *wma_ptr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1124 | tSirModemPowerStateInd *pReq); |
| 1125 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1126 | QDF_STATUS wma_set_smps_params(tp_wma_handle wma, uint8_t vdev_id, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1127 | int value); |
| 1128 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1129 | /* |
| 1130 | * wma_data.c functions declarations |
| 1131 | */ |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1132 | /** |
| 1133 | * wma_set_bss_rate_flags() - set rate flags based on BSS capability |
| 1134 | * @wma: pointer to wma handle |
| 1135 | * @vdev_id: vdev id |
| 1136 | * @add_bss: pointer to bss params |
| 1137 | * |
| 1138 | * Return: none |
| 1139 | */ |
Naveen Rawat | fa2a100 | 2018-05-17 16:06:37 -0700 | [diff] [blame] | 1140 | void wma_set_bss_rate_flags(tp_wma_handle wma, uint8_t vdev_id, |
Jianmin Zhu | f07aa51 | 2019-08-09 18:20:17 +0800 | [diff] [blame] | 1141 | struct bss_params *add_bss); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1142 | |
| 1143 | int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params); |
| 1144 | |
Jiachao Wu | 08719b0 | 2017-07-05 13:05:34 +0800 | [diff] [blame] | 1145 | /** |
| 1146 | * wma_check_txrx_chainmask() - check txrx chainmask |
| 1147 | * @num_rf_chains: number of rf chains |
| 1148 | * @cmd_value: command value |
| 1149 | * |
| 1150 | * Return: QDF_STATUS_SUCCESS for success or error code |
| 1151 | */ |
| 1152 | QDF_STATUS wma_check_txrx_chainmask(int num_rf_chains, int cmd_value); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1153 | |
| 1154 | int wma_peer_state_change_event_handler(void *handle, |
| 1155 | uint8_t *event_buff, |
| 1156 | uint32_t len); |
| 1157 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1158 | QDF_STATUS wma_set_enable_disable_mcc_adaptive_scheduler(uint32_t |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1159 | mcc_adaptive_scheduler); |
| 1160 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1161 | QDF_STATUS wma_set_mcc_channel_time_latency |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1162 | (tp_wma_handle wma, |
| 1163 | uint32_t mcc_channel, uint32_t mcc_channel_time_latency); |
| 1164 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1165 | QDF_STATUS wma_set_mcc_channel_time_quota |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1166 | (tp_wma_handle wma, |
| 1167 | uint32_t adapter_1_chan_number, |
| 1168 | uint32_t adapter_1_quota, uint32_t adapter_2_chan_number); |
| 1169 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1170 | /** |
| 1171 | * wma_process_rate_update_indate() - rate update indication |
| 1172 | * @wma: wma handle |
| 1173 | * @pRateUpdateParams: Rate update params |
| 1174 | * |
| 1175 | * This function update rate & short GI interval to fw based on params |
| 1176 | * send by SME. |
| 1177 | * |
| 1178 | * Return: QDF status |
| 1179 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1180 | QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1181 | tSirRateUpdateInd * |
| 1182 | pRateUpdateParams); |
| 1183 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1184 | QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1185 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1186 | QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1187 | |
Poddar, Siddarth | 5a91f5b | 2016-04-28 12:24:10 +0530 | [diff] [blame] | 1188 | #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \ |
| 1189 | defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(CONFIG_HL_SUPPORT) |
| 1190 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1191 | /** |
| 1192 | * wma_mcc_vdev_tx_pause_evt_handler() - pause event handler |
| 1193 | * @handle: wma handle |
| 1194 | * @event: event buffer |
| 1195 | * @len: data length |
| 1196 | * |
| 1197 | * This function handle pause event from fw and pause/unpause |
| 1198 | * vdev. |
| 1199 | * |
| 1200 | * Return: 0 for success or error code. |
| 1201 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1202 | int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event, |
| 1203 | uint32_t len); |
| 1204 | #endif |
| 1205 | |
Poddar, Siddarth | 5a91f5b | 2016-04-28 12:24:10 +0530 | [diff] [blame] | 1206 | #if defined(CONFIG_HL_SUPPORT) && defined(QCA_BAD_PEER_TX_FLOW_CL) |
| 1207 | QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma, |
| 1208 | struct t_bad_peer_txtcl_config *config); |
Mohit Khanna | 0fe6167 | 2016-05-19 16:53:39 -0700 | [diff] [blame] | 1209 | #else |
| 1210 | static inline QDF_STATUS |
| 1211 | wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma, |
| 1212 | struct t_bad_peer_txtcl_config *config) |
| 1213 | { |
| 1214 | return QDF_STATUS_E_FAILURE; |
| 1215 | } |
Poddar, Siddarth | 5a91f5b | 2016-04-28 12:24:10 +0530 | [diff] [blame] | 1216 | #endif |
| 1217 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1218 | QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1219 | t_thermal_mgmt *pThermalParams); |
| 1220 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1221 | QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1222 | uint8_t thermal_level); |
| 1223 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1224 | QDF_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1225 | t_thermal_cmd_params thermal_info); |
| 1226 | |
| 1227 | int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event, |
| 1228 | uint32_t len); |
| 1229 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1230 | int wma_fast_tx_fail_event_handler(void *handle, uint8_t *data, |
| 1231 | uint32_t len); |
| 1232 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1233 | /* |
| 1234 | * wma_utils.c functions declarations |
| 1235 | */ |
| 1236 | |
| 1237 | #ifdef WLAN_FEATURE_STATS_EXT |
Sravan Goud | 1f95d22 | 2020-01-17 14:41:15 -0800 | [diff] [blame^] | 1238 | /** |
| 1239 | * wma_stats_ext_event_handler() - extended stats event handler |
| 1240 | * @handle: wma handle |
| 1241 | * @event_buf: event buffer received from fw |
| 1242 | * @len: length of data |
| 1243 | * |
| 1244 | * Return: 0 for success or error code |
| 1245 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1246 | int wma_stats_ext_event_handler(void *handle, uint8_t *event_buf, |
| 1247 | uint32_t len); |
| 1248 | #endif |
| 1249 | |
Manikandan Mohan | 1dd8b5d | 2017-04-18 15:54:09 -0700 | [diff] [blame] | 1250 | enum eSmpsModeValue host_map_smps_mode(A_UINT32 fw_smps_mode); |
Archana Ramachandran | 20d2e23 | 2016-02-11 16:58:40 -0800 | [diff] [blame] | 1251 | int wma_smps_mode_to_force_mode_param(uint8_t smps_mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1252 | |
| 1253 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 1254 | void wma_register_ll_stats_event_handler(tp_wma_handle wma_handle); |
| 1255 | |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 1256 | /** |
| 1257 | * wma_process_ll_stats_clear_req() - clear link layer stats |
| 1258 | * @wma: wma handle |
| 1259 | * @clearReq: ll stats clear request command params |
| 1260 | * |
| 1261 | * Return: QDF_STATUS_SUCCESS for success or error code |
| 1262 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1263 | QDF_STATUS wma_process_ll_stats_clear_req |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1264 | (tp_wma_handle wma, const tpSirLLStatsClearReq clearReq); |
| 1265 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1266 | QDF_STATUS wma_process_ll_stats_set_req |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1267 | (tp_wma_handle wma, const tpSirLLStatsSetReq setReq); |
| 1268 | |
Abhishek Ambure | 3ee8088 | 2019-09-20 16:32:12 +0530 | [diff] [blame] | 1269 | /** |
| 1270 | * wma_process_ll_stats_get_req() - link layer stats get request |
| 1271 | * @wma:wma handle |
| 1272 | * @getReq:ll stats get request command params |
| 1273 | * |
| 1274 | * Return: QDF_STATUS_SUCCESS for success or error code |
| 1275 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1276 | QDF_STATUS wma_process_ll_stats_get_req |
Manikandan Mohan | 1dd8b5d | 2017-04-18 15:54:09 -0700 | [diff] [blame] | 1277 | (tp_wma_handle wma, const tpSirLLStatsGetReq getReq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1278 | |
| 1279 | int wma_unified_link_iface_stats_event_handler(void *handle, |
| 1280 | uint8_t *cmd_param_info, |
| 1281 | uint32_t len); |
Zhang Qian | 73c348a | 2017-03-13 16:15:55 +0800 | [diff] [blame] | 1282 | void wma_config_stats_ext_threshold(tp_wma_handle wma, |
| 1283 | struct sir_ll_ext_stats_threshold *thresh); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1284 | #endif |
| 1285 | |
| 1286 | void wma_post_link_status(tAniGetLinkStatus *pGetLinkStatus, |
| 1287 | uint8_t link_status); |
| 1288 | |
Abhishek Ambure | 0b2ea32 | 2019-09-23 19:25:39 +0530 | [diff] [blame] | 1289 | /** |
| 1290 | * wma_link_status_event_handler() - link status event handler |
| 1291 | * @handle: wma handle |
| 1292 | * @cmd_param_info: data from event |
| 1293 | * @len: length |
| 1294 | * |
| 1295 | * Return: 0 for success or error code |
| 1296 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1297 | int wma_link_status_event_handler(void *handle, uint8_t *cmd_param_info, |
| 1298 | uint32_t len); |
| 1299 | |
Sreelakshmi Konamki | 88a2a41 | 2017-04-14 15:11:55 +0530 | [diff] [blame] | 1300 | /** |
| 1301 | * wma_rso_cmd_status_event_handler() - RSO Command status event handler |
| 1302 | * @wmi_event: WMI event |
| 1303 | * |
| 1304 | * This function is used to send RSO command status to upper layer |
| 1305 | * |
| 1306 | * Return: 0 for success |
| 1307 | */ |
| 1308 | int wma_rso_cmd_status_event_handler(wmi_roam_event_fixed_param *wmi_event); |
| 1309 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1310 | int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info, |
| 1311 | uint32_t len); |
| 1312 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1313 | QDF_STATUS wma_send_link_speed(uint32_t link_speed); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1314 | |
| 1315 | int wma_link_speed_event_handler(void *handle, uint8_t *cmd_param_info, |
| 1316 | uint32_t len); |
| 1317 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1318 | QDF_STATUS wma_wni_cfg_dnld(tp_wma_handle wma_handle); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1319 | |
| 1320 | int wma_unified_debug_print_event_handler(void *handle, uint8_t *datap, |
| 1321 | uint32_t len); |
| 1322 | |
Abhishek Ambure | 6a2773e | 2019-10-14 15:15:42 +0530 | [diff] [blame] | 1323 | /** |
| 1324 | * wma_peer_phymode() - get phymode |
| 1325 | * @nw_type: nw type |
| 1326 | * @sta_type: sta type |
| 1327 | * @is_ht: is ht supported |
| 1328 | * @ch_width: supported channel width |
| 1329 | * @is_vht: is vht supported |
| 1330 | * @is_he: is HE supported |
| 1331 | * |
| 1332 | * Return: host phymode |
| 1333 | */ |
| 1334 | enum wlan_phymode |
| 1335 | wma_peer_phymode(tSirNwType nw_type, uint8_t sta_type, |
| 1336 | uint8_t is_ht, uint8_t ch_width, |
| 1337 | uint8_t is_vht, bool is_he); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1338 | |
| 1339 | int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle, |
| 1340 | uint8_t vdev_id, uint32_t value); |
| 1341 | |
| 1342 | int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle, |
| 1343 | uint8_t vdev_id, uint32_t value); |
| 1344 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1345 | /* |
| 1346 | * wma_features.c functions declarations |
| 1347 | */ |
| 1348 | |
Jeff Johnson | f0e54b0 | 2017-12-18 15:22:25 -0800 | [diff] [blame] | 1349 | /** |
| 1350 | * wma_sar_register_event_handlers() - Register SAR event handlers |
| 1351 | * @handle: WMA Handle |
| 1352 | * |
| 1353 | * Function to be called during WMA initialization to register SAR |
| 1354 | * event handlers with WMI |
| 1355 | * |
| 1356 | * Return: QDF_STATUS_SUCCESS if registration is successful, otherwise |
| 1357 | * an error enumeration |
| 1358 | */ |
| 1359 | QDF_STATUS wma_sar_register_event_handlers(WMA_HANDLE handle); |
| 1360 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1361 | void wma_process_link_status_req(tp_wma_handle wma, |
| 1362 | tAniGetLinkStatus *pGetLinkStatus); |
| 1363 | |
Will Huang | a981459 | 2017-05-24 15:47:58 +0800 | [diff] [blame] | 1364 | /** |
| 1365 | * wma_get_peer_info_ext() - get peer info |
| 1366 | * @handle: wma interface |
| 1367 | * @peer_info_req: get peer info request information |
| 1368 | * |
| 1369 | * This function will send WMI_REQUEST_PEER_STATS_INFO_CMDID to FW |
| 1370 | * |
| 1371 | * Return: 0 on success, otherwise error value |
| 1372 | */ |
| 1373 | QDF_STATUS wma_get_peer_info_ext(WMA_HANDLE handle, |
| 1374 | struct sir_peer_info_ext_req *peer_info_req); |
| 1375 | |
| 1376 | /** |
guangde | 4853c40 | 2019-05-06 15:54:04 +0800 | [diff] [blame] | 1377 | * wma_get_isolation() - get antenna isolation |
| 1378 | * @handle: wma interface |
| 1379 | * |
| 1380 | * This function will send WMI_COEX_GET_ANTENNA_ISOLATION_CMDID to FW |
| 1381 | * |
| 1382 | * Return: 0 on success, otherwise error value |
| 1383 | */ |
| 1384 | QDF_STATUS wma_get_isolation(tp_wma_handle wma); |
| 1385 | |
| 1386 | /** |
Will Huang | a981459 | 2017-05-24 15:47:58 +0800 | [diff] [blame] | 1387 | * wma_peer_info_event_handler() - Handler for WMI_PEER_STATS_INFO_EVENTID |
| 1388 | * @handle: WMA global handle |
| 1389 | * @cmd_param_info: Command event data |
| 1390 | * @len: Length of cmd_param_info |
| 1391 | * |
| 1392 | * This function will handle WMI_PEER_STATS_INFO_EVENTID |
| 1393 | * |
| 1394 | * Return: 0 on success, error code otherwise |
| 1395 | */ |
| 1396 | int wma_peer_info_event_handler(void *handle, u_int8_t *cmd_param_info, |
| 1397 | u_int32_t len); |
| 1398 | |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 1399 | int wma_profile_data_report_event_handler(void *handle, uint8_t *event_buf, |
| 1400 | uint32_t len); |
| 1401 | |
Govind Singh | f25a0f1 | 2016-03-08 16:09:48 +0530 | [diff] [blame] | 1402 | QDF_STATUS wma_unified_fw_profiling_cmd(wmi_unified_t wmi_handle, |
Govind Singh | a471e5e | 2015-10-12 17:11:14 +0530 | [diff] [blame] | 1403 | uint32_t cmd, uint32_t value1, uint32_t value2); |
| 1404 | |
Govind Singh | d76a5b0 | 2016-03-08 15:12:14 +0530 | [diff] [blame] | 1405 | int wma_unified_csa_offload_enable(tp_wma_handle wma, uint8_t vdev_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1406 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1407 | #ifdef FEATURE_WLAN_TDLS |
| 1408 | int wma_tdls_event_handler(void *handle, uint8_t *event, uint32_t len); |
| 1409 | #endif |
| 1410 | |
| 1411 | int wma_csa_offload_handler(void *handle, uint8_t *event, uint32_t len); |
| 1412 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1413 | #ifdef FEATURE_OEM_DATA_SUPPORT |
Krishna Kumaar Natarajan | 4e9cf39 | 2015-11-20 13:35:05 -0800 | [diff] [blame] | 1414 | int wma_oem_data_response_handler(void *handle, uint8_t *datap, |
| 1415 | uint32_t len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1416 | #endif |
| 1417 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1418 | #if !defined(REMOVE_PKT_LOG) |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1419 | QDF_STATUS wma_pktlog_wmi_send_cmd(WMA_HANDLE handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1420 | struct ath_pktlog_wmi_params *params); |
| 1421 | #endif |
| 1422 | |
| 1423 | int wma_wow_wakeup_host_event(void *handle, uint8_t *event, |
| 1424 | uint32_t len); |
Will Huang | 3cd2b7c | 2017-11-17 13:16:56 +0800 | [diff] [blame] | 1425 | |
| 1426 | int wma_d0_wow_disable_ack_event(void *handle, uint8_t *event, uint32_t len); |
| 1427 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1428 | int wma_pdev_resume_event_handler(void *handle, uint8_t *event, uint32_t len); |
| 1429 | |
Jeff Johnson | 256002f | 2018-12-22 17:53:19 -0800 | [diff] [blame] | 1430 | void wma_del_ts_req(tp_wma_handle wma, struct del_ts_params *msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1431 | |
Jeff Johnson | 5402441 | 2018-12-22 12:07:06 -0800 | [diff] [blame] | 1432 | /** |
| 1433 | * wma_aggr_qos_req() - send aggr qos request to fw |
| 1434 | * @wma: handle to wma |
| 1435 | * @pAggrQosRspMsg - combined struct for all ADD_TS requests. |
| 1436 | * |
| 1437 | * A function to handle WMA_AGGR_QOS_REQ. This will send out |
| 1438 | * ADD_TS requestes to firmware in loop for all the ACs with |
| 1439 | * active flow. |
| 1440 | * |
| 1441 | * Return: none |
| 1442 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1443 | void wma_aggr_qos_req(tp_wma_handle wma, |
Jeff Johnson | 5402441 | 2018-12-22 12:07:06 -0800 | [diff] [blame] | 1444 | struct aggr_add_ts_param *pAggrQosRspMsg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1445 | |
Jeff Johnson | 9851fcc | 2018-12-22 17:29:58 -0800 | [diff] [blame] | 1446 | void wma_add_ts_req(tp_wma_handle wma, struct add_ts_param *msg); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1447 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1448 | #ifdef FEATURE_WLAN_ESE |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1449 | QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1450 | void *pTsmStatsMsg); |
Jeff Johnson | 36583f0 | 2019-02-26 08:02:11 -0800 | [diff] [blame] | 1451 | void wma_config_plm(tp_wma_handle wma, struct plm_req_params *plm); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1452 | #endif |
| 1453 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1454 | QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle, |
| 1455 | tSirRcvFltMcAddrList * mcbc_param); |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1456 | QDF_STATUS wma_process_cesium_enable_ind(tp_wma_handle wma); |
| 1457 | |
| 1458 | QDF_STATUS wma_process_get_peer_info_req |
| 1459 | (tp_wma_handle wma, tSirIbssGetPeerInfoReqParams *pReq); |
| 1460 | |
| 1461 | QDF_STATUS wma_process_tx_fail_monitor_ind |
| 1462 | (tp_wma_handle wma, tAniTXFailMonitorInd *pReq); |
| 1463 | |
Rachit Kankane | ee1735c | 2018-08-02 13:19:34 +0530 | [diff] [blame] | 1464 | #ifdef FEATURE_WLAN_RMC |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1465 | QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma); |
| 1466 | |
| 1467 | QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma); |
| 1468 | |
| 1469 | QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma); |
Rachit Kankane | ee1735c | 2018-08-02 13:19:34 +0530 | [diff] [blame] | 1470 | #else |
| 1471 | static inline |
| 1472 | QDF_STATUS wma_process_rmc_enable_ind(tp_wma_handle wma) |
| 1473 | { |
| 1474 | return QDF_STATUS_SUCCESS; |
| 1475 | } |
| 1476 | |
| 1477 | static inline |
| 1478 | QDF_STATUS wma_process_rmc_disable_ind(tp_wma_handle wma) |
| 1479 | { |
| 1480 | return QDF_STATUS_SUCCESS; |
| 1481 | } |
| 1482 | |
| 1483 | static inline |
| 1484 | QDF_STATUS wma_process_rmc_action_period_ind(tp_wma_handle wma) |
| 1485 | { |
| 1486 | return QDF_STATUS_SUCCESS; |
| 1487 | } |
| 1488 | #endif |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1489 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1490 | QDF_STATUS wma_process_add_periodic_tx_ptrn_ind(WMA_HANDLE handle, |
Jeff Johnson | 6dcb44a | 2018-12-23 10:17:00 -0800 | [diff] [blame] | 1491 | tSirAddPeriodicTxPtrn *pattern); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1492 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1493 | QDF_STATUS wma_process_del_periodic_tx_ptrn_ind(WMA_HANDLE handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1494 | tSirDelPeriodicTxPtrn * |
| 1495 | pDelPeriodicTxPtrnParams); |
| 1496 | |
| 1497 | #ifdef WLAN_FEATURE_STATS_EXT |
Sravan Goud | 1f95d22 | 2020-01-17 14:41:15 -0800 | [diff] [blame^] | 1498 | /** |
| 1499 | * wma_stats_ext_req() - request ext stats from fw |
| 1500 | * @wma_ptr: wma handle |
| 1501 | * @preq: stats ext params |
| 1502 | * |
| 1503 | * Return: QDF status |
| 1504 | */ |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1505 | QDF_STATUS wma_stats_ext_req(void *wma_ptr, tpStatsExtRequest preq); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1506 | #endif |
| 1507 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1508 | #ifdef WLAN_FEATURE_EXTWOW_SUPPORT |
Himanshu Agarwal | 4419541 | 2016-03-09 13:03:54 +0530 | [diff] [blame] | 1509 | QDF_STATUS wma_enable_ext_wow(tp_wma_handle wma, tpSirExtWoWParams params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1510 | |
| 1511 | int wma_set_app_type1_params_in_fw(tp_wma_handle wma, |
| 1512 | tpSirAppType1Params appType1Params); |
| 1513 | |
Himanshu Agarwal | 4419541 | 2016-03-09 13:03:54 +0530 | [diff] [blame] | 1514 | QDF_STATUS wma_set_app_type2_params_in_fw(tp_wma_handle wma, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1515 | tpSirAppType2Params appType2Params); |
| 1516 | #endif |
| 1517 | |
| 1518 | #ifdef FEATURE_WLAN_AUTO_SHUTDOWN |
| 1519 | int wma_auto_shutdown_event_handler(void *handle, uint8_t *event, |
| 1520 | uint32_t len); |
| 1521 | |
Jeff Johnson | a9ade7d | 2019-02-17 10:08:17 -0800 | [diff] [blame] | 1522 | /** |
| 1523 | * wma_set_auto_shutdown_timer_req() - sets auto shutdown timer in firmware |
| 1524 | * @wma_handle: wma handle |
| 1525 | * @auto_sh_cmd: auto shutdown timer params |
| 1526 | * |
| 1527 | * Return: QDF status |
| 1528 | */ |
| 1529 | QDF_STATUS |
| 1530 | wma_set_auto_shutdown_timer_req(tp_wma_handle wma_handle, |
| 1531 | struct auto_shutdown_cmd *auto_sh_cmd); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1532 | #endif |
| 1533 | |
Manikandan Mohan | 976e756 | 2016-03-15 16:33:31 -0700 | [diff] [blame] | 1534 | #ifdef WLAN_FEATURE_TSF |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1535 | int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len); |
| 1536 | QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, uint32_t vdev_id); |
| 1537 | QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, uint32_t vdev_id); |
Manikandan Mohan | 976e756 | 2016-03-15 16:33:31 -0700 | [diff] [blame] | 1538 | QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin); |
| 1539 | #else |
| 1540 | static inline QDF_STATUS wma_capture_tsf(tp_wma_handle wma_handle, |
| 1541 | uint32_t vdev_id) |
| 1542 | { |
| 1543 | return QDF_STATUS_SUCCESS; |
| 1544 | } |
| 1545 | |
| 1546 | static inline QDF_STATUS wma_reset_tsf_gpio(tp_wma_handle wma_handle, |
| 1547 | uint32_t vdev_id) |
| 1548 | { |
| 1549 | return QDF_STATUS_SUCCESS; |
| 1550 | } |
| 1551 | |
| 1552 | static inline int wma_vdev_tsf_handler(void *handle, uint8_t *data, |
| 1553 | uint32_t data_len) |
| 1554 | { |
| 1555 | return 0; |
| 1556 | } |
| 1557 | |
| 1558 | static inline QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin) |
| 1559 | { |
| 1560 | return QDF_STATUS_E_INVAL; |
| 1561 | } |
| 1562 | #endif |
Manikandan Mohan | 80dea79 | 2016-04-28 16:36:48 -0700 | [diff] [blame] | 1563 | QDF_STATUS wma_set_wisa_params(tp_wma_handle wma, struct sir_wisa_params *wisa); |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1564 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1565 | #ifdef DHCP_SERVER_OFFLOAD |
Jeff Johnson | 8bfc29e | 2019-02-15 07:58:15 -0800 | [diff] [blame] | 1566 | /** |
| 1567 | * wma_process_dhcpserver_offload() - enable DHCP server offload |
| 1568 | * @wma_handle: wma handle |
| 1569 | * @params: DHCP server offload information |
| 1570 | * |
| 1571 | * Return: QDF_STATUS_SUCCESS for success or error code |
| 1572 | */ |
| 1573 | QDF_STATUS |
| 1574 | wma_process_dhcpserver_offload(tp_wma_handle wma_handle, |
| 1575 | struct dhcp_offload_info_params *params); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1576 | #endif |
| 1577 | |
| 1578 | #ifdef WLAN_FEATURE_GPIO_LED_FLASHING |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1579 | QDF_STATUS wma_set_led_flashing(tp_wma_handle wma_handle, |
Jeff Johnson | 5a6b660 | 2017-10-04 14:44:30 -0700 | [diff] [blame] | 1580 | struct flashing_req_params *flashing); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1581 | #endif |
| 1582 | |
Kabilan Kannan | caa8550 | 2018-04-13 18:04:58 -0700 | [diff] [blame] | 1583 | /** |
| 1584 | * wma_sar_rsp_evt_handler() - process sar response event from FW. |
Kabilan Kannan | ebe01e7 | 2018-06-13 01:13:46 -0700 | [diff] [blame] | 1585 | * @handle: ol scn handle |
Kabilan Kannan | caa8550 | 2018-04-13 18:04:58 -0700 | [diff] [blame] | 1586 | * @event: event buffer |
| 1587 | * @len: buffer length |
| 1588 | * |
| 1589 | * Return: 0 for success or error code |
| 1590 | */ |
Kabilan Kannan | ebe01e7 | 2018-06-13 01:13:46 -0700 | [diff] [blame] | 1591 | int wma_sar_rsp_evt_handler(ol_scn_t handle, uint8_t *event, uint32_t len); |
Kabilan Kannan | caa8550 | 2018-04-13 18:04:58 -0700 | [diff] [blame] | 1592 | |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 1593 | #ifdef FEATURE_WLAN_CH_AVOID |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1594 | QDF_STATUS wma_process_ch_avoid_update_req(tp_wma_handle wma_handle, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1595 | tSirChAvoidUpdateReq * |
| 1596 | ch_avoid_update_req); |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 1597 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1598 | |
| 1599 | #ifdef FEATURE_WLAN_TDLS |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1600 | int wma_update_tdls_peer_state(WMA_HANDLE handle, |
Jeff Johnson | 517ee49 | 2019-02-07 11:59:04 -0800 | [diff] [blame] | 1601 | struct tdls_peer_update_state *peer_state); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1602 | #endif |
| 1603 | |
Hong Shi | b90718f | 2017-02-20 00:57:22 +0800 | [diff] [blame] | 1604 | void wma_set_vdev_mgmt_rate(tp_wma_handle wma, uint8_t vdev_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1605 | void wma_set_sap_keepalive(tp_wma_handle wma, uint8_t vdev_id); |
| 1606 | |
Qiwei Cai | e689a26 | 2018-07-26 15:50:22 +0800 | [diff] [blame] | 1607 | #ifdef FEATURE_RSSI_MONITOR |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1608 | int wma_rssi_breached_event_handler(void *handle, |
| 1609 | u_int8_t *cmd_param_info, u_int32_t len); |
Qiwei Cai | e689a26 | 2018-07-26 15:50:22 +0800 | [diff] [blame] | 1610 | #else /* FEATURE_RSSI_MONITOR */ |
| 1611 | static inline |
| 1612 | int wma_rssi_breached_event_handler(void *handle, |
| 1613 | u_int8_t *cmd_param_info, u_int32_t len) |
| 1614 | { |
| 1615 | return 0; |
| 1616 | } |
| 1617 | #endif /* FEATURE_RSSI_MONITOR */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1618 | |
Kiran Kumar Lokere | ee20577 | 2018-09-27 00:27:27 -0700 | [diff] [blame] | 1619 | QDF_STATUS wma_process_cfg_action_frm_tb_ppdu(tp_wma_handle wma, |
| 1620 | struct cfg_action_frm_tb_ppdu *cfg_info); |
| 1621 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1622 | QDF_STATUS wma_process_set_ie_info(tp_wma_handle wma, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1623 | struct vdev_ie_info *ie_info); |
| 1624 | int wma_peer_assoc_conf_handler(void *handle, uint8_t *cmd_param_info, |
| 1625 | uint32_t len); |
| 1626 | |
Sandeep Puligilla | 19ddda2 | 2016-01-05 12:18:02 -0800 | [diff] [blame] | 1627 | int wma_peer_delete_handler(void *handle, uint8_t *cmd_param_info, |
| 1628 | uint32_t len); |
| 1629 | void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id, |
| 1630 | uint8_t type); |
Manjeet Singh | f82ed07 | 2016-07-08 11:40:00 +0530 | [diff] [blame] | 1631 | |
| 1632 | QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle, |
| 1633 | struct sir_mac_pwr_dbg_cmd * |
| 1634 | sir_pwr_dbg_params); |
| 1635 | |
Sreelakshmi Konamki | 58c7243 | 2016-11-09 17:06:44 +0530 | [diff] [blame] | 1636 | /** |
| 1637 | * wma_lost_link_info_handler() - collect lost link information and inform SME |
| 1638 | * @wma: WMA handle |
| 1639 | * @vdev_id: vdev ID |
| 1640 | * @rssi: rssi at disconnection time |
| 1641 | * |
| 1642 | * Return: none |
| 1643 | */ |
| 1644 | void wma_lost_link_info_handler(tp_wma_handle wma, uint32_t vdev_id, |
| 1645 | int32_t rssi); |
Sridhar Selvaraj | dc400d2 | 2016-10-18 17:18:03 +0530 | [diff] [blame] | 1646 | int wma_unified_power_debug_stats_event_handler(void *handle, |
| 1647 | uint8_t *cmd_param_info, uint32_t len); |
Arunk Khandavalli | ca56d4b | 2018-11-29 15:46:00 +0530 | [diff] [blame] | 1648 | /** |
| 1649 | * wma_unified_beacon_debug_stats_event_handler() - collect beacon debug stats |
| 1650 | * @handle: WMA handle |
| 1651 | * @cmd_param_info: data from event |
| 1652 | * @len: length |
| 1653 | * |
| 1654 | * Return: 0 for success or error code |
| 1655 | */ |
| 1656 | int wma_unified_beacon_debug_stats_event_handler(void *handle, |
| 1657 | uint8_t *cmd_param_info, |
| 1658 | uint32_t len); |
Sen, Devendra | 154b3c4 | 2017-02-13 20:44:15 +0530 | [diff] [blame] | 1659 | |
| 1660 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 1661 | /** |
| 1662 | * wma_sta_kickout_event()- send sta kickout event |
| 1663 | * @kickout_reason - reasoncode for kickout |
Srinivas Girigowda | a47b45f | 2019-02-27 12:29:02 -0800 | [diff] [blame] | 1664 | * @macaddr[QDF_MAC_ADDR_SIZE]: Peer mac address |
Sen, Devendra | 154b3c4 | 2017-02-13 20:44:15 +0530 | [diff] [blame] | 1665 | * @vdev_id: Unique id for identifying the VDEV |
| 1666 | * |
| 1667 | * This function sends sta kickout diag event |
| 1668 | * |
| 1669 | * Return: void. |
| 1670 | */ |
| 1671 | void wma_sta_kickout_event(uint32_t kickout_reason, uint8_t vdev_id, |
| 1672 | uint8_t *macaddr); |
| 1673 | #else |
| 1674 | static inline void wma_sta_kickout_event(uint32_t kickout_reason, |
| 1675 | uint8_t vdev_id, uint8_t *macaddr) |
| 1676 | { |
| 1677 | |
| 1678 | }; |
| 1679 | #endif /* FEATURE_WLAN_DIAG_SUPPORT */ |
| 1680 | |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1681 | /** |
Rajeev Kumar Sirasanagandla | 996e529 | 2016-11-22 21:20:33 +0530 | [diff] [blame] | 1682 | * wma_get_rcpi_req() - get rcpi request |
| 1683 | * @handle: wma handle |
| 1684 | * @rcpi_request: rcpi params |
| 1685 | * |
| 1686 | * Return: none |
| 1687 | */ |
| 1688 | QDF_STATUS wma_get_rcpi_req(WMA_HANDLE handle, |
| 1689 | struct sme_rcpi_req *rcpi_request); |
| 1690 | |
| 1691 | /** |
| 1692 | * wma_rcpi_event_handler() - rcpi event handler |
| 1693 | * @handle: wma handle |
| 1694 | * @cmd_param_info: data from event |
| 1695 | * @len: length |
| 1696 | * |
| 1697 | * Return: 0 for success or error code |
| 1698 | */ |
| 1699 | int wma_rcpi_event_handler(void *handle, uint8_t *cmd_param_info, |
| 1700 | uint32_t len); |
| 1701 | |
| 1702 | /** |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1703 | * wma_acquire_wakelock() - acquire the given wakelock |
| 1704 | * @wl: the wakelock to acquire |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1705 | * @msec: the wakelock duration in milliseconds |
| 1706 | * |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1707 | * This also acquires the wma runtime pm lock. |
| 1708 | * |
| 1709 | * Return: None |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1710 | */ |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1711 | void wma_acquire_wakelock(qdf_wake_lock_t *wl, uint32_t msec); |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1712 | |
| 1713 | /** |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1714 | * wma_release_wakelock() - release the given wakelock |
| 1715 | * @wl: the wakelock to release |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1716 | * |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1717 | * This also releases the wma runtime pm lock. |
| 1718 | * |
| 1719 | * Return: None |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1720 | */ |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1721 | void wma_release_wakelock(qdf_wake_lock_t *wl); |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1722 | |
| 1723 | /** |
| 1724 | * wma_send_vdev_stop_to_fw() - send the vdev stop command to firmware |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1725 | * @wma: a reference to the global WMA handle |
| 1726 | * @vdev_id: the Id of the vdev to stop |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1727 | * |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1728 | * Consumers should call wma_release_wakelock() upon receipt of the vdev stop |
| 1729 | * response from firmware to avoid power penalties. |
Dustin Brown | bf6d16b | 2017-03-03 11:41:05 -0800 | [diff] [blame] | 1730 | * |
| 1731 | * Return: QDF_STATUS |
| 1732 | */ |
| 1733 | QDF_STATUS wma_send_vdev_stop_to_fw(t_wma_handle *wma, uint8_t vdev_id); |
| 1734 | |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 1735 | int wma_get_arp_stats_handler(void *handle, uint8_t *data, uint32_t data_len); |
| 1736 | |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1737 | /** |
Dustin Brown | ec2c92e | 2017-07-26 11:13:49 -0700 | [diff] [blame] | 1738 | * wma_send_vdev_down_to_fw() - send the vdev down command to firmware |
| 1739 | * @wma: a reference to the global WMA handle |
| 1740 | * @vdev_id: the Id of the vdev to down |
| 1741 | * |
| 1742 | * This also releases the vdev start wakelock. |
| 1743 | * |
| 1744 | * Return: QDF_STATUS |
| 1745 | */ |
| 1746 | QDF_STATUS wma_send_vdev_down_to_fw(t_wma_handle *wma, uint8_t vdev_id); |
| 1747 | |
lifeng | 6683166 | 2017-05-19 16:01:35 +0800 | [diff] [blame] | 1748 | /* |
| 1749 | * wma_rx_aggr_failure_event_handler - event handler to handle rx aggr failure |
| 1750 | * @handle: the wma handle |
| 1751 | * @event_buf: buffer with event |
| 1752 | * @len: buffer length |
| 1753 | * |
| 1754 | * This function receives rx aggregation failure event and then pass to upper |
| 1755 | * layer |
| 1756 | * |
| 1757 | * Return: 0 on success |
| 1758 | */ |
| 1759 | int wma_rx_aggr_failure_event_handler(void *handle, u_int8_t *event_buf, |
| 1760 | u_int32_t len); |
| 1761 | |
Vidyullatha Kanchanapally | be0ebb3 | 2017-03-23 14:36:21 +0530 | [diff] [blame] | 1762 | /** |
| 1763 | * wma_wlan_bt_activity_evt_handler - event handler to handle bt activity |
| 1764 | * @handle: the WMA handle |
| 1765 | * @event: buffer with the event parameters |
| 1766 | * @len: length of the buffer |
| 1767 | * |
| 1768 | * This function receives BT activity event from firmware and passes the event |
| 1769 | * information to upper layers |
| 1770 | * |
| 1771 | * Return: 0 on success |
| 1772 | */ |
| 1773 | int wma_wlan_bt_activity_evt_handler(void *handle, uint8_t *event, |
| 1774 | uint32_t len); |
lifeng | d217d19 | 2017-05-09 19:44:16 +0800 | [diff] [blame] | 1775 | |
| 1776 | /** |
lifeng | fe6c3e2 | 2018-04-03 12:10:04 +0800 | [diff] [blame] | 1777 | * wma_pdev_div_info_evt_handler - event handler to handle antenna info |
lifeng | d217d19 | 2017-05-09 19:44:16 +0800 | [diff] [blame] | 1778 | * @handle: the wma handle |
lifeng | fe6c3e2 | 2018-04-03 12:10:04 +0800 | [diff] [blame] | 1779 | * @event_buf: buffer with event |
lifeng | d217d19 | 2017-05-09 19:44:16 +0800 | [diff] [blame] | 1780 | * @len: buffer length |
| 1781 | * |
| 1782 | * This function receives antenna info from firmware and passes the event |
| 1783 | * to upper layer |
| 1784 | * |
| 1785 | * Return: 0 on success |
| 1786 | */ |
lifeng | fe6c3e2 | 2018-04-03 12:10:04 +0800 | [diff] [blame] | 1787 | int wma_pdev_div_info_evt_handler(void *handle, u_int8_t *event_buf, |
lifeng | d217d19 | 2017-05-09 19:44:16 +0800 | [diff] [blame] | 1788 | u_int32_t len); |
| 1789 | |
lifeng | 7c607dd | 2017-02-21 21:16:49 +0800 | [diff] [blame] | 1790 | /** |
| 1791 | * wma_update_beacon_interval() - update beacon interval in fw |
| 1792 | * @wma: wma handle |
| 1793 | * @vdev_id: vdev id |
| 1794 | * @beaconInterval: becon interval |
| 1795 | * |
| 1796 | * Return: none |
| 1797 | */ |
| 1798 | void |
| 1799 | wma_update_beacon_interval(tp_wma_handle wma, uint8_t vdev_id, |
| 1800 | uint16_t beaconInterval); |
| 1801 | |
| 1802 | #define RESET_BEACON_INTERVAL_TIMEOUT 200 |
| 1803 | |
| 1804 | struct wma_beacon_interval_reset_req { |
| 1805 | qdf_timer_t event_timeout; |
| 1806 | uint8_t vdev_id; |
| 1807 | uint16_t interval; |
| 1808 | }; |
| 1809 | |
| 1810 | /** |
| 1811 | * wma_fill_beacon_interval_reset_req() - req to reset beacon interval |
| 1812 | * @wma: wma handle |
| 1813 | * @vdev_id: vdev id |
| 1814 | * @beacon_interval: beacon interval |
| 1815 | * @timeout: timeout val |
| 1816 | * |
| 1817 | * Return: status |
| 1818 | */ |
| 1819 | int wma_fill_beacon_interval_reset_req(tp_wma_handle wma, uint8_t vdev_id, |
| 1820 | uint16_t beacon_interval, uint32_t timeout); |
Yeshwanth Sriram Guntuka | d5aae7f | 2017-11-27 14:33:51 +0530 | [diff] [blame] | 1821 | /* |
| 1822 | * wma_is_vdev_valid() - check the vdev status |
| 1823 | * @vdev_id: vdev identifier |
| 1824 | * |
| 1825 | * This function verifies the vdev validity |
| 1826 | * |
| 1827 | * Return: 'true' on valid vdev else 'false' |
| 1828 | */ |
| 1829 | bool wma_is_vdev_valid(uint32_t vdev_id); |
Arif Hussain | ee10f90 | 2017-12-27 16:30:17 -0800 | [diff] [blame] | 1830 | |
| 1831 | /** |
| 1832 | * wma_vdev_obss_detection_info_handler - event handler to handle obss detection |
| 1833 | * @handle: the wma handle |
| 1834 | * @event: buffer with event |
| 1835 | * @len: buffer length |
| 1836 | * |
| 1837 | * This function receives obss detection info from firmware which is used to |
| 1838 | * decide obss protection. |
| 1839 | * |
| 1840 | * Return: 0 on success |
| 1841 | */ |
| 1842 | int wma_vdev_obss_detection_info_handler(void *handle, uint8_t *event, |
| 1843 | uint32_t len); |
Arif Hussain | 05fb487 | 2018-01-03 16:02:55 -0800 | [diff] [blame] | 1844 | |
| 1845 | /** |
| 1846 | * wma_vdev_bss_color_collision_info_handler - event handler to |
| 1847 | * handle obss color collision detection. |
| 1848 | * @handle: the wma handle |
| 1849 | * @event: buffer with event |
| 1850 | * @len: buffer length |
| 1851 | * |
| 1852 | * This function receives obss color collision detection info from firmware |
| 1853 | * which is used to select new bss color. |
| 1854 | * |
| 1855 | * Return: 0 on success |
| 1856 | */ |
| 1857 | int wma_vdev_bss_color_collision_info_handler(void *handle, |
| 1858 | uint8_t *event, |
| 1859 | uint32_t len); |
| 1860 | |
Kiran Kumar Lokere | 54819a3 | 2019-10-04 18:30:43 -0700 | [diff] [blame] | 1861 | #ifdef WLAN_SUPPORT_TWT |
| 1862 | /** |
| 1863 | * wma_twt_en_complete_event_handler - TWT enable complete event handler |
| 1864 | * @handle: wma handle |
| 1865 | * @event: buffer with event |
| 1866 | * @len: buffer length |
| 1867 | * |
| 1868 | * Return: 0 on success |
| 1869 | */ |
Varun Reddy Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 1870 | int wma_twt_en_complete_event_handler(void *handle, |
| 1871 | uint8_t *event, uint32_t len); |
Kiran Kumar Lokere | 54819a3 | 2019-10-04 18:30:43 -0700 | [diff] [blame] | 1872 | |
| 1873 | /** |
| 1874 | * wma_twt_disable_comp_event_handler- TWT disable complete event handler |
| 1875 | * @handle: wma handle |
| 1876 | * @event: buffer with event |
| 1877 | * @len: buffer length |
| 1878 | * |
| 1879 | * Return: 0 on success |
| 1880 | */ |
| 1881 | int wma_twt_disable_comp_event_handler(void *handle, uint8_t *event, |
| 1882 | uint32_t len); |
| 1883 | #else |
| 1884 | static inline int wma_twt_en_complete_event_handler(void *handle, |
| 1885 | uint8_t *event, |
| 1886 | uint32_t len) |
| 1887 | { |
| 1888 | return 0; |
| 1889 | } |
| 1890 | |
| 1891 | static inline int wma_twt_disable_comp_event_handler(void *handle, |
| 1892 | uint8_t *event, |
| 1893 | uint32_t len) |
| 1894 | { |
| 1895 | return 0; |
| 1896 | } |
| 1897 | #endif |
Abhishek Ambure | 6a2773e | 2019-10-14 15:15:42 +0530 | [diff] [blame] | 1898 | |
Rajeev Kumar Sirasanagandla | 4f20b67 | 2018-03-12 13:52:50 +0530 | [diff] [blame] | 1899 | /** |
| 1900 | * wma_get_roam_scan_stats() - Get roam scan stats request |
| 1901 | * @handle: wma handle |
| 1902 | * @req: request details |
| 1903 | * |
| 1904 | * Return: QDF_STATUS |
| 1905 | */ |
| 1906 | QDF_STATUS wma_get_roam_scan_stats(WMA_HANDLE handle, |
| 1907 | struct sir_roam_scan_stats *req); |
| 1908 | |
| 1909 | /** |
| 1910 | * wma_roam_scan_stats_event_handler() - roam scan stats event handler |
| 1911 | * @handle: wma handle |
| 1912 | * @event: event data |
| 1913 | * @len: length of data |
| 1914 | * |
| 1915 | * Return: Success or Failure status |
| 1916 | */ |
| 1917 | int wma_roam_scan_stats_event_handler(void *handle, uint8_t *event, |
| 1918 | uint32_t len); |
| 1919 | |
Abhishek Singh | caa6185 | 2018-09-12 15:50:04 +0530 | [diff] [blame] | 1920 | /** |
Abhishek Singh | fb5b4d3 | 2018-12-06 11:53:08 +0530 | [diff] [blame] | 1921 | * wma_send_vdev_down() - send del bss req to firmware |
Abhishek Singh | caa6185 | 2018-09-12 15:50:04 +0530 | [diff] [blame] | 1922 | * @wma: wma handle. |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 1923 | * @req: pointer to del bss response |
Abhishek Singh | caa6185 | 2018-09-12 15:50:04 +0530 | [diff] [blame] | 1924 | * |
| 1925 | * This function sends del bss resp to upper layer |
| 1926 | * |
| 1927 | * Return: none |
| 1928 | */ |
Abhishek Ambure | 968f151 | 2019-08-28 18:33:57 +0530 | [diff] [blame] | 1929 | void wma_send_vdev_down(tp_wma_handle wma, struct del_bss_resp *req); |
Abhishek Singh | caa6185 | 2018-09-12 15:50:04 +0530 | [diff] [blame] | 1930 | |
Yeshwanth Sriram Guntuka | fa9f379 | 2019-02-28 18:24:58 +0530 | [diff] [blame] | 1931 | /** |
| 1932 | * wma_cold_boot_cal_event_handler() - Cold boot cal event handler |
| 1933 | * @wma_ctx: wma handle |
| 1934 | * @event_buff: event data |
| 1935 | * @len: length of data |
| 1936 | * |
| 1937 | * Return: Success or Failure status |
| 1938 | */ |
| 1939 | int wma_cold_boot_cal_event_handler(void *wma_ctx, uint8_t *event_buff, |
| 1940 | uint32_t len); |
Srinivas Dasari | f4e1b12 | 2019-08-22 03:39:48 +0530 | [diff] [blame] | 1941 | |
Ashish Kumar Dhanotiya | d8d7dea | 2019-10-24 14:34:56 +0530 | [diff] [blame] | 1942 | #ifdef FEATURE_OEM_DATA |
| 1943 | /** |
| 1944 | * wma_oem_event_handler() - oem data event handler |
| 1945 | * @wma_ctx: wma handle |
| 1946 | * @event_buff: event data |
| 1947 | * @len: length of event buffer |
| 1948 | * |
| 1949 | * Return: Success or Failure status |
| 1950 | */ |
| 1951 | int wma_oem_event_handler(void *wma_ctx, uint8_t *event_buff, uint32_t len); |
| 1952 | #endif |
| 1953 | |
Srinivas Dasari | f4e1b12 | 2019-08-22 03:39:48 +0530 | [diff] [blame] | 1954 | /** |
| 1955 | * wma_set_roam_triggers() - Send roam trigger bitmap to WMI |
| 1956 | * @wma_handle: wma handle |
| 1957 | * @triggers: Carries vdev id and roam trigger bitmap. |
| 1958 | * |
| 1959 | * Return: Success or Failure status |
| 1960 | */ |
| 1961 | QDF_STATUS wma_set_roam_triggers(tp_wma_handle wma_handle, |
| 1962 | struct roam_triggers *triggers); |
Sourav Mohapatra | 2a67b0e | 2019-10-15 17:59:59 +0530 | [diff] [blame] | 1963 | |
| 1964 | /** |
| 1965 | * wma_get_ani_level_evt_handler - event handler to fetch ani level |
| 1966 | * @handle: the wma handle |
| 1967 | * @event_buf: buffer with event |
| 1968 | * @len: buffer length |
| 1969 | * |
| 1970 | * This function receives ani level from firmware and passes the event |
| 1971 | * to upper layer |
| 1972 | * |
| 1973 | * Return: 0 on success |
| 1974 | */ |
| 1975 | int wma_get_ani_level_evt_handler(void *handle, uint8_t *event_buf, |
| 1976 | uint32_t len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1977 | #endif |