wmi_unified_priv.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. /*
  2. * Copyright (c) 2013-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. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /*
  27. * This file contains the API definitions for the Unified Wireless
  28. * Module Interface (WMI).
  29. */
  30. #ifndef _WMI_UNIFIED_PRIV_H_
  31. #define _WMI_UNIFIED_PRIV_H_
  32. #include <osdep.h>
  33. #include "a_types.h"
  34. #include "wmi.h"
  35. #include "wmi_unified.h"
  36. #include "qdf_atomic.h"
  37. #define WMI_UNIFIED_MAX_EVENT 0x100
  38. #define WMI_MAX_CMDS 1024
  39. typedef qdf_nbuf_t wmi_buf_t;
  40. #ifdef WMI_INTERFACE_EVENT_LOGGING
  41. #define WMI_EVENT_DEBUG_MAX_ENTRY (1024)
  42. struct wmi_command_debug {
  43. uint32_t command;
  44. uint32_t data[4]; /*16 bytes of WMI cmd excluding TLV and WMI headers */
  45. uint64_t time;
  46. };
  47. struct wmi_event_debug {
  48. uint32_t event;
  49. uint32_t data[4]; /*16 bytes of WMI event data excluding TLV header */
  50. uint64_t time;
  51. };
  52. #endif /*WMI_INTERFACE_EVENT_LOGGING */
  53. #ifdef WLAN_OPEN_SOURCE
  54. struct fwdebug {
  55. struct sk_buff_head fwlog_queue;
  56. struct completion fwlog_completion;
  57. A_BOOL fwlog_open;
  58. };
  59. #endif /* WLAN_OPEN_SOURCE */
  60. struct wmi_ops {
  61. QDF_STATUS (*send_vdev_create_cmd)(wmi_unified_t wmi_handle,
  62. uint8_t macaddr[IEEE80211_ADDR_LEN],
  63. struct vdev_create_params *param);
  64. QDF_STATUS (*send_vdev_delete_cmd)(wmi_unified_t wmi_handle,
  65. uint8_t if_id);
  66. QDF_STATUS (*send_vdev_stop_cmd)(wmi_unified_t wmi,
  67. uint8_t vdev_id);
  68. QDF_STATUS (*send_vdev_down_cmd)(wmi_unified_t wmi,
  69. uint8_t vdev_id);
  70. QDF_STATUS (*send_vdev_start_cmd)(wmi_unified_t wmi,
  71. struct vdev_start_params *req);
  72. QDF_STATUS (*send_hidden_ssid_vdev_restart_cmd)(wmi_unified_t wmi_handle,
  73. struct hidden_ssid_vdev_restart_params *restart_params);
  74. QDF_STATUS (*send_peer_flush_tids_cmd)(wmi_unified_t wmi,
  75. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  76. struct peer_flush_params *param);
  77. QDF_STATUS (*send_peer_delete_cmd)(wmi_unified_t wmi,
  78. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  79. uint8_t vdev_id);
  80. QDF_STATUS (*send_peer_param_cmd)(wmi_unified_t wmi,
  81. uint8_t peer_addr[IEEE80211_ADDR_LEN],
  82. struct peer_set_params *param);
  83. QDF_STATUS (*send_vdev_up_cmd)(wmi_unified_t wmi,
  84. uint8_t bssid[IEEE80211_ADDR_LEN],
  85. struct vdev_up_params *params);
  86. QDF_STATUS (*send_peer_create_cmd)(wmi_unified_t wmi,
  87. struct peer_create_params *param);
  88. QDF_STATUS (*send_green_ap_ps_cmd)(wmi_unified_t wmi_handle,
  89. uint32_t value, uint8_t mac_id);
  90. QDF_STATUS
  91. (*send_pdev_utf_cmd)(wmi_unified_t wmi_handle,
  92. struct pdev_utf_params *param,
  93. uint8_t mac_id);
  94. QDF_STATUS
  95. (*send_pdev_param_cmd)(wmi_unified_t wmi_handle,
  96. struct pdev_params *param,
  97. uint8_t mac_id);
  98. QDF_STATUS (*send_suspend_cmd)(wmi_unified_t wmi_handle,
  99. struct suspend_params *param,
  100. uint8_t mac_id);
  101. QDF_STATUS (*send_resume_cmd)(wmi_unified_t wmi_handle,
  102. uint8_t mac_id);
  103. QDF_STATUS (*send_wow_enable_cmd)(wmi_unified_t wmi_handle,
  104. struct wow_cmd_params *param,
  105. uint8_t mac_id);
  106. QDF_STATUS (*send_set_ap_ps_param_cmd)(wmi_unified_t wmi_handle,
  107. uint8_t *peer_addr,
  108. struct ap_ps_params *param);
  109. QDF_STATUS (*send_set_sta_ps_param_cmd)(wmi_unified_t wmi_handle,
  110. struct sta_ps_params *param);
  111. QDF_STATUS (*send_crash_inject_cmd)(wmi_unified_t wmi_handle,
  112. struct crash_inject *param);
  113. QDF_STATUS
  114. (*send_dbglog_cmd)(wmi_unified_t wmi_handle,
  115. struct dbglog_params *dbglog_param);
  116. QDF_STATUS (*send_vdev_set_param_cmd)(wmi_unified_t wmi_handle,
  117. struct vdev_set_params *param);
  118. QDF_STATUS (*send_stats_request_cmd)(wmi_unified_t wmi_handle,
  119. uint8_t macaddr[IEEE80211_ADDR_LEN],
  120. struct stats_request_params *param);
  121. QDF_STATUS (*send_packet_log_enable_cmd)(wmi_unified_t wmi_handle,
  122. uint8_t macaddr[IEEE80211_ADDR_LEN],
  123. struct packet_enable_params *param);
  124. QDF_STATUS (*send_beacon_send_cmd)(wmi_unified_t wmi_handle,
  125. struct beacon_params *param);
  126. QDF_STATUS (*send_peer_assoc_cmd)(wmi_unified_t wmi_handle,
  127. struct peer_assoc_params *param);
  128. QDF_STATUS (*send_scan_start_cmd)(wmi_unified_t wmi_handle,
  129. struct scan_start_params *param);
  130. QDF_STATUS (*send_scan_stop_cmd)(wmi_unified_t wmi_handle,
  131. struct scan_stop_params *param);
  132. QDF_STATUS (*send_scan_chan_list_cmd)(wmi_unified_t wmi_handle,
  133. struct scan_chan_list_params *param);
  134. QDF_STATUS (*send_mgmt_cmd)(wmi_unified_t wmi_handle,
  135. struct wmi_mgmt_params *param);
  136. QDF_STATUS (*send_modem_power_state_cmd)(wmi_unified_t wmi_handle,
  137. uint32_t param_value);
  138. QDF_STATUS (*send_set_sta_ps_mode_cmd)(wmi_unified_t wmi_handle,
  139. uint32_t vdev_id, uint8_t val);
  140. QDF_STATUS (*send_get_temperature_cmd)(wmi_unified_t wmi_handle);
  141. QDF_STATUS (*send_set_p2pgo_oppps_req_cmd)(wmi_unified_t wmi_handle,
  142. struct p2p_ps_params *oppps);
  143. QDF_STATUS (*send_set_p2pgo_noa_req_cmd)(wmi_unified_t wmi_handle,
  144. struct p2p_ps_params *noa);
  145. QDF_STATUS (*send_set_smps_params_cmd)(wmi_unified_t wmi_handle,
  146. uint8_t vdev_id,
  147. int value);
  148. QDF_STATUS (*send_set_mimops_cmd)(wmi_unified_t wmi_handle,
  149. uint8_t vdev_id, int value);
  150. QDF_STATUS (*send_set_sta_uapsd_auto_trig_cmd)(wmi_unified_t wmi_handle,
  151. struct sta_uapsd_trig_params *param);
  152. QDF_STATUS (*send_ocb_set_utc_time_cmd)(wmi_unified_t wmi_handle,
  153. struct ocb_utc_param *utc);
  154. QDF_STATUS (*send_ocb_get_tsf_timer_cmd)(wmi_unified_t wmi_handle,
  155. uint8_t vdev_id);
  156. QDF_STATUS (*send_ocb_start_timing_advert_cmd)(wmi_unified_t wmi_handle,
  157. struct ocb_timing_advert_param *timing_advert);
  158. QDF_STATUS (*send_ocb_stop_timing_advert_cmd)(wmi_unified_t wmi_handle,
  159. struct ocb_timing_advert_param *timing_advert);
  160. QDF_STATUS (*send_dcc_get_stats_cmd)(wmi_unified_t wmi_handle,
  161. struct dcc_get_stats_param *get_stats_param);
  162. QDF_STATUS (*send_dcc_clear_stats_cmd)(wmi_unified_t wmi_handle,
  163. uint32_t vdev_id, uint32_t dcc_stats_bitmap);
  164. QDF_STATUS (*send_dcc_update_ndl_cmd)(wmi_unified_t wmi_handle,
  165. struct dcc_update_ndl_param *update_ndl_param);
  166. QDF_STATUS (*send_ocb_set_config_cmd)(wmi_unified_t wmi_handle,
  167. struct ocb_config_param *config, uint32_t *ch_mhz);
  168. QDF_STATUS (*send_lro_config_cmd)(wmi_unified_t wmi_handle,
  169. struct wmi_lro_config_cmd_t *wmi_lro_cmd);
  170. QDF_STATUS (*send_set_thermal_mgmt_cmd)(wmi_unified_t wmi_handle,
  171. struct thermal_cmd_params *thermal_info);
  172. QDF_STATUS (*send_set_mcc_channel_time_quota_cmd)
  173. (wmi_unified_t wmi_handle,
  174. uint32_t adapter_1_chan_freq,
  175. uint32_t adapter_1_quota, uint32_t adapter_2_chan_freq);
  176. QDF_STATUS (*send_set_mcc_channel_time_latency_cmd)
  177. (wmi_unified_t wmi_handle,
  178. uint32_t mcc_channel_freq, uint32_t mcc_channel_time_latency);
  179. QDF_STATUS (*send_set_enable_disable_mcc_adaptive_scheduler_cmd)(
  180. wmi_unified_t wmi_handle, uint32_t mcc_adaptive_scheduler);
  181. QDF_STATUS (*send_p2p_go_set_beacon_ie_cmd)(wmi_unified_t wmi_handle,
  182. A_UINT32 vdev_id, uint8_t *p2p_ie);
  183. QDF_STATUS (*send_probe_rsp_tmpl_send_cmd)(wmi_unified_t wmi_handle,
  184. uint8_t vdev_id,
  185. struct wmi_probe_resp_params *probe_rsp_info,
  186. uint8_t *frm);
  187. QDF_STATUS (*send_process_update_edca_param_cmd)(wmi_unified_t wmi_handle,
  188. uint8_t vdev_id,
  189. wmi_wmm_vparams gwmm_param[WMI_MAX_NUM_AC]);
  190. QDF_STATUS (*send_vdev_set_gtx_cfg_cmd)(wmi_unified_t wmi_handle,
  191. uint32_t if_id,
  192. struct wmi_gtx_config *gtx_info);
  193. QDF_STATUS (*send_set_sta_keep_alive_cmd)(wmi_unified_t wmi_handle,
  194. struct sta_params *params);
  195. QDF_STATUS (*send_set_sta_sa_query_param_cmd)(wmi_unified_t wmi_handle,
  196. uint8_t vdev_id, uint32_t max_retries,
  197. uint32_t retry_interval);
  198. QDF_STATUS (*send_bcn_buf_ll_cmd)(wmi_unified_t wmi_handle,
  199. wmi_bcn_send_from_host_cmd_fixed_param *param);
  200. QDF_STATUS (*send_set_gateway_params_cmd)(wmi_unified_t wmi_handle,
  201. struct gateway_update_req_param *req);
  202. QDF_STATUS (*send_set_rssi_monitoring_cmd)(wmi_unified_t wmi_handle,
  203. struct rssi_monitor_param *req);
  204. QDF_STATUS (*send_scan_probe_setoui_cmd)(wmi_unified_t wmi_handle,
  205. struct scan_mac_oui *psetoui);
  206. QDF_STATUS (*send_reset_passpoint_network_list_cmd)(wmi_unified_t wmi_handle,
  207. struct wifi_passpoint_req_param *req);
  208. QDF_STATUS (*send_roam_scan_offload_mode_cmd)(wmi_unified_t wmi_handle,
  209. wmi_start_scan_cmd_fixed_param *scan_cmd_fp,
  210. struct roam_offload_scan_params *roam_req);
  211. QDF_STATUS (*send_roam_scan_offload_rssi_thresh_cmd)(wmi_unified_t wmi_handle,
  212. struct roam_offload_scan_rssi_params *roam_req);
  213. QDF_STATUS (*send_roam_scan_filter_cmd)(wmi_unified_t wmi_handle,
  214. struct roam_scan_filter_params *roam_req);
  215. QDF_STATUS (*send_set_passpoint_network_list_cmd)(wmi_unified_t wmi_handle,
  216. struct wifi_passpoint_req_param *req);
  217. QDF_STATUS (*send_set_epno_network_list_cmd)(wmi_unified_t wmi_handle,
  218. struct wifi_enhanched_pno_params *req);
  219. QDF_STATUS (*send_extscan_get_capabilities_cmd)(wmi_unified_t wmi_handle,
  220. struct extscan_capabilities_params *pgetcapab);
  221. QDF_STATUS (*send_extscan_get_cached_results_cmd)(wmi_unified_t wmi_handle,
  222. struct extscan_cached_result_params *pcached_results);
  223. QDF_STATUS (*send_extscan_stop_change_monitor_cmd)(wmi_unified_t wmi_handle,
  224. struct extscan_capabilities_reset_params *reset_req);
  225. QDF_STATUS (*send_extscan_start_change_monitor_cmd)(wmi_unified_t wmi_handle,
  226. struct extscan_set_sig_changereq_params *
  227. psigchange);
  228. QDF_STATUS (*send_extscan_stop_hotlist_monitor_cmd)(wmi_unified_t wmi_handle,
  229. struct extscan_bssid_hotlist_reset_params *photlist_reset);
  230. QDF_STATUS (*send_stop_extscan_cmd)(wmi_unified_t wmi_handle,
  231. struct extscan_stop_req_params *pstopcmd);
  232. QDF_STATUS (*send_start_extscan_cmd)(wmi_unified_t wmi_handle,
  233. struct wifi_scan_cmd_req_params *pstart);
  234. QDF_STATUS (*send_plm_stop_cmd)(wmi_unified_t wmi_handle,
  235. const struct plm_req_params *plm);
  236. QDF_STATUS (*send_plm_start_cmd)(wmi_unified_t wmi_handle,
  237. const struct plm_req_params *plm,
  238. uint32_t *gchannel_list);
  239. QDF_STATUS (*send_csa_offload_enable_cmd)(wmi_unified_t wmi_handle,
  240. uint8_t vdev_id);
  241. QDF_STATUS (*send_pno_stop_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id);
  242. QDF_STATUS (*send_pno_start_cmd)(wmi_unified_t wmi_handle,
  243. struct pno_scan_req_params *pno,
  244. uint32_t *gchannel_freq_list);
  245. QDF_STATUS (*send_ipa_offload_control_cmd)(wmi_unified_t wmi_handle,
  246. struct ipa_offload_control_params *ipa_offload);
  247. QDF_STATUS (*send_set_ric_req_cmd)(wmi_unified_t wmi_handle, void *msg,
  248. uint8_t is_add_ts);
  249. QDF_STATUS (*send_process_ll_stats_clear_cmd)
  250. (wmi_unified_t wmi_handle,
  251. const struct ll_stats_clear_params *clear_req,
  252. uint8_t addr[IEEE80211_ADDR_LEN]);
  253. QDF_STATUS (*send_process_ll_stats_set_cmd)
  254. (wmi_unified_t wmi_handle, const struct ll_stats_set_params *set_req);
  255. QDF_STATUS (*send_process_ll_stats_get_cmd)
  256. (wmi_unified_t wmi_handle, const struct ll_stats_get_params *get_req,
  257. uint8_t addr[IEEE80211_ADDR_LEN]);
  258. QDF_STATUS (*send_get_stats_cmd)(wmi_unified_t wmi_handle,
  259. struct pe_stats_req *get_stats_param,
  260. uint8_t addr[IEEE80211_ADDR_LEN]);
  261. QDF_STATUS (*send_snr_request_cmd)(wmi_unified_t wmi_handle);
  262. QDF_STATUS (*send_snr_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id);
  263. QDF_STATUS (*send_link_status_req_cmd)(wmi_unified_t wmi_handle,
  264. struct link_status_params *link_status);
  265. QDF_STATUS (*send_lphb_config_hbenable_cmd)(wmi_unified_t wmi_handle,
  266. wmi_hb_set_enable_cmd_fixed_param *params);
  267. QDF_STATUS (*send_lphb_config_tcp_params_cmd)(wmi_unified_t wmi_handle,
  268. wmi_hb_set_tcp_params_cmd_fixed_param *lphb_conf_req);
  269. QDF_STATUS (*send_lphb_config_tcp_pkt_filter_cmd)(wmi_unified_t wmi_handle,
  270. wmi_hb_set_tcp_pkt_filter_cmd_fixed_param *g_hb_tcp_filter_fp);
  271. QDF_STATUS (*send_lphb_config_udp_params_cmd)(wmi_unified_t wmi_handle,
  272. wmi_hb_set_udp_params_cmd_fixed_param *lphb_conf_req);
  273. QDF_STATUS (*send_lphb_config_udp_pkt_filter_cmd)(wmi_unified_t wmi_handle,
  274. wmi_hb_set_udp_pkt_filter_cmd_fixed_param *lphb_conf_req);
  275. QDF_STATUS (*send_process_dhcp_ind_cmd)(wmi_unified_t wmi_handle,
  276. wmi_peer_set_param_cmd_fixed_param *ta_dhcp_ind);
  277. QDF_STATUS (*send_get_link_speed_cmd)(wmi_unified_t wmi_handle,
  278. wmi_mac_addr peer_macaddr);
  279. QDF_STATUS (*send_egap_conf_params_cmd)(wmi_unified_t wmi_handle,
  280. wmi_ap_ps_egap_param_cmd_fixed_param *egap_params);
  281. QDF_STATUS (*send_fw_profiling_cmd)(wmi_unified_t wmi_handle,
  282. uint32_t cmd, uint32_t value1, uint32_t value2);
  283. QDF_STATUS (*send_wow_sta_ra_filter_cmd)(wmi_unified_t wmi_handle,
  284. uint8_t vdev_id, uint8_t default_pattern,
  285. uint16_t rate_limit_interval);
  286. QDF_STATUS (*send_nat_keepalive_en_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id);
  287. QDF_STATUS (*send_start_oem_data_cmd)(wmi_unified_t wmi_handle,
  288. uint8_t data_len,
  289. uint8_t *data);
  290. QDF_STATUS
  291. (*send_dfs_phyerr_filter_offload_en_cmd)(wmi_unified_t wmi_handle,
  292. bool dfs_phyerr_filter_offload);
  293. QDF_STATUS (*send_pktlog_wmi_send_cmd)(wmi_unified_t wmi_handle,
  294. WMI_PKTLOG_EVENT pktlog_event,
  295. WMI_CMD_ID cmd_id);
  296. QDF_STATUS (*send_add_wow_wakeup_event_cmd)(wmi_unified_t wmi_handle,
  297. uint32_t vdev_id,
  298. uint32_t bitmap,
  299. bool enable);
  300. QDF_STATUS (*send_wow_patterns_to_fw_cmd)(wmi_unified_t wmi_handle,
  301. uint8_t vdev_id, uint8_t ptrn_id,
  302. const uint8_t *ptrn, uint8_t ptrn_len,
  303. uint8_t ptrn_offset, const uint8_t *mask,
  304. uint8_t mask_len, bool user,
  305. uint8_t default_patterns);
  306. QDF_STATUS (*send_wow_delete_pattern_cmd)(wmi_unified_t wmi_handle, uint8_t ptrn_id,
  307. uint8_t vdev_id);
  308. QDF_STATUS (*send_host_wakeup_ind_to_fw_cmd)(wmi_unified_t wmi_handle);
  309. QDF_STATUS (*send_del_ts_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id,
  310. uint8_t ac);
  311. QDF_STATUS (*send_aggr_qos_cmd)(wmi_unified_t wmi_handle,
  312. struct aggr_add_ts_param *aggr_qos_rsp_msg);
  313. QDF_STATUS (*send_add_ts_cmd)(wmi_unified_t wmi_handle,
  314. struct add_ts_param *msg);
  315. QDF_STATUS (*send_enable_disable_packet_filter_cmd)(wmi_unified_t wmi_handle,
  316. uint8_t vdev_id, bool enable);
  317. QDF_STATUS (*send_config_packet_filter_cmd)(wmi_unified_t wmi_handle,
  318. uint8_t vdev_id, struct rcv_pkt_filter_config *rcv_filter_param,
  319. uint8_t filter_id, bool enable);
  320. QDF_STATUS (*send_add_clear_mcbc_filter_cmd)(wmi_unified_t wmi_handle,
  321. uint8_t vdev_id,
  322. struct qdf_mac_addr multicast_addr,
  323. bool clearList);
  324. QDF_STATUS (*send_gtk_offload_cmd)(wmi_unified_t wmi_handle, uint8_t vdev_id,
  325. struct gtk_offload_params *params,
  326. bool enable_offload,
  327. uint32_t gtk_offload_opcode);
  328. QDF_STATUS (*send_process_gtk_offload_getinfo_cmd)(wmi_unified_t wmi_handle,
  329. uint8_t vdev_id,
  330. uint64_t offload_req_opcode);
  331. QDF_STATUS (*send_process_add_periodic_tx_ptrn_cmd)(wmi_unified_t wmi_handle,
  332. struct periodic_tx_pattern *
  333. pAddPeriodicTxPtrnParams,
  334. uint8_t vdev_id);
  335. QDF_STATUS (*send_process_del_periodic_tx_ptrn_cmd)(wmi_unified_t wmi_handle,
  336. uint8_t vdev_id,
  337. uint8_t pattern_id);
  338. QDF_STATUS (*send_stats_ext_req_cmd)(wmi_unified_t wmi_handle,
  339. struct stats_ext_params *preq);
  340. QDF_STATUS (*send_enable_ext_wow_cmd)(wmi_unified_t wmi_handle,
  341. struct ext_wow_params *params);
  342. QDF_STATUS (*send_set_app_type2_params_in_fw_cmd)(wmi_unified_t wmi_handle,
  343. struct app_type2_params *appType2Params);
  344. QDF_STATUS (*send_set_auto_shutdown_timer_cmd)(wmi_unified_t wmi_handle,
  345. uint32_t timer_val);
  346. QDF_STATUS (*send_nan_req_cmd)(wmi_unified_t wmi_handle,
  347. struct nan_req_params *nan_req);
  348. QDF_STATUS (*send_process_dhcpserver_offload_cmd)(wmi_unified_t wmi_handle,
  349. struct dhcp_offload_info_params *pDhcpSrvOffloadInfo);
  350. QDF_STATUS (*send_process_ch_avoid_update_cmd)(wmi_unified_t wmi_handle);
  351. QDF_STATUS (*send_regdomain_info_to_fw_cmd)(wmi_unified_t wmi_handle,
  352. uint32_t reg_dmn, uint16_t regdmn2G,
  353. uint16_t regdmn5G, int8_t ctl2G,
  354. int8_t ctl5G);
  355. QDF_STATUS (*send_set_tdls_offchan_mode_cmd)(wmi_unified_t wmi_handle,
  356. struct tdls_channel_switch_params *chan_switch_params);
  357. QDF_STATUS (*send_update_fw_tdls_state_cmd)(wmi_unified_t wmi_handle,
  358. void *tdls_param, uint8_t tdls_state);
  359. QDF_STATUS (*send_update_tdls_peer_state_cmd)(wmi_unified_t wmi_handle,
  360. struct tdls_peer_state_params *peerStateParams,
  361. uint32_t *ch_mhz);
  362. QDF_STATUS (*send_process_fw_mem_dump_cmd)(wmi_unified_t wmi_handle,
  363. struct fw_dump_req_param *mem_dump_req);
  364. QDF_STATUS (*send_process_set_ie_info_cmd)(wmi_unified_t wmi_handle,
  365. struct vdev_ie_info_param *ie_info);
  366. QDF_STATUS (*send_init_cmd)(wmi_unified_t wmi_handle,
  367. wmi_resource_config *res_cfg,
  368. uint8_t num_mem_chunks, struct wmi_host_mem_chunk *mem_chunk,
  369. bool action);
  370. QDF_STATUS (*save_fw_version_cmd)(wmi_unified_t wmi_handle, void *evt_buf);
  371. QDF_STATUS (*check_and_update_fw_version_cmd)(wmi_unified_t wmi_hdl, void *ev);
  372. QDF_STATUS (*send_saved_init_cmd)(wmi_unified_t wmi_handle);
  373. QDF_STATUS (*send_set_base_macaddr_indicate_cmd)(wmi_unified_t wmi_handle,
  374. uint8_t *custom_addr);
  375. QDF_STATUS (*send_log_supported_evt_cmd)(wmi_unified_t wmi_handle,
  376. uint8_t *event,
  377. uint32_t len);
  378. QDF_STATUS (*send_enable_specific_fw_logs_cmd)(wmi_unified_t wmi_handle,
  379. struct wmi_wifi_start_log *start_log);
  380. QDF_STATUS (*send_flush_logs_to_fw_cmd)(wmi_unified_t wmi_handle);
  381. QDF_STATUS (*send_soc_set_pcl_cmd)(wmi_unified_t wmi_handle,
  382. struct wmi_pcl_list *msg);
  383. QDF_STATUS (*send_soc_set_hw_mode_cmd)(wmi_unified_t wmi_handle,
  384. uint32_t hw_mode_index);
  385. QDF_STATUS (*send_soc_set_dual_mac_config_cmd)(wmi_unified_t wmi_handle,
  386. struct wmi_dual_mac_config *msg);
  387. QDF_STATUS (*send_enable_arp_ns_offload_cmd)(wmi_unified_t wmi_handle,
  388. struct host_offload_req_param *param, bool arp_only,
  389. uint8_t vdev_id);
  390. QDF_STATUS (*send_set_led_flashing_cmd)(wmi_unified_t wmi_handle,
  391. struct flashing_req_params *flashing);
  392. QDF_STATUS (*send_app_type1_params_in_fw_cmd)(wmi_unified_t wmi_handle,
  393. struct app_type1_params *app_type1_params);
  394. QDF_STATUS (*send_set_ssid_hotlist_cmd)(wmi_unified_t wmi_handle,
  395. struct ssid_hotlist_request_params *request);
  396. QDF_STATUS (*send_process_roam_synch_complete_cmd)(wmi_unified_t wmi_handle,
  397. uint8_t vdev_id);
  398. QDF_STATUS (*send_unit_test_cmd)(wmi_unified_t wmi_handle,
  399. struct wmi_unit_test_cmd *wmi_utest);
  400. QDF_STATUS (*send_roam_invoke_cmd)(wmi_unified_t wmi_handle,
  401. struct wmi_roam_invoke_cmd *roaminvoke,
  402. uint32_t ch_hz);
  403. QDF_STATUS (*send_roam_scan_offload_cmd)(wmi_unified_t wmi_handle,
  404. uint32_t command, uint32_t vdev_id);
  405. QDF_STATUS (*send_roam_scan_offload_ap_profile_cmd)(wmi_unified_t wmi_handle,
  406. wmi_ap_profile *ap_profile_p,
  407. uint32_t vdev_id);
  408. QDF_STATUS (*send_roam_scan_offload_scan_period_cmd)(wmi_unified_t wmi_handle,
  409. uint32_t scan_period,
  410. uint32_t scan_age,
  411. uint32_t vdev_id);
  412. QDF_STATUS (*send_roam_scan_offload_chan_list_cmd)(wmi_unified_t wmi_handle,
  413. uint8_t chan_count,
  414. uint8_t *chan_list,
  415. uint8_t list_type, uint32_t vdev_id);
  416. QDF_STATUS (*send_roam_scan_offload_rssi_change_cmd)(wmi_unified_t wmi_handle,
  417. uint32_t vdev_id,
  418. int32_t rssi_change_thresh,
  419. uint32_t bcn_rssi_weight,
  420. uint32_t hirssi_delay_btw_scans);
  421. QDF_STATUS (*send_get_buf_extscan_hotlist_cmd)(wmi_unified_t wmi_handle,
  422. struct ext_scan_setbssi_hotlist_params *
  423. photlist, int *buf_len);
  424. };
  425. /**
  426. * struct wmi_init_cmd - Saved wmi INIT command
  427. * @buf: Buffer containing the wmi INIT command
  428. * @buf_len: Length of the buffer
  429. */
  430. struct wmi_cmd_init {
  431. wmi_buf_t buf;
  432. uint32_t buf_len;
  433. };
  434. struct wmi_unified {
  435. ol_scn_t scn_handle; /* handle to device */
  436. osdev_t osdev; /* handle to use OS-independent services */
  437. qdf_atomic_t pending_cmds;
  438. HTC_ENDPOINT_ID wmi_endpoint_id;
  439. uint16_t max_msg_len;
  440. WMI_EVT_ID event_id[WMI_UNIFIED_MAX_EVENT];
  441. wmi_unified_event_handler event_handler[WMI_UNIFIED_MAX_EVENT];
  442. enum wmi_rx_exec_ctx ctx[WMI_UNIFIED_MAX_EVENT];
  443. uint32_t max_event_idx;
  444. void *htc_handle;
  445. qdf_spinlock_t eventq_lock;
  446. qdf_nbuf_queue_t event_queue;
  447. struct work_struct rx_event_work;
  448. int wmi_stop_in_progress;
  449. struct _wmi_abi_version fw_abi_version;
  450. struct _wmi_abi_version final_abi_vers;
  451. struct wmi_cmd_init saved_wmi_init_cmd;
  452. uint32_t num_of_diag_events_logs;
  453. uint32_t *events_logs_list;
  454. struct host_offload_req_param arp_info;
  455. #ifdef WLAN_OPEN_SOURCE
  456. struct fwdebug dbglog;
  457. struct dentry *debugfs_phy;
  458. #endif /* WLAN_OPEN_SOURCE */
  459. #ifdef WMI_INTERFACE_EVENT_LOGGING
  460. qdf_spinlock_t wmi_record_lock;
  461. #endif /*WMI_INTERFACE_EVENT_LOGGING */
  462. qdf_atomic_t is_target_suspended;
  463. #ifdef FEATURE_RUNTIME_PM
  464. qdf_atomic_t runtime_pm_inprogress;
  465. #endif
  466. struct wmi_rx_ops rx_ops;
  467. struct wmi_ops *ops;
  468. void *event_handler_cookie[WMI_UNIFIED_MAX_EVENT];
  469. bool use_cookie;
  470. qdf_spinlock_t ctx_lock;
  471. };
  472. struct wmi_ops *wmi_get_tlv_ops(void);
  473. struct wmi_ops *wmi_get_non_tlv_ops(void);
  474. #endif