Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
| 29 | * Host WMI unified implementation |
| 30 | */ |
| 31 | #include "athdefs.h" |
| 32 | #include "osapi_linux.h" |
| 33 | #include "a_types.h" |
| 34 | #include "a_debug.h" |
| 35 | #include "ol_if_athvar.h" |
| 36 | #include "ol_defines.h" |
| 37 | #include "ol_fw.h" |
| 38 | #include "htc_api.h" |
| 39 | #include "htc_api.h" |
| 40 | #include "dbglog_host.h" |
| 41 | #include "wmi.h" |
| 42 | #include "wmi_unified_priv.h" |
Govind Singh | 5eb5153 | 2016-03-09 11:34:12 +0530 | [diff] [blame] | 43 | #include "wmi_unified_param.h" |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 44 | |
| 45 | #define WMI_MIN_HEAD_ROOM 64 |
| 46 | |
| 47 | #ifdef WMI_INTERFACE_EVENT_LOGGING |
| 48 | /* WMI commands */ |
| 49 | uint32_t g_wmi_command_buf_idx = 0; |
| 50 | struct wmi_command_debug wmi_command_log_buffer[WMI_EVENT_DEBUG_MAX_ENTRY]; |
| 51 | |
| 52 | /* WMI commands TX completed */ |
| 53 | uint32_t g_wmi_command_tx_cmp_buf_idx = 0; |
| 54 | struct wmi_command_debug |
| 55 | wmi_command_tx_cmp_log_buffer[WMI_EVENT_DEBUG_MAX_ENTRY]; |
| 56 | |
| 57 | /* WMI events when processed */ |
| 58 | uint32_t g_wmi_event_buf_idx = 0; |
| 59 | struct wmi_event_debug wmi_event_log_buffer[WMI_EVENT_DEBUG_MAX_ENTRY]; |
| 60 | |
| 61 | /* WMI events when queued */ |
| 62 | uint32_t g_wmi_rx_event_buf_idx = 0; |
| 63 | struct wmi_event_debug wmi_rx_event_log_buffer[WMI_EVENT_DEBUG_MAX_ENTRY]; |
| 64 | |
| 65 | #define WMI_COMMAND_RECORD(a, b) { \ |
| 66 | if (WMI_EVENT_DEBUG_MAX_ENTRY <= g_wmi_command_buf_idx) \ |
| 67 | g_wmi_command_buf_idx = 0; \ |
| 68 | wmi_command_log_buffer[g_wmi_command_buf_idx].command = a; \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 69 | qdf_mem_copy(wmi_command_log_buffer[g_wmi_command_buf_idx].data, b, 16); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 70 | wmi_command_log_buffer[g_wmi_command_buf_idx].time = \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 71 | qdf_get_log_timestamp(); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 72 | g_wmi_command_buf_idx++; \ |
| 73 | } |
| 74 | |
| 75 | #define WMI_COMMAND_TX_CMP_RECORD(a, b) { \ |
| 76 | if (WMI_EVENT_DEBUG_MAX_ENTRY <= g_wmi_command_tx_cmp_buf_idx) \ |
| 77 | g_wmi_command_tx_cmp_buf_idx = 0; \ |
| 78 | wmi_command_tx_cmp_log_buffer[g_wmi_command_tx_cmp_buf_idx].command = a; \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 79 | qdf_mem_copy(wmi_command_tx_cmp_log_buffer \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 80 | [g_wmi_command_tx_cmp_buf_idx].data, b, 16); \ |
| 81 | wmi_command_tx_cmp_log_buffer[g_wmi_command_tx_cmp_buf_idx].time = \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 82 | qdf_get_log_timestamp(); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 83 | g_wmi_command_tx_cmp_buf_idx++; \ |
| 84 | } |
| 85 | |
| 86 | #define WMI_EVENT_RECORD(a, b) { \ |
| 87 | if (WMI_EVENT_DEBUG_MAX_ENTRY <= g_wmi_event_buf_idx) \ |
| 88 | g_wmi_event_buf_idx = 0; \ |
| 89 | wmi_event_log_buffer[g_wmi_event_buf_idx].event = a; \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 90 | qdf_mem_copy(wmi_event_log_buffer[g_wmi_event_buf_idx].data, b, 16); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 91 | wmi_event_log_buffer[g_wmi_event_buf_idx].time = \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 92 | qdf_get_log_timestamp(); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 93 | g_wmi_event_buf_idx++; \ |
| 94 | } |
| 95 | |
| 96 | #define WMI_RX_EVENT_RECORD(a, b) { \ |
| 97 | if (WMI_EVENT_DEBUG_MAX_ENTRY <= g_wmi_rx_event_buf_idx) \ |
| 98 | g_wmi_rx_event_buf_idx = 0; \ |
| 99 | wmi_rx_event_log_buffer[g_wmi_rx_event_buf_idx].event = a; \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 100 | qdf_mem_copy(wmi_rx_event_log_buffer[g_wmi_rx_event_buf_idx].data, b, 16); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 101 | wmi_rx_event_log_buffer[g_wmi_rx_event_buf_idx].time = \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 102 | qdf_get_log_timestamp(); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 103 | g_wmi_rx_event_buf_idx++; \ |
| 104 | } |
| 105 | /* wmi_mgmt commands */ |
| 106 | #define WMI_MGMT_EVENT_DEBUG_MAX_ENTRY (256) |
| 107 | |
| 108 | uint32_t g_wmi_mgmt_command_buf_idx = 0; |
| 109 | struct |
| 110 | wmi_command_debug wmi_mgmt_command_log_buffer[WMI_MGMT_EVENT_DEBUG_MAX_ENTRY]; |
| 111 | |
| 112 | /* wmi_mgmt commands TX completed */ |
| 113 | uint32_t g_wmi_mgmt_command_tx_cmp_buf_idx = 0; |
| 114 | struct wmi_command_debug |
| 115 | wmi_mgmt_command_tx_cmp_log_buffer[WMI_MGMT_EVENT_DEBUG_MAX_ENTRY]; |
| 116 | |
| 117 | /* wmi_mgmt events when processed */ |
| 118 | uint32_t g_wmi_mgmt_event_buf_idx = 0; |
| 119 | struct wmi_event_debug |
| 120 | wmi_mgmt_event_log_buffer[WMI_MGMT_EVENT_DEBUG_MAX_ENTRY]; |
| 121 | |
| 122 | #define WMI_MGMT_COMMAND_RECORD(a, b) { \ |
| 123 | if (WMI_MGMT_EVENT_DEBUG_MAX_ENTRY <= \ |
| 124 | g_wmi_mgmt_command_buf_idx) \ |
| 125 | g_wmi_mgmt_command_buf_idx = 0; \ |
| 126 | wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].command = a; \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 127 | qdf_mem_copy( \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 128 | wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].data,\ |
| 129 | b, 16); \ |
| 130 | wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].time = \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 131 | qdf_get_log_timestamp(); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 132 | g_wmi_mgmt_command_buf_idx++; \ |
| 133 | } |
| 134 | |
| 135 | #define WMI_MGMT_COMMAND_TX_CMP_RECORD(a, b) { \ |
| 136 | if (WMI_MGMT_EVENT_DEBUG_MAX_ENTRY <= \ |
| 137 | g_wmi_mgmt_command_tx_cmp_buf_idx) \ |
| 138 | g_wmi_mgmt_command_tx_cmp_buf_idx = 0; \ |
| 139 | wmi_mgmt_command_tx_cmp_log_buffer[g_wmi_mgmt_command_tx_cmp_buf_idx].\ |
| 140 | command = a; \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 141 | qdf_mem_copy(wmi_mgmt_command_tx_cmp_log_buffer \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 142 | [g_wmi_mgmt_command_tx_cmp_buf_idx].data, b, 16); \ |
| 143 | wmi_mgmt_command_tx_cmp_log_buffer[g_wmi_mgmt_command_tx_cmp_buf_idx].\ |
| 144 | time =\ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 145 | qdf_get_log_timestamp(); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 146 | g_wmi_mgmt_command_tx_cmp_buf_idx++; \ |
| 147 | } |
| 148 | |
| 149 | #define WMI_MGMT_EVENT_RECORD(a, b) { \ |
| 150 | if (WMI_MGMT_EVENT_DEBUG_MAX_ENTRY <= g_wmi_mgmt_event_buf_idx) \ |
| 151 | g_wmi_mgmt_event_buf_idx = 0; \ |
| 152 | wmi_mgmt_event_log_buffer[g_wmi_mgmt_event_buf_idx].event = a; \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 153 | qdf_mem_copy(wmi_mgmt_event_log_buffer[g_wmi_mgmt_event_buf_idx].data,\ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 154 | b, 16); \ |
| 155 | wmi_mgmt_event_log_buffer[g_wmi_mgmt_event_buf_idx].time = \ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 156 | qdf_get_log_timestamp(); \ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 157 | g_wmi_mgmt_event_buf_idx++; \ |
| 158 | } |
| 159 | |
| 160 | #endif /*WMI_INTERFACE_EVENT_LOGGING */ |
| 161 | |
| 162 | static void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf); |
| 163 | int wmi_get_host_credits(wmi_unified_t wmi_handle); |
| 164 | /* WMI buffer APIs */ |
| 165 | |
| 166 | #ifdef MEMORY_DEBUG |
| 167 | wmi_buf_t |
| 168 | wmi_buf_alloc_debug(wmi_unified_t wmi_handle, uint16_t len, uint8_t *file_name, |
| 169 | uint32_t line_num) |
| 170 | { |
| 171 | wmi_buf_t wmi_buf; |
| 172 | |
| 173 | if (roundup(len + WMI_MIN_HEAD_ROOM, 4) > wmi_handle->max_msg_len) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 174 | QDF_ASSERT(0); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 175 | return NULL; |
| 176 | } |
| 177 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 178 | wmi_buf = qdf_nbuf_alloc_debug(NULL, |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 179 | roundup(len + WMI_MIN_HEAD_ROOM, 4), |
| 180 | WMI_MIN_HEAD_ROOM, 4, false, file_name, |
| 181 | line_num); |
| 182 | |
| 183 | if (!wmi_buf) |
| 184 | return NULL; |
| 185 | |
| 186 | /* Clear the wmi buffer */ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 187 | OS_MEMZERO(qdf_nbuf_data(wmi_buf), len); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 188 | |
| 189 | /* |
| 190 | * Set the length of the buffer to match the allocation size. |
| 191 | */ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 192 | qdf_nbuf_set_pktlen(wmi_buf, len); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 193 | |
| 194 | return wmi_buf; |
| 195 | } |
| 196 | |
| 197 | void wmi_buf_free(wmi_buf_t net_buf) |
| 198 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 199 | qdf_nbuf_free(net_buf); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 200 | } |
| 201 | #else |
| 202 | wmi_buf_t wmi_buf_alloc(wmi_unified_t wmi_handle, uint16_t len) |
| 203 | { |
| 204 | wmi_buf_t wmi_buf; |
| 205 | |
| 206 | if (roundup(len + WMI_MIN_HEAD_ROOM, 4) > wmi_handle->max_msg_len) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 207 | QDF_ASSERT(0); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 208 | return NULL; |
| 209 | } |
| 210 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 211 | wmi_buf = qdf_nbuf_alloc(NULL, roundup(len + WMI_MIN_HEAD_ROOM, 4), |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 212 | WMI_MIN_HEAD_ROOM, 4, false); |
| 213 | if (!wmi_buf) |
| 214 | return NULL; |
| 215 | |
| 216 | /* Clear the wmi buffer */ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 217 | OS_MEMZERO(qdf_nbuf_data(wmi_buf), len); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 218 | |
| 219 | /* |
| 220 | * Set the length of the buffer to match the allocation size. |
| 221 | */ |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 222 | qdf_nbuf_set_pktlen(wmi_buf, len); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 223 | return wmi_buf; |
| 224 | } |
| 225 | |
| 226 | void wmi_buf_free(wmi_buf_t net_buf) |
| 227 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 228 | qdf_nbuf_free(net_buf); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 229 | } |
| 230 | #endif |
| 231 | |
| 232 | /** |
| 233 | * wmi_get_max_msg_len() - get maximum WMI message length |
| 234 | * @wmi_handle: WMI handle. |
| 235 | * |
| 236 | * This function returns the maximum WMI message length |
| 237 | * |
| 238 | * Return: maximum WMI message length |
| 239 | */ |
| 240 | uint16_t wmi_get_max_msg_len(wmi_unified_t wmi_handle) |
| 241 | { |
| 242 | return wmi_handle->max_msg_len - WMI_MIN_HEAD_ROOM; |
| 243 | } |
| 244 | |
| 245 | static uint8_t *get_wmi_cmd_string(WMI_CMD_ID wmi_command) |
| 246 | { |
| 247 | switch (wmi_command) { |
| 248 | /* initialize the wlan sub system */ |
| 249 | CASE_RETURN_STRING(WMI_INIT_CMDID); |
| 250 | |
| 251 | /* Scan specific commands */ |
| 252 | |
| 253 | /* start scan request to FW */ |
| 254 | CASE_RETURN_STRING(WMI_START_SCAN_CMDID); |
| 255 | /* stop scan request to FW */ |
| 256 | CASE_RETURN_STRING(WMI_STOP_SCAN_CMDID); |
| 257 | /* full list of channels as defined by the regulatory |
| 258 | * that will be used by scanner */ |
| 259 | CASE_RETURN_STRING(WMI_SCAN_CHAN_LIST_CMDID); |
| 260 | /* overwrite default priority table in scan scheduler */ |
| 261 | CASE_RETURN_STRING(WMI_SCAN_SCH_PRIO_TBL_CMDID); |
| 262 | /* This command to adjust the priority and min.max_rest_time |
| 263 | * of an on ongoing scan request. |
| 264 | */ |
| 265 | CASE_RETURN_STRING(WMI_SCAN_UPDATE_REQUEST_CMDID); |
| 266 | |
| 267 | /* PDEV(physical device) specific commands */ |
| 268 | /* set regulatorty ctl id used by FW to determine the exact |
| 269 | * ctl power limits */ |
| 270 | CASE_RETURN_STRING(WMI_PDEV_SET_REGDOMAIN_CMDID); |
| 271 | /* set channel. mainly used for supporting monitor mode */ |
| 272 | CASE_RETURN_STRING(WMI_PDEV_SET_CHANNEL_CMDID); |
| 273 | /* set pdev specific parameters */ |
| 274 | CASE_RETURN_STRING(WMI_PDEV_SET_PARAM_CMDID); |
| 275 | /* enable packet log */ |
| 276 | CASE_RETURN_STRING(WMI_PDEV_PKTLOG_ENABLE_CMDID); |
| 277 | /* disable packet log*/ |
| 278 | CASE_RETURN_STRING(WMI_PDEV_PKTLOG_DISABLE_CMDID); |
| 279 | /* set wmm parameters */ |
| 280 | CASE_RETURN_STRING(WMI_PDEV_SET_WMM_PARAMS_CMDID); |
| 281 | /* set HT cap ie that needs to be carried probe requests |
| 282 | * HT/VHT channels */ |
| 283 | CASE_RETURN_STRING(WMI_PDEV_SET_HT_CAP_IE_CMDID); |
| 284 | /* set VHT cap ie that needs to be carried on probe |
| 285 | * requests on VHT channels */ |
| 286 | CASE_RETURN_STRING(WMI_PDEV_SET_VHT_CAP_IE_CMDID); |
| 287 | |
| 288 | /* Command to send the DSCP-to-TID map to the target */ |
| 289 | CASE_RETURN_STRING(WMI_PDEV_SET_DSCP_TID_MAP_CMDID); |
| 290 | /* set quiet ie parameters. primarily used in AP mode */ |
| 291 | CASE_RETURN_STRING(WMI_PDEV_SET_QUIET_MODE_CMDID); |
| 292 | /* Enable/Disable Green AP Power Save */ |
| 293 | CASE_RETURN_STRING(WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID); |
| 294 | /* get TPC config for the current operating channel */ |
| 295 | CASE_RETURN_STRING(WMI_PDEV_GET_TPC_CONFIG_CMDID); |
| 296 | |
| 297 | /* set the base MAC address for the physical device before |
| 298 | * a VDEV is created. For firmware that does not support |
| 299 | * this feature and this command, the pdev MAC address will |
| 300 | * not be changed. */ |
| 301 | CASE_RETURN_STRING(WMI_PDEV_SET_BASE_MACADDR_CMDID); |
| 302 | |
| 303 | /* eeprom content dump , the same to bdboard data */ |
| 304 | CASE_RETURN_STRING(WMI_PDEV_DUMP_CMDID); |
| 305 | |
| 306 | /* VDEV(virtual device) specific commands */ |
| 307 | /* vdev create */ |
| 308 | CASE_RETURN_STRING(WMI_VDEV_CREATE_CMDID); |
| 309 | /* vdev delete */ |
| 310 | CASE_RETURN_STRING(WMI_VDEV_DELETE_CMDID); |
| 311 | /* vdev start request */ |
| 312 | CASE_RETURN_STRING(WMI_VDEV_START_REQUEST_CMDID); |
| 313 | /* vdev restart request (RX only, NO TX, used for CAC period)*/ |
| 314 | CASE_RETURN_STRING(WMI_VDEV_RESTART_REQUEST_CMDID); |
| 315 | /* vdev up request */ |
| 316 | CASE_RETURN_STRING(WMI_VDEV_UP_CMDID); |
| 317 | /* vdev stop request */ |
| 318 | CASE_RETURN_STRING(WMI_VDEV_STOP_CMDID); |
| 319 | /* vdev down request */ |
| 320 | CASE_RETURN_STRING(WMI_VDEV_DOWN_CMDID); |
| 321 | /* set a vdev param */ |
| 322 | CASE_RETURN_STRING(WMI_VDEV_SET_PARAM_CMDID); |
| 323 | /* set a key (used for setting per peer unicast |
| 324 | * and per vdev multicast) */ |
| 325 | CASE_RETURN_STRING(WMI_VDEV_INSTALL_KEY_CMDID); |
| 326 | |
| 327 | /* wnm sleep mode command */ |
| 328 | CASE_RETURN_STRING(WMI_VDEV_WNM_SLEEPMODE_CMDID); |
| 329 | CASE_RETURN_STRING(WMI_VDEV_WMM_ADDTS_CMDID); |
| 330 | CASE_RETURN_STRING(WMI_VDEV_WMM_DELTS_CMDID); |
| 331 | CASE_RETURN_STRING(WMI_VDEV_SET_WMM_PARAMS_CMDID); |
| 332 | CASE_RETURN_STRING(WMI_VDEV_SET_GTX_PARAMS_CMDID); |
| 333 | CASE_RETURN_STRING(WMI_VDEV_IPSEC_NATKEEPALIVE_FILTER_CMDID); |
| 334 | |
| 335 | CASE_RETURN_STRING(WMI_VDEV_PLMREQ_START_CMDID); |
| 336 | CASE_RETURN_STRING(WMI_VDEV_PLMREQ_STOP_CMDID); |
| 337 | CASE_RETURN_STRING(WMI_VDEV_TSF_TSTAMP_ACTION_CMDID); |
| 338 | CASE_RETURN_STRING(WMI_VDEV_SET_IE_CMDID); |
| 339 | |
| 340 | /* peer specific commands */ |
| 341 | |
| 342 | /** create a peer */ |
| 343 | CASE_RETURN_STRING(WMI_PEER_CREATE_CMDID); |
| 344 | /** delete a peer */ |
| 345 | CASE_RETURN_STRING(WMI_PEER_DELETE_CMDID); |
| 346 | /** flush specific tid queues of a peer */ |
| 347 | CASE_RETURN_STRING(WMI_PEER_FLUSH_TIDS_CMDID); |
| 348 | /** set a parameter of a peer */ |
| 349 | CASE_RETURN_STRING(WMI_PEER_SET_PARAM_CMDID); |
| 350 | /* set peer to associated state. will cary all parameters |
| 351 | * determined during assocication time */ |
| 352 | CASE_RETURN_STRING(WMI_PEER_ASSOC_CMDID); |
| 353 | /* add a wds (4 address ) entry. used only for testing |
| 354 | * WDS feature on AP products */ |
| 355 | CASE_RETURN_STRING(WMI_PEER_ADD_WDS_ENTRY_CMDID); |
| 356 | /* remove wds (4 address ) entry. used only for testing WDS |
| 357 | * feature on AP products */ |
| 358 | CASE_RETURN_STRING(WMI_PEER_REMOVE_WDS_ENTRY_CMDID); |
| 359 | /* set up mcast info for multicast to unicast conversion */ |
| 360 | CASE_RETURN_STRING(WMI_PEER_MCAST_GROUP_CMDID); |
| 361 | /* request peer info from FW to get PEER_INFO_EVENTID */ |
| 362 | CASE_RETURN_STRING(WMI_PEER_INFO_REQ_CMDID); |
| 363 | |
| 364 | /* beacon/management specific commands */ |
| 365 | |
| 366 | /* transmit beacon by reference. used for transmitting beacon |
| 367 | * on low latency interface like pcie */ |
| 368 | CASE_RETURN_STRING(WMI_BCN_TX_CMDID); |
| 369 | /* transmit beacon by value */ |
| 370 | CASE_RETURN_STRING(WMI_PDEV_SEND_BCN_CMDID); |
| 371 | /* set the beacon template. used in beacon offload mode to setup |
| 372 | * the common beacon template with the FW to be used by FW to |
| 373 | * generate beacons */ |
| 374 | CASE_RETURN_STRING(WMI_BCN_TMPL_CMDID); |
| 375 | /* set beacon filter with FW */ |
| 376 | CASE_RETURN_STRING(WMI_BCN_FILTER_RX_CMDID); |
| 377 | /* enable/disable filtering of probe requests in the firmware */ |
| 378 | CASE_RETURN_STRING(WMI_PRB_REQ_FILTER_RX_CMDID); |
| 379 | /* transmit management frame by value. will be deprecated */ |
| 380 | CASE_RETURN_STRING(WMI_MGMT_TX_CMDID); |
| 381 | /* set the probe response template. used in beacon offload mode |
| 382 | * to setup the common probe response template with the FW to |
| 383 | * be used by FW to generate probe responses */ |
| 384 | CASE_RETURN_STRING(WMI_PRB_TMPL_CMDID); |
| 385 | |
| 386 | /* commands to directly control ba negotiation directly from |
| 387 | * host. only used in test mode */ |
| 388 | |
| 389 | /* turn off FW Auto addba mode and let host control addba */ |
| 390 | CASE_RETURN_STRING(WMI_ADDBA_CLEAR_RESP_CMDID); |
| 391 | /* send add ba request */ |
| 392 | CASE_RETURN_STRING(WMI_ADDBA_SEND_CMDID); |
| 393 | CASE_RETURN_STRING(WMI_ADDBA_STATUS_CMDID); |
| 394 | /* send del ba */ |
| 395 | CASE_RETURN_STRING(WMI_DELBA_SEND_CMDID); |
| 396 | /* set add ba response will be used by FW to generate |
| 397 | * addba response*/ |
| 398 | CASE_RETURN_STRING(WMI_ADDBA_SET_RESP_CMDID); |
| 399 | /* send single VHT MPDU with AMSDU */ |
| 400 | CASE_RETURN_STRING(WMI_SEND_SINGLEAMSDU_CMDID); |
| 401 | |
| 402 | /* Station power save specific config */ |
| 403 | /* enable/disable station powersave */ |
| 404 | CASE_RETURN_STRING(WMI_STA_POWERSAVE_MODE_CMDID); |
| 405 | /* set station power save specific parameter */ |
| 406 | CASE_RETURN_STRING(WMI_STA_POWERSAVE_PARAM_CMDID); |
| 407 | /* set station mimo powersave mode */ |
| 408 | CASE_RETURN_STRING(WMI_STA_MIMO_PS_MODE_CMDID); |
| 409 | |
| 410 | /* DFS-specific commands */ |
| 411 | /* enable DFS (radar detection)*/ |
| 412 | CASE_RETURN_STRING(WMI_PDEV_DFS_ENABLE_CMDID); |
| 413 | /* disable DFS (radar detection)*/ |
| 414 | CASE_RETURN_STRING(WMI_PDEV_DFS_DISABLE_CMDID); |
| 415 | /* enable DFS phyerr/parse filter offload */ |
| 416 | CASE_RETURN_STRING(WMI_DFS_PHYERR_FILTER_ENA_CMDID); |
| 417 | /* enable DFS phyerr/parse filter offload */ |
| 418 | CASE_RETURN_STRING(WMI_DFS_PHYERR_FILTER_DIS_CMDID); |
| 419 | |
| 420 | /* Roaming specific commands */ |
| 421 | /* set roam scan mode */ |
| 422 | CASE_RETURN_STRING(WMI_ROAM_SCAN_MODE); |
| 423 | /* set roam scan rssi threshold below which roam |
| 424 | * scan is enabled */ |
| 425 | CASE_RETURN_STRING(WMI_ROAM_SCAN_RSSI_THRESHOLD); |
| 426 | /* set roam scan period for periodic roam scan mode */ |
| 427 | CASE_RETURN_STRING(WMI_ROAM_SCAN_PERIOD); |
| 428 | /* set roam scan trigger rssi change threshold */ |
| 429 | CASE_RETURN_STRING(WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD); |
| 430 | /* set roam AP profile */ |
| 431 | CASE_RETURN_STRING(WMI_ROAM_AP_PROFILE); |
| 432 | /* set channel list for roam scans */ |
| 433 | CASE_RETURN_STRING(WMI_ROAM_CHAN_LIST); |
| 434 | /* offload scan specific commands */ |
| 435 | /* set offload scan AP profile */ |
| 436 | CASE_RETURN_STRING(WMI_OFL_SCAN_ADD_AP_PROFILE); |
| 437 | /* remove offload scan AP profile */ |
| 438 | CASE_RETURN_STRING(WMI_OFL_SCAN_REMOVE_AP_PROFILE); |
| 439 | /* set offload scan period */ |
| 440 | CASE_RETURN_STRING(WMI_OFL_SCAN_PERIOD); |
| 441 | |
| 442 | /* P2P specific commands */ |
| 443 | /* set P2P device info. FW will used by FW to create P2P IE |
| 444 | * to be carried in probe response generated during p2p listen |
| 445 | * and for p2p discoverability */ |
| 446 | CASE_RETURN_STRING(WMI_P2P_DEV_SET_DEVICE_INFO); |
| 447 | /* enable/disable p2p discoverability on STA/AP VDEVs */ |
| 448 | CASE_RETURN_STRING(WMI_P2P_DEV_SET_DISCOVERABILITY); |
| 449 | /* set p2p ie to be carried in beacons generated by FW for GO */ |
| 450 | CASE_RETURN_STRING(WMI_P2P_GO_SET_BEACON_IE); |
| 451 | /* set p2p ie to be carried in probe response frames generated |
| 452 | * by FW for GO */ |
| 453 | CASE_RETURN_STRING(WMI_P2P_GO_SET_PROBE_RESP_IE); |
| 454 | /* set the vendor specific p2p ie data. |
| 455 | * FW will use this to parse the P2P NoA |
| 456 | * attribute in the beacons/probe responses received. |
| 457 | */ |
| 458 | CASE_RETURN_STRING(WMI_P2P_SET_VENDOR_IE_DATA_CMDID); |
| 459 | /* set the configure of p2p find offload */ |
| 460 | CASE_RETURN_STRING(WMI_P2P_DISC_OFFLOAD_CONFIG_CMDID); |
| 461 | /* set the vendor specific p2p ie data for p2p find offload */ |
| 462 | CASE_RETURN_STRING(WMI_P2P_DISC_OFFLOAD_APPIE_CMDID); |
| 463 | /* set the BSSID/device name pattern of p2p find offload */ |
| 464 | CASE_RETURN_STRING(WMI_P2P_DISC_OFFLOAD_PATTERN_CMDID); |
| 465 | /* set OppPS related parameters **/ |
| 466 | CASE_RETURN_STRING(WMI_P2P_SET_OPPPS_PARAM_CMDID); |
| 467 | |
| 468 | /* AP power save specific config |
| 469 | * set AP power save specific param */ |
| 470 | CASE_RETURN_STRING(WMI_AP_PS_PEER_PARAM_CMDID); |
| 471 | /* set AP UAPSD coex pecific param */ |
| 472 | CASE_RETURN_STRING(WMI_AP_PS_PEER_UAPSD_COEX_CMDID); |
| 473 | |
| 474 | /* Rate-control specific commands */ |
| 475 | CASE_RETURN_STRING(WMI_PEER_RATE_RETRY_SCHED_CMDID); |
| 476 | |
| 477 | /* WLAN Profiling commands. */ |
| 478 | CASE_RETURN_STRING(WMI_WLAN_PROFILE_TRIGGER_CMDID); |
| 479 | CASE_RETURN_STRING(WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID); |
| 480 | CASE_RETURN_STRING(WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID); |
| 481 | CASE_RETURN_STRING(WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID); |
| 482 | CASE_RETURN_STRING(WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID); |
| 483 | |
| 484 | /* Suspend resume command Ids */ |
| 485 | CASE_RETURN_STRING(WMI_PDEV_SUSPEND_CMDID); |
| 486 | CASE_RETURN_STRING(WMI_PDEV_RESUME_CMDID); |
| 487 | |
| 488 | /* Beacon filter commands */ |
| 489 | /* add a beacon filter */ |
| 490 | CASE_RETURN_STRING(WMI_ADD_BCN_FILTER_CMDID); |
| 491 | /* remove a beacon filter */ |
| 492 | CASE_RETURN_STRING(WMI_RMV_BCN_FILTER_CMDID); |
| 493 | |
| 494 | /* WOW Specific WMI commands */ |
| 495 | /* add pattern for awake */ |
| 496 | CASE_RETURN_STRING(WMI_WOW_ADD_WAKE_PATTERN_CMDID); |
| 497 | /* deleta a wake pattern */ |
| 498 | CASE_RETURN_STRING(WMI_WOW_DEL_WAKE_PATTERN_CMDID); |
| 499 | /* enable/deisable wake event */ |
| 500 | CASE_RETURN_STRING(WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID); |
| 501 | /* enable WOW */ |
| 502 | CASE_RETURN_STRING(WMI_WOW_ENABLE_CMDID); |
| 503 | /* host woke up from sleep event to FW. Generated in response |
| 504 | * to WOW Hardware event */ |
| 505 | CASE_RETURN_STRING(WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID); |
| 506 | |
| 507 | /* RTT measurement related cmd */ |
| 508 | /* reques to make an RTT measurement */ |
| 509 | CASE_RETURN_STRING(WMI_RTT_MEASREQ_CMDID); |
| 510 | /* reques to report a tsf measurement */ |
| 511 | CASE_RETURN_STRING(WMI_RTT_TSF_CMDID); |
| 512 | |
| 513 | /* spectral scan command */ |
| 514 | /* configure spectral scan */ |
| 515 | CASE_RETURN_STRING(WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID); |
| 516 | /* enable/disable spectral scan and trigger */ |
| 517 | CASE_RETURN_STRING(WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID); |
| 518 | |
| 519 | /* F/W stats */ |
| 520 | /* one time request for stats */ |
| 521 | CASE_RETURN_STRING(WMI_REQUEST_STATS_CMDID); |
| 522 | /* Push MCC Adaptive Scheduler Stats to Firmware */ |
| 523 | CASE_RETURN_STRING(WMI_MCC_SCHED_TRAFFIC_STATS_CMDID); |
| 524 | |
| 525 | /* ARP OFFLOAD REQUEST*/ |
| 526 | CASE_RETURN_STRING(WMI_SET_ARP_NS_OFFLOAD_CMDID); |
| 527 | |
| 528 | /* Proactive ARP Response Add Pattern Command*/ |
| 529 | CASE_RETURN_STRING(WMI_ADD_PROACTIVE_ARP_RSP_PATTERN_CMDID); |
| 530 | |
| 531 | /* Proactive ARP Response Del Pattern Command*/ |
| 532 | CASE_RETURN_STRING(WMI_DEL_PROACTIVE_ARP_RSP_PATTERN_CMDID); |
| 533 | |
| 534 | /* NS offload confid*/ |
| 535 | CASE_RETURN_STRING(WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID); |
| 536 | |
| 537 | /* GTK offload Specific WMI commands */ |
| 538 | CASE_RETURN_STRING(WMI_GTK_OFFLOAD_CMDID); |
| 539 | |
| 540 | /* CSA offload Specific WMI commands */ |
| 541 | /* csa offload enable */ |
| 542 | CASE_RETURN_STRING(WMI_CSA_OFFLOAD_ENABLE_CMDID); |
| 543 | /* chan switch command */ |
| 544 | CASE_RETURN_STRING(WMI_CSA_OFFLOAD_CHANSWITCH_CMDID); |
| 545 | |
| 546 | /* Chatter commands */ |
| 547 | /* Change chatter mode of operation */ |
| 548 | CASE_RETURN_STRING(WMI_CHATTER_SET_MODE_CMDID); |
| 549 | /* chatter add coalescing filter command */ |
| 550 | CASE_RETURN_STRING(WMI_CHATTER_ADD_COALESCING_FILTER_CMDID); |
| 551 | /* chatter delete coalescing filter command */ |
| 552 | CASE_RETURN_STRING(WMI_CHATTER_DELETE_COALESCING_FILTER_CMDID); |
| 553 | /* chatter coalecing query command */ |
| 554 | CASE_RETURN_STRING(WMI_CHATTER_COALESCING_QUERY_CMDID); |
| 555 | |
| 556 | /* addba specific commands */ |
| 557 | /* start the aggregation on this TID */ |
| 558 | CASE_RETURN_STRING(WMI_PEER_TID_ADDBA_CMDID); |
| 559 | /* stop the aggregation on this TID */ |
| 560 | CASE_RETURN_STRING(WMI_PEER_TID_DELBA_CMDID); |
| 561 | |
| 562 | /* set station mimo powersave method */ |
| 563 | CASE_RETURN_STRING(WMI_STA_DTIM_PS_METHOD_CMDID); |
| 564 | /* Configure the Station UAPSD AC Auto Trigger Parameters */ |
| 565 | CASE_RETURN_STRING(WMI_STA_UAPSD_AUTO_TRIG_CMDID); |
| 566 | /* Configure the Keep Alive Parameters */ |
| 567 | CASE_RETURN_STRING(WMI_STA_KEEPALIVE_CMDID); |
| 568 | |
| 569 | /* Request ssn from target for a sta/tid pair */ |
| 570 | CASE_RETURN_STRING(WMI_BA_REQ_SSN_CMDID); |
| 571 | /* misc command group */ |
| 572 | /* echo command mainly used for testing */ |
| 573 | CASE_RETURN_STRING(WMI_ECHO_CMDID); |
| 574 | |
| 575 | /* !!IMPORTANT!! |
| 576 | * If you need to add a new WMI command to the CASE_RETURN_STRING(WMI_GRP_MISC sub-group, |
| 577 | * please make sure you add it BEHIND CASE_RETURN_STRING(WMI_PDEV_UTF_CMDID); |
| 578 | * as we MUST have a fixed value here to maintain compatibility between |
| 579 | * UTF and the ART2 driver |
| 580 | */ |
| 581 | /** UTF WMI commands */ |
| 582 | CASE_RETURN_STRING(WMI_PDEV_UTF_CMDID); |
| 583 | |
| 584 | /** set debug log config */ |
| 585 | CASE_RETURN_STRING(WMI_DBGLOG_CFG_CMDID); |
| 586 | /* QVIT specific command id */ |
| 587 | CASE_RETURN_STRING(WMI_PDEV_QVIT_CMDID); |
| 588 | /* Factory Testing Mode request command |
| 589 | * used for integrated chipsets */ |
| 590 | CASE_RETURN_STRING(WMI_PDEV_FTM_INTG_CMDID); |
| 591 | /* set and get keepalive parameters command */ |
| 592 | CASE_RETURN_STRING(WMI_VDEV_SET_KEEPALIVE_CMDID); |
| 593 | CASE_RETURN_STRING(WMI_VDEV_GET_KEEPALIVE_CMDID); |
| 594 | /* For fw recovery test command */ |
| 595 | CASE_RETURN_STRING(WMI_FORCE_FW_HANG_CMDID); |
| 596 | /* Set Mcast/Bdcast filter */ |
| 597 | CASE_RETURN_STRING(WMI_SET_MCASTBCAST_FILTER_CMDID); |
| 598 | /* set thermal management params */ |
| 599 | CASE_RETURN_STRING(WMI_THERMAL_MGMT_CMDID); |
| 600 | CASE_RETURN_STRING(WMI_RSSI_BREACH_MONITOR_CONFIG_CMDID); |
| 601 | CASE_RETURN_STRING(WMI_LRO_CONFIG_CMDID); |
| 602 | CASE_RETURN_STRING(WMI_TRANSFER_DATA_TO_FLASH_CMDID); |
Sreelakshmi Konamki | 57a2c04 | 2016-04-14 18:04:17 +0530 | [diff] [blame] | 603 | CASE_RETURN_STRING(WMI_CONFIG_ENHANCED_MCAST_FILTER_CMDID); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 604 | CASE_RETURN_STRING(WMI_MAWC_SENSOR_REPORT_IND_CMDID); |
| 605 | CASE_RETURN_STRING(WMI_ROAM_CONFIGURE_MAWC_CMDID); |
| 606 | CASE_RETURN_STRING(WMI_NLO_CONFIGURE_MAWC_CMDID); |
| 607 | CASE_RETURN_STRING(WMI_EXTSCAN_CONFIGURE_MAWC_CMDID); |
| 608 | /* GPIO Configuration */ |
| 609 | CASE_RETURN_STRING(WMI_GPIO_CONFIG_CMDID); |
| 610 | CASE_RETURN_STRING(WMI_GPIO_OUTPUT_CMDID); |
| 611 | |
| 612 | /* Txbf configuration command */ |
| 613 | CASE_RETURN_STRING(WMI_TXBF_CMDID); |
| 614 | |
| 615 | /* FWTEST Commands */ |
| 616 | CASE_RETURN_STRING(WMI_FWTEST_VDEV_MCC_SET_TBTT_MODE_CMDID); |
| 617 | /* set NoA descs */ |
| 618 | CASE_RETURN_STRING(WMI_FWTEST_P2P_SET_NOA_PARAM_CMDID); |
| 619 | |
| 620 | /* TDLS Configuration */ |
| 621 | /* enable/disable TDLS */ |
| 622 | CASE_RETURN_STRING(WMI_TDLS_SET_STATE_CMDID); |
| 623 | /* set tdls peer state */ |
| 624 | CASE_RETURN_STRING(WMI_TDLS_PEER_UPDATE_CMDID); |
| 625 | |
| 626 | /* Resmgr Configuration */ |
| 627 | /* Adaptive OCS is enabled by default in the FW. |
| 628 | * This command is used to disable FW based adaptive OCS. |
| 629 | */ |
| 630 | CASE_RETURN_STRING |
| 631 | (WMI_RESMGR_ADAPTIVE_OCS_ENABLE_DISABLE_CMDID); |
| 632 | /* set the requested channel time quota for the home channels */ |
| 633 | CASE_RETURN_STRING(WMI_RESMGR_SET_CHAN_TIME_QUOTA_CMDID); |
| 634 | /* set the requested latency for the home channels */ |
| 635 | CASE_RETURN_STRING(WMI_RESMGR_SET_CHAN_LATENCY_CMDID); |
| 636 | |
| 637 | /* STA SMPS Configuration */ |
| 638 | /* force SMPS mode */ |
| 639 | CASE_RETURN_STRING(WMI_STA_SMPS_FORCE_MODE_CMDID); |
| 640 | /* set SMPS parameters */ |
| 641 | CASE_RETURN_STRING(WMI_STA_SMPS_PARAM_CMDID); |
| 642 | |
| 643 | /* Wlan HB commands */ |
| 644 | /* enalbe/disable wlan HB */ |
| 645 | CASE_RETURN_STRING(WMI_HB_SET_ENABLE_CMDID); |
| 646 | /* set tcp parameters for wlan HB */ |
| 647 | CASE_RETURN_STRING(WMI_HB_SET_TCP_PARAMS_CMDID); |
| 648 | /* set tcp pkt filter for wlan HB */ |
| 649 | CASE_RETURN_STRING(WMI_HB_SET_TCP_PKT_FILTER_CMDID); |
| 650 | /* set udp parameters for wlan HB */ |
| 651 | CASE_RETURN_STRING(WMI_HB_SET_UDP_PARAMS_CMDID); |
| 652 | /* set udp pkt filter for wlan HB */ |
| 653 | CASE_RETURN_STRING(WMI_HB_SET_UDP_PKT_FILTER_CMDID); |
| 654 | |
| 655 | /* Wlan RMC commands*/ |
| 656 | /* enable/disable RMC */ |
| 657 | CASE_RETURN_STRING(WMI_RMC_SET_MODE_CMDID); |
| 658 | /* configure action frame period */ |
| 659 | CASE_RETURN_STRING(WMI_RMC_SET_ACTION_PERIOD_CMDID); |
| 660 | /* For debug/future enhancement purposes only, |
| 661 | * configures/finetunes RMC algorithms */ |
| 662 | CASE_RETURN_STRING(WMI_RMC_CONFIG_CMDID); |
| 663 | |
| 664 | /* WLAN MHF offload commands */ |
| 665 | /** enable/disable MHF offload */ |
| 666 | CASE_RETURN_STRING(WMI_MHF_OFFLOAD_SET_MODE_CMDID); |
| 667 | /* Plumb routing table for MHF offload */ |
| 668 | CASE_RETURN_STRING(WMI_MHF_OFFLOAD_PLUMB_ROUTING_TBL_CMDID); |
| 669 | |
| 670 | /* location scan commands */ |
| 671 | /* start batch scan */ |
| 672 | CASE_RETURN_STRING(WMI_BATCH_SCAN_ENABLE_CMDID); |
| 673 | /* stop batch scan */ |
| 674 | CASE_RETURN_STRING(WMI_BATCH_SCAN_DISABLE_CMDID); |
| 675 | /* get batch scan result */ |
| 676 | CASE_RETURN_STRING(WMI_BATCH_SCAN_TRIGGER_RESULT_CMDID); |
| 677 | /* OEM related cmd */ |
| 678 | CASE_RETURN_STRING(WMI_OEM_REQ_CMDID); |
| 679 | CASE_RETURN_STRING(WMI_OEM_REQUEST_CMDID); |
| 680 | /* NAN request cmd */ |
| 681 | CASE_RETURN_STRING(WMI_NAN_CMDID); |
| 682 | /* Modem power state cmd */ |
| 683 | CASE_RETURN_STRING(WMI_MODEM_POWER_STATE_CMDID); |
| 684 | CASE_RETURN_STRING(WMI_REQUEST_STATS_EXT_CMDID); |
| 685 | CASE_RETURN_STRING(WMI_OBSS_SCAN_ENABLE_CMDID); |
| 686 | CASE_RETURN_STRING(WMI_OBSS_SCAN_DISABLE_CMDID); |
| 687 | CASE_RETURN_STRING(WMI_PEER_GET_ESTIMATED_LINKSPEED_CMDID); |
| 688 | CASE_RETURN_STRING(WMI_ROAM_SCAN_CMD); |
| 689 | CASE_RETURN_STRING(WMI_PDEV_SET_LED_CONFIG_CMDID); |
| 690 | CASE_RETURN_STRING(WMI_HOST_AUTO_SHUTDOWN_CFG_CMDID); |
| 691 | CASE_RETURN_STRING(WMI_CHAN_AVOID_UPDATE_CMDID); |
Sreelakshmi Konamki | 084f3d3 | 2016-04-14 17:46:26 +0530 | [diff] [blame] | 692 | CASE_RETURN_STRING(WMI_COEX_CONFIG_CMDID); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 693 | CASE_RETURN_STRING(WMI_WOW_IOAC_ADD_KEEPALIVE_CMDID); |
| 694 | CASE_RETURN_STRING(WMI_WOW_IOAC_DEL_KEEPALIVE_CMDID); |
| 695 | CASE_RETURN_STRING(WMI_WOW_IOAC_ADD_WAKE_PATTERN_CMDID); |
| 696 | CASE_RETURN_STRING(WMI_WOW_IOAC_DEL_WAKE_PATTERN_CMDID); |
| 697 | CASE_RETURN_STRING(WMI_REQUEST_LINK_STATS_CMDID); |
| 698 | CASE_RETURN_STRING(WMI_START_LINK_STATS_CMDID); |
| 699 | CASE_RETURN_STRING(WMI_CLEAR_LINK_STATS_CMDID); |
| 700 | CASE_RETURN_STRING(WMI_GET_FW_MEM_DUMP_CMDID); |
| 701 | CASE_RETURN_STRING(WMI_LPI_MGMT_SNOOPING_CONFIG_CMDID); |
| 702 | CASE_RETURN_STRING(WMI_LPI_START_SCAN_CMDID); |
| 703 | CASE_RETURN_STRING(WMI_LPI_STOP_SCAN_CMDID); |
| 704 | CASE_RETURN_STRING(WMI_EXTSCAN_START_CMDID); |
| 705 | CASE_RETURN_STRING(WMI_EXTSCAN_STOP_CMDID); |
| 706 | CASE_RETURN_STRING |
| 707 | (WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID); |
| 708 | CASE_RETURN_STRING(WMI_EXTSCAN_CONFIGURE_HOTLIST_MONITOR_CMDID); |
| 709 | CASE_RETURN_STRING(WMI_EXTSCAN_GET_CACHED_RESULTS_CMDID); |
| 710 | CASE_RETURN_STRING(WMI_EXTSCAN_GET_WLAN_CHANGE_RESULTS_CMDID); |
| 711 | CASE_RETURN_STRING(WMI_EXTSCAN_SET_CAPABILITIES_CMDID); |
| 712 | CASE_RETURN_STRING(WMI_EXTSCAN_GET_CAPABILITIES_CMDID); |
| 713 | CASE_RETURN_STRING(WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID); |
| 714 | CASE_RETURN_STRING(WMI_ROAM_SYNCH_COMPLETE); |
| 715 | CASE_RETURN_STRING(WMI_D0_WOW_ENABLE_DISABLE_CMDID); |
| 716 | CASE_RETURN_STRING(WMI_EXTWOW_ENABLE_CMDID); |
| 717 | CASE_RETURN_STRING(WMI_EXTWOW_SET_APP_TYPE1_PARAMS_CMDID); |
| 718 | CASE_RETURN_STRING(WMI_EXTWOW_SET_APP_TYPE2_PARAMS_CMDID); |
| 719 | CASE_RETURN_STRING(WMI_UNIT_TEST_CMDID); |
| 720 | CASE_RETURN_STRING(WMI_ROAM_SET_RIC_REQUEST_CMDID); |
| 721 | CASE_RETURN_STRING(WMI_PDEV_GET_TEMPERATURE_CMDID); |
| 722 | CASE_RETURN_STRING(WMI_SET_DHCP_SERVER_OFFLOAD_CMDID); |
| 723 | CASE_RETURN_STRING(WMI_TPC_CHAINMASK_CONFIG_CMDID); |
| 724 | CASE_RETURN_STRING(WMI_IPA_OFFLOAD_ENABLE_DISABLE_CMDID); |
| 725 | CASE_RETURN_STRING(WMI_SCAN_PROB_REQ_OUI_CMDID); |
| 726 | CASE_RETURN_STRING(WMI_TDLS_SET_OFFCHAN_MODE_CMDID); |
| 727 | CASE_RETURN_STRING(WMI_PDEV_SET_LED_FLASHING_CMDID); |
| 728 | CASE_RETURN_STRING(WMI_MDNS_OFFLOAD_ENABLE_CMDID); |
| 729 | CASE_RETURN_STRING(WMI_MDNS_SET_FQDN_CMDID); |
| 730 | CASE_RETURN_STRING(WMI_MDNS_SET_RESPONSE_CMDID); |
| 731 | CASE_RETURN_STRING(WMI_MDNS_GET_STATS_CMDID); |
| 732 | CASE_RETURN_STRING(WMI_ROAM_INVOKE_CMDID); |
| 733 | CASE_RETURN_STRING(WMI_SET_ANTENNA_DIVERSITY_CMDID); |
| 734 | CASE_RETURN_STRING(WMI_SAP_OFL_ENABLE_CMDID); |
| 735 | CASE_RETURN_STRING(WMI_APFIND_CMDID); |
| 736 | CASE_RETURN_STRING(WMI_PASSPOINT_LIST_CONFIG_CMDID); |
| 737 | CASE_RETURN_STRING(WMI_OCB_SET_SCHED_CMDID); |
| 738 | CASE_RETURN_STRING(WMI_OCB_SET_CONFIG_CMDID); |
| 739 | CASE_RETURN_STRING(WMI_OCB_SET_UTC_TIME_CMDID); |
| 740 | CASE_RETURN_STRING(WMI_OCB_START_TIMING_ADVERT_CMDID); |
| 741 | CASE_RETURN_STRING(WMI_OCB_STOP_TIMING_ADVERT_CMDID); |
| 742 | CASE_RETURN_STRING(WMI_OCB_GET_TSF_TIMER_CMDID); |
| 743 | CASE_RETURN_STRING(WMI_DCC_GET_STATS_CMDID); |
| 744 | CASE_RETURN_STRING(WMI_DCC_CLEAR_STATS_CMDID); |
| 745 | CASE_RETURN_STRING(WMI_DCC_UPDATE_NDL_CMDID); |
| 746 | CASE_RETURN_STRING(WMI_ROAM_FILTER_CMDID); |
| 747 | CASE_RETURN_STRING(WMI_ROAM_SUBNET_CHANGE_CONFIG_CMDID); |
| 748 | CASE_RETURN_STRING(WMI_DEBUG_MESG_FLUSH_CMDID); |
| 749 | CASE_RETURN_STRING(WMI_PEER_SET_RATE_REPORT_CONDITION_CMDID); |
| 750 | CASE_RETURN_STRING(WMI_SOC_SET_PCL_CMDID); |
| 751 | CASE_RETURN_STRING(WMI_SOC_SET_HW_MODE_CMDID); |
| 752 | CASE_RETURN_STRING(WMI_SOC_SET_DUAL_MAC_CONFIG_CMDID); |
| 753 | CASE_RETURN_STRING(WMI_WOW_ENABLE_ICMPV6_NA_FLT_CMDID); |
| 754 | CASE_RETURN_STRING(WMI_DIAG_EVENT_LOG_CONFIG_CMDID); |
| 755 | CASE_RETURN_STRING(WMI_PACKET_FILTER_CONFIG_CMDID); |
| 756 | CASE_RETURN_STRING(WMI_PACKET_FILTER_ENABLE_CMDID); |
| 757 | CASE_RETURN_STRING(WMI_SAP_SET_BLACKLIST_PARAM_CMDID); |
| 758 | CASE_RETURN_STRING(WMI_WOW_UDP_SVC_OFLD_CMDID); |
| 759 | CASE_RETURN_STRING(WMI_MGMT_TX_SEND_CMDID); |
| 760 | CASE_RETURN_STRING(WMI_SOC_SET_ANTENNA_MODE_CMDID); |
| 761 | CASE_RETURN_STRING(WMI_WOW_HOSTWAKEUP_GPIO_PIN_PATTERN_CONFIG_CMDID); |
| 762 | CASE_RETURN_STRING(WMI_AP_PS_EGAP_PARAM_CMDID); |
| 763 | CASE_RETURN_STRING(WMI_PMF_OFFLOAD_SET_SA_QUERY_CMDID); |
| 764 | CASE_RETURN_STRING(WMI_BPF_GET_CAPABILITY_CMDID); |
| 765 | CASE_RETURN_STRING(WMI_BPF_GET_VDEV_STATS_CMDID); |
| 766 | CASE_RETURN_STRING(WMI_BPF_SET_VDEV_INSTRUCTIONS_CMDID); |
| 767 | CASE_RETURN_STRING(WMI_BPF_DEL_VDEV_INSTRUCTIONS_CMDID); |
Govind Singh | 8b1466e | 2016-03-16 16:27:50 +0530 | [diff] [blame] | 768 | CASE_RETURN_STRING(WMI_NDI_GET_CAP_REQ_CMDID); |
| 769 | CASE_RETURN_STRING(WMI_NDP_INITIATOR_REQ_CMDID); |
| 770 | CASE_RETURN_STRING(WMI_NDP_RESPONDER_REQ_CMDID); |
| 771 | CASE_RETURN_STRING(WMI_NDP_END_REQ_CMDID); |
| 772 | CASE_RETURN_STRING(WMI_PEER_UPDATE_WDS_ENTRY_CMDID); |
| 773 | CASE_RETURN_STRING(WMI_PEER_ADD_PROXY_STA_ENTRY_CMDID); |
| 774 | CASE_RETURN_STRING(WMI_PDEV_FIPS_CMDID); |
| 775 | CASE_RETURN_STRING(WMI_PDEV_SMART_ANT_ENABLE_CMDID); |
| 776 | CASE_RETURN_STRING(WMI_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID); |
| 777 | CASE_RETURN_STRING(WMI_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID); |
| 778 | CASE_RETURN_STRING(WMI_PDEV_SET_CTL_TABLE_CMDID); |
| 779 | CASE_RETURN_STRING(WMI_PDEV_SET_MIMOGAIN_TABLE_CMDID); |
| 780 | CASE_RETURN_STRING(WMI_PDEV_GET_TPC_CMDID); |
| 781 | CASE_RETURN_STRING(WMI_MIB_STATS_ENABLE_CMDID); |
| 782 | CASE_RETURN_STRING(WMI_PDEV_GET_ANI_CCK_CONFIG_CMDID); |
| 783 | CASE_RETURN_STRING(WMI_PDEV_GET_ANI_OFDM_CONFIG_CMDID); |
| 784 | CASE_RETURN_STRING(WMI_VDEV_RATEMASK_CMDID); |
| 785 | CASE_RETURN_STRING(WMI_VDEV_ATF_REQUEST_CMDID); |
| 786 | CASE_RETURN_STRING(WMI_VDEV_SET_DSCP_TID_MAP_CMDID); |
| 787 | CASE_RETURN_STRING(WMI_VDEV_FILTER_NEIGHBOR_RX_PACKETS_CMDID); |
| 788 | CASE_RETURN_STRING(WMI_VDEV_SET_QUIET_MODE_CMDID); |
| 789 | CASE_RETURN_STRING(WMI_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID); |
| 790 | CASE_RETURN_STRING(WMI_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID); |
| 791 | CASE_RETURN_STRING(WMI_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID); |
| 792 | CASE_RETURN_STRING(WMI_PEER_ATF_REQUEST_CMDID); |
| 793 | CASE_RETURN_STRING(WMI_FWTEST_CMDID); |
| 794 | CASE_RETURN_STRING(WMI_QBOOST_CFG_CMDID); |
| 795 | CASE_RETURN_STRING(WMI_PDEV_GET_NFCAL_POWER_CMDID); |
| 796 | CASE_RETURN_STRING(WMI_PDEV_SET_PCL_CMDID); |
| 797 | CASE_RETURN_STRING(WMI_PDEV_SET_HW_MODE_CMDID); |
| 798 | CASE_RETURN_STRING(WMI_PDEV_SET_MAC_CONFIG_CMDID); |
| 799 | CASE_RETURN_STRING(WMI_PDEV_SET_ANTENNA_MODE_CMDID); |
| 800 | CASE_RETURN_STRING(WMI_ROAM_SET_MBO_PARAM_CMDID); |
Naveen Rawat | 8cf610b | 2016-04-14 20:10:15 -0700 | [diff] [blame^] | 801 | CASE_RETURN_STRING(WMI_CHAN_AVOID_RPT_ALLOW_CMDID); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 802 | } |
| 803 | |
| 804 | return "Invalid WMI cmd"; |
| 805 | } |
| 806 | |
| 807 | #ifdef QCA_WIFI_3_0_EMU |
| 808 | static inline void wma_log_cmd_id(WMI_CMD_ID cmd_id) |
| 809 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 810 | WMI_LOGE("Send WMI command:%s command_id:%d", |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 811 | get_wmi_cmd_string(cmd_id), cmd_id); |
| 812 | } |
| 813 | #else |
| 814 | static inline void wma_log_cmd_id(WMI_CMD_ID cmd_id) |
| 815 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 816 | WMI_LOGD("Send WMI command:%s command_id:%d", |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 817 | get_wmi_cmd_string(cmd_id), cmd_id); |
| 818 | } |
| 819 | #endif |
| 820 | |
| 821 | /** |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 822 | * wmi_is_runtime_pm_cmd() - check if a cmd is from suspend resume sequence |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 823 | * @cmd: command to check |
| 824 | * |
| 825 | * Return: true if the command is part of the suspend resume sequence. |
| 826 | */ |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 827 | static bool wmi_is_runtime_pm_cmd(WMI_CMD_ID cmd_id) |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 828 | { |
| 829 | switch (cmd_id) { |
| 830 | case WMI_WOW_ENABLE_CMDID: |
| 831 | case WMI_PDEV_SUSPEND_CMDID: |
| 832 | case WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID: |
| 833 | case WMI_WOW_ADD_WAKE_PATTERN_CMDID: |
| 834 | case WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID: |
| 835 | case WMI_PDEV_RESUME_CMDID: |
| 836 | case WMI_WOW_DEL_WAKE_PATTERN_CMDID: |
| 837 | case WMI_D0_WOW_ENABLE_DISABLE_CMDID: |
| 838 | return true; |
| 839 | |
| 840 | default: |
| 841 | return false; |
| 842 | } |
| 843 | } |
| 844 | |
| 845 | /** |
| 846 | * wmi_unified_cmd_send() - WMI command API |
| 847 | * @wmi_handle: handle to wmi |
| 848 | * @buf: wmi buf |
| 849 | * @len: wmi buffer length |
| 850 | * @cmd_id: wmi command id |
| 851 | * |
| 852 | * Return: 0 on success |
| 853 | */ |
Govind Singh | c458f38 | 2016-02-04 18:42:30 +0530 | [diff] [blame] | 854 | int wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, uint32_t len, |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 855 | WMI_CMD_ID cmd_id) |
| 856 | { |
| 857 | HTC_PACKET *pkt; |
| 858 | A_STATUS status; |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 859 | uint16_t htc_tag = 0; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 860 | |
| 861 | if (wmi_get_runtime_pm_inprogress(wmi_handle)) { |
| 862 | if (wmi_is_runtime_pm_cmd(cmd_id)) |
| 863 | htc_tag = HTC_TX_PACKET_TAG_AUTO_PM; |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 864 | } else if (qdf_atomic_read(&wmi_handle->is_target_suspended) && |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 865 | ((WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID != cmd_id) && |
| 866 | (WMI_PDEV_RESUME_CMDID != cmd_id))) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 867 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 868 | "%s: Target is suspended", __func__); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 869 | QDF_ASSERT(0); |
Govind Singh | 67922e8 | 2016-04-01 16:48:57 +0530 | [diff] [blame] | 870 | return QDF_STATUS_E_BUSY; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 871 | } |
| 872 | |
| 873 | /* Do sanity check on the TLV parameter structure */ |
| 874 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 875 | void *buf_ptr = (void *)qdf_nbuf_data(buf); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 876 | |
| 877 | if (wmitlv_check_command_tlv_params(NULL, buf_ptr, len, cmd_id) |
| 878 | != 0) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 879 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 880 | "\nERROR: %s: Invalid WMI Param Buffer for Cmd:%d", |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 881 | __func__, cmd_id); |
Govind Singh | 67922e8 | 2016-04-01 16:48:57 +0530 | [diff] [blame] | 882 | return QDF_STATUS_E_INVAL; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 883 | } |
| 884 | } |
| 885 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 886 | if (qdf_nbuf_push_head(buf, sizeof(WMI_CMD_HDR)) == NULL) { |
| 887 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 888 | "%s, Failed to send cmd %x, no memory", |
| 889 | __func__, cmd_id); |
Govind Singh | 67922e8 | 2016-04-01 16:48:57 +0530 | [diff] [blame] | 890 | return QDF_STATUS_E_NOMEM; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 891 | } |
| 892 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 893 | WMI_SET_FIELD(qdf_nbuf_data(buf), WMI_CMD_HDR, COMMANDID, cmd_id); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 894 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 895 | qdf_atomic_inc(&wmi_handle->pending_cmds); |
| 896 | if (qdf_atomic_read(&wmi_handle->pending_cmds) >= WMI_MAX_CMDS) { |
| 897 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 898 | "\n%s: hostcredits = %d", __func__, |
| 899 | wmi_get_host_credits(wmi_handle)); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 900 | htc_dump_counter_info(wmi_handle->htc_handle); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 901 | qdf_atomic_dec(&wmi_handle->pending_cmds); |
| 902 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 903 | "%s: MAX 1024 WMI Pending cmds reached.", __func__); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 904 | QDF_BUG(0); |
Govind Singh | 67922e8 | 2016-04-01 16:48:57 +0530 | [diff] [blame] | 905 | return QDF_STATUS_E_BUSY; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 906 | } |
| 907 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 908 | pkt = qdf_mem_malloc(sizeof(*pkt)); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 909 | if (!pkt) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 910 | qdf_atomic_dec(&wmi_handle->pending_cmds); |
| 911 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 912 | "%s, Failed to alloc htc packet %x, no memory", |
| 913 | __func__, cmd_id); |
Govind Singh | 67922e8 | 2016-04-01 16:48:57 +0530 | [diff] [blame] | 914 | return QDF_STATUS_E_NOMEM; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 915 | } |
| 916 | |
| 917 | SET_HTC_PACKET_INFO_TX(pkt, |
| 918 | NULL, |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 919 | qdf_nbuf_data(buf), len + sizeof(WMI_CMD_HDR), |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 920 | wmi_handle->wmi_endpoint_id, htc_tag); |
| 921 | |
| 922 | SET_HTC_PACKET_NET_BUF_CONTEXT(pkt, buf); |
| 923 | |
| 924 | wma_log_cmd_id(cmd_id); |
| 925 | |
| 926 | #ifdef WMI_INTERFACE_EVENT_LOGGING |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 927 | qdf_spin_lock_bh(&wmi_handle->wmi_record_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 928 | /*Record 16 bytes of WMI cmd data - exclude TLV and WMI headers */ |
| 929 | if (cmd_id == WMI_MGMT_TX_SEND_CMDID) { |
| 930 | WMI_MGMT_COMMAND_RECORD(cmd_id, |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 931 | ((uint32_t *)qdf_nbuf_data(buf) + 2)); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 932 | } else { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 933 | WMI_COMMAND_RECORD(cmd_id, ((uint32_t *) qdf_nbuf_data(buf) + |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 934 | 2)); |
| 935 | } |
| 936 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 937 | qdf_spin_unlock_bh(&wmi_handle->wmi_record_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 938 | #endif |
| 939 | |
| 940 | status = htc_send_pkt(wmi_handle->htc_handle, pkt); |
| 941 | |
| 942 | if (A_OK != status) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 943 | qdf_atomic_dec(&wmi_handle->pending_cmds); |
| 944 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 945 | "%s %d, htc_send_pkt failed", __func__, __LINE__); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 946 | } |
| 947 | if (status) |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 948 | return QDF_STATUS_E_FAILURE; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 949 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 950 | return QDF_STATUS_SUCCESS; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 951 | } |
| 952 | |
| 953 | /** |
| 954 | * wmi_unified_get_event_handler_ix() - gives event handler's index |
| 955 | * @wmi_handle: handle to wmi |
| 956 | * @event_id: wmi event id |
| 957 | * |
| 958 | * Return: event handler's index |
| 959 | */ |
| 960 | int wmi_unified_get_event_handler_ix(wmi_unified_t wmi_handle, |
| 961 | WMI_EVT_ID event_id) |
| 962 | { |
| 963 | uint32_t idx = 0; |
| 964 | int32_t invalid_idx = -1; |
| 965 | for (idx = 0; (idx < wmi_handle->max_event_idx && |
| 966 | idx < WMI_UNIFIED_MAX_EVENT); ++idx) { |
| 967 | if (wmi_handle->event_id[idx] == event_id && |
| 968 | wmi_handle->event_handler[idx] != NULL) { |
| 969 | return idx; |
| 970 | } |
| 971 | } |
| 972 | |
| 973 | return invalid_idx; |
| 974 | } |
| 975 | |
| 976 | /** |
| 977 | * wmi_unified_register_event_handler() - register wmi event handler |
| 978 | * @wmi_handle: handle to wmi |
| 979 | * @event_id: wmi event id |
| 980 | * @handler_func: wmi event handler function |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 981 | * @rx_ctx: rx execution context for wmi rx events |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 982 | * |
| 983 | * Return: 0 on success |
| 984 | */ |
| 985 | int wmi_unified_register_event_handler(wmi_unified_t wmi_handle, |
| 986 | WMI_EVT_ID event_id, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 987 | wmi_unified_event_handler handler_func, |
| 988 | uint8_t rx_ctx) |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 989 | { |
| 990 | uint32_t idx = 0; |
| 991 | |
| 992 | if (wmi_unified_get_event_handler_ix(wmi_handle, event_id) != -1) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 993 | qdf_print("%s : event handler already registered 0x%x \n", |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 994 | __func__, event_id); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 995 | return QDF_STATUS_E_FAILURE; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 996 | } |
| 997 | if (wmi_handle->max_event_idx == WMI_UNIFIED_MAX_EVENT) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 998 | qdf_print("%s : no more event handlers 0x%x \n", |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 999 | __func__, event_id); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1000 | return QDF_STATUS_E_FAILURE; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1001 | } |
| 1002 | idx = wmi_handle->max_event_idx; |
| 1003 | wmi_handle->event_handler[idx] = handler_func; |
| 1004 | wmi_handle->event_id[idx] = event_id; |
Govind Singh | 813fdac | 2016-03-12 09:26:52 +0530 | [diff] [blame] | 1005 | qdf_spin_lock_bh(&wmi_handle->ctx_lock); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1006 | wmi_handle->ctx[idx] = rx_ctx; |
Govind Singh | 813fdac | 2016-03-12 09:26:52 +0530 | [diff] [blame] | 1007 | qdf_spin_unlock_bh(&wmi_handle->ctx_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1008 | wmi_handle->max_event_idx++; |
| 1009 | |
| 1010 | return 0; |
| 1011 | } |
| 1012 | |
| 1013 | /** |
| 1014 | * wmi_unified_unregister_event_handler() - unregister wmi event handler |
| 1015 | * @wmi_handle: handle to wmi |
| 1016 | * @event_id: wmi event id |
| 1017 | * |
| 1018 | * Return: 0 on success |
| 1019 | */ |
| 1020 | int wmi_unified_unregister_event_handler(wmi_unified_t wmi_handle, |
| 1021 | WMI_EVT_ID event_id) |
| 1022 | { |
| 1023 | uint32_t idx = 0; |
| 1024 | |
| 1025 | idx = wmi_unified_get_event_handler_ix(wmi_handle, event_id); |
| 1026 | if (idx == -1) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1027 | qdf_print("%s : event handler is not registered: event id 0x%x \n", |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1028 | __func__, event_id); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1029 | return QDF_STATUS_E_FAILURE; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1030 | } |
| 1031 | wmi_handle->event_handler[idx] = NULL; |
| 1032 | wmi_handle->event_id[idx] = 0; |
| 1033 | --wmi_handle->max_event_idx; |
| 1034 | wmi_handle->event_handler[idx] = |
| 1035 | wmi_handle->event_handler[wmi_handle->max_event_idx]; |
| 1036 | wmi_handle->event_id[idx] = |
| 1037 | wmi_handle->event_id[wmi_handle->max_event_idx]; |
| 1038 | |
| 1039 | return 0; |
| 1040 | } |
| 1041 | |
| 1042 | /** |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1043 | * wmi_process_fw_event_default_ctx() - process in default caller context |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1044 | * @wmi_handle: handle to wmi |
| 1045 | * @htc_packet: pointer to htc packet |
| 1046 | * |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1047 | * Event process by below function will be in default caller context. |
| 1048 | * wmi internally provides rx work thread processing context. |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1049 | * |
| 1050 | * Return: none |
| 1051 | */ |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1052 | static void wmi_process_fw_event_default_ctx(struct wmi_unified *wmi_handle, |
| 1053 | HTC_PACKET *htc_packet, uint8_t exec_ctx) |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1054 | { |
| 1055 | wmi_buf_t evt_buf; |
| 1056 | evt_buf = (wmi_buf_t) htc_packet->pPktContext; |
| 1057 | |
Govind Singh | 5eb5153 | 2016-03-09 11:34:12 +0530 | [diff] [blame] | 1058 | wmi_handle->rx_ops.wma_process_fw_event_handler_cbk(wmi_handle, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1059 | evt_buf, exec_ctx); |
| 1060 | |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1061 | return; |
| 1062 | } |
| 1063 | |
| 1064 | /** |
| 1065 | * wmi_process_fw_event_worker_thread_ctx() - process in worker thread context |
| 1066 | * @wmi_handle: handle to wmi |
| 1067 | * @htc_packet: pointer to htc packet |
| 1068 | * |
| 1069 | * Event process by below function will be in worker thread context. |
| 1070 | * Use this method for events which are not critical and not |
| 1071 | * handled in protocol stack. |
| 1072 | * |
| 1073 | * Return: none |
| 1074 | */ |
| 1075 | static void wmi_process_fw_event_worker_thread_ctx |
| 1076 | (struct wmi_unified *wmi_handle, HTC_PACKET *htc_packet) |
| 1077 | { |
| 1078 | wmi_buf_t evt_buf; |
| 1079 | uint32_t id; |
| 1080 | uint8_t *data; |
| 1081 | |
| 1082 | evt_buf = (wmi_buf_t) htc_packet->pPktContext; |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1083 | id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID); |
| 1084 | data = qdf_nbuf_data(evt_buf); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1085 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1086 | qdf_spin_lock_bh(&wmi_handle->wmi_record_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1087 | /* Exclude 4 bytes of TLV header */ |
| 1088 | WMI_RX_EVENT_RECORD(id, ((uint8_t *) data + 4)); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1089 | qdf_spin_unlock_bh(&wmi_handle->wmi_record_lock); |
| 1090 | qdf_spin_lock_bh(&wmi_handle->eventq_lock); |
| 1091 | qdf_nbuf_queue_add(&wmi_handle->event_queue, evt_buf); |
| 1092 | qdf_spin_unlock_bh(&wmi_handle->eventq_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1093 | schedule_work(&wmi_handle->rx_event_work); |
| 1094 | return; |
| 1095 | } |
| 1096 | |
| 1097 | /** |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1098 | * wmi_control_rx() - process fw events callbacks |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1099 | * @ctx: handle to wmi |
| 1100 | * @htc_packet: pointer to htc packet |
| 1101 | * |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1102 | * Return: none |
| 1103 | */ |
| 1104 | void wmi_control_rx(void *ctx, HTC_PACKET *htc_packet) |
| 1105 | { |
| 1106 | struct wmi_unified *wmi_handle = (struct wmi_unified *)ctx; |
| 1107 | wmi_buf_t evt_buf; |
| 1108 | uint32_t id; |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1109 | uint32_t idx = 0; |
| 1110 | enum wmi_rx_exec_ctx exec_ctx; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1111 | |
| 1112 | evt_buf = (wmi_buf_t) htc_packet->pPktContext; |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1113 | id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1114 | idx = wmi_unified_get_event_handler_ix(wmi_handle, id); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1115 | if (qdf_unlikely(idx == A_ERROR)) { |
| 1116 | qdf_print |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1117 | ("%s :event handler is not registered: event id 0x%x\n", |
| 1118 | __func__, id); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1119 | qdf_nbuf_free(evt_buf); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1120 | return; |
| 1121 | } |
Govind Singh | 813fdac | 2016-03-12 09:26:52 +0530 | [diff] [blame] | 1122 | qdf_spin_lock_bh(&wmi_handle->ctx_lock); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1123 | exec_ctx = wmi_handle->ctx[idx]; |
Govind Singh | 813fdac | 2016-03-12 09:26:52 +0530 | [diff] [blame] | 1124 | qdf_spin_unlock_bh(&wmi_handle->ctx_lock); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1125 | |
| 1126 | if (exec_ctx == WMI_RX_WORK_CTX) { |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1127 | wmi_process_fw_event_worker_thread_ctx |
| 1128 | (wmi_handle, htc_packet); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1129 | } else if (exec_ctx > WMI_RX_WORK_CTX) { |
| 1130 | wmi_process_fw_event_default_ctx |
| 1131 | (wmi_handle, htc_packet, exec_ctx); |
| 1132 | } else { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1133 | qdf_print("%s :Invalid event context %d\n", __func__, exec_ctx); |
| 1134 | qdf_nbuf_free(evt_buf); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1135 | } |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1136 | |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1137 | } |
| 1138 | |
| 1139 | /** |
| 1140 | * wmi_process_fw_event() - process any fw event |
| 1141 | * @wmi_handle: wmi handle |
| 1142 | * @evt_buf: fw event buffer |
| 1143 | * |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1144 | * This function process fw event in caller context |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1145 | * |
| 1146 | * Return: none |
| 1147 | */ |
| 1148 | void wmi_process_fw_event(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf) |
| 1149 | { |
| 1150 | __wmi_control_rx(wmi_handle, evt_buf); |
| 1151 | } |
| 1152 | |
| 1153 | /** |
| 1154 | * __wmi_control_rx() - process serialize wmi event callback |
| 1155 | * @wmi_handle: wmi handle |
| 1156 | * @evt_buf: fw event buffer |
| 1157 | * |
| 1158 | * Return: none |
| 1159 | */ |
| 1160 | void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf) |
| 1161 | { |
| 1162 | uint32_t id; |
| 1163 | uint8_t *data; |
| 1164 | uint32_t len; |
| 1165 | void *wmi_cmd_struct_ptr = NULL; |
| 1166 | int tlv_ok_status = 0; |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1167 | uint32_t idx = 0; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1168 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1169 | id = WMI_GET_FIELD(qdf_nbuf_data(evt_buf), WMI_CMD_HDR, COMMANDID); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1170 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1171 | if (qdf_nbuf_pull_head(evt_buf, sizeof(WMI_CMD_HDR)) == NULL) |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1172 | goto end; |
| 1173 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1174 | data = qdf_nbuf_data(evt_buf); |
| 1175 | len = qdf_nbuf_len(evt_buf); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1176 | |
| 1177 | /* Validate and pad(if necessary) the TLVs */ |
| 1178 | tlv_ok_status = wmitlv_check_and_pad_event_tlvs(wmi_handle->scn_handle, |
| 1179 | data, len, id, |
| 1180 | &wmi_cmd_struct_ptr); |
| 1181 | if (tlv_ok_status != 0) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1182 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1183 | "%s: Error: id=0x%d, wmitlv check status=%d\n", |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1184 | __func__, id, tlv_ok_status); |
| 1185 | goto end; |
| 1186 | } |
| 1187 | |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1188 | idx = wmi_unified_get_event_handler_ix(wmi_handle, id); |
| 1189 | if (idx == A_ERROR) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1190 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_ERROR, |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1191 | "%s : event handler is not registered: event id 0x%x\n", |
| 1192 | __func__, id); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1193 | goto end; |
| 1194 | } |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1195 | #ifdef WMI_INTERFACE_EVENT_LOGGING |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1196 | qdf_spin_lock_bh(&wmi_handle->wmi_record_lock); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1197 | /* Exclude 4 bytes of TLV header */ |
| 1198 | if (id == WMI_MGMT_TX_COMPLETION_EVENTID) { |
| 1199 | WMI_MGMT_EVENT_RECORD(id, ((uint8_t *) data + 4)); |
| 1200 | } else { |
| 1201 | WMI_EVENT_RECORD(id, ((uint8_t *) data + 4)); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1202 | } |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1203 | qdf_spin_unlock_bh(&wmi_handle->wmi_record_lock); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1204 | #endif |
| 1205 | /* Call the WMI registered event handler */ |
| 1206 | wmi_handle->event_handler[idx] (wmi_handle->scn_handle, |
| 1207 | wmi_cmd_struct_ptr, len); |
| 1208 | |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1209 | end: |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1210 | /* Free event buffer and allocated event tlv */ |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1211 | wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1212 | qdf_nbuf_free(evt_buf); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1213 | |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1214 | } |
| 1215 | |
| 1216 | /** |
| 1217 | * wmi_rx_event_work() - process rx event in rx work queue context |
| 1218 | * @work: rx work queue struct |
| 1219 | * |
| 1220 | * This function process any fw event to serialize it through rx worker thread. |
| 1221 | * |
| 1222 | * Return: none |
| 1223 | */ |
| 1224 | void wmi_rx_event_work(struct work_struct *work) |
| 1225 | { |
| 1226 | struct wmi_unified *wmi = container_of(work, struct wmi_unified, |
| 1227 | rx_event_work); |
| 1228 | wmi_buf_t buf; |
| 1229 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1230 | qdf_spin_lock_bh(&wmi->eventq_lock); |
| 1231 | buf = qdf_nbuf_queue_remove(&wmi->event_queue); |
| 1232 | qdf_spin_unlock_bh(&wmi->eventq_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1233 | while (buf) { |
| 1234 | __wmi_control_rx(wmi, buf); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1235 | qdf_spin_lock_bh(&wmi->eventq_lock); |
| 1236 | buf = qdf_nbuf_queue_remove(&wmi->event_queue); |
| 1237 | qdf_spin_unlock_bh(&wmi->eventq_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1238 | } |
| 1239 | } |
| 1240 | |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1241 | #ifdef FEATURE_RUNTIME_PM |
| 1242 | /** |
| 1243 | * wmi_runtime_pm_init() - initialize runtime pm wmi variables |
| 1244 | * @wmi_handle: wmi context |
| 1245 | */ |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1246 | static void wmi_runtime_pm_init(struct wmi_unified *wmi_handle) |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1247 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1248 | qdf_atomic_init(&wmi_handle->runtime_pm_inprogress); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1249 | } |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1250 | |
| 1251 | /** |
| 1252 | * wmi_set_runtime_pm_inprogress() - set runtime pm progress flag |
| 1253 | * @wmi_handle: wmi context |
| 1254 | * @val: runtime pm progress flag |
| 1255 | */ |
| 1256 | void wmi_set_runtime_pm_inprogress(wmi_unified_t wmi_handle, A_BOOL val) |
| 1257 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1258 | qdf_atomic_set(&wmi_handle->runtime_pm_inprogress, val); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1259 | } |
| 1260 | |
| 1261 | /** |
| 1262 | * wmi_get_runtime_pm_inprogress() - get runtime pm progress flag |
| 1263 | * @wmi_handle: wmi context |
| 1264 | */ |
| 1265 | inline bool wmi_get_runtime_pm_inprogress(wmi_unified_t wmi_handle) |
| 1266 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1267 | return qdf_atomic_read(&wmi_handle->runtime_pm_inprogress); |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1268 | } |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1269 | #else |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1270 | static void wmi_runtime_pm_init(struct wmi_unified *wmi_handle) |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1271 | { |
| 1272 | } |
| 1273 | #endif |
| 1274 | |
| 1275 | /** |
| 1276 | * wmi_unified_attach() - attach for unified WMI |
Govind Singh | c458f38 | 2016-02-04 18:42:30 +0530 | [diff] [blame] | 1277 | * @scn_handle: handle to SCN |
| 1278 | * @osdev: OS device context |
| 1279 | * @target_type: TLV or not-TLV based target |
| 1280 | * @use_cookie: cookie based allocation enabled/disabled |
| 1281 | * @ops: umac rx callbacks |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1282 | * |
| 1283 | * @Return: wmi handle. |
| 1284 | */ |
Govind Singh | c458f38 | 2016-02-04 18:42:30 +0530 | [diff] [blame] | 1285 | void *wmi_unified_attach(void *scn_handle, |
| 1286 | osdev_t osdev, enum wmi_target_type target_type, |
Govind Singh | 5eb5153 | 2016-03-09 11:34:12 +0530 | [diff] [blame] | 1287 | bool use_cookie, struct wmi_rx_ops *rx_ops) |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1288 | { |
| 1289 | struct wmi_unified *wmi_handle; |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1290 | wmi_handle = |
| 1291 | (struct wmi_unified *)os_malloc(NULL, |
| 1292 | sizeof(struct wmi_unified), |
| 1293 | GFP_ATOMIC); |
| 1294 | if (wmi_handle == NULL) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1295 | qdf_print("allocation of wmi handle failed %zu\n", |
Govind Singh | d52faac | 2016-03-09 12:03:29 +0530 | [diff] [blame] | 1296 | sizeof(struct wmi_unified)); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1297 | return NULL; |
| 1298 | } |
| 1299 | OS_MEMZERO(wmi_handle, sizeof(struct wmi_unified)); |
Govind Singh | c458f38 | 2016-02-04 18:42:30 +0530 | [diff] [blame] | 1300 | wmi_handle->scn_handle = (ol_scn_t *)scn_handle; |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1301 | qdf_atomic_init(&wmi_handle->pending_cmds); |
| 1302 | qdf_atomic_init(&wmi_handle->is_target_suspended); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1303 | wmi_runtime_pm_init(wmi_handle); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1304 | qdf_spinlock_create(&wmi_handle->eventq_lock); |
| 1305 | qdf_nbuf_queue_init(&wmi_handle->event_queue); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1306 | #ifdef CONFIG_CNSS |
| 1307 | cnss_init_work(&wmi_handle->rx_event_work, wmi_rx_event_work); |
| 1308 | #else |
| 1309 | INIT_WORK(&wmi_handle->rx_event_work, wmi_rx_event_work); |
| 1310 | #endif |
| 1311 | #ifdef WMI_INTERFACE_EVENT_LOGGING |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1312 | qdf_spinlock_create(&wmi_handle->wmi_record_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1313 | #endif |
Govind Singh | c458f38 | 2016-02-04 18:42:30 +0530 | [diff] [blame] | 1314 | /* Attach mc_thread context processing function */ |
Govind Singh | 5eb5153 | 2016-03-09 11:34:12 +0530 | [diff] [blame] | 1315 | wmi_handle->rx_ops.wma_process_fw_event_handler_cbk = |
| 1316 | rx_ops->wma_process_fw_event_handler_cbk; |
Govind Singh | c458f38 | 2016-02-04 18:42:30 +0530 | [diff] [blame] | 1317 | if (target_type == WMI_TLV_TARGET) |
Govind Singh | 5eb5153 | 2016-03-09 11:34:12 +0530 | [diff] [blame] | 1318 | wmi_handle->ops = wmi_get_tlv_ops(); |
Govind Singh | c458f38 | 2016-02-04 18:42:30 +0530 | [diff] [blame] | 1319 | else |
Govind Singh | 5eb5153 | 2016-03-09 11:34:12 +0530 | [diff] [blame] | 1320 | wmi_handle->ops = wmi_get_non_tlv_ops(); |
Govind Singh | c458f38 | 2016-02-04 18:42:30 +0530 | [diff] [blame] | 1321 | /* Assign target cookie capablity */ |
| 1322 | wmi_handle->use_cookie = use_cookie; |
| 1323 | wmi_handle->osdev = osdev; |
Govind Singh | 813fdac | 2016-03-12 09:26:52 +0530 | [diff] [blame] | 1324 | qdf_spinlock_create(&wmi_handle->ctx_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1325 | |
| 1326 | return wmi_handle; |
| 1327 | } |
| 1328 | |
| 1329 | /** |
| 1330 | * wmi_unified_detach() - detach for unified WMI |
| 1331 | * |
| 1332 | * @wmi_handle : handle to wmi. |
| 1333 | * |
| 1334 | * @Return: none. |
| 1335 | */ |
| 1336 | void wmi_unified_detach(struct wmi_unified *wmi_handle) |
| 1337 | { |
| 1338 | wmi_buf_t buf; |
| 1339 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1340 | cancel_work_sync(&wmi_handle->rx_event_work); |
| 1341 | qdf_spin_lock_bh(&wmi_handle->eventq_lock); |
| 1342 | buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1343 | while (buf) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1344 | qdf_nbuf_free(buf); |
| 1345 | buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1346 | } |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1347 | qdf_spin_unlock_bh(&wmi_handle->eventq_lock); |
Govind Singh | 813fdac | 2016-03-12 09:26:52 +0530 | [diff] [blame] | 1348 | qdf_spinlock_destroy(&wmi_handle->ctx_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1349 | if (wmi_handle != NULL) { |
| 1350 | OS_FREE(wmi_handle); |
| 1351 | wmi_handle = NULL; |
| 1352 | } |
| 1353 | } |
| 1354 | |
| 1355 | /** |
| 1356 | * wmi_unified_remove_work() - detach for WMI work |
| 1357 | * @wmi_handle: handle to WMI |
| 1358 | * |
| 1359 | * A function that does not fully detach WMI, but just remove work |
| 1360 | * queue items associated with it. This is used to make sure that |
| 1361 | * before any other processing code that may destroy related contexts |
| 1362 | * (HTC, etc), work queue processing on WMI has already been stopped. |
| 1363 | * |
| 1364 | * Return: None |
| 1365 | */ |
| 1366 | void |
| 1367 | wmi_unified_remove_work(struct wmi_unified *wmi_handle) |
| 1368 | { |
| 1369 | wmi_buf_t buf; |
| 1370 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1371 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO, |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1372 | "Enter: %s", __func__); |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1373 | cancel_work_sync(&wmi_handle->rx_event_work); |
| 1374 | qdf_spin_lock_bh(&wmi_handle->eventq_lock); |
| 1375 | buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1376 | while (buf) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1377 | qdf_nbuf_free(buf); |
| 1378 | buf = qdf_nbuf_queue_remove(&wmi_handle->event_queue); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1379 | } |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1380 | qdf_spin_unlock_bh(&wmi_handle->eventq_lock); |
| 1381 | QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO, |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1382 | "Done: %s", __func__); |
| 1383 | } |
| 1384 | |
| 1385 | void wmi_htc_tx_complete(void *ctx, HTC_PACKET *htc_pkt) |
| 1386 | { |
| 1387 | struct wmi_unified *wmi_handle = (struct wmi_unified *)ctx; |
| 1388 | wmi_buf_t wmi_cmd_buf = GET_HTC_PACKET_NET_BUF_CONTEXT(htc_pkt); |
| 1389 | #ifdef WMI_INTERFACE_EVENT_LOGGING |
| 1390 | uint32_t cmd_id; |
| 1391 | #endif |
| 1392 | |
| 1393 | ASSERT(wmi_cmd_buf); |
| 1394 | #ifdef WMI_INTERFACE_EVENT_LOGGING |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1395 | cmd_id = WMI_GET_FIELD(qdf_nbuf_data(wmi_cmd_buf), |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1396 | WMI_CMD_HDR, COMMANDID); |
| 1397 | |
| 1398 | #ifdef QCA_WIFI_3_0_EMU |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1399 | qdf_print |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1400 | ("\nSent WMI command:%s command_id:0x%x over dma and recieved tx complete interupt\n", |
| 1401 | get_wmi_cmd_string(cmd_id), cmd_id); |
| 1402 | #endif |
| 1403 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1404 | qdf_spin_lock_bh(&wmi_handle->wmi_record_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1405 | /* Record 16 bytes of WMI cmd tx complete data |
| 1406 | - exclude TLV and WMI headers */ |
| 1407 | if (cmd_id == WMI_MGMT_TX_SEND_CMDID) { |
| 1408 | WMI_MGMT_COMMAND_TX_CMP_RECORD(cmd_id, |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1409 | ((uint32_t *) qdf_nbuf_data(wmi_cmd_buf) + 2)); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1410 | } else { |
| 1411 | WMI_COMMAND_TX_CMP_RECORD(cmd_id, |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1412 | ((uint32_t *) qdf_nbuf_data(wmi_cmd_buf) + 2)); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1413 | } |
| 1414 | |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1415 | qdf_spin_unlock_bh(&wmi_handle->wmi_record_lock); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1416 | #endif |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1417 | qdf_nbuf_free(wmi_cmd_buf); |
| 1418 | qdf_mem_free(htc_pkt); |
| 1419 | qdf_atomic_dec(&wmi_handle->pending_cmds); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1420 | } |
| 1421 | |
| 1422 | /** |
| 1423 | * wmi_get_host_credits() - WMI API to get updated host_credits |
| 1424 | * |
| 1425 | * @wmi_handle: handle to WMI. |
| 1426 | * |
| 1427 | * @Return: updated host_credits. |
| 1428 | */ |
| 1429 | int |
| 1430 | wmi_unified_connect_htc_service(struct wmi_unified *wmi_handle, |
| 1431 | void *htc_handle) |
| 1432 | { |
| 1433 | |
| 1434 | int status; |
| 1435 | HTC_SERVICE_CONNECT_RESP response; |
| 1436 | HTC_SERVICE_CONNECT_REQ connect; |
| 1437 | |
| 1438 | OS_MEMZERO(&connect, sizeof(connect)); |
| 1439 | OS_MEMZERO(&response, sizeof(response)); |
| 1440 | |
| 1441 | /* meta data is unused for now */ |
| 1442 | connect.pMetaData = NULL; |
| 1443 | connect.MetaDataLength = 0; |
| 1444 | /* these fields are the same for all service endpoints */ |
| 1445 | connect.EpCallbacks.pContext = wmi_handle; |
| 1446 | connect.EpCallbacks.EpTxCompleteMultiple = |
| 1447 | NULL /* Control path completion ar6000_tx_complete */; |
| 1448 | connect.EpCallbacks.EpRecv = wmi_control_rx /* Control path rx */; |
| 1449 | connect.EpCallbacks.EpRecvRefill = NULL /* ar6000_rx_refill */; |
| 1450 | connect.EpCallbacks.EpSendFull = NULL /* ar6000_tx_queue_full */; |
| 1451 | connect.EpCallbacks.EpTxComplete = |
| 1452 | wmi_htc_tx_complete /* ar6000_tx_queue_full */; |
| 1453 | |
| 1454 | /* connect to control service */ |
| 1455 | connect.service_id = WMI_CONTROL_SVC; |
| 1456 | status = htc_connect_service(htc_handle, &connect, |
| 1457 | &response); |
| 1458 | |
| 1459 | if (status != EOK) { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1460 | qdf_print |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1461 | ("Failed to connect to WMI CONTROL service status:%d \n", |
| 1462 | status); |
| 1463 | return status; |
| 1464 | } |
| 1465 | wmi_handle->wmi_endpoint_id = response.Endpoint; |
| 1466 | wmi_handle->htc_handle = htc_handle; |
| 1467 | wmi_handle->max_msg_len = response.MaxMsgLength; |
| 1468 | |
| 1469 | return EOK; |
| 1470 | } |
| 1471 | |
| 1472 | /** |
| 1473 | * wmi_get_host_credits() - WMI API to get updated host_credits |
| 1474 | * |
| 1475 | * @wmi_handle: handle to WMI. |
| 1476 | * |
| 1477 | * @Return: updated host_credits. |
| 1478 | */ |
| 1479 | int wmi_get_host_credits(wmi_unified_t wmi_handle) |
| 1480 | { |
| 1481 | int host_credits; |
| 1482 | |
| 1483 | htc_get_control_endpoint_tx_host_credits(wmi_handle->htc_handle, |
| 1484 | &host_credits); |
| 1485 | return host_credits; |
| 1486 | } |
| 1487 | |
| 1488 | /** |
| 1489 | * wmi_get_pending_cmds() - WMI API to get WMI Pending Commands in the HTC queue |
| 1490 | * |
| 1491 | * @wmi_handle: handle to WMI. |
| 1492 | * |
| 1493 | * @Return: Pending Commands in the HTC queue. |
| 1494 | */ |
| 1495 | int wmi_get_pending_cmds(wmi_unified_t wmi_handle) |
| 1496 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1497 | return qdf_atomic_read(&wmi_handle->pending_cmds); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1498 | } |
| 1499 | |
| 1500 | /** |
| 1501 | * wmi_set_target_suspend() - WMI API to set target suspend state |
| 1502 | * |
| 1503 | * @wmi_handle: handle to WMI. |
| 1504 | * @val: suspend state boolean. |
| 1505 | * |
| 1506 | * @Return: none. |
| 1507 | */ |
| 1508 | void wmi_set_target_suspend(wmi_unified_t wmi_handle, A_BOOL val) |
| 1509 | { |
Govind Singh | b53420c | 2016-03-09 14:32:57 +0530 | [diff] [blame] | 1510 | qdf_atomic_set(&wmi_handle->is_target_suspended, val); |
Govind Singh | 6b411b5 | 2016-03-06 19:55:02 +0530 | [diff] [blame] | 1511 | } |
| 1512 | |