2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include <linux/skbuff.h>
19 #include <linux/ctype.h>
32 #define ATH10K_WMI_BARRIER_ECHO_ID 0xBA991E9
33 #define ATH10K_WMI_BARRIER_TIMEOUT_HZ (3 * HZ)
35 /* MAIN WMI cmd track */
36 static struct wmi_cmd_map wmi_cmd_map
= {
37 .init_cmdid
= WMI_INIT_CMDID
,
38 .start_scan_cmdid
= WMI_START_SCAN_CMDID
,
39 .stop_scan_cmdid
= WMI_STOP_SCAN_CMDID
,
40 .scan_chan_list_cmdid
= WMI_SCAN_CHAN_LIST_CMDID
,
41 .scan_sch_prio_tbl_cmdid
= WMI_SCAN_SCH_PRIO_TBL_CMDID
,
42 .pdev_set_regdomain_cmdid
= WMI_PDEV_SET_REGDOMAIN_CMDID
,
43 .pdev_set_channel_cmdid
= WMI_PDEV_SET_CHANNEL_CMDID
,
44 .pdev_set_param_cmdid
= WMI_PDEV_SET_PARAM_CMDID
,
45 .pdev_pktlog_enable_cmdid
= WMI_PDEV_PKTLOG_ENABLE_CMDID
,
46 .pdev_pktlog_disable_cmdid
= WMI_PDEV_PKTLOG_DISABLE_CMDID
,
47 .pdev_set_wmm_params_cmdid
= WMI_PDEV_SET_WMM_PARAMS_CMDID
,
48 .pdev_set_ht_cap_ie_cmdid
= WMI_PDEV_SET_HT_CAP_IE_CMDID
,
49 .pdev_set_vht_cap_ie_cmdid
= WMI_PDEV_SET_VHT_CAP_IE_CMDID
,
50 .pdev_set_dscp_tid_map_cmdid
= WMI_PDEV_SET_DSCP_TID_MAP_CMDID
,
51 .pdev_set_quiet_mode_cmdid
= WMI_PDEV_SET_QUIET_MODE_CMDID
,
52 .pdev_green_ap_ps_enable_cmdid
= WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID
,
53 .pdev_get_tpc_config_cmdid
= WMI_PDEV_GET_TPC_CONFIG_CMDID
,
54 .pdev_set_base_macaddr_cmdid
= WMI_PDEV_SET_BASE_MACADDR_CMDID
,
55 .vdev_create_cmdid
= WMI_VDEV_CREATE_CMDID
,
56 .vdev_delete_cmdid
= WMI_VDEV_DELETE_CMDID
,
57 .vdev_start_request_cmdid
= WMI_VDEV_START_REQUEST_CMDID
,
58 .vdev_restart_request_cmdid
= WMI_VDEV_RESTART_REQUEST_CMDID
,
59 .vdev_up_cmdid
= WMI_VDEV_UP_CMDID
,
60 .vdev_stop_cmdid
= WMI_VDEV_STOP_CMDID
,
61 .vdev_down_cmdid
= WMI_VDEV_DOWN_CMDID
,
62 .vdev_set_param_cmdid
= WMI_VDEV_SET_PARAM_CMDID
,
63 .vdev_install_key_cmdid
= WMI_VDEV_INSTALL_KEY_CMDID
,
64 .peer_create_cmdid
= WMI_PEER_CREATE_CMDID
,
65 .peer_delete_cmdid
= WMI_PEER_DELETE_CMDID
,
66 .peer_flush_tids_cmdid
= WMI_PEER_FLUSH_TIDS_CMDID
,
67 .peer_set_param_cmdid
= WMI_PEER_SET_PARAM_CMDID
,
68 .peer_assoc_cmdid
= WMI_PEER_ASSOC_CMDID
,
69 .peer_add_wds_entry_cmdid
= WMI_PEER_ADD_WDS_ENTRY_CMDID
,
70 .peer_remove_wds_entry_cmdid
= WMI_PEER_REMOVE_WDS_ENTRY_CMDID
,
71 .peer_mcast_group_cmdid
= WMI_PEER_MCAST_GROUP_CMDID
,
72 .bcn_tx_cmdid
= WMI_BCN_TX_CMDID
,
73 .pdev_send_bcn_cmdid
= WMI_PDEV_SEND_BCN_CMDID
,
74 .bcn_tmpl_cmdid
= WMI_BCN_TMPL_CMDID
,
75 .bcn_filter_rx_cmdid
= WMI_BCN_FILTER_RX_CMDID
,
76 .prb_req_filter_rx_cmdid
= WMI_PRB_REQ_FILTER_RX_CMDID
,
77 .mgmt_tx_cmdid
= WMI_MGMT_TX_CMDID
,
78 .prb_tmpl_cmdid
= WMI_PRB_TMPL_CMDID
,
79 .addba_clear_resp_cmdid
= WMI_ADDBA_CLEAR_RESP_CMDID
,
80 .addba_send_cmdid
= WMI_ADDBA_SEND_CMDID
,
81 .addba_status_cmdid
= WMI_ADDBA_STATUS_CMDID
,
82 .delba_send_cmdid
= WMI_DELBA_SEND_CMDID
,
83 .addba_set_resp_cmdid
= WMI_ADDBA_SET_RESP_CMDID
,
84 .send_singleamsdu_cmdid
= WMI_SEND_SINGLEAMSDU_CMDID
,
85 .sta_powersave_mode_cmdid
= WMI_STA_POWERSAVE_MODE_CMDID
,
86 .sta_powersave_param_cmdid
= WMI_STA_POWERSAVE_PARAM_CMDID
,
87 .sta_mimo_ps_mode_cmdid
= WMI_STA_MIMO_PS_MODE_CMDID
,
88 .pdev_dfs_enable_cmdid
= WMI_PDEV_DFS_ENABLE_CMDID
,
89 .pdev_dfs_disable_cmdid
= WMI_PDEV_DFS_DISABLE_CMDID
,
90 .roam_scan_mode
= WMI_ROAM_SCAN_MODE
,
91 .roam_scan_rssi_threshold
= WMI_ROAM_SCAN_RSSI_THRESHOLD
,
92 .roam_scan_period
= WMI_ROAM_SCAN_PERIOD
,
93 .roam_scan_rssi_change_threshold
= WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD
,
94 .roam_ap_profile
= WMI_ROAM_AP_PROFILE
,
95 .ofl_scan_add_ap_profile
= WMI_ROAM_AP_PROFILE
,
96 .ofl_scan_remove_ap_profile
= WMI_OFL_SCAN_REMOVE_AP_PROFILE
,
97 .ofl_scan_period
= WMI_OFL_SCAN_PERIOD
,
98 .p2p_dev_set_device_info
= WMI_P2P_DEV_SET_DEVICE_INFO
,
99 .p2p_dev_set_discoverability
= WMI_P2P_DEV_SET_DISCOVERABILITY
,
100 .p2p_go_set_beacon_ie
= WMI_P2P_GO_SET_BEACON_IE
,
101 .p2p_go_set_probe_resp_ie
= WMI_P2P_GO_SET_PROBE_RESP_IE
,
102 .p2p_set_vendor_ie_data_cmdid
= WMI_P2P_SET_VENDOR_IE_DATA_CMDID
,
103 .ap_ps_peer_param_cmdid
= WMI_AP_PS_PEER_PARAM_CMDID
,
104 .ap_ps_peer_uapsd_coex_cmdid
= WMI_AP_PS_PEER_UAPSD_COEX_CMDID
,
105 .peer_rate_retry_sched_cmdid
= WMI_PEER_RATE_RETRY_SCHED_CMDID
,
106 .wlan_profile_trigger_cmdid
= WMI_WLAN_PROFILE_TRIGGER_CMDID
,
107 .wlan_profile_set_hist_intvl_cmdid
=
108 WMI_WLAN_PROFILE_SET_HIST_INTVL_CMDID
,
109 .wlan_profile_get_profile_data_cmdid
=
110 WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID
,
111 .wlan_profile_enable_profile_id_cmdid
=
112 WMI_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID
,
113 .wlan_profile_list_profile_id_cmdid
=
114 WMI_WLAN_PROFILE_LIST_PROFILE_ID_CMDID
,
115 .pdev_suspend_cmdid
= WMI_PDEV_SUSPEND_CMDID
,
116 .pdev_resume_cmdid
= WMI_PDEV_RESUME_CMDID
,
117 .add_bcn_filter_cmdid
= WMI_ADD_BCN_FILTER_CMDID
,
118 .rmv_bcn_filter_cmdid
= WMI_RMV_BCN_FILTER_CMDID
,
119 .wow_add_wake_pattern_cmdid
= WMI_WOW_ADD_WAKE_PATTERN_CMDID
,
120 .wow_del_wake_pattern_cmdid
= WMI_WOW_DEL_WAKE_PATTERN_CMDID
,
121 .wow_enable_disable_wake_event_cmdid
=
122 WMI_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID
,
123 .wow_enable_cmdid
= WMI_WOW_ENABLE_CMDID
,
124 .wow_hostwakeup_from_sleep_cmdid
= WMI_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID
,
125 .rtt_measreq_cmdid
= WMI_RTT_MEASREQ_CMDID
,
126 .rtt_tsf_cmdid
= WMI_RTT_TSF_CMDID
,
127 .vdev_spectral_scan_configure_cmdid
=
128 WMI_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID
,
129 .vdev_spectral_scan_enable_cmdid
= WMI_VDEV_SPECTRAL_SCAN_ENABLE_CMDID
,
130 .request_stats_cmdid
= WMI_REQUEST_STATS_CMDID
,
131 .set_arp_ns_offload_cmdid
= WMI_SET_ARP_NS_OFFLOAD_CMDID
,
132 .network_list_offload_config_cmdid
=
133 WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID
,
134 .gtk_offload_cmdid
= WMI_GTK_OFFLOAD_CMDID
,
135 .csa_offload_enable_cmdid
= WMI_CSA_OFFLOAD_ENABLE_CMDID
,
136 .csa_offload_chanswitch_cmdid
= WMI_CSA_OFFLOAD_CHANSWITCH_CMDID
,
137 .chatter_set_mode_cmdid
= WMI_CHATTER_SET_MODE_CMDID
,
138 .peer_tid_addba_cmdid
= WMI_PEER_TID_ADDBA_CMDID
,
139 .peer_tid_delba_cmdid
= WMI_PEER_TID_DELBA_CMDID
,
140 .sta_dtim_ps_method_cmdid
= WMI_STA_DTIM_PS_METHOD_CMDID
,
141 .sta_uapsd_auto_trig_cmdid
= WMI_STA_UAPSD_AUTO_TRIG_CMDID
,
142 .sta_keepalive_cmd
= WMI_STA_KEEPALIVE_CMD
,
143 .echo_cmdid
= WMI_ECHO_CMDID
,
144 .pdev_utf_cmdid
= WMI_PDEV_UTF_CMDID
,
145 .dbglog_cfg_cmdid
= WMI_DBGLOG_CFG_CMDID
,
146 .pdev_qvit_cmdid
= WMI_PDEV_QVIT_CMDID
,
147 .pdev_ftm_intg_cmdid
= WMI_PDEV_FTM_INTG_CMDID
,
148 .vdev_set_keepalive_cmdid
= WMI_VDEV_SET_KEEPALIVE_CMDID
,
149 .vdev_get_keepalive_cmdid
= WMI_VDEV_GET_KEEPALIVE_CMDID
,
150 .force_fw_hang_cmdid
= WMI_FORCE_FW_HANG_CMDID
,
151 .gpio_config_cmdid
= WMI_GPIO_CONFIG_CMDID
,
152 .gpio_output_cmdid
= WMI_GPIO_OUTPUT_CMDID
,
153 .pdev_get_temperature_cmdid
= WMI_CMD_UNSUPPORTED
,
154 .pdev_enable_adaptive_cca_cmdid
= WMI_CMD_UNSUPPORTED
,
155 .scan_update_request_cmdid
= WMI_CMD_UNSUPPORTED
,
156 .vdev_standby_response_cmdid
= WMI_CMD_UNSUPPORTED
,
157 .vdev_resume_response_cmdid
= WMI_CMD_UNSUPPORTED
,
158 .wlan_peer_caching_add_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
159 .wlan_peer_caching_evict_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
160 .wlan_peer_caching_restore_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
161 .wlan_peer_caching_print_all_peers_info_cmdid
= WMI_CMD_UNSUPPORTED
,
162 .peer_update_wds_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
163 .peer_add_proxy_sta_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
164 .rtt_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
165 .oem_req_cmdid
= WMI_CMD_UNSUPPORTED
,
166 .nan_cmdid
= WMI_CMD_UNSUPPORTED
,
167 .vdev_ratemask_cmdid
= WMI_CMD_UNSUPPORTED
,
168 .qboost_cfg_cmdid
= WMI_CMD_UNSUPPORTED
,
169 .pdev_smart_ant_enable_cmdid
= WMI_CMD_UNSUPPORTED
,
170 .pdev_smart_ant_set_rx_antenna_cmdid
= WMI_CMD_UNSUPPORTED
,
171 .peer_smart_ant_set_tx_antenna_cmdid
= WMI_CMD_UNSUPPORTED
,
172 .peer_smart_ant_set_train_info_cmdid
= WMI_CMD_UNSUPPORTED
,
173 .peer_smart_ant_set_node_config_ops_cmdid
= WMI_CMD_UNSUPPORTED
,
174 .pdev_set_antenna_switch_table_cmdid
= WMI_CMD_UNSUPPORTED
,
175 .pdev_set_ctl_table_cmdid
= WMI_CMD_UNSUPPORTED
,
176 .pdev_set_mimogain_table_cmdid
= WMI_CMD_UNSUPPORTED
,
177 .pdev_ratepwr_table_cmdid
= WMI_CMD_UNSUPPORTED
,
178 .pdev_ratepwr_chainmsk_table_cmdid
= WMI_CMD_UNSUPPORTED
,
179 .pdev_fips_cmdid
= WMI_CMD_UNSUPPORTED
,
180 .tt_set_conf_cmdid
= WMI_CMD_UNSUPPORTED
,
181 .fwtest_cmdid
= WMI_CMD_UNSUPPORTED
,
182 .vdev_atf_request_cmdid
= WMI_CMD_UNSUPPORTED
,
183 .peer_atf_request_cmdid
= WMI_CMD_UNSUPPORTED
,
184 .pdev_get_ani_cck_config_cmdid
= WMI_CMD_UNSUPPORTED
,
185 .pdev_get_ani_ofdm_config_cmdid
= WMI_CMD_UNSUPPORTED
,
186 .pdev_reserve_ast_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
187 .pdev_get_nfcal_power_cmdid
= WMI_CMD_UNSUPPORTED
,
188 .pdev_get_tpc_cmdid
= WMI_CMD_UNSUPPORTED
,
189 .pdev_get_ast_info_cmdid
= WMI_CMD_UNSUPPORTED
,
190 .vdev_set_dscp_tid_map_cmdid
= WMI_CMD_UNSUPPORTED
,
191 .pdev_get_info_cmdid
= WMI_CMD_UNSUPPORTED
,
192 .vdev_get_info_cmdid
= WMI_CMD_UNSUPPORTED
,
193 .vdev_filter_neighbor_rx_packets_cmdid
= WMI_CMD_UNSUPPORTED
,
194 .mu_cal_start_cmdid
= WMI_CMD_UNSUPPORTED
,
195 .set_cca_params_cmdid
= WMI_CMD_UNSUPPORTED
,
196 .pdev_bss_chan_info_request_cmdid
= WMI_CMD_UNSUPPORTED
,
199 /* 10.X WMI cmd track */
200 static struct wmi_cmd_map wmi_10x_cmd_map
= {
201 .init_cmdid
= WMI_10X_INIT_CMDID
,
202 .start_scan_cmdid
= WMI_10X_START_SCAN_CMDID
,
203 .stop_scan_cmdid
= WMI_10X_STOP_SCAN_CMDID
,
204 .scan_chan_list_cmdid
= WMI_10X_SCAN_CHAN_LIST_CMDID
,
205 .scan_sch_prio_tbl_cmdid
= WMI_CMD_UNSUPPORTED
,
206 .pdev_set_regdomain_cmdid
= WMI_10X_PDEV_SET_REGDOMAIN_CMDID
,
207 .pdev_set_channel_cmdid
= WMI_10X_PDEV_SET_CHANNEL_CMDID
,
208 .pdev_set_param_cmdid
= WMI_10X_PDEV_SET_PARAM_CMDID
,
209 .pdev_pktlog_enable_cmdid
= WMI_10X_PDEV_PKTLOG_ENABLE_CMDID
,
210 .pdev_pktlog_disable_cmdid
= WMI_10X_PDEV_PKTLOG_DISABLE_CMDID
,
211 .pdev_set_wmm_params_cmdid
= WMI_10X_PDEV_SET_WMM_PARAMS_CMDID
,
212 .pdev_set_ht_cap_ie_cmdid
= WMI_10X_PDEV_SET_HT_CAP_IE_CMDID
,
213 .pdev_set_vht_cap_ie_cmdid
= WMI_10X_PDEV_SET_VHT_CAP_IE_CMDID
,
214 .pdev_set_dscp_tid_map_cmdid
= WMI_10X_PDEV_SET_DSCP_TID_MAP_CMDID
,
215 .pdev_set_quiet_mode_cmdid
= WMI_10X_PDEV_SET_QUIET_MODE_CMDID
,
216 .pdev_green_ap_ps_enable_cmdid
= WMI_10X_PDEV_GREEN_AP_PS_ENABLE_CMDID
,
217 .pdev_get_tpc_config_cmdid
= WMI_10X_PDEV_GET_TPC_CONFIG_CMDID
,
218 .pdev_set_base_macaddr_cmdid
= WMI_10X_PDEV_SET_BASE_MACADDR_CMDID
,
219 .vdev_create_cmdid
= WMI_10X_VDEV_CREATE_CMDID
,
220 .vdev_delete_cmdid
= WMI_10X_VDEV_DELETE_CMDID
,
221 .vdev_start_request_cmdid
= WMI_10X_VDEV_START_REQUEST_CMDID
,
222 .vdev_restart_request_cmdid
= WMI_10X_VDEV_RESTART_REQUEST_CMDID
,
223 .vdev_up_cmdid
= WMI_10X_VDEV_UP_CMDID
,
224 .vdev_stop_cmdid
= WMI_10X_VDEV_STOP_CMDID
,
225 .vdev_down_cmdid
= WMI_10X_VDEV_DOWN_CMDID
,
226 .vdev_set_param_cmdid
= WMI_10X_VDEV_SET_PARAM_CMDID
,
227 .vdev_install_key_cmdid
= WMI_10X_VDEV_INSTALL_KEY_CMDID
,
228 .peer_create_cmdid
= WMI_10X_PEER_CREATE_CMDID
,
229 .peer_delete_cmdid
= WMI_10X_PEER_DELETE_CMDID
,
230 .peer_flush_tids_cmdid
= WMI_10X_PEER_FLUSH_TIDS_CMDID
,
231 .peer_set_param_cmdid
= WMI_10X_PEER_SET_PARAM_CMDID
,
232 .peer_assoc_cmdid
= WMI_10X_PEER_ASSOC_CMDID
,
233 .peer_add_wds_entry_cmdid
= WMI_10X_PEER_ADD_WDS_ENTRY_CMDID
,
234 .peer_remove_wds_entry_cmdid
= WMI_10X_PEER_REMOVE_WDS_ENTRY_CMDID
,
235 .peer_mcast_group_cmdid
= WMI_10X_PEER_MCAST_GROUP_CMDID
,
236 .bcn_tx_cmdid
= WMI_10X_BCN_TX_CMDID
,
237 .pdev_send_bcn_cmdid
= WMI_10X_PDEV_SEND_BCN_CMDID
,
238 .bcn_tmpl_cmdid
= WMI_CMD_UNSUPPORTED
,
239 .bcn_filter_rx_cmdid
= WMI_10X_BCN_FILTER_RX_CMDID
,
240 .prb_req_filter_rx_cmdid
= WMI_10X_PRB_REQ_FILTER_RX_CMDID
,
241 .mgmt_tx_cmdid
= WMI_10X_MGMT_TX_CMDID
,
242 .prb_tmpl_cmdid
= WMI_CMD_UNSUPPORTED
,
243 .addba_clear_resp_cmdid
= WMI_10X_ADDBA_CLEAR_RESP_CMDID
,
244 .addba_send_cmdid
= WMI_10X_ADDBA_SEND_CMDID
,
245 .addba_status_cmdid
= WMI_10X_ADDBA_STATUS_CMDID
,
246 .delba_send_cmdid
= WMI_10X_DELBA_SEND_CMDID
,
247 .addba_set_resp_cmdid
= WMI_10X_ADDBA_SET_RESP_CMDID
,
248 .send_singleamsdu_cmdid
= WMI_10X_SEND_SINGLEAMSDU_CMDID
,
249 .sta_powersave_mode_cmdid
= WMI_10X_STA_POWERSAVE_MODE_CMDID
,
250 .sta_powersave_param_cmdid
= WMI_10X_STA_POWERSAVE_PARAM_CMDID
,
251 .sta_mimo_ps_mode_cmdid
= WMI_10X_STA_MIMO_PS_MODE_CMDID
,
252 .pdev_dfs_enable_cmdid
= WMI_10X_PDEV_DFS_ENABLE_CMDID
,
253 .pdev_dfs_disable_cmdid
= WMI_10X_PDEV_DFS_DISABLE_CMDID
,
254 .roam_scan_mode
= WMI_10X_ROAM_SCAN_MODE
,
255 .roam_scan_rssi_threshold
= WMI_10X_ROAM_SCAN_RSSI_THRESHOLD
,
256 .roam_scan_period
= WMI_10X_ROAM_SCAN_PERIOD
,
257 .roam_scan_rssi_change_threshold
=
258 WMI_10X_ROAM_SCAN_RSSI_CHANGE_THRESHOLD
,
259 .roam_ap_profile
= WMI_10X_ROAM_AP_PROFILE
,
260 .ofl_scan_add_ap_profile
= WMI_10X_OFL_SCAN_ADD_AP_PROFILE
,
261 .ofl_scan_remove_ap_profile
= WMI_10X_OFL_SCAN_REMOVE_AP_PROFILE
,
262 .ofl_scan_period
= WMI_10X_OFL_SCAN_PERIOD
,
263 .p2p_dev_set_device_info
= WMI_10X_P2P_DEV_SET_DEVICE_INFO
,
264 .p2p_dev_set_discoverability
= WMI_10X_P2P_DEV_SET_DISCOVERABILITY
,
265 .p2p_go_set_beacon_ie
= WMI_10X_P2P_GO_SET_BEACON_IE
,
266 .p2p_go_set_probe_resp_ie
= WMI_10X_P2P_GO_SET_PROBE_RESP_IE
,
267 .p2p_set_vendor_ie_data_cmdid
= WMI_CMD_UNSUPPORTED
,
268 .ap_ps_peer_param_cmdid
= WMI_10X_AP_PS_PEER_PARAM_CMDID
,
269 .ap_ps_peer_uapsd_coex_cmdid
= WMI_CMD_UNSUPPORTED
,
270 .peer_rate_retry_sched_cmdid
= WMI_10X_PEER_RATE_RETRY_SCHED_CMDID
,
271 .wlan_profile_trigger_cmdid
= WMI_10X_WLAN_PROFILE_TRIGGER_CMDID
,
272 .wlan_profile_set_hist_intvl_cmdid
=
273 WMI_10X_WLAN_PROFILE_SET_HIST_INTVL_CMDID
,
274 .wlan_profile_get_profile_data_cmdid
=
275 WMI_10X_WLAN_PROFILE_GET_PROFILE_DATA_CMDID
,
276 .wlan_profile_enable_profile_id_cmdid
=
277 WMI_10X_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID
,
278 .wlan_profile_list_profile_id_cmdid
=
279 WMI_10X_WLAN_PROFILE_LIST_PROFILE_ID_CMDID
,
280 .pdev_suspend_cmdid
= WMI_10X_PDEV_SUSPEND_CMDID
,
281 .pdev_resume_cmdid
= WMI_10X_PDEV_RESUME_CMDID
,
282 .add_bcn_filter_cmdid
= WMI_10X_ADD_BCN_FILTER_CMDID
,
283 .rmv_bcn_filter_cmdid
= WMI_10X_RMV_BCN_FILTER_CMDID
,
284 .wow_add_wake_pattern_cmdid
= WMI_10X_WOW_ADD_WAKE_PATTERN_CMDID
,
285 .wow_del_wake_pattern_cmdid
= WMI_10X_WOW_DEL_WAKE_PATTERN_CMDID
,
286 .wow_enable_disable_wake_event_cmdid
=
287 WMI_10X_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID
,
288 .wow_enable_cmdid
= WMI_10X_WOW_ENABLE_CMDID
,
289 .wow_hostwakeup_from_sleep_cmdid
=
290 WMI_10X_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID
,
291 .rtt_measreq_cmdid
= WMI_10X_RTT_MEASREQ_CMDID
,
292 .rtt_tsf_cmdid
= WMI_10X_RTT_TSF_CMDID
,
293 .vdev_spectral_scan_configure_cmdid
=
294 WMI_10X_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID
,
295 .vdev_spectral_scan_enable_cmdid
=
296 WMI_10X_VDEV_SPECTRAL_SCAN_ENABLE_CMDID
,
297 .request_stats_cmdid
= WMI_10X_REQUEST_STATS_CMDID
,
298 .set_arp_ns_offload_cmdid
= WMI_CMD_UNSUPPORTED
,
299 .network_list_offload_config_cmdid
= WMI_CMD_UNSUPPORTED
,
300 .gtk_offload_cmdid
= WMI_CMD_UNSUPPORTED
,
301 .csa_offload_enable_cmdid
= WMI_CMD_UNSUPPORTED
,
302 .csa_offload_chanswitch_cmdid
= WMI_CMD_UNSUPPORTED
,
303 .chatter_set_mode_cmdid
= WMI_CMD_UNSUPPORTED
,
304 .peer_tid_addba_cmdid
= WMI_CMD_UNSUPPORTED
,
305 .peer_tid_delba_cmdid
= WMI_CMD_UNSUPPORTED
,
306 .sta_dtim_ps_method_cmdid
= WMI_CMD_UNSUPPORTED
,
307 .sta_uapsd_auto_trig_cmdid
= WMI_CMD_UNSUPPORTED
,
308 .sta_keepalive_cmd
= WMI_CMD_UNSUPPORTED
,
309 .echo_cmdid
= WMI_10X_ECHO_CMDID
,
310 .pdev_utf_cmdid
= WMI_10X_PDEV_UTF_CMDID
,
311 .dbglog_cfg_cmdid
= WMI_10X_DBGLOG_CFG_CMDID
,
312 .pdev_qvit_cmdid
= WMI_10X_PDEV_QVIT_CMDID
,
313 .pdev_ftm_intg_cmdid
= WMI_CMD_UNSUPPORTED
,
314 .vdev_set_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
315 .vdev_get_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
316 .force_fw_hang_cmdid
= WMI_CMD_UNSUPPORTED
,
317 .gpio_config_cmdid
= WMI_10X_GPIO_CONFIG_CMDID
,
318 .gpio_output_cmdid
= WMI_10X_GPIO_OUTPUT_CMDID
,
319 .pdev_get_temperature_cmdid
= WMI_CMD_UNSUPPORTED
,
320 .pdev_enable_adaptive_cca_cmdid
= WMI_CMD_UNSUPPORTED
,
321 .scan_update_request_cmdid
= WMI_CMD_UNSUPPORTED
,
322 .vdev_standby_response_cmdid
= WMI_CMD_UNSUPPORTED
,
323 .vdev_resume_response_cmdid
= WMI_CMD_UNSUPPORTED
,
324 .wlan_peer_caching_add_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
325 .wlan_peer_caching_evict_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
326 .wlan_peer_caching_restore_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
327 .wlan_peer_caching_print_all_peers_info_cmdid
= WMI_CMD_UNSUPPORTED
,
328 .peer_update_wds_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
329 .peer_add_proxy_sta_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
330 .rtt_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
331 .oem_req_cmdid
= WMI_CMD_UNSUPPORTED
,
332 .nan_cmdid
= WMI_CMD_UNSUPPORTED
,
333 .vdev_ratemask_cmdid
= WMI_CMD_UNSUPPORTED
,
334 .qboost_cfg_cmdid
= WMI_CMD_UNSUPPORTED
,
335 .pdev_smart_ant_enable_cmdid
= WMI_CMD_UNSUPPORTED
,
336 .pdev_smart_ant_set_rx_antenna_cmdid
= WMI_CMD_UNSUPPORTED
,
337 .peer_smart_ant_set_tx_antenna_cmdid
= WMI_CMD_UNSUPPORTED
,
338 .peer_smart_ant_set_train_info_cmdid
= WMI_CMD_UNSUPPORTED
,
339 .peer_smart_ant_set_node_config_ops_cmdid
= WMI_CMD_UNSUPPORTED
,
340 .pdev_set_antenna_switch_table_cmdid
= WMI_CMD_UNSUPPORTED
,
341 .pdev_set_ctl_table_cmdid
= WMI_CMD_UNSUPPORTED
,
342 .pdev_set_mimogain_table_cmdid
= WMI_CMD_UNSUPPORTED
,
343 .pdev_ratepwr_table_cmdid
= WMI_CMD_UNSUPPORTED
,
344 .pdev_ratepwr_chainmsk_table_cmdid
= WMI_CMD_UNSUPPORTED
,
345 .pdev_fips_cmdid
= WMI_CMD_UNSUPPORTED
,
346 .tt_set_conf_cmdid
= WMI_CMD_UNSUPPORTED
,
347 .fwtest_cmdid
= WMI_CMD_UNSUPPORTED
,
348 .vdev_atf_request_cmdid
= WMI_CMD_UNSUPPORTED
,
349 .peer_atf_request_cmdid
= WMI_CMD_UNSUPPORTED
,
350 .pdev_get_ani_cck_config_cmdid
= WMI_CMD_UNSUPPORTED
,
351 .pdev_get_ani_ofdm_config_cmdid
= WMI_CMD_UNSUPPORTED
,
352 .pdev_reserve_ast_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
353 .pdev_get_nfcal_power_cmdid
= WMI_CMD_UNSUPPORTED
,
354 .pdev_get_tpc_cmdid
= WMI_CMD_UNSUPPORTED
,
355 .pdev_get_ast_info_cmdid
= WMI_CMD_UNSUPPORTED
,
356 .vdev_set_dscp_tid_map_cmdid
= WMI_CMD_UNSUPPORTED
,
357 .pdev_get_info_cmdid
= WMI_CMD_UNSUPPORTED
,
358 .vdev_get_info_cmdid
= WMI_CMD_UNSUPPORTED
,
359 .vdev_filter_neighbor_rx_packets_cmdid
= WMI_CMD_UNSUPPORTED
,
360 .mu_cal_start_cmdid
= WMI_CMD_UNSUPPORTED
,
361 .set_cca_params_cmdid
= WMI_CMD_UNSUPPORTED
,
362 .pdev_bss_chan_info_request_cmdid
= WMI_CMD_UNSUPPORTED
,
365 /* 10.2.4 WMI cmd track */
366 static struct wmi_cmd_map wmi_10_2_4_cmd_map
= {
367 .init_cmdid
= WMI_10_2_INIT_CMDID
,
368 .start_scan_cmdid
= WMI_10_2_START_SCAN_CMDID
,
369 .stop_scan_cmdid
= WMI_10_2_STOP_SCAN_CMDID
,
370 .scan_chan_list_cmdid
= WMI_10_2_SCAN_CHAN_LIST_CMDID
,
371 .scan_sch_prio_tbl_cmdid
= WMI_CMD_UNSUPPORTED
,
372 .pdev_set_regdomain_cmdid
= WMI_10_2_PDEV_SET_REGDOMAIN_CMDID
,
373 .pdev_set_channel_cmdid
= WMI_10_2_PDEV_SET_CHANNEL_CMDID
,
374 .pdev_set_param_cmdid
= WMI_10_2_PDEV_SET_PARAM_CMDID
,
375 .pdev_pktlog_enable_cmdid
= WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID
,
376 .pdev_pktlog_disable_cmdid
= WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID
,
377 .pdev_set_wmm_params_cmdid
= WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID
,
378 .pdev_set_ht_cap_ie_cmdid
= WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID
,
379 .pdev_set_vht_cap_ie_cmdid
= WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID
,
380 .pdev_set_quiet_mode_cmdid
= WMI_10_2_PDEV_SET_QUIET_MODE_CMDID
,
381 .pdev_green_ap_ps_enable_cmdid
= WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID
,
382 .pdev_get_tpc_config_cmdid
= WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID
,
383 .pdev_set_base_macaddr_cmdid
= WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID
,
384 .vdev_create_cmdid
= WMI_10_2_VDEV_CREATE_CMDID
,
385 .vdev_delete_cmdid
= WMI_10_2_VDEV_DELETE_CMDID
,
386 .vdev_start_request_cmdid
= WMI_10_2_VDEV_START_REQUEST_CMDID
,
387 .vdev_restart_request_cmdid
= WMI_10_2_VDEV_RESTART_REQUEST_CMDID
,
388 .vdev_up_cmdid
= WMI_10_2_VDEV_UP_CMDID
,
389 .vdev_stop_cmdid
= WMI_10_2_VDEV_STOP_CMDID
,
390 .vdev_down_cmdid
= WMI_10_2_VDEV_DOWN_CMDID
,
391 .vdev_set_param_cmdid
= WMI_10_2_VDEV_SET_PARAM_CMDID
,
392 .vdev_install_key_cmdid
= WMI_10_2_VDEV_INSTALL_KEY_CMDID
,
393 .peer_create_cmdid
= WMI_10_2_PEER_CREATE_CMDID
,
394 .peer_delete_cmdid
= WMI_10_2_PEER_DELETE_CMDID
,
395 .peer_flush_tids_cmdid
= WMI_10_2_PEER_FLUSH_TIDS_CMDID
,
396 .peer_set_param_cmdid
= WMI_10_2_PEER_SET_PARAM_CMDID
,
397 .peer_assoc_cmdid
= WMI_10_2_PEER_ASSOC_CMDID
,
398 .peer_add_wds_entry_cmdid
= WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID
,
399 .peer_remove_wds_entry_cmdid
= WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID
,
400 .peer_mcast_group_cmdid
= WMI_10_2_PEER_MCAST_GROUP_CMDID
,
401 .bcn_tx_cmdid
= WMI_10_2_BCN_TX_CMDID
,
402 .pdev_send_bcn_cmdid
= WMI_10_2_PDEV_SEND_BCN_CMDID
,
403 .bcn_tmpl_cmdid
= WMI_CMD_UNSUPPORTED
,
404 .bcn_filter_rx_cmdid
= WMI_10_2_BCN_FILTER_RX_CMDID
,
405 .prb_req_filter_rx_cmdid
= WMI_10_2_PRB_REQ_FILTER_RX_CMDID
,
406 .mgmt_tx_cmdid
= WMI_10_2_MGMT_TX_CMDID
,
407 .prb_tmpl_cmdid
= WMI_CMD_UNSUPPORTED
,
408 .addba_clear_resp_cmdid
= WMI_10_2_ADDBA_CLEAR_RESP_CMDID
,
409 .addba_send_cmdid
= WMI_10_2_ADDBA_SEND_CMDID
,
410 .addba_status_cmdid
= WMI_10_2_ADDBA_STATUS_CMDID
,
411 .delba_send_cmdid
= WMI_10_2_DELBA_SEND_CMDID
,
412 .addba_set_resp_cmdid
= WMI_10_2_ADDBA_SET_RESP_CMDID
,
413 .send_singleamsdu_cmdid
= WMI_10_2_SEND_SINGLEAMSDU_CMDID
,
414 .sta_powersave_mode_cmdid
= WMI_10_2_STA_POWERSAVE_MODE_CMDID
,
415 .sta_powersave_param_cmdid
= WMI_10_2_STA_POWERSAVE_PARAM_CMDID
,
416 .sta_mimo_ps_mode_cmdid
= WMI_10_2_STA_MIMO_PS_MODE_CMDID
,
417 .pdev_dfs_enable_cmdid
= WMI_10_2_PDEV_DFS_ENABLE_CMDID
,
418 .pdev_dfs_disable_cmdid
= WMI_10_2_PDEV_DFS_DISABLE_CMDID
,
419 .roam_scan_mode
= WMI_10_2_ROAM_SCAN_MODE
,
420 .roam_scan_rssi_threshold
= WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD
,
421 .roam_scan_period
= WMI_10_2_ROAM_SCAN_PERIOD
,
422 .roam_scan_rssi_change_threshold
=
423 WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD
,
424 .roam_ap_profile
= WMI_10_2_ROAM_AP_PROFILE
,
425 .ofl_scan_add_ap_profile
= WMI_10_2_OFL_SCAN_ADD_AP_PROFILE
,
426 .ofl_scan_remove_ap_profile
= WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE
,
427 .ofl_scan_period
= WMI_10_2_OFL_SCAN_PERIOD
,
428 .p2p_dev_set_device_info
= WMI_10_2_P2P_DEV_SET_DEVICE_INFO
,
429 .p2p_dev_set_discoverability
= WMI_10_2_P2P_DEV_SET_DISCOVERABILITY
,
430 .p2p_go_set_beacon_ie
= WMI_10_2_P2P_GO_SET_BEACON_IE
,
431 .p2p_go_set_probe_resp_ie
= WMI_10_2_P2P_GO_SET_PROBE_RESP_IE
,
432 .p2p_set_vendor_ie_data_cmdid
= WMI_CMD_UNSUPPORTED
,
433 .ap_ps_peer_param_cmdid
= WMI_10_2_AP_PS_PEER_PARAM_CMDID
,
434 .ap_ps_peer_uapsd_coex_cmdid
= WMI_CMD_UNSUPPORTED
,
435 .peer_rate_retry_sched_cmdid
= WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID
,
436 .wlan_profile_trigger_cmdid
= WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID
,
437 .wlan_profile_set_hist_intvl_cmdid
=
438 WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID
,
439 .wlan_profile_get_profile_data_cmdid
=
440 WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID
,
441 .wlan_profile_enable_profile_id_cmdid
=
442 WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID
,
443 .wlan_profile_list_profile_id_cmdid
=
444 WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID
,
445 .pdev_suspend_cmdid
= WMI_10_2_PDEV_SUSPEND_CMDID
,
446 .pdev_resume_cmdid
= WMI_10_2_PDEV_RESUME_CMDID
,
447 .add_bcn_filter_cmdid
= WMI_10_2_ADD_BCN_FILTER_CMDID
,
448 .rmv_bcn_filter_cmdid
= WMI_10_2_RMV_BCN_FILTER_CMDID
,
449 .wow_add_wake_pattern_cmdid
= WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID
,
450 .wow_del_wake_pattern_cmdid
= WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID
,
451 .wow_enable_disable_wake_event_cmdid
=
452 WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID
,
453 .wow_enable_cmdid
= WMI_10_2_WOW_ENABLE_CMDID
,
454 .wow_hostwakeup_from_sleep_cmdid
=
455 WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID
,
456 .rtt_measreq_cmdid
= WMI_10_2_RTT_MEASREQ_CMDID
,
457 .rtt_tsf_cmdid
= WMI_10_2_RTT_TSF_CMDID
,
458 .vdev_spectral_scan_configure_cmdid
=
459 WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID
,
460 .vdev_spectral_scan_enable_cmdid
=
461 WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID
,
462 .request_stats_cmdid
= WMI_10_2_REQUEST_STATS_CMDID
,
463 .set_arp_ns_offload_cmdid
= WMI_CMD_UNSUPPORTED
,
464 .network_list_offload_config_cmdid
= WMI_CMD_UNSUPPORTED
,
465 .gtk_offload_cmdid
= WMI_CMD_UNSUPPORTED
,
466 .csa_offload_enable_cmdid
= WMI_CMD_UNSUPPORTED
,
467 .csa_offload_chanswitch_cmdid
= WMI_CMD_UNSUPPORTED
,
468 .chatter_set_mode_cmdid
= WMI_CMD_UNSUPPORTED
,
469 .peer_tid_addba_cmdid
= WMI_CMD_UNSUPPORTED
,
470 .peer_tid_delba_cmdid
= WMI_CMD_UNSUPPORTED
,
471 .sta_dtim_ps_method_cmdid
= WMI_CMD_UNSUPPORTED
,
472 .sta_uapsd_auto_trig_cmdid
= WMI_CMD_UNSUPPORTED
,
473 .sta_keepalive_cmd
= WMI_CMD_UNSUPPORTED
,
474 .echo_cmdid
= WMI_10_2_ECHO_CMDID
,
475 .pdev_utf_cmdid
= WMI_10_2_PDEV_UTF_CMDID
,
476 .dbglog_cfg_cmdid
= WMI_10_2_DBGLOG_CFG_CMDID
,
477 .pdev_qvit_cmdid
= WMI_10_2_PDEV_QVIT_CMDID
,
478 .pdev_ftm_intg_cmdid
= WMI_CMD_UNSUPPORTED
,
479 .vdev_set_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
480 .vdev_get_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
481 .force_fw_hang_cmdid
= WMI_CMD_UNSUPPORTED
,
482 .gpio_config_cmdid
= WMI_10_2_GPIO_CONFIG_CMDID
,
483 .gpio_output_cmdid
= WMI_10_2_GPIO_OUTPUT_CMDID
,
484 .pdev_get_temperature_cmdid
= WMI_10_2_PDEV_GET_TEMPERATURE_CMDID
,
485 .pdev_enable_adaptive_cca_cmdid
= WMI_10_2_SET_CCA_PARAMS
,
486 .scan_update_request_cmdid
= WMI_CMD_UNSUPPORTED
,
487 .vdev_standby_response_cmdid
= WMI_CMD_UNSUPPORTED
,
488 .vdev_resume_response_cmdid
= WMI_CMD_UNSUPPORTED
,
489 .wlan_peer_caching_add_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
490 .wlan_peer_caching_evict_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
491 .wlan_peer_caching_restore_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
492 .wlan_peer_caching_print_all_peers_info_cmdid
= WMI_CMD_UNSUPPORTED
,
493 .peer_update_wds_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
494 .peer_add_proxy_sta_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
495 .rtt_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
496 .oem_req_cmdid
= WMI_CMD_UNSUPPORTED
,
497 .nan_cmdid
= WMI_CMD_UNSUPPORTED
,
498 .vdev_ratemask_cmdid
= WMI_CMD_UNSUPPORTED
,
499 .qboost_cfg_cmdid
= WMI_CMD_UNSUPPORTED
,
500 .pdev_smart_ant_enable_cmdid
= WMI_CMD_UNSUPPORTED
,
501 .pdev_smart_ant_set_rx_antenna_cmdid
= WMI_CMD_UNSUPPORTED
,
502 .peer_smart_ant_set_tx_antenna_cmdid
= WMI_CMD_UNSUPPORTED
,
503 .peer_smart_ant_set_train_info_cmdid
= WMI_CMD_UNSUPPORTED
,
504 .peer_smart_ant_set_node_config_ops_cmdid
= WMI_CMD_UNSUPPORTED
,
505 .pdev_set_antenna_switch_table_cmdid
= WMI_CMD_UNSUPPORTED
,
506 .pdev_set_ctl_table_cmdid
= WMI_CMD_UNSUPPORTED
,
507 .pdev_set_mimogain_table_cmdid
= WMI_CMD_UNSUPPORTED
,
508 .pdev_ratepwr_table_cmdid
= WMI_CMD_UNSUPPORTED
,
509 .pdev_ratepwr_chainmsk_table_cmdid
= WMI_CMD_UNSUPPORTED
,
510 .pdev_fips_cmdid
= WMI_CMD_UNSUPPORTED
,
511 .tt_set_conf_cmdid
= WMI_CMD_UNSUPPORTED
,
512 .fwtest_cmdid
= WMI_CMD_UNSUPPORTED
,
513 .vdev_atf_request_cmdid
= WMI_CMD_UNSUPPORTED
,
514 .peer_atf_request_cmdid
= WMI_CMD_UNSUPPORTED
,
515 .pdev_get_ani_cck_config_cmdid
= WMI_CMD_UNSUPPORTED
,
516 .pdev_get_ani_ofdm_config_cmdid
= WMI_CMD_UNSUPPORTED
,
517 .pdev_reserve_ast_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
518 .pdev_get_nfcal_power_cmdid
= WMI_CMD_UNSUPPORTED
,
519 .pdev_get_tpc_cmdid
= WMI_CMD_UNSUPPORTED
,
520 .pdev_get_ast_info_cmdid
= WMI_CMD_UNSUPPORTED
,
521 .vdev_set_dscp_tid_map_cmdid
= WMI_CMD_UNSUPPORTED
,
522 .pdev_get_info_cmdid
= WMI_CMD_UNSUPPORTED
,
523 .vdev_get_info_cmdid
= WMI_CMD_UNSUPPORTED
,
524 .vdev_filter_neighbor_rx_packets_cmdid
= WMI_CMD_UNSUPPORTED
,
525 .mu_cal_start_cmdid
= WMI_CMD_UNSUPPORTED
,
526 .set_cca_params_cmdid
= WMI_CMD_UNSUPPORTED
,
527 .pdev_bss_chan_info_request_cmdid
=
528 WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID
,
531 /* 10.4 WMI cmd track */
532 static struct wmi_cmd_map wmi_10_4_cmd_map
= {
533 .init_cmdid
= WMI_10_4_INIT_CMDID
,
534 .start_scan_cmdid
= WMI_10_4_START_SCAN_CMDID
,
535 .stop_scan_cmdid
= WMI_10_4_STOP_SCAN_CMDID
,
536 .scan_chan_list_cmdid
= WMI_10_4_SCAN_CHAN_LIST_CMDID
,
537 .scan_sch_prio_tbl_cmdid
= WMI_10_4_SCAN_SCH_PRIO_TBL_CMDID
,
538 .pdev_set_regdomain_cmdid
= WMI_10_4_PDEV_SET_REGDOMAIN_CMDID
,
539 .pdev_set_channel_cmdid
= WMI_10_4_PDEV_SET_CHANNEL_CMDID
,
540 .pdev_set_param_cmdid
= WMI_10_4_PDEV_SET_PARAM_CMDID
,
541 .pdev_pktlog_enable_cmdid
= WMI_10_4_PDEV_PKTLOG_ENABLE_CMDID
,
542 .pdev_pktlog_disable_cmdid
= WMI_10_4_PDEV_PKTLOG_DISABLE_CMDID
,
543 .pdev_set_wmm_params_cmdid
= WMI_10_4_PDEV_SET_WMM_PARAMS_CMDID
,
544 .pdev_set_ht_cap_ie_cmdid
= WMI_10_4_PDEV_SET_HT_CAP_IE_CMDID
,
545 .pdev_set_vht_cap_ie_cmdid
= WMI_10_4_PDEV_SET_VHT_CAP_IE_CMDID
,
546 .pdev_set_dscp_tid_map_cmdid
= WMI_10_4_PDEV_SET_DSCP_TID_MAP_CMDID
,
547 .pdev_set_quiet_mode_cmdid
= WMI_10_4_PDEV_SET_QUIET_MODE_CMDID
,
548 .pdev_green_ap_ps_enable_cmdid
= WMI_10_4_PDEV_GREEN_AP_PS_ENABLE_CMDID
,
549 .pdev_get_tpc_config_cmdid
= WMI_10_4_PDEV_GET_TPC_CONFIG_CMDID
,
550 .pdev_set_base_macaddr_cmdid
= WMI_10_4_PDEV_SET_BASE_MACADDR_CMDID
,
551 .vdev_create_cmdid
= WMI_10_4_VDEV_CREATE_CMDID
,
552 .vdev_delete_cmdid
= WMI_10_4_VDEV_DELETE_CMDID
,
553 .vdev_start_request_cmdid
= WMI_10_4_VDEV_START_REQUEST_CMDID
,
554 .vdev_restart_request_cmdid
= WMI_10_4_VDEV_RESTART_REQUEST_CMDID
,
555 .vdev_up_cmdid
= WMI_10_4_VDEV_UP_CMDID
,
556 .vdev_stop_cmdid
= WMI_10_4_VDEV_STOP_CMDID
,
557 .vdev_down_cmdid
= WMI_10_4_VDEV_DOWN_CMDID
,
558 .vdev_set_param_cmdid
= WMI_10_4_VDEV_SET_PARAM_CMDID
,
559 .vdev_install_key_cmdid
= WMI_10_4_VDEV_INSTALL_KEY_CMDID
,
560 .peer_create_cmdid
= WMI_10_4_PEER_CREATE_CMDID
,
561 .peer_delete_cmdid
= WMI_10_4_PEER_DELETE_CMDID
,
562 .peer_flush_tids_cmdid
= WMI_10_4_PEER_FLUSH_TIDS_CMDID
,
563 .peer_set_param_cmdid
= WMI_10_4_PEER_SET_PARAM_CMDID
,
564 .peer_assoc_cmdid
= WMI_10_4_PEER_ASSOC_CMDID
,
565 .peer_add_wds_entry_cmdid
= WMI_10_4_PEER_ADD_WDS_ENTRY_CMDID
,
566 .peer_remove_wds_entry_cmdid
= WMI_10_4_PEER_REMOVE_WDS_ENTRY_CMDID
,
567 .peer_mcast_group_cmdid
= WMI_10_4_PEER_MCAST_GROUP_CMDID
,
568 .bcn_tx_cmdid
= WMI_10_4_BCN_TX_CMDID
,
569 .pdev_send_bcn_cmdid
= WMI_10_4_PDEV_SEND_BCN_CMDID
,
570 .bcn_tmpl_cmdid
= WMI_10_4_BCN_PRB_TMPL_CMDID
,
571 .bcn_filter_rx_cmdid
= WMI_10_4_BCN_FILTER_RX_CMDID
,
572 .prb_req_filter_rx_cmdid
= WMI_10_4_PRB_REQ_FILTER_RX_CMDID
,
573 .mgmt_tx_cmdid
= WMI_10_4_MGMT_TX_CMDID
,
574 .prb_tmpl_cmdid
= WMI_10_4_PRB_TMPL_CMDID
,
575 .addba_clear_resp_cmdid
= WMI_10_4_ADDBA_CLEAR_RESP_CMDID
,
576 .addba_send_cmdid
= WMI_10_4_ADDBA_SEND_CMDID
,
577 .addba_status_cmdid
= WMI_10_4_ADDBA_STATUS_CMDID
,
578 .delba_send_cmdid
= WMI_10_4_DELBA_SEND_CMDID
,
579 .addba_set_resp_cmdid
= WMI_10_4_ADDBA_SET_RESP_CMDID
,
580 .send_singleamsdu_cmdid
= WMI_10_4_SEND_SINGLEAMSDU_CMDID
,
581 .sta_powersave_mode_cmdid
= WMI_10_4_STA_POWERSAVE_MODE_CMDID
,
582 .sta_powersave_param_cmdid
= WMI_10_4_STA_POWERSAVE_PARAM_CMDID
,
583 .sta_mimo_ps_mode_cmdid
= WMI_10_4_STA_MIMO_PS_MODE_CMDID
,
584 .pdev_dfs_enable_cmdid
= WMI_10_4_PDEV_DFS_ENABLE_CMDID
,
585 .pdev_dfs_disable_cmdid
= WMI_10_4_PDEV_DFS_DISABLE_CMDID
,
586 .roam_scan_mode
= WMI_10_4_ROAM_SCAN_MODE
,
587 .roam_scan_rssi_threshold
= WMI_10_4_ROAM_SCAN_RSSI_THRESHOLD
,
588 .roam_scan_period
= WMI_10_4_ROAM_SCAN_PERIOD
,
589 .roam_scan_rssi_change_threshold
=
590 WMI_10_4_ROAM_SCAN_RSSI_CHANGE_THRESHOLD
,
591 .roam_ap_profile
= WMI_10_4_ROAM_AP_PROFILE
,
592 .ofl_scan_add_ap_profile
= WMI_10_4_OFL_SCAN_ADD_AP_PROFILE
,
593 .ofl_scan_remove_ap_profile
= WMI_10_4_OFL_SCAN_REMOVE_AP_PROFILE
,
594 .ofl_scan_period
= WMI_10_4_OFL_SCAN_PERIOD
,
595 .p2p_dev_set_device_info
= WMI_10_4_P2P_DEV_SET_DEVICE_INFO
,
596 .p2p_dev_set_discoverability
= WMI_10_4_P2P_DEV_SET_DISCOVERABILITY
,
597 .p2p_go_set_beacon_ie
= WMI_10_4_P2P_GO_SET_BEACON_IE
,
598 .p2p_go_set_probe_resp_ie
= WMI_10_4_P2P_GO_SET_PROBE_RESP_IE
,
599 .p2p_set_vendor_ie_data_cmdid
= WMI_10_4_P2P_SET_VENDOR_IE_DATA_CMDID
,
600 .ap_ps_peer_param_cmdid
= WMI_10_4_AP_PS_PEER_PARAM_CMDID
,
601 .ap_ps_peer_uapsd_coex_cmdid
= WMI_10_4_AP_PS_PEER_UAPSD_COEX_CMDID
,
602 .peer_rate_retry_sched_cmdid
= WMI_10_4_PEER_RATE_RETRY_SCHED_CMDID
,
603 .wlan_profile_trigger_cmdid
= WMI_10_4_WLAN_PROFILE_TRIGGER_CMDID
,
604 .wlan_profile_set_hist_intvl_cmdid
=
605 WMI_10_4_WLAN_PROFILE_SET_HIST_INTVL_CMDID
,
606 .wlan_profile_get_profile_data_cmdid
=
607 WMI_10_4_WLAN_PROFILE_GET_PROFILE_DATA_CMDID
,
608 .wlan_profile_enable_profile_id_cmdid
=
609 WMI_10_4_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID
,
610 .wlan_profile_list_profile_id_cmdid
=
611 WMI_10_4_WLAN_PROFILE_LIST_PROFILE_ID_CMDID
,
612 .pdev_suspend_cmdid
= WMI_10_4_PDEV_SUSPEND_CMDID
,
613 .pdev_resume_cmdid
= WMI_10_4_PDEV_RESUME_CMDID
,
614 .add_bcn_filter_cmdid
= WMI_10_4_ADD_BCN_FILTER_CMDID
,
615 .rmv_bcn_filter_cmdid
= WMI_10_4_RMV_BCN_FILTER_CMDID
,
616 .wow_add_wake_pattern_cmdid
= WMI_10_4_WOW_ADD_WAKE_PATTERN_CMDID
,
617 .wow_del_wake_pattern_cmdid
= WMI_10_4_WOW_DEL_WAKE_PATTERN_CMDID
,
618 .wow_enable_disable_wake_event_cmdid
=
619 WMI_10_4_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID
,
620 .wow_enable_cmdid
= WMI_10_4_WOW_ENABLE_CMDID
,
621 .wow_hostwakeup_from_sleep_cmdid
=
622 WMI_10_4_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID
,
623 .rtt_measreq_cmdid
= WMI_10_4_RTT_MEASREQ_CMDID
,
624 .rtt_tsf_cmdid
= WMI_10_4_RTT_TSF_CMDID
,
625 .vdev_spectral_scan_configure_cmdid
=
626 WMI_10_4_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID
,
627 .vdev_spectral_scan_enable_cmdid
=
628 WMI_10_4_VDEV_SPECTRAL_SCAN_ENABLE_CMDID
,
629 .request_stats_cmdid
= WMI_10_4_REQUEST_STATS_CMDID
,
630 .set_arp_ns_offload_cmdid
= WMI_CMD_UNSUPPORTED
,
631 .network_list_offload_config_cmdid
= WMI_CMD_UNSUPPORTED
,
632 .gtk_offload_cmdid
= WMI_10_4_GTK_OFFLOAD_CMDID
,
633 .csa_offload_enable_cmdid
= WMI_10_4_CSA_OFFLOAD_ENABLE_CMDID
,
634 .csa_offload_chanswitch_cmdid
= WMI_10_4_CSA_OFFLOAD_CHANSWITCH_CMDID
,
635 .chatter_set_mode_cmdid
= WMI_CMD_UNSUPPORTED
,
636 .peer_tid_addba_cmdid
= WMI_CMD_UNSUPPORTED
,
637 .peer_tid_delba_cmdid
= WMI_CMD_UNSUPPORTED
,
638 .sta_dtim_ps_method_cmdid
= WMI_CMD_UNSUPPORTED
,
639 .sta_uapsd_auto_trig_cmdid
= WMI_CMD_UNSUPPORTED
,
640 .sta_keepalive_cmd
= WMI_CMD_UNSUPPORTED
,
641 .echo_cmdid
= WMI_10_4_ECHO_CMDID
,
642 .pdev_utf_cmdid
= WMI_10_4_PDEV_UTF_CMDID
,
643 .dbglog_cfg_cmdid
= WMI_10_4_DBGLOG_CFG_CMDID
,
644 .pdev_qvit_cmdid
= WMI_10_4_PDEV_QVIT_CMDID
,
645 .pdev_ftm_intg_cmdid
= WMI_CMD_UNSUPPORTED
,
646 .vdev_set_keepalive_cmdid
= WMI_10_4_VDEV_SET_KEEPALIVE_CMDID
,
647 .vdev_get_keepalive_cmdid
= WMI_10_4_VDEV_GET_KEEPALIVE_CMDID
,
648 .force_fw_hang_cmdid
= WMI_10_4_FORCE_FW_HANG_CMDID
,
649 .gpio_config_cmdid
= WMI_10_4_GPIO_CONFIG_CMDID
,
650 .gpio_output_cmdid
= WMI_10_4_GPIO_OUTPUT_CMDID
,
651 .pdev_get_temperature_cmdid
= WMI_10_4_PDEV_GET_TEMPERATURE_CMDID
,
652 .vdev_set_wmm_params_cmdid
= WMI_CMD_UNSUPPORTED
,
653 .tdls_set_state_cmdid
= WMI_CMD_UNSUPPORTED
,
654 .tdls_peer_update_cmdid
= WMI_CMD_UNSUPPORTED
,
655 .adaptive_qcs_cmdid
= WMI_CMD_UNSUPPORTED
,
656 .scan_update_request_cmdid
= WMI_10_4_SCAN_UPDATE_REQUEST_CMDID
,
657 .vdev_standby_response_cmdid
= WMI_10_4_VDEV_STANDBY_RESPONSE_CMDID
,
658 .vdev_resume_response_cmdid
= WMI_10_4_VDEV_RESUME_RESPONSE_CMDID
,
659 .wlan_peer_caching_add_peer_cmdid
=
660 WMI_10_4_WLAN_PEER_CACHING_ADD_PEER_CMDID
,
661 .wlan_peer_caching_evict_peer_cmdid
=
662 WMI_10_4_WLAN_PEER_CACHING_EVICT_PEER_CMDID
,
663 .wlan_peer_caching_restore_peer_cmdid
=
664 WMI_10_4_WLAN_PEER_CACHING_RESTORE_PEER_CMDID
,
665 .wlan_peer_caching_print_all_peers_info_cmdid
=
666 WMI_10_4_WLAN_PEER_CACHING_PRINT_ALL_PEERS_INFO_CMDID
,
667 .peer_update_wds_entry_cmdid
= WMI_10_4_PEER_UPDATE_WDS_ENTRY_CMDID
,
668 .peer_add_proxy_sta_entry_cmdid
=
669 WMI_10_4_PEER_ADD_PROXY_STA_ENTRY_CMDID
,
670 .rtt_keepalive_cmdid
= WMI_10_4_RTT_KEEPALIVE_CMDID
,
671 .oem_req_cmdid
= WMI_10_4_OEM_REQ_CMDID
,
672 .nan_cmdid
= WMI_10_4_NAN_CMDID
,
673 .vdev_ratemask_cmdid
= WMI_10_4_VDEV_RATEMASK_CMDID
,
674 .qboost_cfg_cmdid
= WMI_10_4_QBOOST_CFG_CMDID
,
675 .pdev_smart_ant_enable_cmdid
= WMI_10_4_PDEV_SMART_ANT_ENABLE_CMDID
,
676 .pdev_smart_ant_set_rx_antenna_cmdid
=
677 WMI_10_4_PDEV_SMART_ANT_SET_RX_ANTENNA_CMDID
,
678 .peer_smart_ant_set_tx_antenna_cmdid
=
679 WMI_10_4_PEER_SMART_ANT_SET_TX_ANTENNA_CMDID
,
680 .peer_smart_ant_set_train_info_cmdid
=
681 WMI_10_4_PEER_SMART_ANT_SET_TRAIN_INFO_CMDID
,
682 .peer_smart_ant_set_node_config_ops_cmdid
=
683 WMI_10_4_PEER_SMART_ANT_SET_NODE_CONFIG_OPS_CMDID
,
684 .pdev_set_antenna_switch_table_cmdid
=
685 WMI_10_4_PDEV_SET_ANTENNA_SWITCH_TABLE_CMDID
,
686 .pdev_set_ctl_table_cmdid
= WMI_10_4_PDEV_SET_CTL_TABLE_CMDID
,
687 .pdev_set_mimogain_table_cmdid
= WMI_10_4_PDEV_SET_MIMOGAIN_TABLE_CMDID
,
688 .pdev_ratepwr_table_cmdid
= WMI_10_4_PDEV_RATEPWR_TABLE_CMDID
,
689 .pdev_ratepwr_chainmsk_table_cmdid
=
690 WMI_10_4_PDEV_RATEPWR_CHAINMSK_TABLE_CMDID
,
691 .pdev_fips_cmdid
= WMI_10_4_PDEV_FIPS_CMDID
,
692 .tt_set_conf_cmdid
= WMI_10_4_TT_SET_CONF_CMDID
,
693 .fwtest_cmdid
= WMI_10_4_FWTEST_CMDID
,
694 .vdev_atf_request_cmdid
= WMI_10_4_VDEV_ATF_REQUEST_CMDID
,
695 .peer_atf_request_cmdid
= WMI_10_4_PEER_ATF_REQUEST_CMDID
,
696 .pdev_get_ani_cck_config_cmdid
= WMI_10_4_PDEV_GET_ANI_CCK_CONFIG_CMDID
,
697 .pdev_get_ani_ofdm_config_cmdid
=
698 WMI_10_4_PDEV_GET_ANI_OFDM_CONFIG_CMDID
,
699 .pdev_reserve_ast_entry_cmdid
= WMI_10_4_PDEV_RESERVE_AST_ENTRY_CMDID
,
700 .pdev_get_nfcal_power_cmdid
= WMI_10_4_PDEV_GET_NFCAL_POWER_CMDID
,
701 .pdev_get_tpc_cmdid
= WMI_10_4_PDEV_GET_TPC_CMDID
,
702 .pdev_get_ast_info_cmdid
= WMI_10_4_PDEV_GET_AST_INFO_CMDID
,
703 .vdev_set_dscp_tid_map_cmdid
= WMI_10_4_VDEV_SET_DSCP_TID_MAP_CMDID
,
704 .pdev_get_info_cmdid
= WMI_10_4_PDEV_GET_INFO_CMDID
,
705 .vdev_get_info_cmdid
= WMI_10_4_VDEV_GET_INFO_CMDID
,
706 .vdev_filter_neighbor_rx_packets_cmdid
=
707 WMI_10_4_VDEV_FILTER_NEIGHBOR_RX_PACKETS_CMDID
,
708 .mu_cal_start_cmdid
= WMI_10_4_MU_CAL_START_CMDID
,
709 .set_cca_params_cmdid
= WMI_10_4_SET_CCA_PARAMS_CMDID
,
710 .pdev_bss_chan_info_request_cmdid
=
711 WMI_10_4_PDEV_BSS_CHAN_INFO_REQUEST_CMDID
,
712 .ext_resource_cfg_cmdid
= WMI_10_4_EXT_RESOURCE_CFG_CMDID
,
715 /* MAIN WMI VDEV param map */
716 static struct wmi_vdev_param_map wmi_vdev_param_map
= {
717 .rts_threshold
= WMI_VDEV_PARAM_RTS_THRESHOLD
,
718 .fragmentation_threshold
= WMI_VDEV_PARAM_FRAGMENTATION_THRESHOLD
,
719 .beacon_interval
= WMI_VDEV_PARAM_BEACON_INTERVAL
,
720 .listen_interval
= WMI_VDEV_PARAM_LISTEN_INTERVAL
,
721 .multicast_rate
= WMI_VDEV_PARAM_MULTICAST_RATE
,
722 .mgmt_tx_rate
= WMI_VDEV_PARAM_MGMT_TX_RATE
,
723 .slot_time
= WMI_VDEV_PARAM_SLOT_TIME
,
724 .preamble
= WMI_VDEV_PARAM_PREAMBLE
,
725 .swba_time
= WMI_VDEV_PARAM_SWBA_TIME
,
726 .wmi_vdev_stats_update_period
= WMI_VDEV_STATS_UPDATE_PERIOD
,
727 .wmi_vdev_pwrsave_ageout_time
= WMI_VDEV_PWRSAVE_AGEOUT_TIME
,
728 .wmi_vdev_host_swba_interval
= WMI_VDEV_HOST_SWBA_INTERVAL
,
729 .dtim_period
= WMI_VDEV_PARAM_DTIM_PERIOD
,
730 .wmi_vdev_oc_scheduler_air_time_limit
=
731 WMI_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT
,
732 .wds
= WMI_VDEV_PARAM_WDS
,
733 .atim_window
= WMI_VDEV_PARAM_ATIM_WINDOW
,
734 .bmiss_count_max
= WMI_VDEV_PARAM_BMISS_COUNT_MAX
,
735 .bmiss_first_bcnt
= WMI_VDEV_PARAM_BMISS_FIRST_BCNT
,
736 .bmiss_final_bcnt
= WMI_VDEV_PARAM_BMISS_FINAL_BCNT
,
737 .feature_wmm
= WMI_VDEV_PARAM_FEATURE_WMM
,
738 .chwidth
= WMI_VDEV_PARAM_CHWIDTH
,
739 .chextoffset
= WMI_VDEV_PARAM_CHEXTOFFSET
,
740 .disable_htprotection
= WMI_VDEV_PARAM_DISABLE_HTPROTECTION
,
741 .sta_quickkickout
= WMI_VDEV_PARAM_STA_QUICKKICKOUT
,
742 .mgmt_rate
= WMI_VDEV_PARAM_MGMT_RATE
,
743 .protection_mode
= WMI_VDEV_PARAM_PROTECTION_MODE
,
744 .fixed_rate
= WMI_VDEV_PARAM_FIXED_RATE
,
745 .sgi
= WMI_VDEV_PARAM_SGI
,
746 .ldpc
= WMI_VDEV_PARAM_LDPC
,
747 .tx_stbc
= WMI_VDEV_PARAM_TX_STBC
,
748 .rx_stbc
= WMI_VDEV_PARAM_RX_STBC
,
749 .intra_bss_fwd
= WMI_VDEV_PARAM_INTRA_BSS_FWD
,
750 .def_keyid
= WMI_VDEV_PARAM_DEF_KEYID
,
751 .nss
= WMI_VDEV_PARAM_NSS
,
752 .bcast_data_rate
= WMI_VDEV_PARAM_BCAST_DATA_RATE
,
753 .mcast_data_rate
= WMI_VDEV_PARAM_MCAST_DATA_RATE
,
754 .mcast_indicate
= WMI_VDEV_PARAM_MCAST_INDICATE
,
755 .dhcp_indicate
= WMI_VDEV_PARAM_DHCP_INDICATE
,
756 .unknown_dest_indicate
= WMI_VDEV_PARAM_UNKNOWN_DEST_INDICATE
,
757 .ap_keepalive_min_idle_inactive_time_secs
=
758 WMI_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS
,
759 .ap_keepalive_max_idle_inactive_time_secs
=
760 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS
,
761 .ap_keepalive_max_unresponsive_time_secs
=
762 WMI_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS
,
763 .ap_enable_nawds
= WMI_VDEV_PARAM_AP_ENABLE_NAWDS
,
764 .mcast2ucast_set
= WMI_VDEV_PARAM_UNSUPPORTED
,
765 .enable_rtscts
= WMI_VDEV_PARAM_ENABLE_RTSCTS
,
766 .txbf
= WMI_VDEV_PARAM_TXBF
,
767 .packet_powersave
= WMI_VDEV_PARAM_PACKET_POWERSAVE
,
768 .drop_unencry
= WMI_VDEV_PARAM_DROP_UNENCRY
,
769 .tx_encap_type
= WMI_VDEV_PARAM_TX_ENCAP_TYPE
,
770 .ap_detect_out_of_sync_sleeping_sta_time_secs
=
771 WMI_VDEV_PARAM_UNSUPPORTED
,
772 .rc_num_retries
= WMI_VDEV_PARAM_UNSUPPORTED
,
773 .cabq_maxdur
= WMI_VDEV_PARAM_UNSUPPORTED
,
774 .mfptest_set
= WMI_VDEV_PARAM_UNSUPPORTED
,
775 .rts_fixed_rate
= WMI_VDEV_PARAM_UNSUPPORTED
,
776 .vht_sgimask
= WMI_VDEV_PARAM_UNSUPPORTED
,
777 .vht80_ratemask
= WMI_VDEV_PARAM_UNSUPPORTED
,
778 .early_rx_adjust_enable
= WMI_VDEV_PARAM_UNSUPPORTED
,
779 .early_rx_tgt_bmiss_num
= WMI_VDEV_PARAM_UNSUPPORTED
,
780 .early_rx_bmiss_sample_cycle
= WMI_VDEV_PARAM_UNSUPPORTED
,
781 .early_rx_slop_step
= WMI_VDEV_PARAM_UNSUPPORTED
,
782 .early_rx_init_slop
= WMI_VDEV_PARAM_UNSUPPORTED
,
783 .early_rx_adjust_pause
= WMI_VDEV_PARAM_UNSUPPORTED
,
784 .proxy_sta
= WMI_VDEV_PARAM_UNSUPPORTED
,
785 .meru_vc
= WMI_VDEV_PARAM_UNSUPPORTED
,
786 .rx_decap_type
= WMI_VDEV_PARAM_UNSUPPORTED
,
787 .bw_nss_ratemask
= WMI_VDEV_PARAM_UNSUPPORTED
,
788 .set_tsf
= WMI_VDEV_PARAM_UNSUPPORTED
,
791 /* 10.X WMI VDEV param map */
792 static struct wmi_vdev_param_map wmi_10x_vdev_param_map
= {
793 .rts_threshold
= WMI_10X_VDEV_PARAM_RTS_THRESHOLD
,
794 .fragmentation_threshold
= WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD
,
795 .beacon_interval
= WMI_10X_VDEV_PARAM_BEACON_INTERVAL
,
796 .listen_interval
= WMI_10X_VDEV_PARAM_LISTEN_INTERVAL
,
797 .multicast_rate
= WMI_10X_VDEV_PARAM_MULTICAST_RATE
,
798 .mgmt_tx_rate
= WMI_10X_VDEV_PARAM_MGMT_TX_RATE
,
799 .slot_time
= WMI_10X_VDEV_PARAM_SLOT_TIME
,
800 .preamble
= WMI_10X_VDEV_PARAM_PREAMBLE
,
801 .swba_time
= WMI_10X_VDEV_PARAM_SWBA_TIME
,
802 .wmi_vdev_stats_update_period
= WMI_10X_VDEV_STATS_UPDATE_PERIOD
,
803 .wmi_vdev_pwrsave_ageout_time
= WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME
,
804 .wmi_vdev_host_swba_interval
= WMI_10X_VDEV_HOST_SWBA_INTERVAL
,
805 .dtim_period
= WMI_10X_VDEV_PARAM_DTIM_PERIOD
,
806 .wmi_vdev_oc_scheduler_air_time_limit
=
807 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT
,
808 .wds
= WMI_10X_VDEV_PARAM_WDS
,
809 .atim_window
= WMI_10X_VDEV_PARAM_ATIM_WINDOW
,
810 .bmiss_count_max
= WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX
,
811 .bmiss_first_bcnt
= WMI_VDEV_PARAM_UNSUPPORTED
,
812 .bmiss_final_bcnt
= WMI_VDEV_PARAM_UNSUPPORTED
,
813 .feature_wmm
= WMI_10X_VDEV_PARAM_FEATURE_WMM
,
814 .chwidth
= WMI_10X_VDEV_PARAM_CHWIDTH
,
815 .chextoffset
= WMI_10X_VDEV_PARAM_CHEXTOFFSET
,
816 .disable_htprotection
= WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION
,
817 .sta_quickkickout
= WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT
,
818 .mgmt_rate
= WMI_10X_VDEV_PARAM_MGMT_RATE
,
819 .protection_mode
= WMI_10X_VDEV_PARAM_PROTECTION_MODE
,
820 .fixed_rate
= WMI_10X_VDEV_PARAM_FIXED_RATE
,
821 .sgi
= WMI_10X_VDEV_PARAM_SGI
,
822 .ldpc
= WMI_10X_VDEV_PARAM_LDPC
,
823 .tx_stbc
= WMI_10X_VDEV_PARAM_TX_STBC
,
824 .rx_stbc
= WMI_10X_VDEV_PARAM_RX_STBC
,
825 .intra_bss_fwd
= WMI_10X_VDEV_PARAM_INTRA_BSS_FWD
,
826 .def_keyid
= WMI_10X_VDEV_PARAM_DEF_KEYID
,
827 .nss
= WMI_10X_VDEV_PARAM_NSS
,
828 .bcast_data_rate
= WMI_10X_VDEV_PARAM_BCAST_DATA_RATE
,
829 .mcast_data_rate
= WMI_10X_VDEV_PARAM_MCAST_DATA_RATE
,
830 .mcast_indicate
= WMI_10X_VDEV_PARAM_MCAST_INDICATE
,
831 .dhcp_indicate
= WMI_10X_VDEV_PARAM_DHCP_INDICATE
,
832 .unknown_dest_indicate
= WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE
,
833 .ap_keepalive_min_idle_inactive_time_secs
=
834 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS
,
835 .ap_keepalive_max_idle_inactive_time_secs
=
836 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS
,
837 .ap_keepalive_max_unresponsive_time_secs
=
838 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS
,
839 .ap_enable_nawds
= WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS
,
840 .mcast2ucast_set
= WMI_10X_VDEV_PARAM_MCAST2UCAST_SET
,
841 .enable_rtscts
= WMI_10X_VDEV_PARAM_ENABLE_RTSCTS
,
842 .txbf
= WMI_VDEV_PARAM_UNSUPPORTED
,
843 .packet_powersave
= WMI_VDEV_PARAM_UNSUPPORTED
,
844 .drop_unencry
= WMI_VDEV_PARAM_UNSUPPORTED
,
845 .tx_encap_type
= WMI_VDEV_PARAM_UNSUPPORTED
,
846 .ap_detect_out_of_sync_sleeping_sta_time_secs
=
847 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS
,
848 .rc_num_retries
= WMI_VDEV_PARAM_UNSUPPORTED
,
849 .cabq_maxdur
= WMI_VDEV_PARAM_UNSUPPORTED
,
850 .mfptest_set
= WMI_VDEV_PARAM_UNSUPPORTED
,
851 .rts_fixed_rate
= WMI_VDEV_PARAM_UNSUPPORTED
,
852 .vht_sgimask
= WMI_VDEV_PARAM_UNSUPPORTED
,
853 .vht80_ratemask
= WMI_VDEV_PARAM_UNSUPPORTED
,
854 .early_rx_adjust_enable
= WMI_VDEV_PARAM_UNSUPPORTED
,
855 .early_rx_tgt_bmiss_num
= WMI_VDEV_PARAM_UNSUPPORTED
,
856 .early_rx_bmiss_sample_cycle
= WMI_VDEV_PARAM_UNSUPPORTED
,
857 .early_rx_slop_step
= WMI_VDEV_PARAM_UNSUPPORTED
,
858 .early_rx_init_slop
= WMI_VDEV_PARAM_UNSUPPORTED
,
859 .early_rx_adjust_pause
= WMI_VDEV_PARAM_UNSUPPORTED
,
860 .proxy_sta
= WMI_VDEV_PARAM_UNSUPPORTED
,
861 .meru_vc
= WMI_VDEV_PARAM_UNSUPPORTED
,
862 .rx_decap_type
= WMI_VDEV_PARAM_UNSUPPORTED
,
863 .bw_nss_ratemask
= WMI_VDEV_PARAM_UNSUPPORTED
,
864 .set_tsf
= WMI_VDEV_PARAM_UNSUPPORTED
,
867 static struct wmi_vdev_param_map wmi_10_2_4_vdev_param_map
= {
868 .rts_threshold
= WMI_10X_VDEV_PARAM_RTS_THRESHOLD
,
869 .fragmentation_threshold
= WMI_10X_VDEV_PARAM_FRAGMENTATION_THRESHOLD
,
870 .beacon_interval
= WMI_10X_VDEV_PARAM_BEACON_INTERVAL
,
871 .listen_interval
= WMI_10X_VDEV_PARAM_LISTEN_INTERVAL
,
872 .multicast_rate
= WMI_10X_VDEV_PARAM_MULTICAST_RATE
,
873 .mgmt_tx_rate
= WMI_10X_VDEV_PARAM_MGMT_TX_RATE
,
874 .slot_time
= WMI_10X_VDEV_PARAM_SLOT_TIME
,
875 .preamble
= WMI_10X_VDEV_PARAM_PREAMBLE
,
876 .swba_time
= WMI_10X_VDEV_PARAM_SWBA_TIME
,
877 .wmi_vdev_stats_update_period
= WMI_10X_VDEV_STATS_UPDATE_PERIOD
,
878 .wmi_vdev_pwrsave_ageout_time
= WMI_10X_VDEV_PWRSAVE_AGEOUT_TIME
,
879 .wmi_vdev_host_swba_interval
= WMI_10X_VDEV_HOST_SWBA_INTERVAL
,
880 .dtim_period
= WMI_10X_VDEV_PARAM_DTIM_PERIOD
,
881 .wmi_vdev_oc_scheduler_air_time_limit
=
882 WMI_10X_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT
,
883 .wds
= WMI_10X_VDEV_PARAM_WDS
,
884 .atim_window
= WMI_10X_VDEV_PARAM_ATIM_WINDOW
,
885 .bmiss_count_max
= WMI_10X_VDEV_PARAM_BMISS_COUNT_MAX
,
886 .bmiss_first_bcnt
= WMI_VDEV_PARAM_UNSUPPORTED
,
887 .bmiss_final_bcnt
= WMI_VDEV_PARAM_UNSUPPORTED
,
888 .feature_wmm
= WMI_10X_VDEV_PARAM_FEATURE_WMM
,
889 .chwidth
= WMI_10X_VDEV_PARAM_CHWIDTH
,
890 .chextoffset
= WMI_10X_VDEV_PARAM_CHEXTOFFSET
,
891 .disable_htprotection
= WMI_10X_VDEV_PARAM_DISABLE_HTPROTECTION
,
892 .sta_quickkickout
= WMI_10X_VDEV_PARAM_STA_QUICKKICKOUT
,
893 .mgmt_rate
= WMI_10X_VDEV_PARAM_MGMT_RATE
,
894 .protection_mode
= WMI_10X_VDEV_PARAM_PROTECTION_MODE
,
895 .fixed_rate
= WMI_10X_VDEV_PARAM_FIXED_RATE
,
896 .sgi
= WMI_10X_VDEV_PARAM_SGI
,
897 .ldpc
= WMI_10X_VDEV_PARAM_LDPC
,
898 .tx_stbc
= WMI_10X_VDEV_PARAM_TX_STBC
,
899 .rx_stbc
= WMI_10X_VDEV_PARAM_RX_STBC
,
900 .intra_bss_fwd
= WMI_10X_VDEV_PARAM_INTRA_BSS_FWD
,
901 .def_keyid
= WMI_10X_VDEV_PARAM_DEF_KEYID
,
902 .nss
= WMI_10X_VDEV_PARAM_NSS
,
903 .bcast_data_rate
= WMI_10X_VDEV_PARAM_BCAST_DATA_RATE
,
904 .mcast_data_rate
= WMI_10X_VDEV_PARAM_MCAST_DATA_RATE
,
905 .mcast_indicate
= WMI_10X_VDEV_PARAM_MCAST_INDICATE
,
906 .dhcp_indicate
= WMI_10X_VDEV_PARAM_DHCP_INDICATE
,
907 .unknown_dest_indicate
= WMI_10X_VDEV_PARAM_UNKNOWN_DEST_INDICATE
,
908 .ap_keepalive_min_idle_inactive_time_secs
=
909 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS
,
910 .ap_keepalive_max_idle_inactive_time_secs
=
911 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS
,
912 .ap_keepalive_max_unresponsive_time_secs
=
913 WMI_10X_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS
,
914 .ap_enable_nawds
= WMI_10X_VDEV_PARAM_AP_ENABLE_NAWDS
,
915 .mcast2ucast_set
= WMI_10X_VDEV_PARAM_MCAST2UCAST_SET
,
916 .enable_rtscts
= WMI_10X_VDEV_PARAM_ENABLE_RTSCTS
,
917 .txbf
= WMI_VDEV_PARAM_UNSUPPORTED
,
918 .packet_powersave
= WMI_VDEV_PARAM_UNSUPPORTED
,
919 .drop_unencry
= WMI_VDEV_PARAM_UNSUPPORTED
,
920 .tx_encap_type
= WMI_VDEV_PARAM_UNSUPPORTED
,
921 .ap_detect_out_of_sync_sleeping_sta_time_secs
=
922 WMI_10X_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS
,
923 .rc_num_retries
= WMI_VDEV_PARAM_UNSUPPORTED
,
924 .cabq_maxdur
= WMI_VDEV_PARAM_UNSUPPORTED
,
925 .mfptest_set
= WMI_VDEV_PARAM_UNSUPPORTED
,
926 .rts_fixed_rate
= WMI_VDEV_PARAM_UNSUPPORTED
,
927 .vht_sgimask
= WMI_VDEV_PARAM_UNSUPPORTED
,
928 .vht80_ratemask
= WMI_VDEV_PARAM_UNSUPPORTED
,
929 .early_rx_adjust_enable
= WMI_VDEV_PARAM_UNSUPPORTED
,
930 .early_rx_tgt_bmiss_num
= WMI_VDEV_PARAM_UNSUPPORTED
,
931 .early_rx_bmiss_sample_cycle
= WMI_VDEV_PARAM_UNSUPPORTED
,
932 .early_rx_slop_step
= WMI_VDEV_PARAM_UNSUPPORTED
,
933 .early_rx_init_slop
= WMI_VDEV_PARAM_UNSUPPORTED
,
934 .early_rx_adjust_pause
= WMI_VDEV_PARAM_UNSUPPORTED
,
935 .proxy_sta
= WMI_VDEV_PARAM_UNSUPPORTED
,
936 .meru_vc
= WMI_VDEV_PARAM_UNSUPPORTED
,
937 .rx_decap_type
= WMI_VDEV_PARAM_UNSUPPORTED
,
938 .bw_nss_ratemask
= WMI_VDEV_PARAM_UNSUPPORTED
,
939 .set_tsf
= WMI_10X_VDEV_PARAM_TSF_INCREMENT
,
942 static struct wmi_vdev_param_map wmi_10_4_vdev_param_map
= {
943 .rts_threshold
= WMI_10_4_VDEV_PARAM_RTS_THRESHOLD
,
944 .fragmentation_threshold
= WMI_10_4_VDEV_PARAM_FRAGMENTATION_THRESHOLD
,
945 .beacon_interval
= WMI_10_4_VDEV_PARAM_BEACON_INTERVAL
,
946 .listen_interval
= WMI_10_4_VDEV_PARAM_LISTEN_INTERVAL
,
947 .multicast_rate
= WMI_10_4_VDEV_PARAM_MULTICAST_RATE
,
948 .mgmt_tx_rate
= WMI_10_4_VDEV_PARAM_MGMT_TX_RATE
,
949 .slot_time
= WMI_10_4_VDEV_PARAM_SLOT_TIME
,
950 .preamble
= WMI_10_4_VDEV_PARAM_PREAMBLE
,
951 .swba_time
= WMI_10_4_VDEV_PARAM_SWBA_TIME
,
952 .wmi_vdev_stats_update_period
= WMI_10_4_VDEV_STATS_UPDATE_PERIOD
,
953 .wmi_vdev_pwrsave_ageout_time
= WMI_10_4_VDEV_PWRSAVE_AGEOUT_TIME
,
954 .wmi_vdev_host_swba_interval
= WMI_10_4_VDEV_HOST_SWBA_INTERVAL
,
955 .dtim_period
= WMI_10_4_VDEV_PARAM_DTIM_PERIOD
,
956 .wmi_vdev_oc_scheduler_air_time_limit
=
957 WMI_10_4_VDEV_OC_SCHEDULER_AIR_TIME_LIMIT
,
958 .wds
= WMI_10_4_VDEV_PARAM_WDS
,
959 .atim_window
= WMI_10_4_VDEV_PARAM_ATIM_WINDOW
,
960 .bmiss_count_max
= WMI_10_4_VDEV_PARAM_BMISS_COUNT_MAX
,
961 .bmiss_first_bcnt
= WMI_10_4_VDEV_PARAM_BMISS_FIRST_BCNT
,
962 .bmiss_final_bcnt
= WMI_10_4_VDEV_PARAM_BMISS_FINAL_BCNT
,
963 .feature_wmm
= WMI_10_4_VDEV_PARAM_FEATURE_WMM
,
964 .chwidth
= WMI_10_4_VDEV_PARAM_CHWIDTH
,
965 .chextoffset
= WMI_10_4_VDEV_PARAM_CHEXTOFFSET
,
966 .disable_htprotection
= WMI_10_4_VDEV_PARAM_DISABLE_HTPROTECTION
,
967 .sta_quickkickout
= WMI_10_4_VDEV_PARAM_STA_QUICKKICKOUT
,
968 .mgmt_rate
= WMI_10_4_VDEV_PARAM_MGMT_RATE
,
969 .protection_mode
= WMI_10_4_VDEV_PARAM_PROTECTION_MODE
,
970 .fixed_rate
= WMI_10_4_VDEV_PARAM_FIXED_RATE
,
971 .sgi
= WMI_10_4_VDEV_PARAM_SGI
,
972 .ldpc
= WMI_10_4_VDEV_PARAM_LDPC
,
973 .tx_stbc
= WMI_10_4_VDEV_PARAM_TX_STBC
,
974 .rx_stbc
= WMI_10_4_VDEV_PARAM_RX_STBC
,
975 .intra_bss_fwd
= WMI_10_4_VDEV_PARAM_INTRA_BSS_FWD
,
976 .def_keyid
= WMI_10_4_VDEV_PARAM_DEF_KEYID
,
977 .nss
= WMI_10_4_VDEV_PARAM_NSS
,
978 .bcast_data_rate
= WMI_10_4_VDEV_PARAM_BCAST_DATA_RATE
,
979 .mcast_data_rate
= WMI_10_4_VDEV_PARAM_MCAST_DATA_RATE
,
980 .mcast_indicate
= WMI_10_4_VDEV_PARAM_MCAST_INDICATE
,
981 .dhcp_indicate
= WMI_10_4_VDEV_PARAM_DHCP_INDICATE
,
982 .unknown_dest_indicate
= WMI_10_4_VDEV_PARAM_UNKNOWN_DEST_INDICATE
,
983 .ap_keepalive_min_idle_inactive_time_secs
=
984 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MIN_IDLE_INACTIVE_TIME_SECS
,
985 .ap_keepalive_max_idle_inactive_time_secs
=
986 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_IDLE_INACTIVE_TIME_SECS
,
987 .ap_keepalive_max_unresponsive_time_secs
=
988 WMI_10_4_VDEV_PARAM_AP_KEEPALIVE_MAX_UNRESPONSIVE_TIME_SECS
,
989 .ap_enable_nawds
= WMI_10_4_VDEV_PARAM_AP_ENABLE_NAWDS
,
990 .mcast2ucast_set
= WMI_10_4_VDEV_PARAM_MCAST2UCAST_SET
,
991 .enable_rtscts
= WMI_10_4_VDEV_PARAM_ENABLE_RTSCTS
,
992 .txbf
= WMI_10_4_VDEV_PARAM_TXBF
,
993 .packet_powersave
= WMI_10_4_VDEV_PARAM_PACKET_POWERSAVE
,
994 .drop_unencry
= WMI_10_4_VDEV_PARAM_DROP_UNENCRY
,
995 .tx_encap_type
= WMI_10_4_VDEV_PARAM_TX_ENCAP_TYPE
,
996 .ap_detect_out_of_sync_sleeping_sta_time_secs
=
997 WMI_10_4_VDEV_PARAM_AP_DETECT_OUT_OF_SYNC_SLEEPING_STA_TIME_SECS
,
998 .rc_num_retries
= WMI_10_4_VDEV_PARAM_RC_NUM_RETRIES
,
999 .cabq_maxdur
= WMI_10_4_VDEV_PARAM_CABQ_MAXDUR
,
1000 .mfptest_set
= WMI_10_4_VDEV_PARAM_MFPTEST_SET
,
1001 .rts_fixed_rate
= WMI_10_4_VDEV_PARAM_RTS_FIXED_RATE
,
1002 .vht_sgimask
= WMI_10_4_VDEV_PARAM_VHT_SGIMASK
,
1003 .vht80_ratemask
= WMI_10_4_VDEV_PARAM_VHT80_RATEMASK
,
1004 .early_rx_adjust_enable
= WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_ENABLE
,
1005 .early_rx_tgt_bmiss_num
= WMI_10_4_VDEV_PARAM_EARLY_RX_TGT_BMISS_NUM
,
1006 .early_rx_bmiss_sample_cycle
=
1007 WMI_10_4_VDEV_PARAM_EARLY_RX_BMISS_SAMPLE_CYCLE
,
1008 .early_rx_slop_step
= WMI_10_4_VDEV_PARAM_EARLY_RX_SLOP_STEP
,
1009 .early_rx_init_slop
= WMI_10_4_VDEV_PARAM_EARLY_RX_INIT_SLOP
,
1010 .early_rx_adjust_pause
= WMI_10_4_VDEV_PARAM_EARLY_RX_ADJUST_PAUSE
,
1011 .proxy_sta
= WMI_10_4_VDEV_PARAM_PROXY_STA
,
1012 .meru_vc
= WMI_10_4_VDEV_PARAM_MERU_VC
,
1013 .rx_decap_type
= WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE
,
1014 .bw_nss_ratemask
= WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK
,
1015 .set_tsf
= WMI_10_4_VDEV_PARAM_TSF_INCREMENT
,
1018 static struct wmi_pdev_param_map wmi_pdev_param_map
= {
1019 .tx_chain_mask
= WMI_PDEV_PARAM_TX_CHAIN_MASK
,
1020 .rx_chain_mask
= WMI_PDEV_PARAM_RX_CHAIN_MASK
,
1021 .txpower_limit2g
= WMI_PDEV_PARAM_TXPOWER_LIMIT2G
,
1022 .txpower_limit5g
= WMI_PDEV_PARAM_TXPOWER_LIMIT5G
,
1023 .txpower_scale
= WMI_PDEV_PARAM_TXPOWER_SCALE
,
1024 .beacon_gen_mode
= WMI_PDEV_PARAM_BEACON_GEN_MODE
,
1025 .beacon_tx_mode
= WMI_PDEV_PARAM_BEACON_TX_MODE
,
1026 .resmgr_offchan_mode
= WMI_PDEV_PARAM_RESMGR_OFFCHAN_MODE
,
1027 .protection_mode
= WMI_PDEV_PARAM_PROTECTION_MODE
,
1028 .dynamic_bw
= WMI_PDEV_PARAM_DYNAMIC_BW
,
1029 .non_agg_sw_retry_th
= WMI_PDEV_PARAM_NON_AGG_SW_RETRY_TH
,
1030 .agg_sw_retry_th
= WMI_PDEV_PARAM_AGG_SW_RETRY_TH
,
1031 .sta_kickout_th
= WMI_PDEV_PARAM_STA_KICKOUT_TH
,
1032 .ac_aggrsize_scaling
= WMI_PDEV_PARAM_AC_AGGRSIZE_SCALING
,
1033 .ltr_enable
= WMI_PDEV_PARAM_LTR_ENABLE
,
1034 .ltr_ac_latency_be
= WMI_PDEV_PARAM_LTR_AC_LATENCY_BE
,
1035 .ltr_ac_latency_bk
= WMI_PDEV_PARAM_LTR_AC_LATENCY_BK
,
1036 .ltr_ac_latency_vi
= WMI_PDEV_PARAM_LTR_AC_LATENCY_VI
,
1037 .ltr_ac_latency_vo
= WMI_PDEV_PARAM_LTR_AC_LATENCY_VO
,
1038 .ltr_ac_latency_timeout
= WMI_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT
,
1039 .ltr_sleep_override
= WMI_PDEV_PARAM_LTR_SLEEP_OVERRIDE
,
1040 .ltr_rx_override
= WMI_PDEV_PARAM_LTR_RX_OVERRIDE
,
1041 .ltr_tx_activity_timeout
= WMI_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT
,
1042 .l1ss_enable
= WMI_PDEV_PARAM_L1SS_ENABLE
,
1043 .dsleep_enable
= WMI_PDEV_PARAM_DSLEEP_ENABLE
,
1044 .pcielp_txbuf_flush
= WMI_PDEV_PARAM_PCIELP_TXBUF_FLUSH
,
1045 .pcielp_txbuf_watermark
= WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN
,
1046 .pcielp_txbuf_tmo_en
= WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_EN
,
1047 .pcielp_txbuf_tmo_value
= WMI_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE
,
1048 .pdev_stats_update_period
= WMI_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD
,
1049 .vdev_stats_update_period
= WMI_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD
,
1050 .peer_stats_update_period
= WMI_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD
,
1051 .bcnflt_stats_update_period
= WMI_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD
,
1052 .pmf_qos
= WMI_PDEV_PARAM_PMF_QOS
,
1053 .arp_ac_override
= WMI_PDEV_PARAM_ARP_AC_OVERRIDE
,
1054 .dcs
= WMI_PDEV_PARAM_DCS
,
1055 .ani_enable
= WMI_PDEV_PARAM_ANI_ENABLE
,
1056 .ani_poll_period
= WMI_PDEV_PARAM_ANI_POLL_PERIOD
,
1057 .ani_listen_period
= WMI_PDEV_PARAM_ANI_LISTEN_PERIOD
,
1058 .ani_ofdm_level
= WMI_PDEV_PARAM_ANI_OFDM_LEVEL
,
1059 .ani_cck_level
= WMI_PDEV_PARAM_ANI_CCK_LEVEL
,
1060 .dyntxchain
= WMI_PDEV_PARAM_DYNTXCHAIN
,
1061 .proxy_sta
= WMI_PDEV_PARAM_PROXY_STA
,
1062 .idle_ps_config
= WMI_PDEV_PARAM_IDLE_PS_CONFIG
,
1063 .power_gating_sleep
= WMI_PDEV_PARAM_POWER_GATING_SLEEP
,
1064 .fast_channel_reset
= WMI_PDEV_PARAM_UNSUPPORTED
,
1065 .burst_dur
= WMI_PDEV_PARAM_UNSUPPORTED
,
1066 .burst_enable
= WMI_PDEV_PARAM_UNSUPPORTED
,
1067 .cal_period
= WMI_PDEV_PARAM_UNSUPPORTED
,
1068 .aggr_burst
= WMI_PDEV_PARAM_UNSUPPORTED
,
1069 .rx_decap_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1070 .smart_antenna_default_antenna
= WMI_PDEV_PARAM_UNSUPPORTED
,
1071 .igmpmld_override
= WMI_PDEV_PARAM_UNSUPPORTED
,
1072 .igmpmld_tid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1073 .antenna_gain
= WMI_PDEV_PARAM_UNSUPPORTED
,
1074 .rx_filter
= WMI_PDEV_PARAM_UNSUPPORTED
,
1075 .set_mcast_to_ucast_tid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1076 .proxy_sta_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1077 .set_mcast2ucast_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1078 .set_mcast2ucast_buffer
= WMI_PDEV_PARAM_UNSUPPORTED
,
1079 .remove_mcast2ucast_buffer
= WMI_PDEV_PARAM_UNSUPPORTED
,
1080 .peer_sta_ps_statechg_enable
= WMI_PDEV_PARAM_UNSUPPORTED
,
1081 .igmpmld_ac_override
= WMI_PDEV_PARAM_UNSUPPORTED
,
1082 .block_interbss
= WMI_PDEV_PARAM_UNSUPPORTED
,
1083 .set_disable_reset_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1084 .set_msdu_ttl_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1085 .set_ppdu_duration_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1086 .txbf_sound_period_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1087 .set_promisc_mode_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1088 .set_burst_mode_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1089 .en_stats
= WMI_PDEV_PARAM_UNSUPPORTED
,
1090 .mu_group_policy
= WMI_PDEV_PARAM_UNSUPPORTED
,
1091 .noise_detection
= WMI_PDEV_PARAM_UNSUPPORTED
,
1092 .noise_threshold
= WMI_PDEV_PARAM_UNSUPPORTED
,
1093 .dpd_enable
= WMI_PDEV_PARAM_UNSUPPORTED
,
1094 .set_mcast_bcast_echo
= WMI_PDEV_PARAM_UNSUPPORTED
,
1095 .atf_strict_sch
= WMI_PDEV_PARAM_UNSUPPORTED
,
1096 .atf_sched_duration
= WMI_PDEV_PARAM_UNSUPPORTED
,
1097 .ant_plzn
= WMI_PDEV_PARAM_UNSUPPORTED
,
1098 .mgmt_retry_limit
= WMI_PDEV_PARAM_UNSUPPORTED
,
1099 .sensitivity_level
= WMI_PDEV_PARAM_UNSUPPORTED
,
1100 .signed_txpower_2g
= WMI_PDEV_PARAM_UNSUPPORTED
,
1101 .signed_txpower_5g
= WMI_PDEV_PARAM_UNSUPPORTED
,
1102 .enable_per_tid_amsdu
= WMI_PDEV_PARAM_UNSUPPORTED
,
1103 .enable_per_tid_ampdu
= WMI_PDEV_PARAM_UNSUPPORTED
,
1104 .cca_threshold
= WMI_PDEV_PARAM_UNSUPPORTED
,
1105 .rts_fixed_rate
= WMI_PDEV_PARAM_UNSUPPORTED
,
1106 .pdev_reset
= WMI_PDEV_PARAM_UNSUPPORTED
,
1107 .wapi_mbssid_offset
= WMI_PDEV_PARAM_UNSUPPORTED
,
1108 .arp_srcaddr
= WMI_PDEV_PARAM_UNSUPPORTED
,
1109 .arp_dstaddr
= WMI_PDEV_PARAM_UNSUPPORTED
,
1110 .enable_btcoex
= WMI_PDEV_PARAM_UNSUPPORTED
,
1113 static struct wmi_pdev_param_map wmi_10x_pdev_param_map
= {
1114 .tx_chain_mask
= WMI_10X_PDEV_PARAM_TX_CHAIN_MASK
,
1115 .rx_chain_mask
= WMI_10X_PDEV_PARAM_RX_CHAIN_MASK
,
1116 .txpower_limit2g
= WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G
,
1117 .txpower_limit5g
= WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G
,
1118 .txpower_scale
= WMI_10X_PDEV_PARAM_TXPOWER_SCALE
,
1119 .beacon_gen_mode
= WMI_10X_PDEV_PARAM_BEACON_GEN_MODE
,
1120 .beacon_tx_mode
= WMI_10X_PDEV_PARAM_BEACON_TX_MODE
,
1121 .resmgr_offchan_mode
= WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE
,
1122 .protection_mode
= WMI_10X_PDEV_PARAM_PROTECTION_MODE
,
1123 .dynamic_bw
= WMI_10X_PDEV_PARAM_DYNAMIC_BW
,
1124 .non_agg_sw_retry_th
= WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH
,
1125 .agg_sw_retry_th
= WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH
,
1126 .sta_kickout_th
= WMI_10X_PDEV_PARAM_STA_KICKOUT_TH
,
1127 .ac_aggrsize_scaling
= WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING
,
1128 .ltr_enable
= WMI_10X_PDEV_PARAM_LTR_ENABLE
,
1129 .ltr_ac_latency_be
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE
,
1130 .ltr_ac_latency_bk
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK
,
1131 .ltr_ac_latency_vi
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI
,
1132 .ltr_ac_latency_vo
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO
,
1133 .ltr_ac_latency_timeout
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT
,
1134 .ltr_sleep_override
= WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE
,
1135 .ltr_rx_override
= WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE
,
1136 .ltr_tx_activity_timeout
= WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT
,
1137 .l1ss_enable
= WMI_10X_PDEV_PARAM_L1SS_ENABLE
,
1138 .dsleep_enable
= WMI_10X_PDEV_PARAM_DSLEEP_ENABLE
,
1139 .pcielp_txbuf_flush
= WMI_PDEV_PARAM_UNSUPPORTED
,
1140 .pcielp_txbuf_watermark
= WMI_PDEV_PARAM_UNSUPPORTED
,
1141 .pcielp_txbuf_tmo_en
= WMI_PDEV_PARAM_UNSUPPORTED
,
1142 .pcielp_txbuf_tmo_value
= WMI_PDEV_PARAM_UNSUPPORTED
,
1143 .pdev_stats_update_period
= WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD
,
1144 .vdev_stats_update_period
= WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD
,
1145 .peer_stats_update_period
= WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD
,
1146 .bcnflt_stats_update_period
=
1147 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD
,
1148 .pmf_qos
= WMI_10X_PDEV_PARAM_PMF_QOS
,
1149 .arp_ac_override
= WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE
,
1150 .dcs
= WMI_10X_PDEV_PARAM_DCS
,
1151 .ani_enable
= WMI_10X_PDEV_PARAM_ANI_ENABLE
,
1152 .ani_poll_period
= WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD
,
1153 .ani_listen_period
= WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD
,
1154 .ani_ofdm_level
= WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL
,
1155 .ani_cck_level
= WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL
,
1156 .dyntxchain
= WMI_10X_PDEV_PARAM_DYNTXCHAIN
,
1157 .proxy_sta
= WMI_PDEV_PARAM_UNSUPPORTED
,
1158 .idle_ps_config
= WMI_PDEV_PARAM_UNSUPPORTED
,
1159 .power_gating_sleep
= WMI_PDEV_PARAM_UNSUPPORTED
,
1160 .fast_channel_reset
= WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET
,
1161 .burst_dur
= WMI_10X_PDEV_PARAM_BURST_DUR
,
1162 .burst_enable
= WMI_10X_PDEV_PARAM_BURST_ENABLE
,
1163 .cal_period
= WMI_10X_PDEV_PARAM_CAL_PERIOD
,
1164 .aggr_burst
= WMI_PDEV_PARAM_UNSUPPORTED
,
1165 .rx_decap_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1166 .smart_antenna_default_antenna
= WMI_PDEV_PARAM_UNSUPPORTED
,
1167 .igmpmld_override
= WMI_PDEV_PARAM_UNSUPPORTED
,
1168 .igmpmld_tid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1169 .antenna_gain
= WMI_PDEV_PARAM_UNSUPPORTED
,
1170 .rx_filter
= WMI_PDEV_PARAM_UNSUPPORTED
,
1171 .set_mcast_to_ucast_tid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1172 .proxy_sta_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1173 .set_mcast2ucast_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1174 .set_mcast2ucast_buffer
= WMI_PDEV_PARAM_UNSUPPORTED
,
1175 .remove_mcast2ucast_buffer
= WMI_PDEV_PARAM_UNSUPPORTED
,
1176 .peer_sta_ps_statechg_enable
= WMI_PDEV_PARAM_UNSUPPORTED
,
1177 .igmpmld_ac_override
= WMI_PDEV_PARAM_UNSUPPORTED
,
1178 .block_interbss
= WMI_PDEV_PARAM_UNSUPPORTED
,
1179 .set_disable_reset_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1180 .set_msdu_ttl_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1181 .set_ppdu_duration_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1182 .txbf_sound_period_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1183 .set_promisc_mode_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1184 .set_burst_mode_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1185 .en_stats
= WMI_PDEV_PARAM_UNSUPPORTED
,
1186 .mu_group_policy
= WMI_PDEV_PARAM_UNSUPPORTED
,
1187 .noise_detection
= WMI_PDEV_PARAM_UNSUPPORTED
,
1188 .noise_threshold
= WMI_PDEV_PARAM_UNSUPPORTED
,
1189 .dpd_enable
= WMI_PDEV_PARAM_UNSUPPORTED
,
1190 .set_mcast_bcast_echo
= WMI_PDEV_PARAM_UNSUPPORTED
,
1191 .atf_strict_sch
= WMI_PDEV_PARAM_UNSUPPORTED
,
1192 .atf_sched_duration
= WMI_PDEV_PARAM_UNSUPPORTED
,
1193 .ant_plzn
= WMI_PDEV_PARAM_UNSUPPORTED
,
1194 .mgmt_retry_limit
= WMI_PDEV_PARAM_UNSUPPORTED
,
1195 .sensitivity_level
= WMI_PDEV_PARAM_UNSUPPORTED
,
1196 .signed_txpower_2g
= WMI_PDEV_PARAM_UNSUPPORTED
,
1197 .signed_txpower_5g
= WMI_PDEV_PARAM_UNSUPPORTED
,
1198 .enable_per_tid_amsdu
= WMI_PDEV_PARAM_UNSUPPORTED
,
1199 .enable_per_tid_ampdu
= WMI_PDEV_PARAM_UNSUPPORTED
,
1200 .cca_threshold
= WMI_PDEV_PARAM_UNSUPPORTED
,
1201 .rts_fixed_rate
= WMI_PDEV_PARAM_UNSUPPORTED
,
1202 .pdev_reset
= WMI_PDEV_PARAM_UNSUPPORTED
,
1203 .wapi_mbssid_offset
= WMI_PDEV_PARAM_UNSUPPORTED
,
1204 .arp_srcaddr
= WMI_PDEV_PARAM_UNSUPPORTED
,
1205 .arp_dstaddr
= WMI_PDEV_PARAM_UNSUPPORTED
,
1206 .enable_btcoex
= WMI_PDEV_PARAM_UNSUPPORTED
,
1209 static struct wmi_pdev_param_map wmi_10_2_4_pdev_param_map
= {
1210 .tx_chain_mask
= WMI_10X_PDEV_PARAM_TX_CHAIN_MASK
,
1211 .rx_chain_mask
= WMI_10X_PDEV_PARAM_RX_CHAIN_MASK
,
1212 .txpower_limit2g
= WMI_10X_PDEV_PARAM_TXPOWER_LIMIT2G
,
1213 .txpower_limit5g
= WMI_10X_PDEV_PARAM_TXPOWER_LIMIT5G
,
1214 .txpower_scale
= WMI_10X_PDEV_PARAM_TXPOWER_SCALE
,
1215 .beacon_gen_mode
= WMI_10X_PDEV_PARAM_BEACON_GEN_MODE
,
1216 .beacon_tx_mode
= WMI_10X_PDEV_PARAM_BEACON_TX_MODE
,
1217 .resmgr_offchan_mode
= WMI_10X_PDEV_PARAM_RESMGR_OFFCHAN_MODE
,
1218 .protection_mode
= WMI_10X_PDEV_PARAM_PROTECTION_MODE
,
1219 .dynamic_bw
= WMI_10X_PDEV_PARAM_DYNAMIC_BW
,
1220 .non_agg_sw_retry_th
= WMI_10X_PDEV_PARAM_NON_AGG_SW_RETRY_TH
,
1221 .agg_sw_retry_th
= WMI_10X_PDEV_PARAM_AGG_SW_RETRY_TH
,
1222 .sta_kickout_th
= WMI_10X_PDEV_PARAM_STA_KICKOUT_TH
,
1223 .ac_aggrsize_scaling
= WMI_10X_PDEV_PARAM_AC_AGGRSIZE_SCALING
,
1224 .ltr_enable
= WMI_10X_PDEV_PARAM_LTR_ENABLE
,
1225 .ltr_ac_latency_be
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BE
,
1226 .ltr_ac_latency_bk
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_BK
,
1227 .ltr_ac_latency_vi
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VI
,
1228 .ltr_ac_latency_vo
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_VO
,
1229 .ltr_ac_latency_timeout
= WMI_10X_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT
,
1230 .ltr_sleep_override
= WMI_10X_PDEV_PARAM_LTR_SLEEP_OVERRIDE
,
1231 .ltr_rx_override
= WMI_10X_PDEV_PARAM_LTR_RX_OVERRIDE
,
1232 .ltr_tx_activity_timeout
= WMI_10X_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT
,
1233 .l1ss_enable
= WMI_10X_PDEV_PARAM_L1SS_ENABLE
,
1234 .dsleep_enable
= WMI_10X_PDEV_PARAM_DSLEEP_ENABLE
,
1235 .pcielp_txbuf_flush
= WMI_PDEV_PARAM_UNSUPPORTED
,
1236 .pcielp_txbuf_watermark
= WMI_PDEV_PARAM_UNSUPPORTED
,
1237 .pcielp_txbuf_tmo_en
= WMI_PDEV_PARAM_UNSUPPORTED
,
1238 .pcielp_txbuf_tmo_value
= WMI_PDEV_PARAM_UNSUPPORTED
,
1239 .pdev_stats_update_period
= WMI_10X_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD
,
1240 .vdev_stats_update_period
= WMI_10X_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD
,
1241 .peer_stats_update_period
= WMI_10X_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD
,
1242 .bcnflt_stats_update_period
=
1243 WMI_10X_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD
,
1244 .pmf_qos
= WMI_10X_PDEV_PARAM_PMF_QOS
,
1245 .arp_ac_override
= WMI_10X_PDEV_PARAM_ARPDHCP_AC_OVERRIDE
,
1246 .dcs
= WMI_10X_PDEV_PARAM_DCS
,
1247 .ani_enable
= WMI_10X_PDEV_PARAM_ANI_ENABLE
,
1248 .ani_poll_period
= WMI_10X_PDEV_PARAM_ANI_POLL_PERIOD
,
1249 .ani_listen_period
= WMI_10X_PDEV_PARAM_ANI_LISTEN_PERIOD
,
1250 .ani_ofdm_level
= WMI_10X_PDEV_PARAM_ANI_OFDM_LEVEL
,
1251 .ani_cck_level
= WMI_10X_PDEV_PARAM_ANI_CCK_LEVEL
,
1252 .dyntxchain
= WMI_10X_PDEV_PARAM_DYNTXCHAIN
,
1253 .proxy_sta
= WMI_PDEV_PARAM_UNSUPPORTED
,
1254 .idle_ps_config
= WMI_PDEV_PARAM_UNSUPPORTED
,
1255 .power_gating_sleep
= WMI_PDEV_PARAM_UNSUPPORTED
,
1256 .fast_channel_reset
= WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET
,
1257 .burst_dur
= WMI_10X_PDEV_PARAM_BURST_DUR
,
1258 .burst_enable
= WMI_10X_PDEV_PARAM_BURST_ENABLE
,
1259 .cal_period
= WMI_10X_PDEV_PARAM_CAL_PERIOD
,
1260 .aggr_burst
= WMI_PDEV_PARAM_UNSUPPORTED
,
1261 .rx_decap_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1262 .smart_antenna_default_antenna
= WMI_PDEV_PARAM_UNSUPPORTED
,
1263 .igmpmld_override
= WMI_PDEV_PARAM_UNSUPPORTED
,
1264 .igmpmld_tid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1265 .antenna_gain
= WMI_PDEV_PARAM_UNSUPPORTED
,
1266 .rx_filter
= WMI_PDEV_PARAM_UNSUPPORTED
,
1267 .set_mcast_to_ucast_tid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1268 .proxy_sta_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1269 .set_mcast2ucast_mode
= WMI_PDEV_PARAM_UNSUPPORTED
,
1270 .set_mcast2ucast_buffer
= WMI_PDEV_PARAM_UNSUPPORTED
,
1271 .remove_mcast2ucast_buffer
= WMI_PDEV_PARAM_UNSUPPORTED
,
1272 .peer_sta_ps_statechg_enable
= WMI_PDEV_PARAM_UNSUPPORTED
,
1273 .igmpmld_ac_override
= WMI_PDEV_PARAM_UNSUPPORTED
,
1274 .block_interbss
= WMI_PDEV_PARAM_UNSUPPORTED
,
1275 .set_disable_reset_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1276 .set_msdu_ttl_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1277 .set_ppdu_duration_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1278 .txbf_sound_period_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1279 .set_promisc_mode_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1280 .set_burst_mode_cmdid
= WMI_PDEV_PARAM_UNSUPPORTED
,
1281 .en_stats
= WMI_PDEV_PARAM_UNSUPPORTED
,
1282 .mu_group_policy
= WMI_PDEV_PARAM_UNSUPPORTED
,
1283 .noise_detection
= WMI_PDEV_PARAM_UNSUPPORTED
,
1284 .noise_threshold
= WMI_PDEV_PARAM_UNSUPPORTED
,
1285 .dpd_enable
= WMI_PDEV_PARAM_UNSUPPORTED
,
1286 .set_mcast_bcast_echo
= WMI_PDEV_PARAM_UNSUPPORTED
,
1287 .atf_strict_sch
= WMI_PDEV_PARAM_UNSUPPORTED
,
1288 .atf_sched_duration
= WMI_PDEV_PARAM_UNSUPPORTED
,
1289 .ant_plzn
= WMI_PDEV_PARAM_UNSUPPORTED
,
1290 .mgmt_retry_limit
= WMI_PDEV_PARAM_UNSUPPORTED
,
1291 .sensitivity_level
= WMI_PDEV_PARAM_UNSUPPORTED
,
1292 .signed_txpower_2g
= WMI_PDEV_PARAM_UNSUPPORTED
,
1293 .signed_txpower_5g
= WMI_PDEV_PARAM_UNSUPPORTED
,
1294 .enable_per_tid_amsdu
= WMI_PDEV_PARAM_UNSUPPORTED
,
1295 .enable_per_tid_ampdu
= WMI_PDEV_PARAM_UNSUPPORTED
,
1296 .cca_threshold
= WMI_PDEV_PARAM_UNSUPPORTED
,
1297 .rts_fixed_rate
= WMI_PDEV_PARAM_UNSUPPORTED
,
1298 .pdev_reset
= WMI_PDEV_PARAM_UNSUPPORTED
,
1299 .wapi_mbssid_offset
= WMI_PDEV_PARAM_UNSUPPORTED
,
1300 .arp_srcaddr
= WMI_PDEV_PARAM_UNSUPPORTED
,
1301 .arp_dstaddr
= WMI_PDEV_PARAM_UNSUPPORTED
,
1302 .enable_btcoex
= WMI_PDEV_PARAM_UNSUPPORTED
,
1305 /* firmware 10.2 specific mappings */
1306 static struct wmi_cmd_map wmi_10_2_cmd_map
= {
1307 .init_cmdid
= WMI_10_2_INIT_CMDID
,
1308 .start_scan_cmdid
= WMI_10_2_START_SCAN_CMDID
,
1309 .stop_scan_cmdid
= WMI_10_2_STOP_SCAN_CMDID
,
1310 .scan_chan_list_cmdid
= WMI_10_2_SCAN_CHAN_LIST_CMDID
,
1311 .scan_sch_prio_tbl_cmdid
= WMI_CMD_UNSUPPORTED
,
1312 .pdev_set_regdomain_cmdid
= WMI_10_2_PDEV_SET_REGDOMAIN_CMDID
,
1313 .pdev_set_channel_cmdid
= WMI_10_2_PDEV_SET_CHANNEL_CMDID
,
1314 .pdev_set_param_cmdid
= WMI_10_2_PDEV_SET_PARAM_CMDID
,
1315 .pdev_pktlog_enable_cmdid
= WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID
,
1316 .pdev_pktlog_disable_cmdid
= WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID
,
1317 .pdev_set_wmm_params_cmdid
= WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID
,
1318 .pdev_set_ht_cap_ie_cmdid
= WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID
,
1319 .pdev_set_vht_cap_ie_cmdid
= WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID
,
1320 .pdev_set_quiet_mode_cmdid
= WMI_10_2_PDEV_SET_QUIET_MODE_CMDID
,
1321 .pdev_green_ap_ps_enable_cmdid
= WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID
,
1322 .pdev_get_tpc_config_cmdid
= WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID
,
1323 .pdev_set_base_macaddr_cmdid
= WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID
,
1324 .vdev_create_cmdid
= WMI_10_2_VDEV_CREATE_CMDID
,
1325 .vdev_delete_cmdid
= WMI_10_2_VDEV_DELETE_CMDID
,
1326 .vdev_start_request_cmdid
= WMI_10_2_VDEV_START_REQUEST_CMDID
,
1327 .vdev_restart_request_cmdid
= WMI_10_2_VDEV_RESTART_REQUEST_CMDID
,
1328 .vdev_up_cmdid
= WMI_10_2_VDEV_UP_CMDID
,
1329 .vdev_stop_cmdid
= WMI_10_2_VDEV_STOP_CMDID
,
1330 .vdev_down_cmdid
= WMI_10_2_VDEV_DOWN_CMDID
,
1331 .vdev_set_param_cmdid
= WMI_10_2_VDEV_SET_PARAM_CMDID
,
1332 .vdev_install_key_cmdid
= WMI_10_2_VDEV_INSTALL_KEY_CMDID
,
1333 .peer_create_cmdid
= WMI_10_2_PEER_CREATE_CMDID
,
1334 .peer_delete_cmdid
= WMI_10_2_PEER_DELETE_CMDID
,
1335 .peer_flush_tids_cmdid
= WMI_10_2_PEER_FLUSH_TIDS_CMDID
,
1336 .peer_set_param_cmdid
= WMI_10_2_PEER_SET_PARAM_CMDID
,
1337 .peer_assoc_cmdid
= WMI_10_2_PEER_ASSOC_CMDID
,
1338 .peer_add_wds_entry_cmdid
= WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID
,
1339 .peer_remove_wds_entry_cmdid
= WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID
,
1340 .peer_mcast_group_cmdid
= WMI_10_2_PEER_MCAST_GROUP_CMDID
,
1341 .bcn_tx_cmdid
= WMI_10_2_BCN_TX_CMDID
,
1342 .pdev_send_bcn_cmdid
= WMI_10_2_PDEV_SEND_BCN_CMDID
,
1343 .bcn_tmpl_cmdid
= WMI_CMD_UNSUPPORTED
,
1344 .bcn_filter_rx_cmdid
= WMI_10_2_BCN_FILTER_RX_CMDID
,
1345 .prb_req_filter_rx_cmdid
= WMI_10_2_PRB_REQ_FILTER_RX_CMDID
,
1346 .mgmt_tx_cmdid
= WMI_10_2_MGMT_TX_CMDID
,
1347 .prb_tmpl_cmdid
= WMI_CMD_UNSUPPORTED
,
1348 .addba_clear_resp_cmdid
= WMI_10_2_ADDBA_CLEAR_RESP_CMDID
,
1349 .addba_send_cmdid
= WMI_10_2_ADDBA_SEND_CMDID
,
1350 .addba_status_cmdid
= WMI_10_2_ADDBA_STATUS_CMDID
,
1351 .delba_send_cmdid
= WMI_10_2_DELBA_SEND_CMDID
,
1352 .addba_set_resp_cmdid
= WMI_10_2_ADDBA_SET_RESP_CMDID
,
1353 .send_singleamsdu_cmdid
= WMI_10_2_SEND_SINGLEAMSDU_CMDID
,
1354 .sta_powersave_mode_cmdid
= WMI_10_2_STA_POWERSAVE_MODE_CMDID
,
1355 .sta_powersave_param_cmdid
= WMI_10_2_STA_POWERSAVE_PARAM_CMDID
,
1356 .sta_mimo_ps_mode_cmdid
= WMI_10_2_STA_MIMO_PS_MODE_CMDID
,
1357 .pdev_dfs_enable_cmdid
= WMI_10_2_PDEV_DFS_ENABLE_CMDID
,
1358 .pdev_dfs_disable_cmdid
= WMI_10_2_PDEV_DFS_DISABLE_CMDID
,
1359 .roam_scan_mode
= WMI_10_2_ROAM_SCAN_MODE
,
1360 .roam_scan_rssi_threshold
= WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD
,
1361 .roam_scan_period
= WMI_10_2_ROAM_SCAN_PERIOD
,
1362 .roam_scan_rssi_change_threshold
=
1363 WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD
,
1364 .roam_ap_profile
= WMI_10_2_ROAM_AP_PROFILE
,
1365 .ofl_scan_add_ap_profile
= WMI_10_2_OFL_SCAN_ADD_AP_PROFILE
,
1366 .ofl_scan_remove_ap_profile
= WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE
,
1367 .ofl_scan_period
= WMI_10_2_OFL_SCAN_PERIOD
,
1368 .p2p_dev_set_device_info
= WMI_10_2_P2P_DEV_SET_DEVICE_INFO
,
1369 .p2p_dev_set_discoverability
= WMI_10_2_P2P_DEV_SET_DISCOVERABILITY
,
1370 .p2p_go_set_beacon_ie
= WMI_10_2_P2P_GO_SET_BEACON_IE
,
1371 .p2p_go_set_probe_resp_ie
= WMI_10_2_P2P_GO_SET_PROBE_RESP_IE
,
1372 .p2p_set_vendor_ie_data_cmdid
= WMI_CMD_UNSUPPORTED
,
1373 .ap_ps_peer_param_cmdid
= WMI_10_2_AP_PS_PEER_PARAM_CMDID
,
1374 .ap_ps_peer_uapsd_coex_cmdid
= WMI_CMD_UNSUPPORTED
,
1375 .peer_rate_retry_sched_cmdid
= WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID
,
1376 .wlan_profile_trigger_cmdid
= WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID
,
1377 .wlan_profile_set_hist_intvl_cmdid
=
1378 WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID
,
1379 .wlan_profile_get_profile_data_cmdid
=
1380 WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID
,
1381 .wlan_profile_enable_profile_id_cmdid
=
1382 WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID
,
1383 .wlan_profile_list_profile_id_cmdid
=
1384 WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID
,
1385 .pdev_suspend_cmdid
= WMI_10_2_PDEV_SUSPEND_CMDID
,
1386 .pdev_resume_cmdid
= WMI_10_2_PDEV_RESUME_CMDID
,
1387 .add_bcn_filter_cmdid
= WMI_10_2_ADD_BCN_FILTER_CMDID
,
1388 .rmv_bcn_filter_cmdid
= WMI_10_2_RMV_BCN_FILTER_CMDID
,
1389 .wow_add_wake_pattern_cmdid
= WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID
,
1390 .wow_del_wake_pattern_cmdid
= WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID
,
1391 .wow_enable_disable_wake_event_cmdid
=
1392 WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID
,
1393 .wow_enable_cmdid
= WMI_10_2_WOW_ENABLE_CMDID
,
1394 .wow_hostwakeup_from_sleep_cmdid
=
1395 WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID
,
1396 .rtt_measreq_cmdid
= WMI_10_2_RTT_MEASREQ_CMDID
,
1397 .rtt_tsf_cmdid
= WMI_10_2_RTT_TSF_CMDID
,
1398 .vdev_spectral_scan_configure_cmdid
=
1399 WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID
,
1400 .vdev_spectral_scan_enable_cmdid
=
1401 WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID
,
1402 .request_stats_cmdid
= WMI_10_2_REQUEST_STATS_CMDID
,
1403 .set_arp_ns_offload_cmdid
= WMI_CMD_UNSUPPORTED
,
1404 .network_list_offload_config_cmdid
= WMI_CMD_UNSUPPORTED
,
1405 .gtk_offload_cmdid
= WMI_CMD_UNSUPPORTED
,
1406 .csa_offload_enable_cmdid
= WMI_CMD_UNSUPPORTED
,
1407 .csa_offload_chanswitch_cmdid
= WMI_CMD_UNSUPPORTED
,
1408 .chatter_set_mode_cmdid
= WMI_CMD_UNSUPPORTED
,
1409 .peer_tid_addba_cmdid
= WMI_CMD_UNSUPPORTED
,
1410 .peer_tid_delba_cmdid
= WMI_CMD_UNSUPPORTED
,
1411 .sta_dtim_ps_method_cmdid
= WMI_CMD_UNSUPPORTED
,
1412 .sta_uapsd_auto_trig_cmdid
= WMI_CMD_UNSUPPORTED
,
1413 .sta_keepalive_cmd
= WMI_CMD_UNSUPPORTED
,
1414 .echo_cmdid
= WMI_10_2_ECHO_CMDID
,
1415 .pdev_utf_cmdid
= WMI_10_2_PDEV_UTF_CMDID
,
1416 .dbglog_cfg_cmdid
= WMI_10_2_DBGLOG_CFG_CMDID
,
1417 .pdev_qvit_cmdid
= WMI_10_2_PDEV_QVIT_CMDID
,
1418 .pdev_ftm_intg_cmdid
= WMI_CMD_UNSUPPORTED
,
1419 .vdev_set_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
1420 .vdev_get_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
1421 .force_fw_hang_cmdid
= WMI_CMD_UNSUPPORTED
,
1422 .gpio_config_cmdid
= WMI_10_2_GPIO_CONFIG_CMDID
,
1423 .gpio_output_cmdid
= WMI_10_2_GPIO_OUTPUT_CMDID
,
1424 .pdev_get_temperature_cmdid
= WMI_CMD_UNSUPPORTED
,
1425 .pdev_enable_adaptive_cca_cmdid
= WMI_CMD_UNSUPPORTED
,
1426 .scan_update_request_cmdid
= WMI_CMD_UNSUPPORTED
,
1427 .vdev_standby_response_cmdid
= WMI_CMD_UNSUPPORTED
,
1428 .vdev_resume_response_cmdid
= WMI_CMD_UNSUPPORTED
,
1429 .wlan_peer_caching_add_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
1430 .wlan_peer_caching_evict_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
1431 .wlan_peer_caching_restore_peer_cmdid
= WMI_CMD_UNSUPPORTED
,
1432 .wlan_peer_caching_print_all_peers_info_cmdid
= WMI_CMD_UNSUPPORTED
,
1433 .peer_update_wds_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
1434 .peer_add_proxy_sta_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
1435 .rtt_keepalive_cmdid
= WMI_CMD_UNSUPPORTED
,
1436 .oem_req_cmdid
= WMI_CMD_UNSUPPORTED
,
1437 .nan_cmdid
= WMI_CMD_UNSUPPORTED
,
1438 .vdev_ratemask_cmdid
= WMI_CMD_UNSUPPORTED
,
1439 .qboost_cfg_cmdid
= WMI_CMD_UNSUPPORTED
,
1440 .pdev_smart_ant_enable_cmdid
= WMI_CMD_UNSUPPORTED
,
1441 .pdev_smart_ant_set_rx_antenna_cmdid
= WMI_CMD_UNSUPPORTED
,
1442 .peer_smart_ant_set_tx_antenna_cmdid
= WMI_CMD_UNSUPPORTED
,
1443 .peer_smart_ant_set_train_info_cmdid
= WMI_CMD_UNSUPPORTED
,
1444 .peer_smart_ant_set_node_config_ops_cmdid
= WMI_CMD_UNSUPPORTED
,
1445 .pdev_set_antenna_switch_table_cmdid
= WMI_CMD_UNSUPPORTED
,
1446 .pdev_set_ctl_table_cmdid
= WMI_CMD_UNSUPPORTED
,
1447 .pdev_set_mimogain_table_cmdid
= WMI_CMD_UNSUPPORTED
,
1448 .pdev_ratepwr_table_cmdid
= WMI_CMD_UNSUPPORTED
,
1449 .pdev_ratepwr_chainmsk_table_cmdid
= WMI_CMD_UNSUPPORTED
,
1450 .pdev_fips_cmdid
= WMI_CMD_UNSUPPORTED
,
1451 .tt_set_conf_cmdid
= WMI_CMD_UNSUPPORTED
,
1452 .fwtest_cmdid
= WMI_CMD_UNSUPPORTED
,
1453 .vdev_atf_request_cmdid
= WMI_CMD_UNSUPPORTED
,
1454 .peer_atf_request_cmdid
= WMI_CMD_UNSUPPORTED
,
1455 .pdev_get_ani_cck_config_cmdid
= WMI_CMD_UNSUPPORTED
,
1456 .pdev_get_ani_ofdm_config_cmdid
= WMI_CMD_UNSUPPORTED
,
1457 .pdev_reserve_ast_entry_cmdid
= WMI_CMD_UNSUPPORTED
,
1460 static struct wmi_pdev_param_map wmi_10_4_pdev_param_map
= {
1461 .tx_chain_mask
= WMI_10_4_PDEV_PARAM_TX_CHAIN_MASK
,
1462 .rx_chain_mask
= WMI_10_4_PDEV_PARAM_RX_CHAIN_MASK
,
1463 .txpower_limit2g
= WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT2G
,
1464 .txpower_limit5g
= WMI_10_4_PDEV_PARAM_TXPOWER_LIMIT5G
,
1465 .txpower_scale
= WMI_10_4_PDEV_PARAM_TXPOWER_SCALE
,
1466 .beacon_gen_mode
= WMI_10_4_PDEV_PARAM_BEACON_GEN_MODE
,
1467 .beacon_tx_mode
= WMI_10_4_PDEV_PARAM_BEACON_TX_MODE
,
1468 .resmgr_offchan_mode
= WMI_10_4_PDEV_PARAM_RESMGR_OFFCHAN_MODE
,
1469 .protection_mode
= WMI_10_4_PDEV_PARAM_PROTECTION_MODE
,
1470 .dynamic_bw
= WMI_10_4_PDEV_PARAM_DYNAMIC_BW
,
1471 .non_agg_sw_retry_th
= WMI_10_4_PDEV_PARAM_NON_AGG_SW_RETRY_TH
,
1472 .agg_sw_retry_th
= WMI_10_4_PDEV_PARAM_AGG_SW_RETRY_TH
,
1473 .sta_kickout_th
= WMI_10_4_PDEV_PARAM_STA_KICKOUT_TH
,
1474 .ac_aggrsize_scaling
= WMI_10_4_PDEV_PARAM_AC_AGGRSIZE_SCALING
,
1475 .ltr_enable
= WMI_10_4_PDEV_PARAM_LTR_ENABLE
,
1476 .ltr_ac_latency_be
= WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BE
,
1477 .ltr_ac_latency_bk
= WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_BK
,
1478 .ltr_ac_latency_vi
= WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VI
,
1479 .ltr_ac_latency_vo
= WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_VO
,
1480 .ltr_ac_latency_timeout
= WMI_10_4_PDEV_PARAM_LTR_AC_LATENCY_TIMEOUT
,
1481 .ltr_sleep_override
= WMI_10_4_PDEV_PARAM_LTR_SLEEP_OVERRIDE
,
1482 .ltr_rx_override
= WMI_10_4_PDEV_PARAM_LTR_RX_OVERRIDE
,
1483 .ltr_tx_activity_timeout
= WMI_10_4_PDEV_PARAM_LTR_TX_ACTIVITY_TIMEOUT
,
1484 .l1ss_enable
= WMI_10_4_PDEV_PARAM_L1SS_ENABLE
,
1485 .dsleep_enable
= WMI_10_4_PDEV_PARAM_DSLEEP_ENABLE
,
1486 .pcielp_txbuf_flush
= WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_FLUSH
,
1487 .pcielp_txbuf_watermark
= WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_WATERMARK
,
1488 .pcielp_txbuf_tmo_en
= WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_EN
,
1489 .pcielp_txbuf_tmo_value
= WMI_10_4_PDEV_PARAM_PCIELP_TXBUF_TMO_VALUE
,
1490 .pdev_stats_update_period
=
1491 WMI_10_4_PDEV_PARAM_PDEV_STATS_UPDATE_PERIOD
,
1492 .vdev_stats_update_period
=
1493 WMI_10_4_PDEV_PARAM_VDEV_STATS_UPDATE_PERIOD
,
1494 .peer_stats_update_period
=
1495 WMI_10_4_PDEV_PARAM_PEER_STATS_UPDATE_PERIOD
,
1496 .bcnflt_stats_update_period
=
1497 WMI_10_4_PDEV_PARAM_BCNFLT_STATS_UPDATE_PERIOD
,
1498 .pmf_qos
= WMI_10_4_PDEV_PARAM_PMF_QOS
,
1499 .arp_ac_override
= WMI_10_4_PDEV_PARAM_ARP_AC_OVERRIDE
,
1500 .dcs
= WMI_10_4_PDEV_PARAM_DCS
,
1501 .ani_enable
= WMI_10_4_PDEV_PARAM_ANI_ENABLE
,
1502 .ani_poll_period
= WMI_10_4_PDEV_PARAM_ANI_POLL_PERIOD
,
1503 .ani_listen_period
= WMI_10_4_PDEV_PARAM_ANI_LISTEN_PERIOD
,
1504 .ani_ofdm_level
= WMI_10_4_PDEV_PARAM_ANI_OFDM_LEVEL
,
1505 .ani_cck_level
= WMI_10_4_PDEV_PARAM_ANI_CCK_LEVEL
,
1506 .dyntxchain
= WMI_10_4_PDEV_PARAM_DYNTXCHAIN
,
1507 .proxy_sta
= WMI_10_4_PDEV_PARAM_PROXY_STA
,
1508 .idle_ps_config
= WMI_10_4_PDEV_PARAM_IDLE_PS_CONFIG
,
1509 .power_gating_sleep
= WMI_10_4_PDEV_PARAM_POWER_GATING_SLEEP
,
1510 .fast_channel_reset
= WMI_10_4_PDEV_PARAM_FAST_CHANNEL_RESET
,
1511 .burst_dur
= WMI_10_4_PDEV_PARAM_BURST_DUR
,
1512 .burst_enable
= WMI_10_4_PDEV_PARAM_BURST_ENABLE
,
1513 .cal_period
= WMI_10_4_PDEV_PARAM_CAL_PERIOD
,
1514 .aggr_burst
= WMI_10_4_PDEV_PARAM_AGGR_BURST
,
1515 .rx_decap_mode
= WMI_10_4_PDEV_PARAM_RX_DECAP_MODE
,
1516 .smart_antenna_default_antenna
=
1517 WMI_10_4_PDEV_PARAM_SMART_ANTENNA_DEFAULT_ANTENNA
,
1518 .igmpmld_override
= WMI_10_4_PDEV_PARAM_IGMPMLD_OVERRIDE
,
1519 .igmpmld_tid
= WMI_10_4_PDEV_PARAM_IGMPMLD_TID
,
1520 .antenna_gain
= WMI_10_4_PDEV_PARAM_ANTENNA_GAIN
,
1521 .rx_filter
= WMI_10_4_PDEV_PARAM_RX_FILTER
,
1522 .set_mcast_to_ucast_tid
= WMI_10_4_PDEV_SET_MCAST_TO_UCAST_TID
,
1523 .proxy_sta_mode
= WMI_10_4_PDEV_PARAM_PROXY_STA_MODE
,
1524 .set_mcast2ucast_mode
= WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_MODE
,
1525 .set_mcast2ucast_buffer
= WMI_10_4_PDEV_PARAM_SET_MCAST2UCAST_BUFFER
,
1526 .remove_mcast2ucast_buffer
=
1527 WMI_10_4_PDEV_PARAM_REMOVE_MCAST2UCAST_BUFFER
,
1528 .peer_sta_ps_statechg_enable
=
1529 WMI_10_4_PDEV_PEER_STA_PS_STATECHG_ENABLE
,
1530 .igmpmld_ac_override
= WMI_10_4_PDEV_PARAM_IGMPMLD_AC_OVERRIDE
,
1531 .block_interbss
= WMI_10_4_PDEV_PARAM_BLOCK_INTERBSS
,
1532 .set_disable_reset_cmdid
= WMI_10_4_PDEV_PARAM_SET_DISABLE_RESET_CMDID
,
1533 .set_msdu_ttl_cmdid
= WMI_10_4_PDEV_PARAM_SET_MSDU_TTL_CMDID
,
1534 .set_ppdu_duration_cmdid
= WMI_10_4_PDEV_PARAM_SET_PPDU_DURATION_CMDID
,
1535 .txbf_sound_period_cmdid
= WMI_10_4_PDEV_PARAM_TXBF_SOUND_PERIOD_CMDID
,
1536 .set_promisc_mode_cmdid
= WMI_10_4_PDEV_PARAM_SET_PROMISC_MODE_CMDID
,
1537 .set_burst_mode_cmdid
= WMI_10_4_PDEV_PARAM_SET_BURST_MODE_CMDID
,
1538 .en_stats
= WMI_10_4_PDEV_PARAM_EN_STATS
,
1539 .mu_group_policy
= WMI_10_4_PDEV_PARAM_MU_GROUP_POLICY
,
1540 .noise_detection
= WMI_10_4_PDEV_PARAM_NOISE_DETECTION
,
1541 .noise_threshold
= WMI_10_4_PDEV_PARAM_NOISE_THRESHOLD
,
1542 .dpd_enable
= WMI_10_4_PDEV_PARAM_DPD_ENABLE
,
1543 .set_mcast_bcast_echo
= WMI_10_4_PDEV_PARAM_SET_MCAST_BCAST_ECHO
,
1544 .atf_strict_sch
= WMI_10_4_PDEV_PARAM_ATF_STRICT_SCH
,
1545 .atf_sched_duration
= WMI_10_4_PDEV_PARAM_ATF_SCHED_DURATION
,
1546 .ant_plzn
= WMI_10_4_PDEV_PARAM_ANT_PLZN
,
1547 .mgmt_retry_limit
= WMI_10_4_PDEV_PARAM_MGMT_RETRY_LIMIT
,
1548 .sensitivity_level
= WMI_10_4_PDEV_PARAM_SENSITIVITY_LEVEL
,
1549 .signed_txpower_2g
= WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_2G
,
1550 .signed_txpower_5g
= WMI_10_4_PDEV_PARAM_SIGNED_TXPOWER_5G
,
1551 .enable_per_tid_amsdu
= WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMSDU
,
1552 .enable_per_tid_ampdu
= WMI_10_4_PDEV_PARAM_ENABLE_PER_TID_AMPDU
,
1553 .cca_threshold
= WMI_10_4_PDEV_PARAM_CCA_THRESHOLD
,
1554 .rts_fixed_rate
= WMI_10_4_PDEV_PARAM_RTS_FIXED_RATE
,
1555 .pdev_reset
= WMI_10_4_PDEV_PARAM_PDEV_RESET
,
1556 .wapi_mbssid_offset
= WMI_10_4_PDEV_PARAM_WAPI_MBSSID_OFFSET
,
1557 .arp_srcaddr
= WMI_10_4_PDEV_PARAM_ARP_SRCADDR
,
1558 .arp_dstaddr
= WMI_10_4_PDEV_PARAM_ARP_DSTADDR
,
1559 .enable_btcoex
= WMI_10_4_PDEV_PARAM_ENABLE_BTCOEX
,
1562 static const struct wmi_peer_flags_map wmi_peer_flags_map
= {
1563 .auth
= WMI_PEER_AUTH
,
1564 .qos
= WMI_PEER_QOS
,
1565 .need_ptk_4_way
= WMI_PEER_NEED_PTK_4_WAY
,
1566 .need_gtk_2_way
= WMI_PEER_NEED_GTK_2_WAY
,
1567 .apsd
= WMI_PEER_APSD
,
1569 .bw40
= WMI_PEER_40MHZ
,
1570 .stbc
= WMI_PEER_STBC
,
1571 .ldbc
= WMI_PEER_LDPC
,
1572 .dyn_mimops
= WMI_PEER_DYN_MIMOPS
,
1573 .static_mimops
= WMI_PEER_STATIC_MIMOPS
,
1574 .spatial_mux
= WMI_PEER_SPATIAL_MUX
,
1575 .vht
= WMI_PEER_VHT
,
1576 .bw80
= WMI_PEER_80MHZ
,
1577 .vht_2g
= WMI_PEER_VHT_2G
,
1578 .pmf
= WMI_PEER_PMF
,
1581 static const struct wmi_peer_flags_map wmi_10x_peer_flags_map
= {
1582 .auth
= WMI_10X_PEER_AUTH
,
1583 .qos
= WMI_10X_PEER_QOS
,
1584 .need_ptk_4_way
= WMI_10X_PEER_NEED_PTK_4_WAY
,
1585 .need_gtk_2_way
= WMI_10X_PEER_NEED_GTK_2_WAY
,
1586 .apsd
= WMI_10X_PEER_APSD
,
1587 .ht
= WMI_10X_PEER_HT
,
1588 .bw40
= WMI_10X_PEER_40MHZ
,
1589 .stbc
= WMI_10X_PEER_STBC
,
1590 .ldbc
= WMI_10X_PEER_LDPC
,
1591 .dyn_mimops
= WMI_10X_PEER_DYN_MIMOPS
,
1592 .static_mimops
= WMI_10X_PEER_STATIC_MIMOPS
,
1593 .spatial_mux
= WMI_10X_PEER_SPATIAL_MUX
,
1594 .vht
= WMI_10X_PEER_VHT
,
1595 .bw80
= WMI_10X_PEER_80MHZ
,
1598 static const struct wmi_peer_flags_map wmi_10_2_peer_flags_map
= {
1599 .auth
= WMI_10_2_PEER_AUTH
,
1600 .qos
= WMI_10_2_PEER_QOS
,
1601 .need_ptk_4_way
= WMI_10_2_PEER_NEED_PTK_4_WAY
,
1602 .need_gtk_2_way
= WMI_10_2_PEER_NEED_GTK_2_WAY
,
1603 .apsd
= WMI_10_2_PEER_APSD
,
1604 .ht
= WMI_10_2_PEER_HT
,
1605 .bw40
= WMI_10_2_PEER_40MHZ
,
1606 .stbc
= WMI_10_2_PEER_STBC
,
1607 .ldbc
= WMI_10_2_PEER_LDPC
,
1608 .dyn_mimops
= WMI_10_2_PEER_DYN_MIMOPS
,
1609 .static_mimops
= WMI_10_2_PEER_STATIC_MIMOPS
,
1610 .spatial_mux
= WMI_10_2_PEER_SPATIAL_MUX
,
1611 .vht
= WMI_10_2_PEER_VHT
,
1612 .bw80
= WMI_10_2_PEER_80MHZ
,
1613 .vht_2g
= WMI_10_2_PEER_VHT_2G
,
1614 .pmf
= WMI_10_2_PEER_PMF
,
1617 void ath10k_wmi_put_wmi_channel(struct wmi_channel
*ch
,
1618 const struct wmi_channel_arg
*arg
)
1622 memset(ch
, 0, sizeof(*ch
));
1625 flags
|= WMI_CHAN_FLAG_PASSIVE
;
1626 if (arg
->allow_ibss
)
1627 flags
|= WMI_CHAN_FLAG_ADHOC_ALLOWED
;
1629 flags
|= WMI_CHAN_FLAG_ALLOW_HT
;
1631 flags
|= WMI_CHAN_FLAG_ALLOW_VHT
;
1633 flags
|= WMI_CHAN_FLAG_HT40_PLUS
;
1634 if (arg
->chan_radar
)
1635 flags
|= WMI_CHAN_FLAG_DFS
;
1637 ch
->mhz
= __cpu_to_le32(arg
->freq
);
1638 ch
->band_center_freq1
= __cpu_to_le32(arg
->band_center_freq1
);
1639 ch
->band_center_freq2
= 0;
1640 ch
->min_power
= arg
->min_power
;
1641 ch
->max_power
= arg
->max_power
;
1642 ch
->reg_power
= arg
->max_reg_power
;
1643 ch
->antenna_max
= arg
->max_antenna_gain
;
1644 ch
->max_tx_power
= arg
->max_power
;
1646 /* mode & flags share storage */
1647 ch
->mode
= arg
->mode
;
1648 ch
->flags
|= __cpu_to_le32(flags
);
1651 int ath10k_wmi_wait_for_service_ready(struct ath10k
*ar
)
1653 unsigned long time_left
;
1655 time_left
= wait_for_completion_timeout(&ar
->wmi
.service_ready
,
1656 WMI_SERVICE_READY_TIMEOUT_HZ
);
1662 int ath10k_wmi_wait_for_unified_ready(struct ath10k
*ar
)
1664 unsigned long time_left
;
1666 time_left
= wait_for_completion_timeout(&ar
->wmi
.unified_ready
,
1667 WMI_UNIFIED_READY_TIMEOUT_HZ
);
1673 struct sk_buff
*ath10k_wmi_alloc_skb(struct ath10k
*ar
, u32 len
)
1675 struct sk_buff
*skb
;
1676 u32 round_len
= roundup(len
, 4);
1678 skb
= ath10k_htc_alloc_skb(ar
, WMI_SKB_HEADROOM
+ round_len
);
1682 skb_reserve(skb
, WMI_SKB_HEADROOM
);
1683 if (!IS_ALIGNED((unsigned long)skb
->data
, 4))
1684 ath10k_warn(ar
, "Unaligned WMI skb\n");
1686 skb_put(skb
, round_len
);
1687 memset(skb
->data
, 0, round_len
);
1692 static void ath10k_wmi_htc_tx_complete(struct ath10k
*ar
, struct sk_buff
*skb
)
1697 int ath10k_wmi_cmd_send_nowait(struct ath10k
*ar
, struct sk_buff
*skb
,
1700 struct ath10k_skb_cb
*skb_cb
= ATH10K_SKB_CB(skb
);
1701 struct wmi_cmd_hdr
*cmd_hdr
;
1705 if (skb_push(skb
, sizeof(struct wmi_cmd_hdr
)) == NULL
)
1708 cmd
|= SM(cmd_id
, WMI_CMD_HDR_CMD_ID
);
1710 cmd_hdr
= (struct wmi_cmd_hdr
*)skb
->data
;
1711 cmd_hdr
->cmd_id
= __cpu_to_le32(cmd
);
1713 memset(skb_cb
, 0, sizeof(*skb_cb
));
1714 ret
= ath10k_htc_send(&ar
->htc
, ar
->wmi
.eid
, skb
);
1715 trace_ath10k_wmi_cmd(ar
, cmd_id
, skb
->data
, skb
->len
, ret
);
1723 skb_pull(skb
, sizeof(struct wmi_cmd_hdr
));
1727 static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif
*arvif
)
1729 struct ath10k
*ar
= arvif
->ar
;
1730 struct ath10k_skb_cb
*cb
;
1731 struct sk_buff
*bcn
;
1736 spin_lock_bh(&ar
->data_lock
);
1738 bcn
= arvif
->beacon
;
1743 cb
= ATH10K_SKB_CB(bcn
);
1745 switch (arvif
->beacon_state
) {
1746 case ATH10K_BEACON_SENDING
:
1747 case ATH10K_BEACON_SENT
:
1749 case ATH10K_BEACON_SCHEDULED
:
1750 arvif
->beacon_state
= ATH10K_BEACON_SENDING
;
1751 spin_unlock_bh(&ar
->data_lock
);
1753 dtim_zero
= !!(cb
->flags
& ATH10K_SKB_F_DTIM_ZERO
);
1754 deliver_cab
= !!(cb
->flags
& ATH10K_SKB_F_DELIVER_CAB
);
1755 ret
= ath10k_wmi_beacon_send_ref_nowait(arvif
->ar
,
1757 bcn
->data
, bcn
->len
,
1762 spin_lock_bh(&ar
->data_lock
);
1765 arvif
->beacon_state
= ATH10K_BEACON_SENT
;
1767 arvif
->beacon_state
= ATH10K_BEACON_SCHEDULED
;
1771 spin_unlock_bh(&ar
->data_lock
);
1774 static void ath10k_wmi_tx_beacons_iter(void *data
, u8
*mac
,
1775 struct ieee80211_vif
*vif
)
1777 struct ath10k_vif
*arvif
= ath10k_vif_to_arvif(vif
);
1779 ath10k_wmi_tx_beacon_nowait(arvif
);
1782 static void ath10k_wmi_tx_beacons_nowait(struct ath10k
*ar
)
1784 ieee80211_iterate_active_interfaces_atomic(ar
->hw
,
1785 IEEE80211_IFACE_ITER_NORMAL
,
1786 ath10k_wmi_tx_beacons_iter
,
1790 static void ath10k_wmi_op_ep_tx_credits(struct ath10k
*ar
)
1792 /* try to send pending beacons first. they take priority */
1793 ath10k_wmi_tx_beacons_nowait(ar
);
1795 wake_up(&ar
->wmi
.tx_credits_wq
);
1798 int ath10k_wmi_cmd_send(struct ath10k
*ar
, struct sk_buff
*skb
, u32 cmd_id
)
1800 int ret
= -EOPNOTSUPP
;
1804 if (cmd_id
== WMI_CMD_UNSUPPORTED
) {
1805 ath10k_warn(ar
, "wmi command %d is not supported by firmware\n",
1810 wait_event_timeout(ar
->wmi
.tx_credits_wq
, ({
1811 /* try to send pending beacons first. they take priority */
1812 ath10k_wmi_tx_beacons_nowait(ar
);
1814 ret
= ath10k_wmi_cmd_send_nowait(ar
, skb
, cmd_id
);
1816 if (ret
&& test_bit(ATH10K_FLAG_CRASH_FLUSH
, &ar
->dev_flags
))
1823 dev_kfree_skb_any(skb
);
1828 static struct sk_buff
*
1829 ath10k_wmi_op_gen_mgmt_tx(struct ath10k
*ar
, struct sk_buff
*msdu
)
1831 struct ath10k_skb_cb
*cb
= ATH10K_SKB_CB(msdu
);
1832 struct ath10k_vif
*arvif
;
1833 struct wmi_mgmt_tx_cmd
*cmd
;
1834 struct ieee80211_hdr
*hdr
;
1835 struct sk_buff
*skb
;
1838 u32 buf_len
= msdu
->len
;
1841 hdr
= (struct ieee80211_hdr
*)msdu
->data
;
1842 fc
= le16_to_cpu(hdr
->frame_control
);
1845 arvif
= (void *)cb
->vif
->drv_priv
;
1846 vdev_id
= arvif
->vdev_id
;
1851 if (WARN_ON_ONCE(!ieee80211_is_mgmt(hdr
->frame_control
)))
1852 return ERR_PTR(-EINVAL
);
1854 len
= sizeof(cmd
->hdr
) + msdu
->len
;
1856 if ((ieee80211_is_action(hdr
->frame_control
) ||
1857 ieee80211_is_deauth(hdr
->frame_control
) ||
1858 ieee80211_is_disassoc(hdr
->frame_control
)) &&
1859 ieee80211_has_protected(hdr
->frame_control
)) {
1860 len
+= IEEE80211_CCMP_MIC_LEN
;
1861 buf_len
+= IEEE80211_CCMP_MIC_LEN
;
1864 len
= round_up(len
, 4);
1866 skb
= ath10k_wmi_alloc_skb(ar
, len
);
1868 return ERR_PTR(-ENOMEM
);
1870 cmd
= (struct wmi_mgmt_tx_cmd
*)skb
->data
;
1872 cmd
->hdr
.vdev_id
= __cpu_to_le32(vdev_id
);
1873 cmd
->hdr
.tx_rate
= 0;
1874 cmd
->hdr
.tx_power
= 0;
1875 cmd
->hdr
.buf_len
= __cpu_to_le32(buf_len
);
1877 ether_addr_copy(cmd
->hdr
.peer_macaddr
.addr
, ieee80211_get_DA(hdr
));
1878 memcpy(cmd
->buf
, msdu
->data
, msdu
->len
);
1880 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi mgmt tx skb %pK len %d ftype %02x stype %02x\n",
1881 msdu
, skb
->len
, fc
& IEEE80211_FCTL_FTYPE
,
1882 fc
& IEEE80211_FCTL_STYPE
);
1883 trace_ath10k_tx_hdr(ar
, skb
->data
, skb
->len
);
1884 trace_ath10k_tx_payload(ar
, skb
->data
, skb
->len
);
1889 static void ath10k_wmi_event_scan_started(struct ath10k
*ar
)
1891 lockdep_assert_held(&ar
->data_lock
);
1893 switch (ar
->scan
.state
) {
1894 case ATH10K_SCAN_IDLE
:
1895 case ATH10K_SCAN_RUNNING
:
1896 case ATH10K_SCAN_ABORTING
:
1897 ath10k_warn(ar
, "received scan started event in an invalid scan state: %s (%d)\n",
1898 ath10k_scan_state_str(ar
->scan
.state
),
1901 case ATH10K_SCAN_STARTING
:
1902 ar
->scan
.state
= ATH10K_SCAN_RUNNING
;
1904 if (ar
->scan
.is_roc
)
1905 ieee80211_ready_on_channel(ar
->hw
);
1907 complete(&ar
->scan
.started
);
1912 static void ath10k_wmi_event_scan_start_failed(struct ath10k
*ar
)
1914 lockdep_assert_held(&ar
->data_lock
);
1916 switch (ar
->scan
.state
) {
1917 case ATH10K_SCAN_IDLE
:
1918 case ATH10K_SCAN_RUNNING
:
1919 case ATH10K_SCAN_ABORTING
:
1920 ath10k_warn(ar
, "received scan start failed event in an invalid scan state: %s (%d)\n",
1921 ath10k_scan_state_str(ar
->scan
.state
),
1924 case ATH10K_SCAN_STARTING
:
1925 complete(&ar
->scan
.started
);
1926 __ath10k_scan_finish(ar
);
1931 static void ath10k_wmi_event_scan_completed(struct ath10k
*ar
)
1933 lockdep_assert_held(&ar
->data_lock
);
1935 switch (ar
->scan
.state
) {
1936 case ATH10K_SCAN_IDLE
:
1937 case ATH10K_SCAN_STARTING
:
1938 /* One suspected reason scan can be completed while starting is
1939 * if firmware fails to deliver all scan events to the host,
1940 * e.g. when transport pipe is full. This has been observed
1941 * with spectral scan phyerr events starving wmi transport
1942 * pipe. In such case the "scan completed" event should be (and
1943 * is) ignored by the host as it may be just firmware's scan
1944 * state machine recovering.
1946 ath10k_warn(ar
, "received scan completed event in an invalid scan state: %s (%d)\n",
1947 ath10k_scan_state_str(ar
->scan
.state
),
1950 case ATH10K_SCAN_RUNNING
:
1951 case ATH10K_SCAN_ABORTING
:
1952 __ath10k_scan_finish(ar
);
1957 static void ath10k_wmi_event_scan_bss_chan(struct ath10k
*ar
)
1959 lockdep_assert_held(&ar
->data_lock
);
1961 switch (ar
->scan
.state
) {
1962 case ATH10K_SCAN_IDLE
:
1963 case ATH10K_SCAN_STARTING
:
1964 ath10k_warn(ar
, "received scan bss chan event in an invalid scan state: %s (%d)\n",
1965 ath10k_scan_state_str(ar
->scan
.state
),
1968 case ATH10K_SCAN_RUNNING
:
1969 case ATH10K_SCAN_ABORTING
:
1970 ar
->scan_channel
= NULL
;
1975 static void ath10k_wmi_event_scan_foreign_chan(struct ath10k
*ar
, u32 freq
)
1977 lockdep_assert_held(&ar
->data_lock
);
1979 switch (ar
->scan
.state
) {
1980 case ATH10K_SCAN_IDLE
:
1981 case ATH10K_SCAN_STARTING
:
1982 ath10k_warn(ar
, "received scan foreign chan event in an invalid scan state: %s (%d)\n",
1983 ath10k_scan_state_str(ar
->scan
.state
),
1986 case ATH10K_SCAN_RUNNING
:
1987 case ATH10K_SCAN_ABORTING
:
1988 ar
->scan_channel
= ieee80211_get_channel(ar
->hw
->wiphy
, freq
);
1990 if (ar
->scan
.is_roc
&& ar
->scan
.roc_freq
== freq
)
1991 complete(&ar
->scan
.on_channel
);
1997 ath10k_wmi_event_scan_type_str(enum wmi_scan_event_type type
,
1998 enum wmi_scan_completion_reason reason
)
2001 case WMI_SCAN_EVENT_STARTED
:
2003 case WMI_SCAN_EVENT_COMPLETED
:
2005 case WMI_SCAN_REASON_COMPLETED
:
2007 case WMI_SCAN_REASON_CANCELLED
:
2008 return "completed [cancelled]";
2009 case WMI_SCAN_REASON_PREEMPTED
:
2010 return "completed [preempted]";
2011 case WMI_SCAN_REASON_TIMEDOUT
:
2012 return "completed [timedout]";
2013 case WMI_SCAN_REASON_INTERNAL_FAILURE
:
2014 return "completed [internal err]";
2015 case WMI_SCAN_REASON_MAX
:
2018 return "completed [unknown]";
2019 case WMI_SCAN_EVENT_BSS_CHANNEL
:
2020 return "bss channel";
2021 case WMI_SCAN_EVENT_FOREIGN_CHANNEL
:
2022 return "foreign channel";
2023 case WMI_SCAN_EVENT_DEQUEUED
:
2025 case WMI_SCAN_EVENT_PREEMPTED
:
2027 case WMI_SCAN_EVENT_START_FAILED
:
2028 return "start failed";
2029 case WMI_SCAN_EVENT_RESTARTED
:
2031 case WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT
:
2032 return "foreign channel exit";
2038 static int ath10k_wmi_op_pull_scan_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
2039 struct wmi_scan_ev_arg
*arg
)
2041 struct wmi_scan_event
*ev
= (void *)skb
->data
;
2043 if (skb
->len
< sizeof(*ev
))
2046 skb_pull(skb
, sizeof(*ev
));
2047 arg
->event_type
= ev
->event_type
;
2048 arg
->reason
= ev
->reason
;
2049 arg
->channel_freq
= ev
->channel_freq
;
2050 arg
->scan_req_id
= ev
->scan_req_id
;
2051 arg
->scan_id
= ev
->scan_id
;
2052 arg
->vdev_id
= ev
->vdev_id
;
2057 int ath10k_wmi_event_scan(struct ath10k
*ar
, struct sk_buff
*skb
)
2059 struct wmi_scan_ev_arg arg
= {};
2060 enum wmi_scan_event_type event_type
;
2061 enum wmi_scan_completion_reason reason
;
2068 ret
= ath10k_wmi_pull_scan(ar
, skb
, &arg
);
2070 ath10k_warn(ar
, "failed to parse scan event: %d\n", ret
);
2074 event_type
= __le32_to_cpu(arg
.event_type
);
2075 reason
= __le32_to_cpu(arg
.reason
);
2076 freq
= __le32_to_cpu(arg
.channel_freq
);
2077 req_id
= __le32_to_cpu(arg
.scan_req_id
);
2078 scan_id
= __le32_to_cpu(arg
.scan_id
);
2079 vdev_id
= __le32_to_cpu(arg
.vdev_id
);
2081 spin_lock_bh(&ar
->data_lock
);
2083 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
2084 "scan event %s type %d reason %d freq %d req_id %d scan_id %d vdev_id %d state %s (%d)\n",
2085 ath10k_wmi_event_scan_type_str(event_type
, reason
),
2086 event_type
, reason
, freq
, req_id
, scan_id
, vdev_id
,
2087 ath10k_scan_state_str(ar
->scan
.state
), ar
->scan
.state
);
2089 switch (event_type
) {
2090 case WMI_SCAN_EVENT_STARTED
:
2091 ath10k_wmi_event_scan_started(ar
);
2093 case WMI_SCAN_EVENT_COMPLETED
:
2094 ath10k_wmi_event_scan_completed(ar
);
2096 case WMI_SCAN_EVENT_BSS_CHANNEL
:
2097 ath10k_wmi_event_scan_bss_chan(ar
);
2099 case WMI_SCAN_EVENT_FOREIGN_CHANNEL
:
2100 ath10k_wmi_event_scan_foreign_chan(ar
, freq
);
2102 case WMI_SCAN_EVENT_START_FAILED
:
2103 ath10k_warn(ar
, "received scan start failure event\n");
2104 ath10k_wmi_event_scan_start_failed(ar
);
2106 case WMI_SCAN_EVENT_DEQUEUED
:
2107 case WMI_SCAN_EVENT_PREEMPTED
:
2108 case WMI_SCAN_EVENT_RESTARTED
:
2109 case WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT
:
2114 spin_unlock_bh(&ar
->data_lock
);
2118 /* If keys are configured, HW decrypts all frames
2119 * with protected bit set. Mark such frames as decrypted.
2121 static void ath10k_wmi_handle_wep_reauth(struct ath10k
*ar
,
2122 struct sk_buff
*skb
,
2123 struct ieee80211_rx_status
*status
)
2125 struct ieee80211_hdr
*hdr
= (struct ieee80211_hdr
*)skb
->data
;
2126 unsigned int hdrlen
;
2130 if (!ieee80211_is_auth(hdr
->frame_control
) ||
2131 !ieee80211_has_protected(hdr
->frame_control
))
2134 hdrlen
= ieee80211_hdrlen(hdr
->frame_control
);
2135 if (skb
->len
< (hdrlen
+ IEEE80211_WEP_IV_LEN
))
2138 keyidx
= skb
->data
[hdrlen
+ (IEEE80211_WEP_IV_LEN
- 1)] >> WEP_KEYID_SHIFT
;
2139 addr
= ieee80211_get_SA(hdr
);
2141 spin_lock_bh(&ar
->data_lock
);
2142 peer_key
= ath10k_mac_is_peer_wep_key_set(ar
, addr
, keyidx
);
2143 spin_unlock_bh(&ar
->data_lock
);
2146 ath10k_dbg(ar
, ATH10K_DBG_MAC
,
2147 "mac wep key present for peer %pM\n", addr
);
2148 status
->flag
|= RX_FLAG_DECRYPTED
;
2152 static int ath10k_wmi_op_pull_mgmt_rx_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
2153 struct wmi_mgmt_rx_ev_arg
*arg
)
2155 struct wmi_mgmt_rx_event_v1
*ev_v1
;
2156 struct wmi_mgmt_rx_event_v2
*ev_v2
;
2157 struct wmi_mgmt_rx_hdr_v1
*ev_hdr
;
2158 struct wmi_mgmt_rx_ext_info
*ext_info
;
2163 if (test_bit(ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX
,
2164 ar
->running_fw
->fw_file
.fw_features
)) {
2165 ev_v2
= (struct wmi_mgmt_rx_event_v2
*)skb
->data
;
2166 ev_hdr
= &ev_v2
->hdr
.v1
;
2167 pull_len
= sizeof(*ev_v2
);
2169 ev_v1
= (struct wmi_mgmt_rx_event_v1
*)skb
->data
;
2170 ev_hdr
= &ev_v1
->hdr
;
2171 pull_len
= sizeof(*ev_v1
);
2174 if (skb
->len
< pull_len
)
2177 skb_pull(skb
, pull_len
);
2178 arg
->channel
= ev_hdr
->channel
;
2179 arg
->buf_len
= ev_hdr
->buf_len
;
2180 arg
->status
= ev_hdr
->status
;
2181 arg
->snr
= ev_hdr
->snr
;
2182 arg
->phy_mode
= ev_hdr
->phy_mode
;
2183 arg
->rate
= ev_hdr
->rate
;
2185 msdu_len
= __le32_to_cpu(arg
->buf_len
);
2186 if (skb
->len
< msdu_len
)
2189 if (le32_to_cpu(arg
->status
) & WMI_RX_STATUS_EXT_INFO
) {
2190 len
= ALIGN(le32_to_cpu(arg
->buf_len
), 4);
2191 ext_info
= (struct wmi_mgmt_rx_ext_info
*)(skb
->data
+ len
);
2192 memcpy(&arg
->ext_info
, ext_info
,
2193 sizeof(struct wmi_mgmt_rx_ext_info
));
2195 /* the WMI buffer might've ended up being padded to 4 bytes due to HTC
2196 * trailer with credit update. Trim the excess garbage.
2198 skb_trim(skb
, msdu_len
);
2203 static int ath10k_wmi_10_4_op_pull_mgmt_rx_ev(struct ath10k
*ar
,
2204 struct sk_buff
*skb
,
2205 struct wmi_mgmt_rx_ev_arg
*arg
)
2207 struct wmi_10_4_mgmt_rx_event
*ev
;
2208 struct wmi_10_4_mgmt_rx_hdr
*ev_hdr
;
2211 struct wmi_mgmt_rx_ext_info
*ext_info
;
2214 ev
= (struct wmi_10_4_mgmt_rx_event
*)skb
->data
;
2216 pull_len
= sizeof(*ev
);
2218 if (skb
->len
< pull_len
)
2221 skb_pull(skb
, pull_len
);
2222 arg
->channel
= ev_hdr
->channel
;
2223 arg
->buf_len
= ev_hdr
->buf_len
;
2224 arg
->status
= ev_hdr
->status
;
2225 arg
->snr
= ev_hdr
->snr
;
2226 arg
->phy_mode
= ev_hdr
->phy_mode
;
2227 arg
->rate
= ev_hdr
->rate
;
2229 msdu_len
= __le32_to_cpu(arg
->buf_len
);
2230 if (skb
->len
< msdu_len
)
2233 if (le32_to_cpu(arg
->status
) & WMI_RX_STATUS_EXT_INFO
) {
2234 len
= ALIGN(le32_to_cpu(arg
->buf_len
), 4);
2235 ext_info
= (struct wmi_mgmt_rx_ext_info
*)(skb
->data
+ len
);
2236 memcpy(&arg
->ext_info
, ext_info
,
2237 sizeof(struct wmi_mgmt_rx_ext_info
));
2240 /* Make sure bytes added for padding are removed. */
2241 skb_trim(skb
, msdu_len
);
2246 static bool ath10k_wmi_rx_is_decrypted(struct ath10k
*ar
,
2247 struct ieee80211_hdr
*hdr
)
2249 if (!ieee80211_has_protected(hdr
->frame_control
))
2252 /* FW delivers WEP Shared Auth frame with Protected Bit set and
2253 * encrypted payload. However in case of PMF it delivers decrypted
2254 * frames with Protected Bit set.
2256 if (ieee80211_is_auth(hdr
->frame_control
))
2259 /* qca99x0 based FW delivers broadcast or multicast management frames
2260 * (ex: group privacy action frames in mesh) as encrypted payload.
2262 if (is_multicast_ether_addr(ieee80211_get_DA(hdr
)) &&
2263 ar
->hw_params
.sw_decrypt_mcast_mgmt
)
2269 int ath10k_wmi_event_mgmt_rx(struct ath10k
*ar
, struct sk_buff
*skb
)
2271 struct wmi_mgmt_rx_ev_arg arg
= {};
2272 struct ieee80211_rx_status
*status
= IEEE80211_SKB_RXCB(skb
);
2273 struct ieee80211_hdr
*hdr
;
2274 struct ieee80211_supported_band
*sband
;
2284 ret
= ath10k_wmi_pull_mgmt_rx(ar
, skb
, &arg
);
2286 ath10k_warn(ar
, "failed to parse mgmt rx event: %d\n", ret
);
2291 channel
= __le32_to_cpu(arg
.channel
);
2292 buf_len
= __le32_to_cpu(arg
.buf_len
);
2293 rx_status
= __le32_to_cpu(arg
.status
);
2294 snr
= __le32_to_cpu(arg
.snr
);
2295 phy_mode
= __le32_to_cpu(arg
.phy_mode
);
2296 rate
= __le32_to_cpu(arg
.rate
);
2298 memset(status
, 0, sizeof(*status
));
2300 ath10k_dbg(ar
, ATH10K_DBG_MGMT
,
2301 "event mgmt rx status %08x\n", rx_status
);
2303 if ((test_bit(ATH10K_CAC_RUNNING
, &ar
->dev_flags
)) ||
2304 (rx_status
& (WMI_RX_STATUS_ERR_DECRYPT
|
2305 WMI_RX_STATUS_ERR_KEY_CACHE_MISS
| WMI_RX_STATUS_ERR_CRC
))) {
2310 if (rx_status
& WMI_RX_STATUS_ERR_MIC
)
2311 status
->flag
|= RX_FLAG_MMIC_ERROR
;
2313 if (rx_status
& WMI_RX_STATUS_EXT_INFO
) {
2315 __le64_to_cpu(arg
.ext_info
.rx_mac_timestamp
);
2316 status
->flag
|= RX_FLAG_MACTIME_END
;
2318 /* Hardware can Rx CCK rates on 5GHz. In that case phy_mode is set to
2319 * MODE_11B. This means phy_mode is not a reliable source for the band
2322 if (channel
>= 1 && channel
<= 14) {
2323 status
->band
= NL80211_BAND_2GHZ
;
2324 } else if (channel
>= 36 && channel
<= 165) {
2325 status
->band
= NL80211_BAND_5GHZ
;
2327 /* Shouldn't happen unless list of advertised channels to
2328 * mac80211 has been changed.
2335 if (phy_mode
== MODE_11B
&& status
->band
== NL80211_BAND_5GHZ
)
2336 ath10k_dbg(ar
, ATH10K_DBG_MGMT
, "wmi mgmt rx 11b (CCK) on 5GHz\n");
2338 sband
= &ar
->mac
.sbands
[status
->band
];
2340 status
->freq
= ieee80211_channel_to_frequency(channel
, status
->band
);
2341 status
->signal
= snr
+ ATH10K_DEFAULT_NOISE_FLOOR
;
2342 status
->rate_idx
= ath10k_mac_bitrate_to_idx(sband
, rate
/ 100);
2344 hdr
= (struct ieee80211_hdr
*)skb
->data
;
2345 fc
= le16_to_cpu(hdr
->frame_control
);
2347 /* Firmware is guaranteed to report all essential management frames via
2348 * WMI while it can deliver some extra via HTT. Since there can be
2349 * duplicates split the reporting wrt monitor/sniffing.
2351 status
->flag
|= RX_FLAG_SKIP_MONITOR
;
2353 ath10k_wmi_handle_wep_reauth(ar
, skb
, status
);
2355 if (ath10k_wmi_rx_is_decrypted(ar
, hdr
)) {
2356 status
->flag
|= RX_FLAG_DECRYPTED
;
2358 if (!ieee80211_is_action(hdr
->frame_control
) &&
2359 !ieee80211_is_deauth(hdr
->frame_control
) &&
2360 !ieee80211_is_disassoc(hdr
->frame_control
)) {
2361 status
->flag
|= RX_FLAG_IV_STRIPPED
|
2362 RX_FLAG_MMIC_STRIPPED
;
2363 hdr
->frame_control
= __cpu_to_le16(fc
&
2364 ~IEEE80211_FCTL_PROTECTED
);
2368 if (ieee80211_is_beacon(hdr
->frame_control
))
2369 ath10k_mac_handle_beacon(ar
, skb
);
2371 ath10k_dbg(ar
, ATH10K_DBG_MGMT
,
2372 "event mgmt rx skb %pK len %d ftype %02x stype %02x\n",
2374 fc
& IEEE80211_FCTL_FTYPE
, fc
& IEEE80211_FCTL_STYPE
);
2376 ath10k_dbg(ar
, ATH10K_DBG_MGMT
,
2377 "event mgmt rx freq %d band %d snr %d, rate_idx %d\n",
2378 status
->freq
, status
->band
, status
->signal
,
2381 ieee80211_rx(ar
->hw
, skb
);
2385 static int freq_to_idx(struct ath10k
*ar
, int freq
)
2387 struct ieee80211_supported_band
*sband
;
2388 int band
, ch
, idx
= 0;
2390 for (band
= NL80211_BAND_2GHZ
; band
< NUM_NL80211_BANDS
; band
++) {
2391 sband
= ar
->hw
->wiphy
->bands
[band
];
2395 for (ch
= 0; ch
< sband
->n_channels
; ch
++, idx
++)
2396 if (sband
->channels
[ch
].center_freq
== freq
)
2404 static int ath10k_wmi_op_pull_ch_info_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
2405 struct wmi_ch_info_ev_arg
*arg
)
2407 struct wmi_chan_info_event
*ev
= (void *)skb
->data
;
2409 if (skb
->len
< sizeof(*ev
))
2412 skb_pull(skb
, sizeof(*ev
));
2413 arg
->err_code
= ev
->err_code
;
2414 arg
->freq
= ev
->freq
;
2415 arg
->cmd_flags
= ev
->cmd_flags
;
2416 arg
->noise_floor
= ev
->noise_floor
;
2417 arg
->rx_clear_count
= ev
->rx_clear_count
;
2418 arg
->cycle_count
= ev
->cycle_count
;
2423 static int ath10k_wmi_10_4_op_pull_ch_info_ev(struct ath10k
*ar
,
2424 struct sk_buff
*skb
,
2425 struct wmi_ch_info_ev_arg
*arg
)
2427 struct wmi_10_4_chan_info_event
*ev
= (void *)skb
->data
;
2429 if (skb
->len
< sizeof(*ev
))
2432 skb_pull(skb
, sizeof(*ev
));
2433 arg
->err_code
= ev
->err_code
;
2434 arg
->freq
= ev
->freq
;
2435 arg
->cmd_flags
= ev
->cmd_flags
;
2436 arg
->noise_floor
= ev
->noise_floor
;
2437 arg
->rx_clear_count
= ev
->rx_clear_count
;
2438 arg
->cycle_count
= ev
->cycle_count
;
2439 arg
->chan_tx_pwr_range
= ev
->chan_tx_pwr_range
;
2440 arg
->chan_tx_pwr_tp
= ev
->chan_tx_pwr_tp
;
2441 arg
->rx_frame_count
= ev
->rx_frame_count
;
2446 void ath10k_wmi_event_chan_info(struct ath10k
*ar
, struct sk_buff
*skb
)
2448 struct wmi_ch_info_ev_arg arg
= {};
2449 struct survey_info
*survey
;
2450 u32 err_code
, freq
, cmd_flags
, noise_floor
, rx_clear_count
, cycle_count
;
2453 ret
= ath10k_wmi_pull_ch_info(ar
, skb
, &arg
);
2455 ath10k_warn(ar
, "failed to parse chan info event: %d\n", ret
);
2459 err_code
= __le32_to_cpu(arg
.err_code
);
2460 freq
= __le32_to_cpu(arg
.freq
);
2461 cmd_flags
= __le32_to_cpu(arg
.cmd_flags
);
2462 noise_floor
= __le32_to_cpu(arg
.noise_floor
);
2463 rx_clear_count
= __le32_to_cpu(arg
.rx_clear_count
);
2464 cycle_count
= __le32_to_cpu(arg
.cycle_count
);
2466 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
2467 "chan info err_code %d freq %d cmd_flags %d noise_floor %d rx_clear_count %d cycle_count %d\n",
2468 err_code
, freq
, cmd_flags
, noise_floor
, rx_clear_count
,
2471 spin_lock_bh(&ar
->data_lock
);
2473 switch (ar
->scan
.state
) {
2474 case ATH10K_SCAN_IDLE
:
2475 case ATH10K_SCAN_STARTING
:
2476 ath10k_warn(ar
, "received chan info event without a scan request, ignoring\n");
2478 case ATH10K_SCAN_RUNNING
:
2479 case ATH10K_SCAN_ABORTING
:
2483 idx
= freq_to_idx(ar
, freq
);
2484 if (idx
>= ARRAY_SIZE(ar
->survey
)) {
2485 ath10k_warn(ar
, "chan info: invalid frequency %d (idx %d out of bounds)\n",
2490 if (cmd_flags
& WMI_CHAN_INFO_FLAG_COMPLETE
) {
2491 if (ar
->ch_info_can_report_survey
) {
2492 survey
= &ar
->survey
[idx
];
2493 survey
->noise
= noise_floor
;
2494 survey
->filled
= SURVEY_INFO_NOISE_DBM
;
2496 ath10k_hw_fill_survey_time(ar
,
2500 ar
->survey_last_cycle_count
,
2501 ar
->survey_last_rx_clear_count
);
2504 ar
->ch_info_can_report_survey
= false;
2506 ar
->ch_info_can_report_survey
= true;
2509 if (!(cmd_flags
& WMI_CHAN_INFO_FLAG_PRE_COMPLETE
)) {
2510 ar
->survey_last_rx_clear_count
= rx_clear_count
;
2511 ar
->survey_last_cycle_count
= cycle_count
;
2515 spin_unlock_bh(&ar
->data_lock
);
2518 void ath10k_wmi_event_echo(struct ath10k
*ar
, struct sk_buff
*skb
)
2520 struct wmi_echo_ev_arg arg
= {};
2523 ret
= ath10k_wmi_pull_echo_ev(ar
, skb
, &arg
);
2525 ath10k_warn(ar
, "failed to parse echo: %d\n", ret
);
2529 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
2530 "wmi event echo value 0x%08x\n",
2531 le32_to_cpu(arg
.value
));
2533 if (le32_to_cpu(arg
.value
) == ATH10K_WMI_BARRIER_ECHO_ID
)
2534 complete(&ar
->wmi
.barrier
);
2537 int ath10k_wmi_event_debug_mesg(struct ath10k
*ar
, struct sk_buff
*skb
)
2539 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi event debug mesg len %d\n",
2542 trace_ath10k_wmi_dbglog(ar
, skb
->data
, skb
->len
);
2547 void ath10k_wmi_pull_pdev_stats_base(const struct wmi_pdev_stats_base
*src
,
2548 struct ath10k_fw_stats_pdev
*dst
)
2550 dst
->ch_noise_floor
= __le32_to_cpu(src
->chan_nf
);
2551 dst
->tx_frame_count
= __le32_to_cpu(src
->tx_frame_count
);
2552 dst
->rx_frame_count
= __le32_to_cpu(src
->rx_frame_count
);
2553 dst
->rx_clear_count
= __le32_to_cpu(src
->rx_clear_count
);
2554 dst
->cycle_count
= __le32_to_cpu(src
->cycle_count
);
2555 dst
->phy_err_count
= __le32_to_cpu(src
->phy_err_count
);
2556 dst
->chan_tx_power
= __le32_to_cpu(src
->chan_tx_pwr
);
2559 void ath10k_wmi_pull_pdev_stats_tx(const struct wmi_pdev_stats_tx
*src
,
2560 struct ath10k_fw_stats_pdev
*dst
)
2562 dst
->comp_queued
= __le32_to_cpu(src
->comp_queued
);
2563 dst
->comp_delivered
= __le32_to_cpu(src
->comp_delivered
);
2564 dst
->msdu_enqued
= __le32_to_cpu(src
->msdu_enqued
);
2565 dst
->mpdu_enqued
= __le32_to_cpu(src
->mpdu_enqued
);
2566 dst
->wmm_drop
= __le32_to_cpu(src
->wmm_drop
);
2567 dst
->local_enqued
= __le32_to_cpu(src
->local_enqued
);
2568 dst
->local_freed
= __le32_to_cpu(src
->local_freed
);
2569 dst
->hw_queued
= __le32_to_cpu(src
->hw_queued
);
2570 dst
->hw_reaped
= __le32_to_cpu(src
->hw_reaped
);
2571 dst
->underrun
= __le32_to_cpu(src
->underrun
);
2572 dst
->tx_abort
= __le32_to_cpu(src
->tx_abort
);
2573 dst
->mpdus_requed
= __le32_to_cpu(src
->mpdus_requed
);
2574 dst
->tx_ko
= __le32_to_cpu(src
->tx_ko
);
2575 dst
->data_rc
= __le32_to_cpu(src
->data_rc
);
2576 dst
->self_triggers
= __le32_to_cpu(src
->self_triggers
);
2577 dst
->sw_retry_failure
= __le32_to_cpu(src
->sw_retry_failure
);
2578 dst
->illgl_rate_phy_err
= __le32_to_cpu(src
->illgl_rate_phy_err
);
2579 dst
->pdev_cont_xretry
= __le32_to_cpu(src
->pdev_cont_xretry
);
2580 dst
->pdev_tx_timeout
= __le32_to_cpu(src
->pdev_tx_timeout
);
2581 dst
->pdev_resets
= __le32_to_cpu(src
->pdev_resets
);
2582 dst
->phy_underrun
= __le32_to_cpu(src
->phy_underrun
);
2583 dst
->txop_ovf
= __le32_to_cpu(src
->txop_ovf
);
2587 ath10k_wmi_10_4_pull_pdev_stats_tx(const struct wmi_10_4_pdev_stats_tx
*src
,
2588 struct ath10k_fw_stats_pdev
*dst
)
2590 dst
->comp_queued
= __le32_to_cpu(src
->comp_queued
);
2591 dst
->comp_delivered
= __le32_to_cpu(src
->comp_delivered
);
2592 dst
->msdu_enqued
= __le32_to_cpu(src
->msdu_enqued
);
2593 dst
->mpdu_enqued
= __le32_to_cpu(src
->mpdu_enqued
);
2594 dst
->wmm_drop
= __le32_to_cpu(src
->wmm_drop
);
2595 dst
->local_enqued
= __le32_to_cpu(src
->local_enqued
);
2596 dst
->local_freed
= __le32_to_cpu(src
->local_freed
);
2597 dst
->hw_queued
= __le32_to_cpu(src
->hw_queued
);
2598 dst
->hw_reaped
= __le32_to_cpu(src
->hw_reaped
);
2599 dst
->underrun
= __le32_to_cpu(src
->underrun
);
2600 dst
->tx_abort
= __le32_to_cpu(src
->tx_abort
);
2601 dst
->mpdus_requed
= __le32_to_cpu(src
->mpdus_requed
);
2602 dst
->tx_ko
= __le32_to_cpu(src
->tx_ko
);
2603 dst
->data_rc
= __le32_to_cpu(src
->data_rc
);
2604 dst
->self_triggers
= __le32_to_cpu(src
->self_triggers
);
2605 dst
->sw_retry_failure
= __le32_to_cpu(src
->sw_retry_failure
);
2606 dst
->illgl_rate_phy_err
= __le32_to_cpu(src
->illgl_rate_phy_err
);
2607 dst
->pdev_cont_xretry
= __le32_to_cpu(src
->pdev_cont_xretry
);
2608 dst
->pdev_tx_timeout
= __le32_to_cpu(src
->pdev_tx_timeout
);
2609 dst
->pdev_resets
= __le32_to_cpu(src
->pdev_resets
);
2610 dst
->phy_underrun
= __le32_to_cpu(src
->phy_underrun
);
2611 dst
->txop_ovf
= __le32_to_cpu(src
->txop_ovf
);
2612 dst
->hw_paused
= __le32_to_cpu(src
->hw_paused
);
2613 dst
->seq_posted
= __le32_to_cpu(src
->seq_posted
);
2614 dst
->seq_failed_queueing
=
2615 __le32_to_cpu(src
->seq_failed_queueing
);
2616 dst
->seq_completed
= __le32_to_cpu(src
->seq_completed
);
2617 dst
->seq_restarted
= __le32_to_cpu(src
->seq_restarted
);
2618 dst
->mu_seq_posted
= __le32_to_cpu(src
->mu_seq_posted
);
2619 dst
->mpdus_sw_flush
= __le32_to_cpu(src
->mpdus_sw_flush
);
2620 dst
->mpdus_hw_filter
= __le32_to_cpu(src
->mpdus_hw_filter
);
2621 dst
->mpdus_truncated
= __le32_to_cpu(src
->mpdus_truncated
);
2622 dst
->mpdus_ack_failed
= __le32_to_cpu(src
->mpdus_ack_failed
);
2623 dst
->mpdus_hw_filter
= __le32_to_cpu(src
->mpdus_hw_filter
);
2624 dst
->mpdus_expired
= __le32_to_cpu(src
->mpdus_expired
);
2627 void ath10k_wmi_pull_pdev_stats_rx(const struct wmi_pdev_stats_rx
*src
,
2628 struct ath10k_fw_stats_pdev
*dst
)
2630 dst
->mid_ppdu_route_change
= __le32_to_cpu(src
->mid_ppdu_route_change
);
2631 dst
->status_rcvd
= __le32_to_cpu(src
->status_rcvd
);
2632 dst
->r0_frags
= __le32_to_cpu(src
->r0_frags
);
2633 dst
->r1_frags
= __le32_to_cpu(src
->r1_frags
);
2634 dst
->r2_frags
= __le32_to_cpu(src
->r2_frags
);
2635 dst
->r3_frags
= __le32_to_cpu(src
->r3_frags
);
2636 dst
->htt_msdus
= __le32_to_cpu(src
->htt_msdus
);
2637 dst
->htt_mpdus
= __le32_to_cpu(src
->htt_mpdus
);
2638 dst
->loc_msdus
= __le32_to_cpu(src
->loc_msdus
);
2639 dst
->loc_mpdus
= __le32_to_cpu(src
->loc_mpdus
);
2640 dst
->oversize_amsdu
= __le32_to_cpu(src
->oversize_amsdu
);
2641 dst
->phy_errs
= __le32_to_cpu(src
->phy_errs
);
2642 dst
->phy_err_drop
= __le32_to_cpu(src
->phy_err_drop
);
2643 dst
->mpdu_errs
= __le32_to_cpu(src
->mpdu_errs
);
2646 void ath10k_wmi_pull_pdev_stats_extra(const struct wmi_pdev_stats_extra
*src
,
2647 struct ath10k_fw_stats_pdev
*dst
)
2649 dst
->ack_rx_bad
= __le32_to_cpu(src
->ack_rx_bad
);
2650 dst
->rts_bad
= __le32_to_cpu(src
->rts_bad
);
2651 dst
->rts_good
= __le32_to_cpu(src
->rts_good
);
2652 dst
->fcs_bad
= __le32_to_cpu(src
->fcs_bad
);
2653 dst
->no_beacons
= __le32_to_cpu(src
->no_beacons
);
2654 dst
->mib_int_count
= __le32_to_cpu(src
->mib_int_count
);
2657 void ath10k_wmi_pull_peer_stats(const struct wmi_peer_stats
*src
,
2658 struct ath10k_fw_stats_peer
*dst
)
2660 ether_addr_copy(dst
->peer_macaddr
, src
->peer_macaddr
.addr
);
2661 dst
->peer_rssi
= __le32_to_cpu(src
->peer_rssi
);
2662 dst
->peer_tx_rate
= __le32_to_cpu(src
->peer_tx_rate
);
2666 ath10k_wmi_10_4_pull_peer_stats(const struct wmi_10_4_peer_stats
*src
,
2667 struct ath10k_fw_stats_peer
*dst
)
2669 ether_addr_copy(dst
->peer_macaddr
, src
->peer_macaddr
.addr
);
2670 dst
->peer_rssi
= __le32_to_cpu(src
->peer_rssi
);
2671 dst
->peer_tx_rate
= __le32_to_cpu(src
->peer_tx_rate
);
2672 dst
->peer_rx_rate
= __le32_to_cpu(src
->peer_rx_rate
);
2675 static int ath10k_wmi_main_op_pull_fw_stats(struct ath10k
*ar
,
2676 struct sk_buff
*skb
,
2677 struct ath10k_fw_stats
*stats
)
2679 const struct wmi_stats_event
*ev
= (void *)skb
->data
;
2680 u32 num_pdev_stats
, num_vdev_stats
, num_peer_stats
;
2683 if (!skb_pull(skb
, sizeof(*ev
)))
2686 num_pdev_stats
= __le32_to_cpu(ev
->num_pdev_stats
);
2687 num_vdev_stats
= __le32_to_cpu(ev
->num_vdev_stats
);
2688 num_peer_stats
= __le32_to_cpu(ev
->num_peer_stats
);
2690 for (i
= 0; i
< num_pdev_stats
; i
++) {
2691 const struct wmi_pdev_stats
*src
;
2692 struct ath10k_fw_stats_pdev
*dst
;
2694 src
= (void *)skb
->data
;
2695 if (!skb_pull(skb
, sizeof(*src
)))
2698 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2702 ath10k_wmi_pull_pdev_stats_base(&src
->base
, dst
);
2703 ath10k_wmi_pull_pdev_stats_tx(&src
->tx
, dst
);
2704 ath10k_wmi_pull_pdev_stats_rx(&src
->rx
, dst
);
2706 list_add_tail(&dst
->list
, &stats
->pdevs
);
2709 /* fw doesn't implement vdev stats */
2711 for (i
= 0; i
< num_peer_stats
; i
++) {
2712 const struct wmi_peer_stats
*src
;
2713 struct ath10k_fw_stats_peer
*dst
;
2715 src
= (void *)skb
->data
;
2716 if (!skb_pull(skb
, sizeof(*src
)))
2719 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2723 ath10k_wmi_pull_peer_stats(src
, dst
);
2724 list_add_tail(&dst
->list
, &stats
->peers
);
2730 static int ath10k_wmi_10x_op_pull_fw_stats(struct ath10k
*ar
,
2731 struct sk_buff
*skb
,
2732 struct ath10k_fw_stats
*stats
)
2734 const struct wmi_stats_event
*ev
= (void *)skb
->data
;
2735 u32 num_pdev_stats
, num_vdev_stats
, num_peer_stats
;
2738 if (!skb_pull(skb
, sizeof(*ev
)))
2741 num_pdev_stats
= __le32_to_cpu(ev
->num_pdev_stats
);
2742 num_vdev_stats
= __le32_to_cpu(ev
->num_vdev_stats
);
2743 num_peer_stats
= __le32_to_cpu(ev
->num_peer_stats
);
2745 for (i
= 0; i
< num_pdev_stats
; i
++) {
2746 const struct wmi_10x_pdev_stats
*src
;
2747 struct ath10k_fw_stats_pdev
*dst
;
2749 src
= (void *)skb
->data
;
2750 if (!skb_pull(skb
, sizeof(*src
)))
2753 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2757 ath10k_wmi_pull_pdev_stats_base(&src
->base
, dst
);
2758 ath10k_wmi_pull_pdev_stats_tx(&src
->tx
, dst
);
2759 ath10k_wmi_pull_pdev_stats_rx(&src
->rx
, dst
);
2760 ath10k_wmi_pull_pdev_stats_extra(&src
->extra
, dst
);
2762 list_add_tail(&dst
->list
, &stats
->pdevs
);
2765 /* fw doesn't implement vdev stats */
2767 for (i
= 0; i
< num_peer_stats
; i
++) {
2768 const struct wmi_10x_peer_stats
*src
;
2769 struct ath10k_fw_stats_peer
*dst
;
2771 src
= (void *)skb
->data
;
2772 if (!skb_pull(skb
, sizeof(*src
)))
2775 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2779 ath10k_wmi_pull_peer_stats(&src
->old
, dst
);
2781 dst
->peer_rx_rate
= __le32_to_cpu(src
->peer_rx_rate
);
2783 list_add_tail(&dst
->list
, &stats
->peers
);
2789 static int ath10k_wmi_10_2_op_pull_fw_stats(struct ath10k
*ar
,
2790 struct sk_buff
*skb
,
2791 struct ath10k_fw_stats
*stats
)
2793 const struct wmi_10_2_stats_event
*ev
= (void *)skb
->data
;
2795 u32 num_pdev_ext_stats
;
2800 if (!skb_pull(skb
, sizeof(*ev
)))
2803 num_pdev_stats
= __le32_to_cpu(ev
->num_pdev_stats
);
2804 num_pdev_ext_stats
= __le32_to_cpu(ev
->num_pdev_ext_stats
);
2805 num_vdev_stats
= __le32_to_cpu(ev
->num_vdev_stats
);
2806 num_peer_stats
= __le32_to_cpu(ev
->num_peer_stats
);
2808 for (i
= 0; i
< num_pdev_stats
; i
++) {
2809 const struct wmi_10_2_pdev_stats
*src
;
2810 struct ath10k_fw_stats_pdev
*dst
;
2812 src
= (void *)skb
->data
;
2813 if (!skb_pull(skb
, sizeof(*src
)))
2816 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2820 ath10k_wmi_pull_pdev_stats_base(&src
->base
, dst
);
2821 ath10k_wmi_pull_pdev_stats_tx(&src
->tx
, dst
);
2822 ath10k_wmi_pull_pdev_stats_rx(&src
->rx
, dst
);
2823 ath10k_wmi_pull_pdev_stats_extra(&src
->extra
, dst
);
2824 /* FIXME: expose 10.2 specific values */
2826 list_add_tail(&dst
->list
, &stats
->pdevs
);
2829 for (i
= 0; i
< num_pdev_ext_stats
; i
++) {
2830 const struct wmi_10_2_pdev_ext_stats
*src
;
2832 src
= (void *)skb
->data
;
2833 if (!skb_pull(skb
, sizeof(*src
)))
2836 /* FIXME: expose values to userspace
2838 * Note: Even though this loop seems to do nothing it is
2839 * required to parse following sub-structures properly.
2843 /* fw doesn't implement vdev stats */
2845 for (i
= 0; i
< num_peer_stats
; i
++) {
2846 const struct wmi_10_2_peer_stats
*src
;
2847 struct ath10k_fw_stats_peer
*dst
;
2849 src
= (void *)skb
->data
;
2850 if (!skb_pull(skb
, sizeof(*src
)))
2853 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2857 ath10k_wmi_pull_peer_stats(&src
->old
, dst
);
2859 dst
->peer_rx_rate
= __le32_to_cpu(src
->peer_rx_rate
);
2860 /* FIXME: expose 10.2 specific values */
2862 list_add_tail(&dst
->list
, &stats
->peers
);
2868 static int ath10k_wmi_10_2_4_op_pull_fw_stats(struct ath10k
*ar
,
2869 struct sk_buff
*skb
,
2870 struct ath10k_fw_stats
*stats
)
2872 const struct wmi_10_2_stats_event
*ev
= (void *)skb
->data
;
2874 u32 num_pdev_ext_stats
;
2879 if (!skb_pull(skb
, sizeof(*ev
)))
2882 num_pdev_stats
= __le32_to_cpu(ev
->num_pdev_stats
);
2883 num_pdev_ext_stats
= __le32_to_cpu(ev
->num_pdev_ext_stats
);
2884 num_vdev_stats
= __le32_to_cpu(ev
->num_vdev_stats
);
2885 num_peer_stats
= __le32_to_cpu(ev
->num_peer_stats
);
2887 for (i
= 0; i
< num_pdev_stats
; i
++) {
2888 const struct wmi_10_2_pdev_stats
*src
;
2889 struct ath10k_fw_stats_pdev
*dst
;
2891 src
= (void *)skb
->data
;
2892 if (!skb_pull(skb
, sizeof(*src
)))
2895 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2899 ath10k_wmi_pull_pdev_stats_base(&src
->base
, dst
);
2900 ath10k_wmi_pull_pdev_stats_tx(&src
->tx
, dst
);
2901 ath10k_wmi_pull_pdev_stats_rx(&src
->rx
, dst
);
2902 ath10k_wmi_pull_pdev_stats_extra(&src
->extra
, dst
);
2903 /* FIXME: expose 10.2 specific values */
2905 list_add_tail(&dst
->list
, &stats
->pdevs
);
2908 for (i
= 0; i
< num_pdev_ext_stats
; i
++) {
2909 const struct wmi_10_2_pdev_ext_stats
*src
;
2911 src
= (void *)skb
->data
;
2912 if (!skb_pull(skb
, sizeof(*src
)))
2915 /* FIXME: expose values to userspace
2917 * Note: Even though this loop seems to do nothing it is
2918 * required to parse following sub-structures properly.
2922 /* fw doesn't implement vdev stats */
2924 for (i
= 0; i
< num_peer_stats
; i
++) {
2925 const struct wmi_10_2_4_ext_peer_stats
*src
;
2926 struct ath10k_fw_stats_peer
*dst
;
2929 if (test_bit(WMI_SERVICE_PEER_STATS
, ar
->wmi
.svc_map
))
2930 stats_len
= sizeof(struct wmi_10_2_4_ext_peer_stats
);
2932 stats_len
= sizeof(struct wmi_10_2_4_peer_stats
);
2934 src
= (void *)skb
->data
;
2935 if (!skb_pull(skb
, stats_len
))
2938 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2942 ath10k_wmi_pull_peer_stats(&src
->common
.old
, dst
);
2944 dst
->peer_rx_rate
= __le32_to_cpu(src
->common
.peer_rx_rate
);
2946 if (ath10k_peer_stats_enabled(ar
))
2947 dst
->rx_duration
= __le32_to_cpu(src
->rx_duration
);
2948 /* FIXME: expose 10.2 specific values */
2950 list_add_tail(&dst
->list
, &stats
->peers
);
2956 static int ath10k_wmi_10_4_op_pull_fw_stats(struct ath10k
*ar
,
2957 struct sk_buff
*skb
,
2958 struct ath10k_fw_stats
*stats
)
2960 const struct wmi_10_2_stats_event
*ev
= (void *)skb
->data
;
2962 u32 num_pdev_ext_stats
;
2965 u32 num_bcnflt_stats
;
2969 if (!skb_pull(skb
, sizeof(*ev
)))
2972 num_pdev_stats
= __le32_to_cpu(ev
->num_pdev_stats
);
2973 num_pdev_ext_stats
= __le32_to_cpu(ev
->num_pdev_ext_stats
);
2974 num_vdev_stats
= __le32_to_cpu(ev
->num_vdev_stats
);
2975 num_peer_stats
= __le32_to_cpu(ev
->num_peer_stats
);
2976 num_bcnflt_stats
= __le32_to_cpu(ev
->num_bcnflt_stats
);
2977 stats_id
= __le32_to_cpu(ev
->stats_id
);
2979 for (i
= 0; i
< num_pdev_stats
; i
++) {
2980 const struct wmi_10_4_pdev_stats
*src
;
2981 struct ath10k_fw_stats_pdev
*dst
;
2983 src
= (void *)skb
->data
;
2984 if (!skb_pull(skb
, sizeof(*src
)))
2987 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
2991 ath10k_wmi_pull_pdev_stats_base(&src
->base
, dst
);
2992 ath10k_wmi_10_4_pull_pdev_stats_tx(&src
->tx
, dst
);
2993 ath10k_wmi_pull_pdev_stats_rx(&src
->rx
, dst
);
2994 dst
->rx_ovfl_errs
= __le32_to_cpu(src
->rx_ovfl_errs
);
2995 ath10k_wmi_pull_pdev_stats_extra(&src
->extra
, dst
);
2997 list_add_tail(&dst
->list
, &stats
->pdevs
);
3000 for (i
= 0; i
< num_pdev_ext_stats
; i
++) {
3001 const struct wmi_10_2_pdev_ext_stats
*src
;
3003 src
= (void *)skb
->data
;
3004 if (!skb_pull(skb
, sizeof(*src
)))
3007 /* FIXME: expose values to userspace
3009 * Note: Even though this loop seems to do nothing it is
3010 * required to parse following sub-structures properly.
3014 /* fw doesn't implement vdev stats */
3016 for (i
= 0; i
< num_peer_stats
; i
++) {
3017 const struct wmi_10_4_peer_stats
*src
;
3018 struct ath10k_fw_stats_peer
*dst
;
3020 src
= (void *)skb
->data
;
3021 if (!skb_pull(skb
, sizeof(*src
)))
3024 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
3028 ath10k_wmi_10_4_pull_peer_stats(src
, dst
);
3029 list_add_tail(&dst
->list
, &stats
->peers
);
3032 for (i
= 0; i
< num_bcnflt_stats
; i
++) {
3033 const struct wmi_10_4_bss_bcn_filter_stats
*src
;
3035 src
= (void *)skb
->data
;
3036 if (!skb_pull(skb
, sizeof(*src
)))
3039 /* FIXME: expose values to userspace
3041 * Note: Even though this loop seems to do nothing it is
3042 * required to parse following sub-structures properly.
3046 if ((stats_id
& WMI_10_4_STAT_PEER_EXTD
) == 0)
3049 stats
->extended
= true;
3051 for (i
= 0; i
< num_peer_stats
; i
++) {
3052 const struct wmi_10_4_peer_extd_stats
*src
;
3053 struct ath10k_fw_extd_stats_peer
*dst
;
3055 src
= (void *)skb
->data
;
3056 if (!skb_pull(skb
, sizeof(*src
)))
3059 dst
= kzalloc(sizeof(*dst
), GFP_ATOMIC
);
3063 ether_addr_copy(dst
->peer_macaddr
, src
->peer_macaddr
.addr
);
3064 dst
->rx_duration
= __le32_to_cpu(src
->rx_duration
);
3065 list_add_tail(&dst
->list
, &stats
->peers_extd
);
3071 void ath10k_wmi_event_update_stats(struct ath10k
*ar
, struct sk_buff
*skb
)
3073 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_UPDATE_STATS_EVENTID\n");
3074 ath10k_debug_fw_stats_process(ar
, skb
);
3078 ath10k_wmi_op_pull_vdev_start_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
3079 struct wmi_vdev_start_ev_arg
*arg
)
3081 struct wmi_vdev_start_response_event
*ev
= (void *)skb
->data
;
3083 if (skb
->len
< sizeof(*ev
))
3086 skb_pull(skb
, sizeof(*ev
));
3087 arg
->vdev_id
= ev
->vdev_id
;
3088 arg
->req_id
= ev
->req_id
;
3089 arg
->resp_type
= ev
->resp_type
;
3090 arg
->status
= ev
->status
;
3095 void ath10k_wmi_event_vdev_start_resp(struct ath10k
*ar
, struct sk_buff
*skb
)
3097 struct wmi_vdev_start_ev_arg arg
= {};
3100 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_VDEV_START_RESP_EVENTID\n");
3102 ret
= ath10k_wmi_pull_vdev_start(ar
, skb
, &arg
);
3104 ath10k_warn(ar
, "failed to parse vdev start event: %d\n", ret
);
3108 if (WARN_ON(__le32_to_cpu(arg
.status
)))
3111 complete(&ar
->vdev_setup_done
);
3114 void ath10k_wmi_event_vdev_stopped(struct ath10k
*ar
, struct sk_buff
*skb
)
3116 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_VDEV_STOPPED_EVENTID\n");
3117 complete(&ar
->vdev_setup_done
);
3121 ath10k_wmi_op_pull_peer_kick_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
3122 struct wmi_peer_kick_ev_arg
*arg
)
3124 struct wmi_peer_sta_kickout_event
*ev
= (void *)skb
->data
;
3126 if (skb
->len
< sizeof(*ev
))
3129 skb_pull(skb
, sizeof(*ev
));
3130 arg
->mac_addr
= ev
->peer_macaddr
.addr
;
3135 void ath10k_wmi_event_peer_sta_kickout(struct ath10k
*ar
, struct sk_buff
*skb
)
3137 struct wmi_peer_kick_ev_arg arg
= {};
3138 struct ieee80211_sta
*sta
;
3141 ret
= ath10k_wmi_pull_peer_kick(ar
, skb
, &arg
);
3143 ath10k_warn(ar
, "failed to parse peer kickout event: %d\n",
3148 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi event peer sta kickout %pM\n",
3153 sta
= ieee80211_find_sta_by_ifaddr(ar
->hw
, arg
.mac_addr
, NULL
);
3155 ath10k_warn(ar
, "Spurious quick kickout for STA %pM\n",
3160 ieee80211_report_low_ack(sta
, 10);
3169 * We don't report to mac80211 sleep state of connected
3170 * stations. Due to this mac80211 can't fill in TIM IE
3173 * I know of no way of getting nullfunc frames that contain
3174 * sleep transition from connected stations - these do not
3175 * seem to be sent from the target to the host. There also
3176 * doesn't seem to be a dedicated event for that. So the
3177 * only way left to do this would be to read tim_bitmap
3180 * We could probably try using tim_bitmap from SWBA to tell
3181 * mac80211 which stations are asleep and which are not. The
3182 * problem here is calling mac80211 functions so many times
3183 * could take too long and make us miss the time to submit
3184 * the beacon to the target.
3186 * So as a workaround we try to extend the TIM IE if there
3187 * is unicast buffered for stations with aid > 7 and fill it
3190 static void ath10k_wmi_update_tim(struct ath10k
*ar
,
3191 struct ath10k_vif
*arvif
,
3192 struct sk_buff
*bcn
,
3193 const struct wmi_tim_info_arg
*tim_info
)
3195 struct ieee80211_hdr
*hdr
= (struct ieee80211_hdr
*)bcn
->data
;
3196 struct ieee80211_tim_ie
*tim
;
3202 /* When FW reports 0 in tim_len, ensure atleast first byte
3203 * in tim_bitmap is considered for pvm calculation.
3205 tim_len
= tim_info
->tim_len
? __le32_to_cpu(tim_info
->tim_len
) : 1;
3207 /* if next SWBA has no tim_changed the tim_bitmap is garbage.
3208 * we must copy the bitmap upon change and reuse it later */
3209 if (__le32_to_cpu(tim_info
->tim_changed
)) {
3212 if (sizeof(arvif
->u
.ap
.tim_bitmap
) < tim_len
) {
3213 ath10k_warn(ar
, "SWBA TIM field is too big (%u), truncated it to %zu",
3214 tim_len
, sizeof(arvif
->u
.ap
.tim_bitmap
));
3215 tim_len
= sizeof(arvif
->u
.ap
.tim_bitmap
);
3218 for (i
= 0; i
< tim_len
; i
++) {
3219 t
= tim_info
->tim_bitmap
[i
/ 4];
3220 v
= __le32_to_cpu(t
);
3221 arvif
->u
.ap
.tim_bitmap
[i
] = (v
>> ((i
% 4) * 8)) & 0xFF;
3224 /* FW reports either length 0 or length based on max supported
3225 * station. so we calculate this on our own
3227 arvif
->u
.ap
.tim_len
= 0;
3228 for (i
= 0; i
< tim_len
; i
++)
3229 if (arvif
->u
.ap
.tim_bitmap
[i
])
3230 arvif
->u
.ap
.tim_len
= i
;
3232 arvif
->u
.ap
.tim_len
++;
3236 ies
+= ieee80211_hdrlen(hdr
->frame_control
);
3237 ies
+= 12; /* fixed parameters */
3239 ie
= (u8
*)cfg80211_find_ie(WLAN_EID_TIM
, ies
,
3240 (u8
*)skb_tail_pointer(bcn
) - ies
);
3242 if (arvif
->vdev_type
!= WMI_VDEV_TYPE_IBSS
)
3243 ath10k_warn(ar
, "no tim ie found;\n");
3247 tim
= (void *)ie
+ 2;
3249 pvm_len
= ie_len
- 3; /* exclude dtim count, dtim period, bmap ctl */
3251 if (pvm_len
< arvif
->u
.ap
.tim_len
) {
3252 int expand_size
= tim_len
- pvm_len
;
3253 int move_size
= skb_tail_pointer(bcn
) - (ie
+ 2 + ie_len
);
3254 void *next_ie
= ie
+ 2 + ie_len
;
3256 if (skb_put(bcn
, expand_size
)) {
3257 memmove(next_ie
+ expand_size
, next_ie
, move_size
);
3259 ie
[1] += expand_size
;
3260 ie_len
+= expand_size
;
3261 pvm_len
+= expand_size
;
3263 ath10k_warn(ar
, "tim expansion failed\n");
3267 if (pvm_len
> tim_len
) {
3268 ath10k_warn(ar
, "tim pvm length is too great (%d)\n", pvm_len
);
3272 tim
->bitmap_ctrl
= !!__le32_to_cpu(tim_info
->tim_mcast
);
3273 memcpy(tim
->virtual_map
, arvif
->u
.ap
.tim_bitmap
, pvm_len
);
3275 if (tim
->dtim_count
== 0) {
3276 ATH10K_SKB_CB(bcn
)->flags
|= ATH10K_SKB_F_DTIM_ZERO
;
3278 if (__le32_to_cpu(tim_info
->tim_mcast
) == 1)
3279 ATH10K_SKB_CB(bcn
)->flags
|= ATH10K_SKB_F_DELIVER_CAB
;
3282 ath10k_dbg(ar
, ATH10K_DBG_MGMT
, "dtim %d/%d mcast %d pvmlen %d\n",
3283 tim
->dtim_count
, tim
->dtim_period
,
3284 tim
->bitmap_ctrl
, pvm_len
);
3287 static void ath10k_wmi_update_noa(struct ath10k
*ar
, struct ath10k_vif
*arvif
,
3288 struct sk_buff
*bcn
,
3289 const struct wmi_p2p_noa_info
*noa
)
3291 if (!arvif
->vif
->p2p
)
3294 ath10k_dbg(ar
, ATH10K_DBG_MGMT
, "noa changed: %d\n", noa
->changed
);
3296 if (noa
->changed
& WMI_P2P_NOA_CHANGED_BIT
)
3297 ath10k_p2p_noa_update(arvif
, noa
);
3299 if (arvif
->u
.ap
.noa_data
)
3300 if (!pskb_expand_head(bcn
, 0, arvif
->u
.ap
.noa_len
, GFP_ATOMIC
))
3301 memcpy(skb_put(bcn
, arvif
->u
.ap
.noa_len
),
3302 arvif
->u
.ap
.noa_data
,
3303 arvif
->u
.ap
.noa_len
);
3306 static int ath10k_wmi_op_pull_swba_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
3307 struct wmi_swba_ev_arg
*arg
)
3309 struct wmi_host_swba_event
*ev
= (void *)skb
->data
;
3313 if (skb
->len
< sizeof(*ev
))
3316 skb_pull(skb
, sizeof(*ev
));
3317 arg
->vdev_map
= ev
->vdev_map
;
3319 for (i
= 0, map
= __le32_to_cpu(ev
->vdev_map
); map
; map
>>= 1) {
3320 if (!(map
& BIT(0)))
3323 /* If this happens there were some changes in firmware and
3324 * ath10k should update the max size of tim_info array.
3326 if (WARN_ON_ONCE(i
== ARRAY_SIZE(arg
->tim_info
)))
3329 if (__le32_to_cpu(ev
->bcn_info
[i
].tim_info
.tim_len
) >
3330 sizeof(ev
->bcn_info
[i
].tim_info
.tim_bitmap
)) {
3331 ath10k_warn(ar
, "refusing to parse invalid swba structure\n");
3335 arg
->tim_info
[i
].tim_len
= ev
->bcn_info
[i
].tim_info
.tim_len
;
3336 arg
->tim_info
[i
].tim_mcast
= ev
->bcn_info
[i
].tim_info
.tim_mcast
;
3337 arg
->tim_info
[i
].tim_bitmap
=
3338 ev
->bcn_info
[i
].tim_info
.tim_bitmap
;
3339 arg
->tim_info
[i
].tim_changed
=
3340 ev
->bcn_info
[i
].tim_info
.tim_changed
;
3341 arg
->tim_info
[i
].tim_num_ps_pending
=
3342 ev
->bcn_info
[i
].tim_info
.tim_num_ps_pending
;
3344 arg
->noa_info
[i
] = &ev
->bcn_info
[i
].p2p_noa_info
;
3351 static int ath10k_wmi_10_2_4_op_pull_swba_ev(struct ath10k
*ar
,
3352 struct sk_buff
*skb
,
3353 struct wmi_swba_ev_arg
*arg
)
3355 struct wmi_10_2_4_host_swba_event
*ev
= (void *)skb
->data
;
3359 if (skb
->len
< sizeof(*ev
))
3362 skb_pull(skb
, sizeof(*ev
));
3363 arg
->vdev_map
= ev
->vdev_map
;
3365 for (i
= 0, map
= __le32_to_cpu(ev
->vdev_map
); map
; map
>>= 1) {
3366 if (!(map
& BIT(0)))
3369 /* If this happens there were some changes in firmware and
3370 * ath10k should update the max size of tim_info array.
3372 if (WARN_ON_ONCE(i
== ARRAY_SIZE(arg
->tim_info
)))
3375 if (__le32_to_cpu(ev
->bcn_info
[i
].tim_info
.tim_len
) >
3376 sizeof(ev
->bcn_info
[i
].tim_info
.tim_bitmap
)) {
3377 ath10k_warn(ar
, "refusing to parse invalid swba structure\n");
3381 arg
->tim_info
[i
].tim_len
= ev
->bcn_info
[i
].tim_info
.tim_len
;
3382 arg
->tim_info
[i
].tim_mcast
= ev
->bcn_info
[i
].tim_info
.tim_mcast
;
3383 arg
->tim_info
[i
].tim_bitmap
=
3384 ev
->bcn_info
[i
].tim_info
.tim_bitmap
;
3385 arg
->tim_info
[i
].tim_changed
=
3386 ev
->bcn_info
[i
].tim_info
.tim_changed
;
3387 arg
->tim_info
[i
].tim_num_ps_pending
=
3388 ev
->bcn_info
[i
].tim_info
.tim_num_ps_pending
;
3395 static int ath10k_wmi_10_4_op_pull_swba_ev(struct ath10k
*ar
,
3396 struct sk_buff
*skb
,
3397 struct wmi_swba_ev_arg
*arg
)
3399 struct wmi_10_4_host_swba_event
*ev
= (void *)skb
->data
;
3403 if (skb
->len
< sizeof(*ev
))
3406 skb_pull(skb
, sizeof(*ev
));
3407 arg
->vdev_map
= ev
->vdev_map
;
3409 for (i
= 0, map
= __le32_to_cpu(ev
->vdev_map
); map
; map
>>= 1) {
3410 if (!(map
& BIT(0)))
3413 /* If this happens there were some changes in firmware and
3414 * ath10k should update the max size of tim_info array.
3416 if (WARN_ON_ONCE(i
== ARRAY_SIZE(arg
->tim_info
)))
3419 if (__le32_to_cpu(ev
->bcn_info
[i
].tim_info
.tim_len
) >
3420 sizeof(ev
->bcn_info
[i
].tim_info
.tim_bitmap
)) {
3421 ath10k_warn(ar
, "refusing to parse invalid swba structure\n");
3425 tim_len
= __le32_to_cpu(ev
->bcn_info
[i
].tim_info
.tim_len
);
3427 /* Exclude 4 byte guard length */
3429 arg
->tim_info
[i
].tim_len
= __cpu_to_le32(tim_len
);
3431 arg
->tim_info
[i
].tim_len
= 0;
3434 arg
->tim_info
[i
].tim_mcast
= ev
->bcn_info
[i
].tim_info
.tim_mcast
;
3435 arg
->tim_info
[i
].tim_bitmap
=
3436 ev
->bcn_info
[i
].tim_info
.tim_bitmap
;
3437 arg
->tim_info
[i
].tim_changed
=
3438 ev
->bcn_info
[i
].tim_info
.tim_changed
;
3439 arg
->tim_info
[i
].tim_num_ps_pending
=
3440 ev
->bcn_info
[i
].tim_info
.tim_num_ps_pending
;
3442 /* 10.4 firmware doesn't have p2p support. notice of absence
3443 * info can be ignored for now.
3452 static enum wmi_txbf_conf
ath10k_wmi_10_4_txbf_conf_scheme(struct ath10k
*ar
)
3454 return WMI_TXBF_CONF_BEFORE_ASSOC
;
3457 void ath10k_wmi_event_host_swba(struct ath10k
*ar
, struct sk_buff
*skb
)
3459 struct wmi_swba_ev_arg arg
= {};
3462 const struct wmi_tim_info_arg
*tim_info
;
3463 const struct wmi_p2p_noa_info
*noa_info
;
3464 struct ath10k_vif
*arvif
;
3465 struct sk_buff
*bcn
;
3467 int ret
, vdev_id
= 0;
3469 ret
= ath10k_wmi_pull_swba(ar
, skb
, &arg
);
3471 ath10k_warn(ar
, "failed to parse swba event: %d\n", ret
);
3475 map
= __le32_to_cpu(arg
.vdev_map
);
3477 ath10k_dbg(ar
, ATH10K_DBG_MGMT
, "mgmt swba vdev_map 0x%x\n",
3480 for (; map
; map
>>= 1, vdev_id
++) {
3486 if (i
>= WMI_MAX_AP_VDEV
) {
3487 ath10k_warn(ar
, "swba has corrupted vdev map\n");
3491 tim_info
= &arg
.tim_info
[i
];
3492 noa_info
= arg
.noa_info
[i
];
3494 ath10k_dbg(ar
, ATH10K_DBG_MGMT
,
3495 "mgmt event bcn_info %d tim_len %d mcast %d changed %d num_ps_pending %d bitmap 0x%08x%08x%08x%08x\n",
3497 __le32_to_cpu(tim_info
->tim_len
),
3498 __le32_to_cpu(tim_info
->tim_mcast
),
3499 __le32_to_cpu(tim_info
->tim_changed
),
3500 __le32_to_cpu(tim_info
->tim_num_ps_pending
),
3501 __le32_to_cpu(tim_info
->tim_bitmap
[3]),
3502 __le32_to_cpu(tim_info
->tim_bitmap
[2]),
3503 __le32_to_cpu(tim_info
->tim_bitmap
[1]),
3504 __le32_to_cpu(tim_info
->tim_bitmap
[0]));
3506 /* TODO: Only first 4 word from tim_bitmap is dumped.
3507 * Extend debug code to dump full tim_bitmap.
3510 arvif
= ath10k_get_arvif(ar
, vdev_id
);
3511 if (arvif
== NULL
) {
3512 ath10k_warn(ar
, "no vif for vdev_id %d found\n",
3517 /* mac80211 would have already asked us to stop beaconing and
3518 * bring the vdev down, so continue in that case
3523 /* There are no completions for beacons so wait for next SWBA
3524 * before telling mac80211 to decrement CSA counter
3526 * Once CSA counter is completed stop sending beacons until
3527 * actual channel switch is done */
3528 if (arvif
->vif
->csa_active
&&
3529 ieee80211_csa_is_complete(arvif
->vif
)) {
3530 ieee80211_csa_finish(arvif
->vif
);
3534 bcn
= ieee80211_beacon_get(ar
->hw
, arvif
->vif
);
3536 ath10k_warn(ar
, "could not get mac80211 beacon\n");
3540 ath10k_tx_h_seq_no(arvif
->vif
, bcn
);
3541 ath10k_wmi_update_tim(ar
, arvif
, bcn
, tim_info
);
3542 ath10k_wmi_update_noa(ar
, arvif
, bcn
, noa_info
);
3544 spin_lock_bh(&ar
->data_lock
);
3546 if (arvif
->beacon
) {
3547 switch (arvif
->beacon_state
) {
3548 case ATH10K_BEACON_SENT
:
3550 case ATH10K_BEACON_SCHEDULED
:
3551 ath10k_warn(ar
, "SWBA overrun on vdev %d, skipped old beacon\n",
3554 case ATH10K_BEACON_SENDING
:
3555 ath10k_warn(ar
, "SWBA overrun on vdev %d, skipped new beacon\n",
3561 ath10k_mac_vif_beacon_free(arvif
);
3564 if (!arvif
->beacon_buf
) {
3565 paddr
= dma_map_single(arvif
->ar
->dev
, bcn
->data
,
3566 bcn
->len
, DMA_TO_DEVICE
);
3567 ret
= dma_mapping_error(arvif
->ar
->dev
, paddr
);
3569 ath10k_warn(ar
, "failed to map beacon: %d\n",
3571 dev_kfree_skb_any(bcn
);
3575 ATH10K_SKB_CB(bcn
)->paddr
= paddr
;
3577 if (bcn
->len
> IEEE80211_MAX_FRAME_LEN
) {
3578 ath10k_warn(ar
, "trimming beacon %d -> %d bytes!\n",
3579 bcn
->len
, IEEE80211_MAX_FRAME_LEN
);
3580 skb_trim(bcn
, IEEE80211_MAX_FRAME_LEN
);
3582 memcpy(arvif
->beacon_buf
, bcn
->data
, bcn
->len
);
3583 ATH10K_SKB_CB(bcn
)->paddr
= arvif
->beacon_paddr
;
3586 arvif
->beacon
= bcn
;
3587 arvif
->beacon_state
= ATH10K_BEACON_SCHEDULED
;
3589 trace_ath10k_tx_hdr(ar
, bcn
->data
, bcn
->len
);
3590 trace_ath10k_tx_payload(ar
, bcn
->data
, bcn
->len
);
3593 spin_unlock_bh(&ar
->data_lock
);
3596 ath10k_wmi_tx_beacons_nowait(ar
);
3599 void ath10k_wmi_event_tbttoffset_update(struct ath10k
*ar
, struct sk_buff
*skb
)
3601 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_TBTTOFFSET_UPDATE_EVENTID\n");
3604 static void ath10k_dfs_radar_report(struct ath10k
*ar
,
3605 struct wmi_phyerr_ev_arg
*phyerr
,
3606 const struct phyerr_radar_report
*rr
,
3609 u32 reg0
, reg1
, tsf32l
;
3610 struct ieee80211_channel
*ch
;
3611 struct pulse_event pe
;
3615 reg0
= __le32_to_cpu(rr
->reg0
);
3616 reg1
= __le32_to_cpu(rr
->reg1
);
3618 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3619 "wmi phyerr radar report chirp %d max_width %d agc_total_gain %d pulse_delta_diff %d\n",
3620 MS(reg0
, RADAR_REPORT_REG0_PULSE_IS_CHIRP
),
3621 MS(reg0
, RADAR_REPORT_REG0_PULSE_IS_MAX_WIDTH
),
3622 MS(reg0
, RADAR_REPORT_REG0_AGC_TOTAL_GAIN
),
3623 MS(reg0
, RADAR_REPORT_REG0_PULSE_DELTA_DIFF
));
3624 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3625 "wmi phyerr radar report pulse_delta_pean %d pulse_sidx %d fft_valid %d agc_mb_gain %d subchan_mask %d\n",
3626 MS(reg0
, RADAR_REPORT_REG0_PULSE_DELTA_PEAK
),
3627 MS(reg0
, RADAR_REPORT_REG0_PULSE_SIDX
),
3628 MS(reg1
, RADAR_REPORT_REG1_PULSE_SRCH_FFT_VALID
),
3629 MS(reg1
, RADAR_REPORT_REG1_PULSE_AGC_MB_GAIN
),
3630 MS(reg1
, RADAR_REPORT_REG1_PULSE_SUBCHAN_MASK
));
3631 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3632 "wmi phyerr radar report pulse_tsf_offset 0x%X pulse_dur: %d\n",
3633 MS(reg1
, RADAR_REPORT_REG1_PULSE_TSF_OFFSET
),
3634 MS(reg1
, RADAR_REPORT_REG1_PULSE_DUR
));
3636 if (!ar
->dfs_detector
)
3639 spin_lock_bh(&ar
->data_lock
);
3640 ch
= ar
->rx_channel
;
3641 spin_unlock_bh(&ar
->data_lock
);
3644 ath10k_warn(ar
, "failed to derive channel for radar pulse, treating as radar\n");
3645 goto radar_detected
;
3648 /* report event to DFS pattern detector */
3649 tsf32l
= phyerr
->tsf_timestamp
;
3650 tsf64
= tsf
& (~0xFFFFFFFFULL
);
3653 width
= MS(reg1
, RADAR_REPORT_REG1_PULSE_DUR
);
3654 rssi
= phyerr
->rssi_combined
;
3656 /* hardware store this as 8 bit signed value,
3657 * set to zero if negative number
3663 pe
.freq
= ch
->center_freq
;
3666 pe
.chirp
= (MS(reg0
, RADAR_REPORT_REG0_PULSE_IS_CHIRP
) != 0);
3667 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3668 "dfs add pulse freq: %d, width: %d, rssi %d, tsf: %llX\n",
3669 pe
.freq
, pe
.width
, pe
.rssi
, pe
.ts
);
3671 ATH10K_DFS_STAT_INC(ar
, pulses_detected
);
3673 if (!ar
->dfs_detector
->add_pulse(ar
->dfs_detector
, &pe
)) {
3674 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3675 "dfs no pulse pattern detected, yet\n");
3680 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
, "dfs radar detected\n");
3681 ATH10K_DFS_STAT_INC(ar
, radar_detected
);
3683 /* Control radar events reporting in debugfs file
3684 dfs_block_radar_events */
3685 if (ar
->dfs_block_radar_events
) {
3686 ath10k_info(ar
, "DFS Radar detected, but ignored as requested\n");
3690 ieee80211_radar_detected(ar
->hw
);
3693 static int ath10k_dfs_fft_report(struct ath10k
*ar
,
3694 struct wmi_phyerr_ev_arg
*phyerr
,
3695 const struct phyerr_fft_report
*fftr
,
3701 reg0
= __le32_to_cpu(fftr
->reg0
);
3702 reg1
= __le32_to_cpu(fftr
->reg1
);
3703 rssi
= phyerr
->rssi_combined
;
3705 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3706 "wmi phyerr fft report total_gain_db %d base_pwr_db %d fft_chn_idx %d peak_sidx %d\n",
3707 MS(reg0
, SEARCH_FFT_REPORT_REG0_TOTAL_GAIN_DB
),
3708 MS(reg0
, SEARCH_FFT_REPORT_REG0_BASE_PWR_DB
),
3709 MS(reg0
, SEARCH_FFT_REPORT_REG0_FFT_CHN_IDX
),
3710 MS(reg0
, SEARCH_FFT_REPORT_REG0_PEAK_SIDX
));
3711 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3712 "wmi phyerr fft report rel_pwr_db %d avgpwr_db %d peak_mag %d num_store_bin %d\n",
3713 MS(reg1
, SEARCH_FFT_REPORT_REG1_RELPWR_DB
),
3714 MS(reg1
, SEARCH_FFT_REPORT_REG1_AVGPWR_DB
),
3715 MS(reg1
, SEARCH_FFT_REPORT_REG1_PEAK_MAG
),
3716 MS(reg1
, SEARCH_FFT_REPORT_REG1_NUM_STR_BINS_IB
));
3718 peak_mag
= MS(reg1
, SEARCH_FFT_REPORT_REG1_PEAK_MAG
);
3720 /* false event detection */
3721 if (rssi
== DFS_RSSI_POSSIBLY_FALSE
&&
3722 peak_mag
< 2 * DFS_PEAK_MAG_THOLD_POSSIBLY_FALSE
) {
3723 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
, "dfs false pulse detected\n");
3724 ATH10K_DFS_STAT_INC(ar
, pulses_discarded
);
3731 void ath10k_wmi_event_dfs(struct ath10k
*ar
,
3732 struct wmi_phyerr_ev_arg
*phyerr
,
3735 int buf_len
, tlv_len
, res
, i
= 0;
3736 const struct phyerr_tlv
*tlv
;
3737 const struct phyerr_radar_report
*rr
;
3738 const struct phyerr_fft_report
*fftr
;
3741 buf_len
= phyerr
->buf_len
;
3742 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3743 "wmi event dfs err_code %d rssi %d tsfl 0x%X tsf64 0x%llX len %d\n",
3744 phyerr
->phy_err_code
, phyerr
->rssi_combined
,
3745 phyerr
->tsf_timestamp
, tsf
, buf_len
);
3747 /* Skip event if DFS disabled */
3748 if (!IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED
))
3751 ATH10K_DFS_STAT_INC(ar
, pulses_total
);
3753 while (i
< buf_len
) {
3754 if (i
+ sizeof(*tlv
) > buf_len
) {
3755 ath10k_warn(ar
, "too short buf for tlv header (%d)\n",
3760 tlv
= (struct phyerr_tlv
*)&phyerr
->buf
[i
];
3761 tlv_len
= __le16_to_cpu(tlv
->len
);
3762 tlv_buf
= &phyerr
->buf
[i
+ sizeof(*tlv
)];
3763 ath10k_dbg(ar
, ATH10K_DBG_REGULATORY
,
3764 "wmi event dfs tlv_len %d tlv_tag 0x%02X tlv_sig 0x%02X\n",
3765 tlv_len
, tlv
->tag
, tlv
->sig
);
3768 case PHYERR_TLV_TAG_RADAR_PULSE_SUMMARY
:
3769 if (i
+ sizeof(*tlv
) + sizeof(*rr
) > buf_len
) {
3770 ath10k_warn(ar
, "too short radar pulse summary (%d)\n",
3775 rr
= (struct phyerr_radar_report
*)tlv_buf
;
3776 ath10k_dfs_radar_report(ar
, phyerr
, rr
, tsf
);
3778 case PHYERR_TLV_TAG_SEARCH_FFT_REPORT
:
3779 if (i
+ sizeof(*tlv
) + sizeof(*fftr
) > buf_len
) {
3780 ath10k_warn(ar
, "too short fft report (%d)\n",
3785 fftr
= (struct phyerr_fft_report
*)tlv_buf
;
3786 res
= ath10k_dfs_fft_report(ar
, phyerr
, fftr
, tsf
);
3792 i
+= sizeof(*tlv
) + tlv_len
;
3796 void ath10k_wmi_event_spectral_scan(struct ath10k
*ar
,
3797 struct wmi_phyerr_ev_arg
*phyerr
,
3800 int buf_len
, tlv_len
, res
, i
= 0;
3801 struct phyerr_tlv
*tlv
;
3802 const void *tlv_buf
;
3803 const struct phyerr_fft_report
*fftr
;
3806 buf_len
= phyerr
->buf_len
;
3808 while (i
< buf_len
) {
3809 if (i
+ sizeof(*tlv
) > buf_len
) {
3810 ath10k_warn(ar
, "failed to parse phyerr tlv header at byte %d\n",
3815 tlv
= (struct phyerr_tlv
*)&phyerr
->buf
[i
];
3816 tlv_len
= __le16_to_cpu(tlv
->len
);
3817 tlv_buf
= &phyerr
->buf
[i
+ sizeof(*tlv
)];
3819 if (i
+ sizeof(*tlv
) + tlv_len
> buf_len
) {
3820 ath10k_warn(ar
, "failed to parse phyerr tlv payload at byte %d\n",
3826 case PHYERR_TLV_TAG_SEARCH_FFT_REPORT
:
3827 if (sizeof(*fftr
) > tlv_len
) {
3828 ath10k_warn(ar
, "failed to parse fft report at byte %d\n",
3833 fftr_len
= tlv_len
- sizeof(*fftr
);
3835 res
= ath10k_spectral_process_fft(ar
, phyerr
,
3839 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "failed to process fft report: %d\n",
3846 i
+= sizeof(*tlv
) + tlv_len
;
3850 static int ath10k_wmi_op_pull_phyerr_ev_hdr(struct ath10k
*ar
,
3851 struct sk_buff
*skb
,
3852 struct wmi_phyerr_hdr_arg
*arg
)
3854 struct wmi_phyerr_event
*ev
= (void *)skb
->data
;
3856 if (skb
->len
< sizeof(*ev
))
3859 arg
->num_phyerrs
= __le32_to_cpu(ev
->num_phyerrs
);
3860 arg
->tsf_l32
= __le32_to_cpu(ev
->tsf_l32
);
3861 arg
->tsf_u32
= __le32_to_cpu(ev
->tsf_u32
);
3862 arg
->buf_len
= skb
->len
- sizeof(*ev
);
3863 arg
->phyerrs
= ev
->phyerrs
;
3868 static int ath10k_wmi_10_4_op_pull_phyerr_ev_hdr(struct ath10k
*ar
,
3869 struct sk_buff
*skb
,
3870 struct wmi_phyerr_hdr_arg
*arg
)
3872 struct wmi_10_4_phyerr_event
*ev
= (void *)skb
->data
;
3874 if (skb
->len
< sizeof(*ev
))
3877 /* 10.4 firmware always reports only one phyerr */
3878 arg
->num_phyerrs
= 1;
3880 arg
->tsf_l32
= __le32_to_cpu(ev
->tsf_l32
);
3881 arg
->tsf_u32
= __le32_to_cpu(ev
->tsf_u32
);
3882 arg
->buf_len
= skb
->len
;
3883 arg
->phyerrs
= skb
->data
;
3888 int ath10k_wmi_op_pull_phyerr_ev(struct ath10k
*ar
,
3889 const void *phyerr_buf
,
3891 struct wmi_phyerr_ev_arg
*arg
)
3893 const struct wmi_phyerr
*phyerr
= phyerr_buf
;
3896 if (left_len
< sizeof(*phyerr
)) {
3897 ath10k_warn(ar
, "wrong phyerr event head len %d (need: >=%zd)\n",
3898 left_len
, sizeof(*phyerr
));
3902 arg
->tsf_timestamp
= __le32_to_cpu(phyerr
->tsf_timestamp
);
3903 arg
->freq1
= __le16_to_cpu(phyerr
->freq1
);
3904 arg
->freq2
= __le16_to_cpu(phyerr
->freq2
);
3905 arg
->rssi_combined
= phyerr
->rssi_combined
;
3906 arg
->chan_width_mhz
= phyerr
->chan_width_mhz
;
3907 arg
->buf_len
= __le32_to_cpu(phyerr
->buf_len
);
3908 arg
->buf
= phyerr
->buf
;
3909 arg
->hdr_len
= sizeof(*phyerr
);
3911 for (i
= 0; i
< 4; i
++)
3912 arg
->nf_chains
[i
] = __le16_to_cpu(phyerr
->nf_chains
[i
]);
3914 switch (phyerr
->phy_err_code
) {
3915 case PHY_ERROR_GEN_SPECTRAL_SCAN
:
3916 arg
->phy_err_code
= PHY_ERROR_SPECTRAL_SCAN
;
3918 case PHY_ERROR_GEN_FALSE_RADAR_EXT
:
3919 arg
->phy_err_code
= PHY_ERROR_FALSE_RADAR_EXT
;
3921 case PHY_ERROR_GEN_RADAR
:
3922 arg
->phy_err_code
= PHY_ERROR_RADAR
;
3925 arg
->phy_err_code
= PHY_ERROR_UNKNOWN
;
3932 static int ath10k_wmi_10_4_op_pull_phyerr_ev(struct ath10k
*ar
,
3933 const void *phyerr_buf
,
3935 struct wmi_phyerr_ev_arg
*arg
)
3937 const struct wmi_10_4_phyerr_event
*phyerr
= phyerr_buf
;
3941 if (left_len
< sizeof(*phyerr
)) {
3942 ath10k_warn(ar
, "wrong phyerr event head len %d (need: >=%zd)\n",
3943 left_len
, sizeof(*phyerr
));
3947 arg
->tsf_timestamp
= __le32_to_cpu(phyerr
->tsf_timestamp
);
3948 arg
->freq1
= __le16_to_cpu(phyerr
->freq1
);
3949 arg
->freq2
= __le16_to_cpu(phyerr
->freq2
);
3950 arg
->rssi_combined
= phyerr
->rssi_combined
;
3951 arg
->chan_width_mhz
= phyerr
->chan_width_mhz
;
3952 arg
->buf_len
= __le32_to_cpu(phyerr
->buf_len
);
3953 arg
->buf
= phyerr
->buf
;
3954 arg
->hdr_len
= sizeof(*phyerr
);
3956 for (i
= 0; i
< 4; i
++)
3957 arg
->nf_chains
[i
] = __le16_to_cpu(phyerr
->nf_chains
[i
]);
3959 phy_err_mask
= __le32_to_cpu(phyerr
->phy_err_mask
[0]);
3961 if (phy_err_mask
& PHY_ERROR_10_4_SPECTRAL_SCAN_MASK
)
3962 arg
->phy_err_code
= PHY_ERROR_SPECTRAL_SCAN
;
3963 else if (phy_err_mask
& PHY_ERROR_10_4_RADAR_MASK
)
3964 arg
->phy_err_code
= PHY_ERROR_RADAR
;
3966 arg
->phy_err_code
= PHY_ERROR_UNKNOWN
;
3971 void ath10k_wmi_event_phyerr(struct ath10k
*ar
, struct sk_buff
*skb
)
3973 struct wmi_phyerr_hdr_arg hdr_arg
= {};
3974 struct wmi_phyerr_ev_arg phyerr_arg
= {};
3976 u32 count
, i
, buf_len
, phy_err_code
;
3980 ATH10K_DFS_STAT_INC(ar
, phy_errors
);
3982 ret
= ath10k_wmi_pull_phyerr_hdr(ar
, skb
, &hdr_arg
);
3984 ath10k_warn(ar
, "failed to parse phyerr event hdr: %d\n", ret
);
3988 /* Check number of included events */
3989 count
= hdr_arg
.num_phyerrs
;
3991 left_len
= hdr_arg
.buf_len
;
3993 tsf
= hdr_arg
.tsf_u32
;
3995 tsf
|= hdr_arg
.tsf_l32
;
3997 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
3998 "wmi event phyerr count %d tsf64 0x%llX\n",
4001 phyerr
= hdr_arg
.phyerrs
;
4002 for (i
= 0; i
< count
; i
++) {
4003 ret
= ath10k_wmi_pull_phyerr(ar
, phyerr
, left_len
, &phyerr_arg
);
4005 ath10k_warn(ar
, "failed to parse phyerr event (%d)\n",
4010 left_len
-= phyerr_arg
.hdr_len
;
4011 buf_len
= phyerr_arg
.buf_len
;
4012 phy_err_code
= phyerr_arg
.phy_err_code
;
4014 if (left_len
< buf_len
) {
4015 ath10k_warn(ar
, "single event (%d) wrong buf len\n", i
);
4019 left_len
-= buf_len
;
4021 switch (phy_err_code
) {
4022 case PHY_ERROR_RADAR
:
4023 ath10k_wmi_event_dfs(ar
, &phyerr_arg
, tsf
);
4025 case PHY_ERROR_SPECTRAL_SCAN
:
4026 ath10k_wmi_event_spectral_scan(ar
, &phyerr_arg
, tsf
);
4028 case PHY_ERROR_FALSE_RADAR_EXT
:
4029 ath10k_wmi_event_dfs(ar
, &phyerr_arg
, tsf
);
4030 ath10k_wmi_event_spectral_scan(ar
, &phyerr_arg
, tsf
);
4036 phyerr
= phyerr
+ phyerr_arg
.hdr_len
+ buf_len
;
4040 void ath10k_wmi_event_roam(struct ath10k
*ar
, struct sk_buff
*skb
)
4042 struct wmi_roam_ev_arg arg
= {};
4048 ret
= ath10k_wmi_pull_roam_ev(ar
, skb
, &arg
);
4050 ath10k_warn(ar
, "failed to parse roam event: %d\n", ret
);
4054 vdev_id
= __le32_to_cpu(arg
.vdev_id
);
4055 reason
= __le32_to_cpu(arg
.reason
);
4056 rssi
= __le32_to_cpu(arg
.rssi
);
4057 rssi
+= WMI_SPECTRAL_NOISE_FLOOR_REF_DEFAULT
;
4059 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
4060 "wmi roam event vdev %u reason 0x%08x rssi %d\n",
4061 vdev_id
, reason
, rssi
);
4063 if (reason
>= WMI_ROAM_REASON_MAX
)
4064 ath10k_warn(ar
, "ignoring unknown roam event reason %d on vdev %i\n",
4068 case WMI_ROAM_REASON_BEACON_MISS
:
4069 ath10k_mac_handle_beacon_miss(ar
, vdev_id
);
4071 case WMI_ROAM_REASON_BETTER_AP
:
4072 case WMI_ROAM_REASON_LOW_RSSI
:
4073 case WMI_ROAM_REASON_SUITABLE_AP_FOUND
:
4074 case WMI_ROAM_REASON_HO_FAILED
:
4075 ath10k_warn(ar
, "ignoring not implemented roam event reason %d on vdev %i\n",
4081 void ath10k_wmi_event_profile_match(struct ath10k
*ar
, struct sk_buff
*skb
)
4083 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_PROFILE_MATCH\n");
4086 void ath10k_wmi_event_debug_print(struct ath10k
*ar
, struct sk_buff
*skb
)
4091 for (i
= 0; i
< sizeof(buf
) - 1; i
++) {
4100 if (isascii(c
) && isprint(c
))
4106 if (i
== sizeof(buf
) - 1)
4107 ath10k_warn(ar
, "wmi debug print truncated: %d\n", skb
->len
);
4109 /* for some reason the debug prints end with \n, remove that */
4110 if (skb
->data
[i
- 1] == '\n')
4113 /* the last byte is always reserved for the null character */
4116 ath10k_dbg(ar
, ATH10K_DBG_WMI_PRINT
, "wmi print '%s'\n", buf
);
4119 void ath10k_wmi_event_pdev_qvit(struct ath10k
*ar
, struct sk_buff
*skb
)
4121 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_PDEV_QVIT_EVENTID\n");
4124 void ath10k_wmi_event_wlan_profile_data(struct ath10k
*ar
, struct sk_buff
*skb
)
4126 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_WLAN_PROFILE_DATA_EVENTID\n");
4129 void ath10k_wmi_event_rtt_measurement_report(struct ath10k
*ar
,
4130 struct sk_buff
*skb
)
4132 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_RTT_MEASUREMENT_REPORT_EVENTID\n");
4135 void ath10k_wmi_event_tsf_measurement_report(struct ath10k
*ar
,
4136 struct sk_buff
*skb
)
4138 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_TSF_MEASUREMENT_REPORT_EVENTID\n");
4141 void ath10k_wmi_event_rtt_error_report(struct ath10k
*ar
, struct sk_buff
*skb
)
4143 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_RTT_ERROR_REPORT_EVENTID\n");
4146 void ath10k_wmi_event_wow_wakeup_host(struct ath10k
*ar
, struct sk_buff
*skb
)
4148 struct wmi_wow_ev_arg ev
= {};
4151 complete(&ar
->wow
.wakeup_completed
);
4153 ret
= ath10k_wmi_pull_wow_event(ar
, skb
, &ev
);
4155 ath10k_warn(ar
, "failed to parse wow wakeup event: %d\n", ret
);
4159 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wow wakeup host reason %s\n",
4160 wow_reason(ev
.wake_reason
));
4163 void ath10k_wmi_event_dcs_interference(struct ath10k
*ar
, struct sk_buff
*skb
)
4165 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_DCS_INTERFERENCE_EVENTID\n");
4168 static u8
ath10k_tpc_config_get_rate(struct ath10k
*ar
,
4169 struct wmi_pdev_tpc_config_event
*ev
,
4170 u32 rate_idx
, u32 num_chains
,
4171 u32 rate_code
, u8 type
)
4173 u8 tpc
, num_streams
, preamble
, ch
, stm_idx
;
4175 num_streams
= ATH10K_HW_NSS(rate_code
);
4176 preamble
= ATH10K_HW_PREAMBLE(rate_code
);
4177 ch
= num_chains
- 1;
4179 tpc
= min_t(u8
, ev
->rates_array
[rate_idx
], ev
->max_reg_allow_pow
[ch
]);
4181 if (__le32_to_cpu(ev
->num_tx_chain
) <= 1)
4184 if (preamble
== WMI_RATE_PREAMBLE_CCK
)
4187 stm_idx
= num_streams
- 1;
4188 if (num_chains
<= num_streams
)
4192 case WMI_TPC_TABLE_TYPE_STBC
:
4193 tpc
= min_t(u8
, tpc
,
4194 ev
->max_reg_allow_pow_agstbc
[ch
- 1][stm_idx
]);
4196 case WMI_TPC_TABLE_TYPE_TXBF
:
4197 tpc
= min_t(u8
, tpc
,
4198 ev
->max_reg_allow_pow_agtxbf
[ch
- 1][stm_idx
]);
4200 case WMI_TPC_TABLE_TYPE_CDD
:
4201 tpc
= min_t(u8
, tpc
,
4202 ev
->max_reg_allow_pow_agcdd
[ch
- 1][stm_idx
]);
4205 ath10k_warn(ar
, "unknown wmi tpc table type: %d\n", type
);
4214 static void ath10k_tpc_config_disp_tables(struct ath10k
*ar
,
4215 struct wmi_pdev_tpc_config_event
*ev
,
4216 struct ath10k_tpc_stats
*tpc_stats
,
4217 u8
*rate_code
, u16
*pream_table
, u8 type
)
4219 u32 i
, j
, pream_idx
, flags
;
4220 u8 tpc
[WMI_TPC_TX_N_CHAIN
];
4221 char tpc_value
[WMI_TPC_TX_N_CHAIN
* WMI_TPC_BUF_SIZE
];
4222 char buff
[WMI_TPC_BUF_SIZE
];
4224 flags
= __le32_to_cpu(ev
->flags
);
4227 case WMI_TPC_TABLE_TYPE_CDD
:
4228 if (!(flags
& WMI_TPC_CONFIG_EVENT_FLAG_TABLE_CDD
)) {
4229 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "CDD not supported\n");
4230 tpc_stats
->flag
[type
] = ATH10K_TPC_TABLE_TYPE_FLAG
;
4234 case WMI_TPC_TABLE_TYPE_STBC
:
4235 if (!(flags
& WMI_TPC_CONFIG_EVENT_FLAG_TABLE_STBC
)) {
4236 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "STBC not supported\n");
4237 tpc_stats
->flag
[type
] = ATH10K_TPC_TABLE_TYPE_FLAG
;
4241 case WMI_TPC_TABLE_TYPE_TXBF
:
4242 if (!(flags
& WMI_TPC_CONFIG_EVENT_FLAG_TABLE_TXBF
)) {
4243 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "TXBF not supported\n");
4244 tpc_stats
->flag
[type
] = ATH10K_TPC_TABLE_TYPE_FLAG
;
4249 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
4250 "invalid table type in wmi tpc event: %d\n", type
);
4255 for (i
= 0; i
< __le32_to_cpu(ev
->rate_max
); i
++) {
4256 memset(tpc_value
, 0, sizeof(tpc_value
));
4257 memset(buff
, 0, sizeof(buff
));
4258 if (i
== pream_table
[pream_idx
])
4261 for (j
= 0; j
< WMI_TPC_TX_N_CHAIN
; j
++) {
4262 if (j
>= __le32_to_cpu(ev
->num_tx_chain
))
4265 tpc
[j
] = ath10k_tpc_config_get_rate(ar
, ev
, i
, j
+ 1,
4268 snprintf(buff
, sizeof(buff
), "%8d ", tpc
[j
]);
4269 strncat(tpc_value
, buff
, strlen(buff
));
4271 tpc_stats
->tpc_table
[type
].pream_idx
[i
] = pream_idx
;
4272 tpc_stats
->tpc_table
[type
].rate_code
[i
] = rate_code
[i
];
4273 memcpy(tpc_stats
->tpc_table
[type
].tpc_value
[i
],
4274 tpc_value
, sizeof(tpc_value
));
4278 void ath10k_wmi_event_pdev_tpc_config(struct ath10k
*ar
, struct sk_buff
*skb
)
4280 u32 i
, j
, pream_idx
, num_tx_chain
;
4281 u8 rate_code
[WMI_TPC_RATE_MAX
], rate_idx
;
4282 u16 pream_table
[WMI_TPC_PREAM_TABLE_MAX
];
4283 struct wmi_pdev_tpc_config_event
*ev
;
4284 struct ath10k_tpc_stats
*tpc_stats
;
4286 ev
= (struct wmi_pdev_tpc_config_event
*)skb
->data
;
4288 tpc_stats
= kzalloc(sizeof(*tpc_stats
), GFP_ATOMIC
);
4292 /* Create the rate code table based on the chains supported */
4296 /* Fill CCK rate code */
4297 for (i
= 0; i
< 4; i
++) {
4298 rate_code
[rate_idx
] =
4299 ATH10K_HW_RATECODE(i
, 0, WMI_RATE_PREAMBLE_CCK
);
4302 pream_table
[pream_idx
] = rate_idx
;
4305 /* Fill OFDM rate code */
4306 for (i
= 0; i
< 8; i
++) {
4307 rate_code
[rate_idx
] =
4308 ATH10K_HW_RATECODE(i
, 0, WMI_RATE_PREAMBLE_OFDM
);
4311 pream_table
[pream_idx
] = rate_idx
;
4314 num_tx_chain
= __le32_to_cpu(ev
->num_tx_chain
);
4316 /* Fill HT20 rate code */
4317 for (i
= 0; i
< num_tx_chain
; i
++) {
4318 for (j
= 0; j
< 8; j
++) {
4319 rate_code
[rate_idx
] =
4320 ATH10K_HW_RATECODE(j
, i
, WMI_RATE_PREAMBLE_HT
);
4324 pream_table
[pream_idx
] = rate_idx
;
4327 /* Fill HT40 rate code */
4328 for (i
= 0; i
< num_tx_chain
; i
++) {
4329 for (j
= 0; j
< 8; j
++) {
4330 rate_code
[rate_idx
] =
4331 ATH10K_HW_RATECODE(j
, i
, WMI_RATE_PREAMBLE_HT
);
4335 pream_table
[pream_idx
] = rate_idx
;
4338 /* Fill VHT20 rate code */
4339 for (i
= 0; i
< __le32_to_cpu(ev
->num_tx_chain
); i
++) {
4340 for (j
= 0; j
< 10; j
++) {
4341 rate_code
[rate_idx
] =
4342 ATH10K_HW_RATECODE(j
, i
, WMI_RATE_PREAMBLE_VHT
);
4346 pream_table
[pream_idx
] = rate_idx
;
4349 /* Fill VHT40 rate code */
4350 for (i
= 0; i
< num_tx_chain
; i
++) {
4351 for (j
= 0; j
< 10; j
++) {
4352 rate_code
[rate_idx
] =
4353 ATH10K_HW_RATECODE(j
, i
, WMI_RATE_PREAMBLE_VHT
);
4357 pream_table
[pream_idx
] = rate_idx
;
4360 /* Fill VHT80 rate code */
4361 for (i
= 0; i
< num_tx_chain
; i
++) {
4362 for (j
= 0; j
< 10; j
++) {
4363 rate_code
[rate_idx
] =
4364 ATH10K_HW_RATECODE(j
, i
, WMI_RATE_PREAMBLE_VHT
);
4368 pream_table
[pream_idx
] = rate_idx
;
4371 rate_code
[rate_idx
++] =
4372 ATH10K_HW_RATECODE(0, 0, WMI_RATE_PREAMBLE_CCK
);
4373 rate_code
[rate_idx
++] =
4374 ATH10K_HW_RATECODE(0, 0, WMI_RATE_PREAMBLE_OFDM
);
4375 rate_code
[rate_idx
++] =
4376 ATH10K_HW_RATECODE(0, 0, WMI_RATE_PREAMBLE_CCK
);
4377 rate_code
[rate_idx
++] =
4378 ATH10K_HW_RATECODE(0, 0, WMI_RATE_PREAMBLE_OFDM
);
4379 rate_code
[rate_idx
++] =
4380 ATH10K_HW_RATECODE(0, 0, WMI_RATE_PREAMBLE_OFDM
);
4382 pream_table
[pream_idx
] = ATH10K_TPC_PREAM_TABLE_END
;
4384 tpc_stats
->chan_freq
= __le32_to_cpu(ev
->chan_freq
);
4385 tpc_stats
->phy_mode
= __le32_to_cpu(ev
->phy_mode
);
4386 tpc_stats
->ctl
= __le32_to_cpu(ev
->ctl
);
4387 tpc_stats
->reg_domain
= __le32_to_cpu(ev
->reg_domain
);
4388 tpc_stats
->twice_antenna_gain
= a_sle32_to_cpu(ev
->twice_antenna_gain
);
4389 tpc_stats
->twice_antenna_reduction
=
4390 __le32_to_cpu(ev
->twice_antenna_reduction
);
4391 tpc_stats
->power_limit
= __le32_to_cpu(ev
->power_limit
);
4392 tpc_stats
->twice_max_rd_power
= __le32_to_cpu(ev
->twice_max_rd_power
);
4393 tpc_stats
->num_tx_chain
= __le32_to_cpu(ev
->num_tx_chain
);
4394 tpc_stats
->rate_max
= __le32_to_cpu(ev
->rate_max
);
4396 ath10k_tpc_config_disp_tables(ar
, ev
, tpc_stats
,
4397 rate_code
, pream_table
,
4398 WMI_TPC_TABLE_TYPE_CDD
);
4399 ath10k_tpc_config_disp_tables(ar
, ev
, tpc_stats
,
4400 rate_code
, pream_table
,
4401 WMI_TPC_TABLE_TYPE_STBC
);
4402 ath10k_tpc_config_disp_tables(ar
, ev
, tpc_stats
,
4403 rate_code
, pream_table
,
4404 WMI_TPC_TABLE_TYPE_TXBF
);
4406 ath10k_debug_tpc_stats_process(ar
, tpc_stats
);
4408 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
4409 "wmi event tpc config channel %d mode %d ctl %d regd %d gain %d %d limit %d max_power %d tx_chanins %d rates %d\n",
4410 __le32_to_cpu(ev
->chan_freq
),
4411 __le32_to_cpu(ev
->phy_mode
),
4412 __le32_to_cpu(ev
->ctl
),
4413 __le32_to_cpu(ev
->reg_domain
),
4414 a_sle32_to_cpu(ev
->twice_antenna_gain
),
4415 __le32_to_cpu(ev
->twice_antenna_reduction
),
4416 __le32_to_cpu(ev
->power_limit
),
4417 __le32_to_cpu(ev
->twice_max_rd_power
) / 2,
4418 __le32_to_cpu(ev
->num_tx_chain
),
4419 __le32_to_cpu(ev
->rate_max
));
4422 void ath10k_wmi_event_pdev_ftm_intg(struct ath10k
*ar
, struct sk_buff
*skb
)
4424 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_PDEV_FTM_INTG_EVENTID\n");
4427 void ath10k_wmi_event_gtk_offload_status(struct ath10k
*ar
, struct sk_buff
*skb
)
4429 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_GTK_OFFLOAD_STATUS_EVENTID\n");
4432 void ath10k_wmi_event_gtk_rekey_fail(struct ath10k
*ar
, struct sk_buff
*skb
)
4434 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_GTK_REKEY_FAIL_EVENTID\n");
4437 void ath10k_wmi_event_delba_complete(struct ath10k
*ar
, struct sk_buff
*skb
)
4439 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_TX_DELBA_COMPLETE_EVENTID\n");
4442 void ath10k_wmi_event_addba_complete(struct ath10k
*ar
, struct sk_buff
*skb
)
4444 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_TX_ADDBA_COMPLETE_EVENTID\n");
4447 void ath10k_wmi_event_vdev_install_key_complete(struct ath10k
*ar
,
4448 struct sk_buff
*skb
)
4450 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID\n");
4453 void ath10k_wmi_event_inst_rssi_stats(struct ath10k
*ar
, struct sk_buff
*skb
)
4455 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_INST_RSSI_STATS_EVENTID\n");
4458 void ath10k_wmi_event_vdev_standby_req(struct ath10k
*ar
, struct sk_buff
*skb
)
4460 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_VDEV_STANDBY_REQ_EVENTID\n");
4463 void ath10k_wmi_event_vdev_resume_req(struct ath10k
*ar
, struct sk_buff
*skb
)
4465 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "WMI_VDEV_RESUME_REQ_EVENTID\n");
4468 static int ath10k_wmi_alloc_chunk(struct ath10k
*ar
, u32 req_id
,
4469 u32 num_units
, u32 unit_len
)
4473 int idx
= ar
->wmi
.num_mem_chunks
;
4476 if (ar
->wmi
.num_mem_chunks
== ARRAY_SIZE(ar
->wmi
.mem_chunks
))
4479 while (!vaddr
&& num_units
) {
4480 pool_size
= num_units
* round_up(unit_len
, 4);
4484 vaddr
= kzalloc(pool_size
, GFP_KERNEL
| __GFP_NOWARN
);
4492 paddr
= dma_map_single(ar
->dev
, vaddr
, pool_size
, DMA_TO_DEVICE
);
4493 if (dma_mapping_error(ar
->dev
, paddr
)) {
4498 ar
->wmi
.mem_chunks
[idx
].vaddr
= vaddr
;
4499 ar
->wmi
.mem_chunks
[idx
].paddr
= paddr
;
4500 ar
->wmi
.mem_chunks
[idx
].len
= pool_size
;
4501 ar
->wmi
.mem_chunks
[idx
].req_id
= req_id
;
4502 ar
->wmi
.num_mem_chunks
++;
4507 static int ath10k_wmi_alloc_host_mem(struct ath10k
*ar
, u32 req_id
,
4508 u32 num_units
, u32 unit_len
)
4513 ret
= ath10k_wmi_alloc_chunk(ar
, req_id
, num_units
, unit_len
);
4524 ath10k_wmi_is_host_mem_allocated(struct ath10k
*ar
,
4525 const struct wlan_host_mem_req
**mem_reqs
,
4528 u32 req_id
, num_units
, unit_size
, num_unit_info
;
4533 if (ar
->wmi
.num_mem_chunks
!= num_mem_reqs
)
4536 for (i
= 0; i
< num_mem_reqs
; ++i
) {
4537 req_id
= __le32_to_cpu(mem_reqs
[i
]->req_id
);
4538 num_units
= __le32_to_cpu(mem_reqs
[i
]->num_units
);
4539 unit_size
= __le32_to_cpu(mem_reqs
[i
]->unit_size
);
4540 num_unit_info
= __le32_to_cpu(mem_reqs
[i
]->num_unit_info
);
4542 if (num_unit_info
& NUM_UNITS_IS_NUM_ACTIVE_PEERS
) {
4543 if (ar
->num_active_peers
)
4544 num_units
= ar
->num_active_peers
+ 1;
4546 num_units
= ar
->max_num_peers
+ 1;
4547 } else if (num_unit_info
& NUM_UNITS_IS_NUM_PEERS
) {
4548 num_units
= ar
->max_num_peers
+ 1;
4549 } else if (num_unit_info
& NUM_UNITS_IS_NUM_VDEVS
) {
4550 num_units
= ar
->max_num_vdevs
+ 1;
4554 for (j
= 0; j
< ar
->wmi
.num_mem_chunks
; j
++) {
4555 if (ar
->wmi
.mem_chunks
[j
].req_id
== req_id
) {
4556 pool_size
= num_units
* round_up(unit_size
, 4);
4557 if (ar
->wmi
.mem_chunks
[j
].len
== pool_size
) {
4571 ath10k_wmi_main_op_pull_svc_rdy_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
4572 struct wmi_svc_rdy_ev_arg
*arg
)
4574 struct wmi_service_ready_event
*ev
;
4577 if (skb
->len
< sizeof(*ev
))
4580 ev
= (void *)skb
->data
;
4581 skb_pull(skb
, sizeof(*ev
));
4582 arg
->min_tx_power
= ev
->hw_min_tx_power
;
4583 arg
->max_tx_power
= ev
->hw_max_tx_power
;
4584 arg
->ht_cap
= ev
->ht_cap_info
;
4585 arg
->vht_cap
= ev
->vht_cap_info
;
4586 arg
->sw_ver0
= ev
->sw_version
;
4587 arg
->sw_ver1
= ev
->sw_version_1
;
4588 arg
->phy_capab
= ev
->phy_capability
;
4589 arg
->num_rf_chains
= ev
->num_rf_chains
;
4590 arg
->eeprom_rd
= ev
->hal_reg_capabilities
.eeprom_rd
;
4591 arg
->num_mem_reqs
= ev
->num_mem_reqs
;
4592 arg
->service_map
= ev
->wmi_service_bitmap
;
4593 arg
->service_map_len
= sizeof(ev
->wmi_service_bitmap
);
4595 n
= min_t(size_t, __le32_to_cpu(arg
->num_mem_reqs
),
4596 ARRAY_SIZE(arg
->mem_reqs
));
4597 for (i
= 0; i
< n
; i
++)
4598 arg
->mem_reqs
[i
] = &ev
->mem_reqs
[i
];
4601 __le32_to_cpu(arg
->num_mem_reqs
) * sizeof(arg
->mem_reqs
[0]))
4608 ath10k_wmi_10x_op_pull_svc_rdy_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
4609 struct wmi_svc_rdy_ev_arg
*arg
)
4611 struct wmi_10x_service_ready_event
*ev
;
4614 if (skb
->len
< sizeof(*ev
))
4617 ev
= (void *)skb
->data
;
4618 skb_pull(skb
, sizeof(*ev
));
4619 arg
->min_tx_power
= ev
->hw_min_tx_power
;
4620 arg
->max_tx_power
= ev
->hw_max_tx_power
;
4621 arg
->ht_cap
= ev
->ht_cap_info
;
4622 arg
->vht_cap
= ev
->vht_cap_info
;
4623 arg
->sw_ver0
= ev
->sw_version
;
4624 arg
->phy_capab
= ev
->phy_capability
;
4625 arg
->num_rf_chains
= ev
->num_rf_chains
;
4626 arg
->eeprom_rd
= ev
->hal_reg_capabilities
.eeprom_rd
;
4627 arg
->num_mem_reqs
= ev
->num_mem_reqs
;
4628 arg
->service_map
= ev
->wmi_service_bitmap
;
4629 arg
->service_map_len
= sizeof(ev
->wmi_service_bitmap
);
4631 n
= min_t(size_t, __le32_to_cpu(arg
->num_mem_reqs
),
4632 ARRAY_SIZE(arg
->mem_reqs
));
4633 for (i
= 0; i
< n
; i
++)
4634 arg
->mem_reqs
[i
] = &ev
->mem_reqs
[i
];
4637 __le32_to_cpu(arg
->num_mem_reqs
) * sizeof(arg
->mem_reqs
[0]))
4643 static void ath10k_wmi_event_service_ready_work(struct work_struct
*work
)
4645 struct ath10k
*ar
= container_of(work
, struct ath10k
, svc_rdy_work
);
4646 struct sk_buff
*skb
= ar
->svc_rdy_skb
;
4647 struct wmi_svc_rdy_ev_arg arg
= {};
4648 u32 num_units
, req_id
, unit_size
, num_mem_reqs
, num_unit_info
, i
;
4653 ath10k_warn(ar
, "invalid service ready event skb\n");
4657 ret
= ath10k_wmi_pull_svc_rdy(ar
, skb
, &arg
);
4659 ath10k_warn(ar
, "failed to parse service ready: %d\n", ret
);
4663 memset(&ar
->wmi
.svc_map
, 0, sizeof(ar
->wmi
.svc_map
));
4664 ath10k_wmi_map_svc(ar
, arg
.service_map
, ar
->wmi
.svc_map
,
4665 arg
.service_map_len
);
4667 ar
->hw_min_tx_power
= __le32_to_cpu(arg
.min_tx_power
);
4668 ar
->hw_max_tx_power
= __le32_to_cpu(arg
.max_tx_power
);
4669 ar
->ht_cap_info
= __le32_to_cpu(arg
.ht_cap
);
4670 ar
->vht_cap_info
= __le32_to_cpu(arg
.vht_cap
);
4671 ar
->fw_version_major
=
4672 (__le32_to_cpu(arg
.sw_ver0
) & 0xff000000) >> 24;
4673 ar
->fw_version_minor
= (__le32_to_cpu(arg
.sw_ver0
) & 0x00ffffff);
4674 ar
->fw_version_release
=
4675 (__le32_to_cpu(arg
.sw_ver1
) & 0xffff0000) >> 16;
4676 ar
->fw_version_build
= (__le32_to_cpu(arg
.sw_ver1
) & 0x0000ffff);
4677 ar
->phy_capability
= __le32_to_cpu(arg
.phy_capab
);
4678 ar
->num_rf_chains
= __le32_to_cpu(arg
.num_rf_chains
);
4679 ar
->hw_eeprom_rd
= __le32_to_cpu(arg
.eeprom_rd
);
4681 ath10k_dbg_dump(ar
, ATH10K_DBG_WMI
, NULL
, "wmi svc: ",
4682 arg
.service_map
, arg
.service_map_len
);
4684 if (ar
->num_rf_chains
> ar
->max_spatial_stream
) {
4685 ath10k_warn(ar
, "hardware advertises support for more spatial streams than it should (%d > %d)\n",
4686 ar
->num_rf_chains
, ar
->max_spatial_stream
);
4687 ar
->num_rf_chains
= ar
->max_spatial_stream
;
4690 if (!ar
->cfg_tx_chainmask
) {
4691 ar
->cfg_tx_chainmask
= (1 << ar
->num_rf_chains
) - 1;
4692 ar
->cfg_rx_chainmask
= (1 << ar
->num_rf_chains
) - 1;
4695 if (strlen(ar
->hw
->wiphy
->fw_version
) == 0) {
4696 snprintf(ar
->hw
->wiphy
->fw_version
,
4697 sizeof(ar
->hw
->wiphy
->fw_version
),
4699 ar
->fw_version_major
,
4700 ar
->fw_version_minor
,
4701 ar
->fw_version_release
,
4702 ar
->fw_version_build
);
4705 num_mem_reqs
= __le32_to_cpu(arg
.num_mem_reqs
);
4706 if (num_mem_reqs
> WMI_MAX_MEM_REQS
) {
4707 ath10k_warn(ar
, "requested memory chunks number (%d) exceeds the limit\n",
4712 if (test_bit(WMI_SERVICE_PEER_CACHING
, ar
->wmi
.svc_map
)) {
4713 if (test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL
,
4714 ar
->running_fw
->fw_file
.fw_features
))
4715 ar
->num_active_peers
= TARGET_10_4_QCACHE_ACTIVE_PEERS_PFC
+
4718 ar
->num_active_peers
= TARGET_10_4_QCACHE_ACTIVE_PEERS
+
4721 ar
->max_num_peers
= TARGET_10_4_NUM_QCACHE_PEERS_MAX
+
4723 ar
->num_tids
= ar
->num_active_peers
* 2;
4724 ar
->max_num_stations
= TARGET_10_4_NUM_QCACHE_PEERS_MAX
;
4727 /* TODO: Adjust max peer count for cases like WMI_SERVICE_RATECTRL_CACHE
4728 * and WMI_SERVICE_IRAM_TIDS, etc.
4731 allocated
= ath10k_wmi_is_host_mem_allocated(ar
, arg
.mem_reqs
,
4734 goto skip_mem_alloc
;
4736 /* Either this event is received during boot time or there is a change
4737 * in memory requirement from firmware when compared to last request.
4738 * Free any old memory and do a fresh allocation based on the current
4739 * memory requirement.
4741 ath10k_wmi_free_host_mem(ar
);
4743 for (i
= 0; i
< num_mem_reqs
; ++i
) {
4744 req_id
= __le32_to_cpu(arg
.mem_reqs
[i
]->req_id
);
4745 num_units
= __le32_to_cpu(arg
.mem_reqs
[i
]->num_units
);
4746 unit_size
= __le32_to_cpu(arg
.mem_reqs
[i
]->unit_size
);
4747 num_unit_info
= __le32_to_cpu(arg
.mem_reqs
[i
]->num_unit_info
);
4749 if (num_unit_info
& NUM_UNITS_IS_NUM_ACTIVE_PEERS
) {
4750 if (ar
->num_active_peers
)
4751 num_units
= ar
->num_active_peers
+ 1;
4753 num_units
= ar
->max_num_peers
+ 1;
4754 } else if (num_unit_info
& NUM_UNITS_IS_NUM_PEERS
) {
4755 /* number of units to allocate is number of
4756 * peers, 1 extra for self peer on target */
4757 /* this needs to be tied, host and target
4758 * can get out of sync */
4759 num_units
= ar
->max_num_peers
+ 1;
4760 } else if (num_unit_info
& NUM_UNITS_IS_NUM_VDEVS
) {
4761 num_units
= ar
->max_num_vdevs
+ 1;
4764 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
4765 "wmi mem_req_id %d num_units %d num_unit_info %d unit size %d actual units %d\n",
4767 __le32_to_cpu(arg
.mem_reqs
[i
]->num_units
),
4772 ret
= ath10k_wmi_alloc_host_mem(ar
, req_id
, num_units
,
4779 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
4780 "wmi event service ready min_tx_power 0x%08x max_tx_power 0x%08x ht_cap 0x%08x vht_cap 0x%08x sw_ver0 0x%08x sw_ver1 0x%08x fw_build 0x%08x phy_capab 0x%08x num_rf_chains 0x%08x eeprom_rd 0x%08x num_mem_reqs 0x%08x\n",
4781 __le32_to_cpu(arg
.min_tx_power
),
4782 __le32_to_cpu(arg
.max_tx_power
),
4783 __le32_to_cpu(arg
.ht_cap
),
4784 __le32_to_cpu(arg
.vht_cap
),
4785 __le32_to_cpu(arg
.sw_ver0
),
4786 __le32_to_cpu(arg
.sw_ver1
),
4787 __le32_to_cpu(arg
.fw_build
),
4788 __le32_to_cpu(arg
.phy_capab
),
4789 __le32_to_cpu(arg
.num_rf_chains
),
4790 __le32_to_cpu(arg
.eeprom_rd
),
4791 __le32_to_cpu(arg
.num_mem_reqs
));
4794 ar
->svc_rdy_skb
= NULL
;
4795 complete(&ar
->wmi
.service_ready
);
4798 void ath10k_wmi_event_service_ready(struct ath10k
*ar
, struct sk_buff
*skb
)
4800 ar
->svc_rdy_skb
= skb
;
4801 queue_work(ar
->workqueue_aux
, &ar
->svc_rdy_work
);
4804 static int ath10k_wmi_op_pull_rdy_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
4805 struct wmi_rdy_ev_arg
*arg
)
4807 struct wmi_ready_event
*ev
= (void *)skb
->data
;
4809 if (skb
->len
< sizeof(*ev
))
4812 skb_pull(skb
, sizeof(*ev
));
4813 arg
->sw_version
= ev
->sw_version
;
4814 arg
->abi_version
= ev
->abi_version
;
4815 arg
->status
= ev
->status
;
4816 arg
->mac_addr
= ev
->mac_addr
.addr
;
4821 static int ath10k_wmi_op_pull_roam_ev(struct ath10k
*ar
, struct sk_buff
*skb
,
4822 struct wmi_roam_ev_arg
*arg
)
4824 struct wmi_roam_ev
*ev
= (void *)skb
->data
;
4826 if (skb
->len
< sizeof(*ev
))
4829 skb_pull(skb
, sizeof(*ev
));
4830 arg
->vdev_id
= ev
->vdev_id
;
4831 arg
->reason
= ev
->reason
;
4836 static int ath10k_wmi_op_pull_echo_ev(struct ath10k
*ar
,
4837 struct sk_buff
*skb
,
4838 struct wmi_echo_ev_arg
*arg
)
4840 struct wmi_echo_event
*ev
= (void *)skb
->data
;
4842 arg
->value
= ev
->value
;
4847 int ath10k_wmi_event_ready(struct ath10k
*ar
, struct sk_buff
*skb
)
4849 struct wmi_rdy_ev_arg arg
= {};
4852 ret
= ath10k_wmi_pull_rdy(ar
, skb
, &arg
);
4854 ath10k_warn(ar
, "failed to parse ready event: %d\n", ret
);
4858 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
4859 "wmi event ready sw_version %u abi_version %u mac_addr %pM status %d\n",
4860 __le32_to_cpu(arg
.sw_version
),
4861 __le32_to_cpu(arg
.abi_version
),
4863 __le32_to_cpu(arg
.status
));
4865 ether_addr_copy(ar
->mac_addr
, arg
.mac_addr
);
4866 complete(&ar
->wmi
.unified_ready
);
4870 static int ath10k_wmi_event_temperature(struct ath10k
*ar
, struct sk_buff
*skb
)
4872 const struct wmi_pdev_temperature_event
*ev
;
4874 ev
= (struct wmi_pdev_temperature_event
*)skb
->data
;
4875 if (WARN_ON(skb
->len
< sizeof(*ev
)))
4878 ath10k_thermal_event_temperature(ar
, __le32_to_cpu(ev
->temperature
));
4882 static int ath10k_wmi_event_pdev_bss_chan_info(struct ath10k
*ar
,
4883 struct sk_buff
*skb
)
4885 struct wmi_pdev_bss_chan_info_event
*ev
;
4886 struct survey_info
*survey
;
4887 u64 busy
, total
, tx
, rx
, rx_bss
;
4888 u32 freq
, noise_floor
;
4889 u32 cc_freq_hz
= ar
->hw_params
.channel_counters_freq_hz
;
4892 ev
= (struct wmi_pdev_bss_chan_info_event
*)skb
->data
;
4893 if (WARN_ON(skb
->len
< sizeof(*ev
)))
4896 freq
= __le32_to_cpu(ev
->freq
);
4897 noise_floor
= __le32_to_cpu(ev
->noise_floor
);
4898 busy
= __le64_to_cpu(ev
->cycle_busy
);
4899 total
= __le64_to_cpu(ev
->cycle_total
);
4900 tx
= __le64_to_cpu(ev
->cycle_tx
);
4901 rx
= __le64_to_cpu(ev
->cycle_rx
);
4902 rx_bss
= __le64_to_cpu(ev
->cycle_rx_bss
);
4904 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
4905 "wmi event pdev bss chan info:\n freq: %d noise: %d cycle: busy %llu total %llu tx %llu rx %llu rx_bss %llu\n",
4906 freq
, noise_floor
, busy
, total
, tx
, rx
, rx_bss
);
4908 spin_lock_bh(&ar
->data_lock
);
4909 idx
= freq_to_idx(ar
, freq
);
4910 if (idx
>= ARRAY_SIZE(ar
->survey
)) {
4911 ath10k_warn(ar
, "bss chan info: invalid frequency %d (idx %d out of bounds)\n",
4916 survey
= &ar
->survey
[idx
];
4918 survey
->noise
= noise_floor
;
4919 survey
->time
= div_u64(total
, cc_freq_hz
);
4920 survey
->time_busy
= div_u64(busy
, cc_freq_hz
);
4921 survey
->time_rx
= div_u64(rx_bss
, cc_freq_hz
);
4922 survey
->time_tx
= div_u64(tx
, cc_freq_hz
);
4923 survey
->filled
|= (SURVEY_INFO_NOISE_DBM
|
4925 SURVEY_INFO_TIME_BUSY
|
4926 SURVEY_INFO_TIME_RX
|
4927 SURVEY_INFO_TIME_TX
);
4929 spin_unlock_bh(&ar
->data_lock
);
4930 complete(&ar
->bss_survey_done
);
4934 static inline void ath10k_wmi_queue_set_coverage_class_work(struct ath10k
*ar
)
4936 if (ar
->hw_params
.hw_ops
->set_coverage_class
) {
4937 spin_lock_bh(&ar
->data_lock
);
4939 /* This call only ensures that the modified coverage class
4940 * persists in case the firmware sets the registers back to
4941 * their default value. So calling it is only necessary if the
4942 * coverage class has a non-zero value.
4944 if (ar
->fw_coverage
.coverage_class
)
4945 queue_work(ar
->workqueue
, &ar
->set_coverage_class_work
);
4947 spin_unlock_bh(&ar
->data_lock
);
4951 static void ath10k_wmi_op_rx(struct ath10k
*ar
, struct sk_buff
*skb
)
4953 struct wmi_cmd_hdr
*cmd_hdr
;
4954 enum wmi_event_id id
;
4956 cmd_hdr
= (struct wmi_cmd_hdr
*)skb
->data
;
4957 id
= MS(__le32_to_cpu(cmd_hdr
->cmd_id
), WMI_CMD_HDR_CMD_ID
);
4959 if (skb_pull(skb
, sizeof(struct wmi_cmd_hdr
)) == NULL
)
4962 trace_ath10k_wmi_event(ar
, id
, skb
->data
, skb
->len
);
4965 case WMI_MGMT_RX_EVENTID
:
4966 ath10k_wmi_event_mgmt_rx(ar
, skb
);
4967 /* mgmt_rx() owns the skb now! */
4969 case WMI_SCAN_EVENTID
:
4970 ath10k_wmi_event_scan(ar
, skb
);
4971 ath10k_wmi_queue_set_coverage_class_work(ar
);
4973 case WMI_CHAN_INFO_EVENTID
:
4974 ath10k_wmi_event_chan_info(ar
, skb
);
4976 case WMI_ECHO_EVENTID
:
4977 ath10k_wmi_event_echo(ar
, skb
);
4979 case WMI_DEBUG_MESG_EVENTID
:
4980 ath10k_wmi_event_debug_mesg(ar
, skb
);
4981 ath10k_wmi_queue_set_coverage_class_work(ar
);
4983 case WMI_UPDATE_STATS_EVENTID
:
4984 ath10k_wmi_event_update_stats(ar
, skb
);
4986 case WMI_VDEV_START_RESP_EVENTID
:
4987 ath10k_wmi_event_vdev_start_resp(ar
, skb
);
4988 ath10k_wmi_queue_set_coverage_class_work(ar
);
4990 case WMI_VDEV_STOPPED_EVENTID
:
4991 ath10k_wmi_event_vdev_stopped(ar
, skb
);
4992 ath10k_wmi_queue_set_coverage_class_work(ar
);
4994 case WMI_PEER_STA_KICKOUT_EVENTID
:
4995 ath10k_wmi_event_peer_sta_kickout(ar
, skb
);
4997 case WMI_HOST_SWBA_EVENTID
:
4998 ath10k_wmi_event_host_swba(ar
, skb
);
5000 case WMI_TBTTOFFSET_UPDATE_EVENTID
:
5001 ath10k_wmi_event_tbttoffset_update(ar
, skb
);
5003 case WMI_PHYERR_EVENTID
:
5004 ath10k_wmi_event_phyerr(ar
, skb
);
5006 case WMI_ROAM_EVENTID
:
5007 ath10k_wmi_event_roam(ar
, skb
);
5008 ath10k_wmi_queue_set_coverage_class_work(ar
);
5010 case WMI_PROFILE_MATCH
:
5011 ath10k_wmi_event_profile_match(ar
, skb
);
5013 case WMI_DEBUG_PRINT_EVENTID
:
5014 ath10k_wmi_event_debug_print(ar
, skb
);
5015 ath10k_wmi_queue_set_coverage_class_work(ar
);
5017 case WMI_PDEV_QVIT_EVENTID
:
5018 ath10k_wmi_event_pdev_qvit(ar
, skb
);
5020 case WMI_WLAN_PROFILE_DATA_EVENTID
:
5021 ath10k_wmi_event_wlan_profile_data(ar
, skb
);
5023 case WMI_RTT_MEASUREMENT_REPORT_EVENTID
:
5024 ath10k_wmi_event_rtt_measurement_report(ar
, skb
);
5026 case WMI_TSF_MEASUREMENT_REPORT_EVENTID
:
5027 ath10k_wmi_event_tsf_measurement_report(ar
, skb
);
5029 case WMI_RTT_ERROR_REPORT_EVENTID
:
5030 ath10k_wmi_event_rtt_error_report(ar
, skb
);
5032 case WMI_WOW_WAKEUP_HOST_EVENTID
:
5033 ath10k_wmi_event_wow_wakeup_host(ar
, skb
);
5035 case WMI_DCS_INTERFERENCE_EVENTID
:
5036 ath10k_wmi_event_dcs_interference(ar
, skb
);
5038 case WMI_PDEV_TPC_CONFIG_EVENTID
:
5039 ath10k_wmi_event_pdev_tpc_config(ar
, skb
);
5041 case WMI_PDEV_FTM_INTG_EVENTID
:
5042 ath10k_wmi_event_pdev_ftm_intg(ar
, skb
);
5044 case WMI_GTK_OFFLOAD_STATUS_EVENTID
:
5045 ath10k_wmi_event_gtk_offload_status(ar
, skb
);
5047 case WMI_GTK_REKEY_FAIL_EVENTID
:
5048 ath10k_wmi_event_gtk_rekey_fail(ar
, skb
);
5050 case WMI_TX_DELBA_COMPLETE_EVENTID
:
5051 ath10k_wmi_event_delba_complete(ar
, skb
);
5053 case WMI_TX_ADDBA_COMPLETE_EVENTID
:
5054 ath10k_wmi_event_addba_complete(ar
, skb
);
5056 case WMI_VDEV_INSTALL_KEY_COMPLETE_EVENTID
:
5057 ath10k_wmi_event_vdev_install_key_complete(ar
, skb
);
5059 case WMI_SERVICE_READY_EVENTID
:
5060 ath10k_wmi_event_service_ready(ar
, skb
);
5062 case WMI_READY_EVENTID
:
5063 ath10k_wmi_event_ready(ar
, skb
);
5064 ath10k_wmi_queue_set_coverage_class_work(ar
);
5067 ath10k_warn(ar
, "Unknown eventid: %d\n", id
);
5075 static void ath10k_wmi_10_1_op_rx(struct ath10k
*ar
, struct sk_buff
*skb
)
5077 struct wmi_cmd_hdr
*cmd_hdr
;
5078 enum wmi_10x_event_id id
;
5081 cmd_hdr
= (struct wmi_cmd_hdr
*)skb
->data
;
5082 id
= MS(__le32_to_cpu(cmd_hdr
->cmd_id
), WMI_CMD_HDR_CMD_ID
);
5084 if (skb_pull(skb
, sizeof(struct wmi_cmd_hdr
)) == NULL
)
5087 trace_ath10k_wmi_event(ar
, id
, skb
->data
, skb
->len
);
5089 consumed
= ath10k_tm_event_wmi(ar
, id
, skb
);
5091 /* Ready event must be handled normally also in UTF mode so that we
5092 * know the UTF firmware has booted, others we are just bypass WMI
5093 * events to testmode.
5095 if (consumed
&& id
!= WMI_10X_READY_EVENTID
) {
5096 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
5097 "wmi testmode consumed 0x%x\n", id
);
5102 case WMI_10X_MGMT_RX_EVENTID
:
5103 ath10k_wmi_event_mgmt_rx(ar
, skb
);
5104 /* mgmt_rx() owns the skb now! */
5106 case WMI_10X_SCAN_EVENTID
:
5107 ath10k_wmi_event_scan(ar
, skb
);
5108 ath10k_wmi_queue_set_coverage_class_work(ar
);
5110 case WMI_10X_CHAN_INFO_EVENTID
:
5111 ath10k_wmi_event_chan_info(ar
, skb
);
5113 case WMI_10X_ECHO_EVENTID
:
5114 ath10k_wmi_event_echo(ar
, skb
);
5116 case WMI_10X_DEBUG_MESG_EVENTID
:
5117 ath10k_wmi_event_debug_mesg(ar
, skb
);
5118 ath10k_wmi_queue_set_coverage_class_work(ar
);
5120 case WMI_10X_UPDATE_STATS_EVENTID
:
5121 ath10k_wmi_event_update_stats(ar
, skb
);
5123 case WMI_10X_VDEV_START_RESP_EVENTID
:
5124 ath10k_wmi_event_vdev_start_resp(ar
, skb
);
5125 ath10k_wmi_queue_set_coverage_class_work(ar
);
5127 case WMI_10X_VDEV_STOPPED_EVENTID
:
5128 ath10k_wmi_event_vdev_stopped(ar
, skb
);
5129 ath10k_wmi_queue_set_coverage_class_work(ar
);
5131 case WMI_10X_PEER_STA_KICKOUT_EVENTID
:
5132 ath10k_wmi_event_peer_sta_kickout(ar
, skb
);
5134 case WMI_10X_HOST_SWBA_EVENTID
:
5135 ath10k_wmi_event_host_swba(ar
, skb
);
5137 case WMI_10X_TBTTOFFSET_UPDATE_EVENTID
:
5138 ath10k_wmi_event_tbttoffset_update(ar
, skb
);
5140 case WMI_10X_PHYERR_EVENTID
:
5141 ath10k_wmi_event_phyerr(ar
, skb
);
5143 case WMI_10X_ROAM_EVENTID
:
5144 ath10k_wmi_event_roam(ar
, skb
);
5145 ath10k_wmi_queue_set_coverage_class_work(ar
);
5147 case WMI_10X_PROFILE_MATCH
:
5148 ath10k_wmi_event_profile_match(ar
, skb
);
5150 case WMI_10X_DEBUG_PRINT_EVENTID
:
5151 ath10k_wmi_event_debug_print(ar
, skb
);
5152 ath10k_wmi_queue_set_coverage_class_work(ar
);
5154 case WMI_10X_PDEV_QVIT_EVENTID
:
5155 ath10k_wmi_event_pdev_qvit(ar
, skb
);
5157 case WMI_10X_WLAN_PROFILE_DATA_EVENTID
:
5158 ath10k_wmi_event_wlan_profile_data(ar
, skb
);
5160 case WMI_10X_RTT_MEASUREMENT_REPORT_EVENTID
:
5161 ath10k_wmi_event_rtt_measurement_report(ar
, skb
);
5163 case WMI_10X_TSF_MEASUREMENT_REPORT_EVENTID
:
5164 ath10k_wmi_event_tsf_measurement_report(ar
, skb
);
5166 case WMI_10X_RTT_ERROR_REPORT_EVENTID
:
5167 ath10k_wmi_event_rtt_error_report(ar
, skb
);
5169 case WMI_10X_WOW_WAKEUP_HOST_EVENTID
:
5170 ath10k_wmi_event_wow_wakeup_host(ar
, skb
);
5172 case WMI_10X_DCS_INTERFERENCE_EVENTID
:
5173 ath10k_wmi_event_dcs_interference(ar
, skb
);
5175 case WMI_10X_PDEV_TPC_CONFIG_EVENTID
:
5176 ath10k_wmi_event_pdev_tpc_config(ar
, skb
);
5178 case WMI_10X_INST_RSSI_STATS_EVENTID
:
5179 ath10k_wmi_event_inst_rssi_stats(ar
, skb
);
5181 case WMI_10X_VDEV_STANDBY_REQ_EVENTID
:
5182 ath10k_wmi_event_vdev_standby_req(ar
, skb
);
5184 case WMI_10X_VDEV_RESUME_REQ_EVENTID
:
5185 ath10k_wmi_event_vdev_resume_req(ar
, skb
);
5187 case WMI_10X_SERVICE_READY_EVENTID
:
5188 ath10k_wmi_event_service_ready(ar
, skb
);
5190 case WMI_10X_READY_EVENTID
:
5191 ath10k_wmi_event_ready(ar
, skb
);
5192 ath10k_wmi_queue_set_coverage_class_work(ar
);
5194 case WMI_10X_PDEV_UTF_EVENTID
:
5195 /* ignore utf events */
5198 ath10k_warn(ar
, "Unknown eventid: %d\n", id
);
5206 static void ath10k_wmi_10_2_op_rx(struct ath10k
*ar
, struct sk_buff
*skb
)
5208 struct wmi_cmd_hdr
*cmd_hdr
;
5209 enum wmi_10_2_event_id id
;
5212 cmd_hdr
= (struct wmi_cmd_hdr
*)skb
->data
;
5213 id
= MS(__le32_to_cpu(cmd_hdr
->cmd_id
), WMI_CMD_HDR_CMD_ID
);
5215 if (skb_pull(skb
, sizeof(struct wmi_cmd_hdr
)) == NULL
)
5218 trace_ath10k_wmi_event(ar
, id
, skb
->data
, skb
->len
);
5220 consumed
= ath10k_tm_event_wmi(ar
, id
, skb
);
5222 /* Ready event must be handled normally also in UTF mode so that we
5223 * know the UTF firmware has booted, others we are just bypass WMI
5224 * events to testmode.
5226 if (consumed
&& id
!= WMI_10_2_READY_EVENTID
) {
5227 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
5228 "wmi testmode consumed 0x%x\n", id
);
5233 case WMI_10_2_MGMT_RX_EVENTID
:
5234 ath10k_wmi_event_mgmt_rx(ar
, skb
);
5235 /* mgmt_rx() owns the skb now! */
5237 case WMI_10_2_SCAN_EVENTID
:
5238 ath10k_wmi_event_scan(ar
, skb
);
5239 ath10k_wmi_queue_set_coverage_class_work(ar
);
5241 case WMI_10_2_CHAN_INFO_EVENTID
:
5242 ath10k_wmi_event_chan_info(ar
, skb
);
5244 case WMI_10_2_ECHO_EVENTID
:
5245 ath10k_wmi_event_echo(ar
, skb
);
5247 case WMI_10_2_DEBUG_MESG_EVENTID
:
5248 ath10k_wmi_event_debug_mesg(ar
, skb
);
5249 ath10k_wmi_queue_set_coverage_class_work(ar
);
5251 case WMI_10_2_UPDATE_STATS_EVENTID
:
5252 ath10k_wmi_event_update_stats(ar
, skb
);
5254 case WMI_10_2_VDEV_START_RESP_EVENTID
:
5255 ath10k_wmi_event_vdev_start_resp(ar
, skb
);
5256 ath10k_wmi_queue_set_coverage_class_work(ar
);
5258 case WMI_10_2_VDEV_STOPPED_EVENTID
:
5259 ath10k_wmi_event_vdev_stopped(ar
, skb
);
5260 ath10k_wmi_queue_set_coverage_class_work(ar
);
5262 case WMI_10_2_PEER_STA_KICKOUT_EVENTID
:
5263 ath10k_wmi_event_peer_sta_kickout(ar
, skb
);
5265 case WMI_10_2_HOST_SWBA_EVENTID
:
5266 ath10k_wmi_event_host_swba(ar
, skb
);
5268 case WMI_10_2_TBTTOFFSET_UPDATE_EVENTID
:
5269 ath10k_wmi_event_tbttoffset_update(ar
, skb
);
5271 case WMI_10_2_PHYERR_EVENTID
:
5272 ath10k_wmi_event_phyerr(ar
, skb
);
5274 case WMI_10_2_ROAM_EVENTID
:
5275 ath10k_wmi_event_roam(ar
, skb
);
5276 ath10k_wmi_queue_set_coverage_class_work(ar
);
5278 case WMI_10_2_PROFILE_MATCH
:
5279 ath10k_wmi_event_profile_match(ar
, skb
);
5281 case WMI_10_2_DEBUG_PRINT_EVENTID
:
5282 ath10k_wmi_event_debug_print(ar
, skb
);
5283 ath10k_wmi_queue_set_coverage_class_work(ar
);
5285 case WMI_10_2_PDEV_QVIT_EVENTID
:
5286 ath10k_wmi_event_pdev_qvit(ar
, skb
);
5288 case WMI_10_2_WLAN_PROFILE_DATA_EVENTID
:
5289 ath10k_wmi_event_wlan_profile_data(ar
, skb
);
5291 case WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID
:
5292 ath10k_wmi_event_rtt_measurement_report(ar
, skb
);
5294 case WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID
:
5295 ath10k_wmi_event_tsf_measurement_report(ar
, skb
);
5297 case WMI_10_2_RTT_ERROR_REPORT_EVENTID
:
5298 ath10k_wmi_event_rtt_error_report(ar
, skb
);
5300 case WMI_10_2_WOW_WAKEUP_HOST_EVENTID
:
5301 ath10k_wmi_event_wow_wakeup_host(ar
, skb
);
5303 case WMI_10_2_DCS_INTERFERENCE_EVENTID
:
5304 ath10k_wmi_event_dcs_interference(ar
, skb
);
5306 case WMI_10_2_PDEV_TPC_CONFIG_EVENTID
:
5307 ath10k_wmi_event_pdev_tpc_config(ar
, skb
);
5309 case WMI_10_2_INST_RSSI_STATS_EVENTID
:
5310 ath10k_wmi_event_inst_rssi_stats(ar
, skb
);
5312 case WMI_10_2_VDEV_STANDBY_REQ_EVENTID
:
5313 ath10k_wmi_event_vdev_standby_req(ar
, skb
);
5314 ath10k_wmi_queue_set_coverage_class_work(ar
);
5316 case WMI_10_2_VDEV_RESUME_REQ_EVENTID
:
5317 ath10k_wmi_event_vdev_resume_req(ar
, skb
);
5318 ath10k_wmi_queue_set_coverage_class_work(ar
);
5320 case WMI_10_2_SERVICE_READY_EVENTID
:
5321 ath10k_wmi_event_service_ready(ar
, skb
);
5323 case WMI_10_2_READY_EVENTID
:
5324 ath10k_wmi_event_ready(ar
, skb
);
5325 ath10k_wmi_queue_set_coverage_class_work(ar
);
5327 case WMI_10_2_PDEV_TEMPERATURE_EVENTID
:
5328 ath10k_wmi_event_temperature(ar
, skb
);
5330 case WMI_10_2_PDEV_BSS_CHAN_INFO_EVENTID
:
5331 ath10k_wmi_event_pdev_bss_chan_info(ar
, skb
);
5333 case WMI_10_2_RTT_KEEPALIVE_EVENTID
:
5334 case WMI_10_2_GPIO_INPUT_EVENTID
:
5335 case WMI_10_2_PEER_RATECODE_LIST_EVENTID
:
5336 case WMI_10_2_GENERIC_BUFFER_EVENTID
:
5337 case WMI_10_2_MCAST_BUF_RELEASE_EVENTID
:
5338 case WMI_10_2_MCAST_LIST_AGEOUT_EVENTID
:
5339 case WMI_10_2_WDS_PEER_EVENTID
:
5340 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
5341 "received event id %d not implemented\n", id
);
5344 ath10k_warn(ar
, "Unknown eventid: %d\n", id
);
5352 static void ath10k_wmi_10_4_op_rx(struct ath10k
*ar
, struct sk_buff
*skb
)
5354 struct wmi_cmd_hdr
*cmd_hdr
;
5355 enum wmi_10_4_event_id id
;
5358 cmd_hdr
= (struct wmi_cmd_hdr
*)skb
->data
;
5359 id
= MS(__le32_to_cpu(cmd_hdr
->cmd_id
), WMI_CMD_HDR_CMD_ID
);
5361 if (!skb_pull(skb
, sizeof(struct wmi_cmd_hdr
)))
5364 trace_ath10k_wmi_event(ar
, id
, skb
->data
, skb
->len
);
5366 consumed
= ath10k_tm_event_wmi(ar
, id
, skb
);
5368 /* Ready event must be handled normally also in UTF mode so that we
5369 * know the UTF firmware has booted, others we are just bypass WMI
5370 * events to testmode.
5372 if (consumed
&& id
!= WMI_10_4_READY_EVENTID
) {
5373 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
5374 "wmi testmode consumed 0x%x\n", id
);
5379 case WMI_10_4_MGMT_RX_EVENTID
:
5380 ath10k_wmi_event_mgmt_rx(ar
, skb
);
5381 /* mgmt_rx() owns the skb now! */
5383 case WMI_10_4_ECHO_EVENTID
:
5384 ath10k_wmi_event_echo(ar
, skb
);
5386 case WMI_10_4_DEBUG_MESG_EVENTID
:
5387 ath10k_wmi_event_debug_mesg(ar
, skb
);
5388 ath10k_wmi_queue_set_coverage_class_work(ar
);
5390 case WMI_10_4_SERVICE_READY_EVENTID
:
5391 ath10k_wmi_event_service_ready(ar
, skb
);
5393 case WMI_10_4_SCAN_EVENTID
:
5394 ath10k_wmi_event_scan(ar
, skb
);
5395 ath10k_wmi_queue_set_coverage_class_work(ar
);
5397 case WMI_10_4_CHAN_INFO_EVENTID
:
5398 ath10k_wmi_event_chan_info(ar
, skb
);
5400 case WMI_10_4_PHYERR_EVENTID
:
5401 ath10k_wmi_event_phyerr(ar
, skb
);
5403 case WMI_10_4_READY_EVENTID
:
5404 ath10k_wmi_event_ready(ar
, skb
);
5405 ath10k_wmi_queue_set_coverage_class_work(ar
);
5407 case WMI_10_4_PEER_STA_KICKOUT_EVENTID
:
5408 ath10k_wmi_event_peer_sta_kickout(ar
, skb
);
5410 case WMI_10_4_ROAM_EVENTID
:
5411 ath10k_wmi_event_roam(ar
, skb
);
5412 ath10k_wmi_queue_set_coverage_class_work(ar
);
5414 case WMI_10_4_HOST_SWBA_EVENTID
:
5415 ath10k_wmi_event_host_swba(ar
, skb
);
5417 case WMI_10_4_TBTTOFFSET_UPDATE_EVENTID
:
5418 ath10k_wmi_event_tbttoffset_update(ar
, skb
);
5420 case WMI_10_4_DEBUG_PRINT_EVENTID
:
5421 ath10k_wmi_event_debug_print(ar
, skb
);
5422 ath10k_wmi_queue_set_coverage_class_work(ar
);
5424 case WMI_10_4_VDEV_START_RESP_EVENTID
:
5425 ath10k_wmi_event_vdev_start_resp(ar
, skb
);
5426 ath10k_wmi_queue_set_coverage_class_work(ar
);
5428 case WMI_10_4_VDEV_STOPPED_EVENTID
:
5429 ath10k_wmi_event_vdev_stopped(ar
, skb
);
5430 ath10k_wmi_queue_set_coverage_class_work(ar
);
5432 case WMI_10_4_WOW_WAKEUP_HOST_EVENTID
:
5433 case WMI_10_4_PEER_RATECODE_LIST_EVENTID
:
5434 case WMI_10_4_WDS_PEER_EVENTID
:
5435 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
5436 "received event id %d not implemented\n", id
);
5438 case WMI_10_4_UPDATE_STATS_EVENTID
:
5439 ath10k_wmi_event_update_stats(ar
, skb
);
5441 case WMI_10_4_PDEV_TEMPERATURE_EVENTID
:
5442 ath10k_wmi_event_temperature(ar
, skb
);
5444 case WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID
:
5445 ath10k_wmi_event_pdev_bss_chan_info(ar
, skb
);
5447 case WMI_10_4_PDEV_TPC_CONFIG_EVENTID
:
5448 ath10k_wmi_event_pdev_tpc_config(ar
, skb
);
5451 ath10k_warn(ar
, "Unknown eventid: %d\n", id
);
5459 static void ath10k_wmi_process_rx(struct ath10k
*ar
, struct sk_buff
*skb
)
5463 ret
= ath10k_wmi_rx(ar
, skb
);
5465 ath10k_warn(ar
, "failed to process wmi rx: %d\n", ret
);
5468 int ath10k_wmi_connect(struct ath10k
*ar
)
5471 struct ath10k_htc_svc_conn_req conn_req
;
5472 struct ath10k_htc_svc_conn_resp conn_resp
;
5474 memset(&conn_req
, 0, sizeof(conn_req
));
5475 memset(&conn_resp
, 0, sizeof(conn_resp
));
5477 /* these fields are the same for all service endpoints */
5478 conn_req
.ep_ops
.ep_tx_complete
= ath10k_wmi_htc_tx_complete
;
5479 conn_req
.ep_ops
.ep_rx_complete
= ath10k_wmi_process_rx
;
5480 conn_req
.ep_ops
.ep_tx_credits
= ath10k_wmi_op_ep_tx_credits
;
5482 /* connect to control service */
5483 conn_req
.service_id
= ATH10K_HTC_SVC_ID_WMI_CONTROL
;
5485 status
= ath10k_htc_connect_service(&ar
->htc
, &conn_req
, &conn_resp
);
5487 ath10k_warn(ar
, "failed to connect to WMI CONTROL service status: %d\n",
5492 ar
->wmi
.eid
= conn_resp
.eid
;
5496 static struct sk_buff
*
5497 ath10k_wmi_op_gen_pdev_set_rd(struct ath10k
*ar
, u16 rd
, u16 rd2g
, u16 rd5g
,
5498 u16 ctl2g
, u16 ctl5g
,
5499 enum wmi_dfs_region dfs_reg
)
5501 struct wmi_pdev_set_regdomain_cmd
*cmd
;
5502 struct sk_buff
*skb
;
5504 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
5506 return ERR_PTR(-ENOMEM
);
5508 cmd
= (struct wmi_pdev_set_regdomain_cmd
*)skb
->data
;
5509 cmd
->reg_domain
= __cpu_to_le32(rd
);
5510 cmd
->reg_domain_2G
= __cpu_to_le32(rd2g
);
5511 cmd
->reg_domain_5G
= __cpu_to_le32(rd5g
);
5512 cmd
->conformance_test_limit_2G
= __cpu_to_le32(ctl2g
);
5513 cmd
->conformance_test_limit_5G
= __cpu_to_le32(ctl5g
);
5515 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
5516 "wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x\n",
5517 rd
, rd2g
, rd5g
, ctl2g
, ctl5g
);
5521 static struct sk_buff
*
5522 ath10k_wmi_10x_op_gen_pdev_set_rd(struct ath10k
*ar
, u16 rd
, u16 rd2g
, u16
5523 rd5g
, u16 ctl2g
, u16 ctl5g
,
5524 enum wmi_dfs_region dfs_reg
)
5526 struct wmi_pdev_set_regdomain_cmd_10x
*cmd
;
5527 struct sk_buff
*skb
;
5529 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
5531 return ERR_PTR(-ENOMEM
);
5533 cmd
= (struct wmi_pdev_set_regdomain_cmd_10x
*)skb
->data
;
5534 cmd
->reg_domain
= __cpu_to_le32(rd
);
5535 cmd
->reg_domain_2G
= __cpu_to_le32(rd2g
);
5536 cmd
->reg_domain_5G
= __cpu_to_le32(rd5g
);
5537 cmd
->conformance_test_limit_2G
= __cpu_to_le32(ctl2g
);
5538 cmd
->conformance_test_limit_5G
= __cpu_to_le32(ctl5g
);
5539 cmd
->dfs_domain
= __cpu_to_le32(dfs_reg
);
5541 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
5542 "wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x dfs_region %x\n",
5543 rd
, rd2g
, rd5g
, ctl2g
, ctl5g
, dfs_reg
);
5547 static struct sk_buff
*
5548 ath10k_wmi_op_gen_pdev_suspend(struct ath10k
*ar
, u32 suspend_opt
)
5550 struct wmi_pdev_suspend_cmd
*cmd
;
5551 struct sk_buff
*skb
;
5553 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
5555 return ERR_PTR(-ENOMEM
);
5557 cmd
= (struct wmi_pdev_suspend_cmd
*)skb
->data
;
5558 cmd
->suspend_opt
= __cpu_to_le32(suspend_opt
);
5563 static struct sk_buff
*
5564 ath10k_wmi_op_gen_pdev_resume(struct ath10k
*ar
)
5566 struct sk_buff
*skb
;
5568 skb
= ath10k_wmi_alloc_skb(ar
, 0);
5570 return ERR_PTR(-ENOMEM
);
5575 static struct sk_buff
*
5576 ath10k_wmi_op_gen_pdev_set_param(struct ath10k
*ar
, u32 id
, u32 value
)
5578 struct wmi_pdev_set_param_cmd
*cmd
;
5579 struct sk_buff
*skb
;
5581 if (id
== WMI_PDEV_PARAM_UNSUPPORTED
) {
5582 ath10k_warn(ar
, "pdev param %d not supported by firmware\n",
5584 return ERR_PTR(-EOPNOTSUPP
);
5587 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
5589 return ERR_PTR(-ENOMEM
);
5591 cmd
= (struct wmi_pdev_set_param_cmd
*)skb
->data
;
5592 cmd
->param_id
= __cpu_to_le32(id
);
5593 cmd
->param_value
= __cpu_to_le32(value
);
5595 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi pdev set param %d value %d\n",
5600 void ath10k_wmi_put_host_mem_chunks(struct ath10k
*ar
,
5601 struct wmi_host_mem_chunks
*chunks
)
5603 struct host_memory_chunk
*chunk
;
5606 chunks
->count
= __cpu_to_le32(ar
->wmi
.num_mem_chunks
);
5608 for (i
= 0; i
< ar
->wmi
.num_mem_chunks
; i
++) {
5609 chunk
= &chunks
->items
[i
];
5610 chunk
->ptr
= __cpu_to_le32(ar
->wmi
.mem_chunks
[i
].paddr
);
5611 chunk
->size
= __cpu_to_le32(ar
->wmi
.mem_chunks
[i
].len
);
5612 chunk
->req_id
= __cpu_to_le32(ar
->wmi
.mem_chunks
[i
].req_id
);
5614 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
5615 "wmi chunk %d len %d requested, addr 0x%llx\n",
5617 ar
->wmi
.mem_chunks
[i
].len
,
5618 (unsigned long long)ar
->wmi
.mem_chunks
[i
].paddr
);
5622 static struct sk_buff
*ath10k_wmi_op_gen_init(struct ath10k
*ar
)
5624 struct wmi_init_cmd
*cmd
;
5625 struct sk_buff
*buf
;
5626 struct wmi_resource_config config
= {};
5629 config
.num_vdevs
= __cpu_to_le32(TARGET_NUM_VDEVS
);
5630 config
.num_peers
= __cpu_to_le32(TARGET_NUM_PEERS
);
5631 config
.num_offload_peers
= __cpu_to_le32(TARGET_NUM_OFFLOAD_PEERS
);
5633 config
.num_offload_reorder_bufs
=
5634 __cpu_to_le32(TARGET_NUM_OFFLOAD_REORDER_BUFS
);
5636 config
.num_peer_keys
= __cpu_to_le32(TARGET_NUM_PEER_KEYS
);
5637 config
.num_tids
= __cpu_to_le32(TARGET_NUM_TIDS
);
5638 config
.ast_skid_limit
= __cpu_to_le32(TARGET_AST_SKID_LIMIT
);
5639 config
.tx_chain_mask
= __cpu_to_le32(TARGET_TX_CHAIN_MASK
);
5640 config
.rx_chain_mask
= __cpu_to_le32(TARGET_RX_CHAIN_MASK
);
5641 config
.rx_timeout_pri_vo
= __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI
);
5642 config
.rx_timeout_pri_vi
= __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI
);
5643 config
.rx_timeout_pri_be
= __cpu_to_le32(TARGET_RX_TIMEOUT_LO_PRI
);
5644 config
.rx_timeout_pri_bk
= __cpu_to_le32(TARGET_RX_TIMEOUT_HI_PRI
);
5645 config
.rx_decap_mode
= __cpu_to_le32(ar
->wmi
.rx_decap_mode
);
5646 config
.scan_max_pending_reqs
=
5647 __cpu_to_le32(TARGET_SCAN_MAX_PENDING_REQS
);
5649 config
.bmiss_offload_max_vdev
=
5650 __cpu_to_le32(TARGET_BMISS_OFFLOAD_MAX_VDEV
);
5652 config
.roam_offload_max_vdev
=
5653 __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_VDEV
);
5655 config
.roam_offload_max_ap_profiles
=
5656 __cpu_to_le32(TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES
);
5658 config
.num_mcast_groups
= __cpu_to_le32(TARGET_NUM_MCAST_GROUPS
);
5659 config
.num_mcast_table_elems
=
5660 __cpu_to_le32(TARGET_NUM_MCAST_TABLE_ELEMS
);
5662 config
.mcast2ucast_mode
= __cpu_to_le32(TARGET_MCAST2UCAST_MODE
);
5663 config
.tx_dbg_log_size
= __cpu_to_le32(TARGET_TX_DBG_LOG_SIZE
);
5664 config
.num_wds_entries
= __cpu_to_le32(TARGET_NUM_WDS_ENTRIES
);
5665 config
.dma_burst_size
= __cpu_to_le32(TARGET_DMA_BURST_SIZE
);
5666 config
.mac_aggr_delim
= __cpu_to_le32(TARGET_MAC_AGGR_DELIM
);
5668 val
= TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK
;
5669 config
.rx_skip_defrag_timeout_dup_detection_check
= __cpu_to_le32(val
);
5671 config
.vow_config
= __cpu_to_le32(TARGET_VOW_CONFIG
);
5673 config
.gtk_offload_max_vdev
=
5674 __cpu_to_le32(TARGET_GTK_OFFLOAD_MAX_VDEV
);
5676 config
.num_msdu_desc
= __cpu_to_le32(TARGET_NUM_MSDU_DESC
);
5677 config
.max_frag_entries
= __cpu_to_le32(TARGET_MAX_FRAG_ENTRIES
);
5679 len
= sizeof(*cmd
) +
5680 (sizeof(struct host_memory_chunk
) * ar
->wmi
.num_mem_chunks
);
5682 buf
= ath10k_wmi_alloc_skb(ar
, len
);
5684 return ERR_PTR(-ENOMEM
);
5686 cmd
= (struct wmi_init_cmd
*)buf
->data
;
5688 memcpy(&cmd
->resource_config
, &config
, sizeof(config
));
5689 ath10k_wmi_put_host_mem_chunks(ar
, &cmd
->mem_chunks
);
5691 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi init\n");
5695 static struct sk_buff
*ath10k_wmi_10_1_op_gen_init(struct ath10k
*ar
)
5697 struct wmi_init_cmd_10x
*cmd
;
5698 struct sk_buff
*buf
;
5699 struct wmi_resource_config_10x config
= {};
5702 config
.num_vdevs
= __cpu_to_le32(TARGET_10X_NUM_VDEVS
);
5703 config
.num_peers
= __cpu_to_le32(TARGET_10X_NUM_PEERS
);
5704 config
.num_peer_keys
= __cpu_to_le32(TARGET_10X_NUM_PEER_KEYS
);
5705 config
.num_tids
= __cpu_to_le32(TARGET_10X_NUM_TIDS
);
5706 config
.ast_skid_limit
= __cpu_to_le32(TARGET_10X_AST_SKID_LIMIT
);
5707 config
.tx_chain_mask
= __cpu_to_le32(TARGET_10X_TX_CHAIN_MASK
);
5708 config
.rx_chain_mask
= __cpu_to_le32(TARGET_10X_RX_CHAIN_MASK
);
5709 config
.rx_timeout_pri_vo
= __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI
);
5710 config
.rx_timeout_pri_vi
= __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI
);
5711 config
.rx_timeout_pri_be
= __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI
);
5712 config
.rx_timeout_pri_bk
= __cpu_to_le32(TARGET_10X_RX_TIMEOUT_HI_PRI
);
5713 config
.rx_decap_mode
= __cpu_to_le32(ar
->wmi
.rx_decap_mode
);
5714 config
.scan_max_pending_reqs
=
5715 __cpu_to_le32(TARGET_10X_SCAN_MAX_PENDING_REQS
);
5717 config
.bmiss_offload_max_vdev
=
5718 __cpu_to_le32(TARGET_10X_BMISS_OFFLOAD_MAX_VDEV
);
5720 config
.roam_offload_max_vdev
=
5721 __cpu_to_le32(TARGET_10X_ROAM_OFFLOAD_MAX_VDEV
);
5723 config
.roam_offload_max_ap_profiles
=
5724 __cpu_to_le32(TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES
);
5726 config
.num_mcast_groups
= __cpu_to_le32(TARGET_10X_NUM_MCAST_GROUPS
);
5727 config
.num_mcast_table_elems
=
5728 __cpu_to_le32(TARGET_10X_NUM_MCAST_TABLE_ELEMS
);
5730 config
.mcast2ucast_mode
= __cpu_to_le32(TARGET_10X_MCAST2UCAST_MODE
);
5731 config
.tx_dbg_log_size
= __cpu_to_le32(TARGET_10X_TX_DBG_LOG_SIZE
);
5732 config
.num_wds_entries
= __cpu_to_le32(TARGET_10X_NUM_WDS_ENTRIES
);
5733 config
.dma_burst_size
= __cpu_to_le32(TARGET_10X_DMA_BURST_SIZE
);
5734 config
.mac_aggr_delim
= __cpu_to_le32(TARGET_10X_MAC_AGGR_DELIM
);
5736 val
= TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK
;
5737 config
.rx_skip_defrag_timeout_dup_detection_check
= __cpu_to_le32(val
);
5739 config
.vow_config
= __cpu_to_le32(TARGET_10X_VOW_CONFIG
);
5741 config
.num_msdu_desc
= __cpu_to_le32(TARGET_10X_NUM_MSDU_DESC
);
5742 config
.max_frag_entries
= __cpu_to_le32(TARGET_10X_MAX_FRAG_ENTRIES
);
5744 len
= sizeof(*cmd
) +
5745 (sizeof(struct host_memory_chunk
) * ar
->wmi
.num_mem_chunks
);
5747 buf
= ath10k_wmi_alloc_skb(ar
, len
);
5749 return ERR_PTR(-ENOMEM
);
5751 cmd
= (struct wmi_init_cmd_10x
*)buf
->data
;
5753 memcpy(&cmd
->resource_config
, &config
, sizeof(config
));
5754 ath10k_wmi_put_host_mem_chunks(ar
, &cmd
->mem_chunks
);
5756 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi init 10x\n");
5760 static struct sk_buff
*ath10k_wmi_10_2_op_gen_init(struct ath10k
*ar
)
5762 struct wmi_init_cmd_10_2
*cmd
;
5763 struct sk_buff
*buf
;
5764 struct wmi_resource_config_10x config
= {};
5765 u32 len
, val
, features
;
5767 config
.num_vdevs
= __cpu_to_le32(TARGET_10X_NUM_VDEVS
);
5768 config
.num_peer_keys
= __cpu_to_le32(TARGET_10X_NUM_PEER_KEYS
);
5770 if (ath10k_peer_stats_enabled(ar
)) {
5771 config
.num_peers
= __cpu_to_le32(TARGET_10X_TX_STATS_NUM_PEERS
);
5772 config
.num_tids
= __cpu_to_le32(TARGET_10X_TX_STATS_NUM_TIDS
);
5774 config
.num_peers
= __cpu_to_le32(TARGET_10X_NUM_PEERS
);
5775 config
.num_tids
= __cpu_to_le32(TARGET_10X_NUM_TIDS
);
5778 config
.ast_skid_limit
= __cpu_to_le32(TARGET_10X_AST_SKID_LIMIT
);
5779 config
.tx_chain_mask
= __cpu_to_le32(TARGET_10X_TX_CHAIN_MASK
);
5780 config
.rx_chain_mask
= __cpu_to_le32(TARGET_10X_RX_CHAIN_MASK
);
5781 config
.rx_timeout_pri_vo
= __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI
);
5782 config
.rx_timeout_pri_vi
= __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI
);
5783 config
.rx_timeout_pri_be
= __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI
);
5784 config
.rx_timeout_pri_bk
= __cpu_to_le32(TARGET_10X_RX_TIMEOUT_HI_PRI
);
5785 config
.rx_decap_mode
= __cpu_to_le32(ar
->wmi
.rx_decap_mode
);
5787 config
.scan_max_pending_reqs
=
5788 __cpu_to_le32(TARGET_10X_SCAN_MAX_PENDING_REQS
);
5790 config
.bmiss_offload_max_vdev
=
5791 __cpu_to_le32(TARGET_10X_BMISS_OFFLOAD_MAX_VDEV
);
5793 config
.roam_offload_max_vdev
=
5794 __cpu_to_le32(TARGET_10X_ROAM_OFFLOAD_MAX_VDEV
);
5796 config
.roam_offload_max_ap_profiles
=
5797 __cpu_to_le32(TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES
);
5799 config
.num_mcast_groups
= __cpu_to_le32(TARGET_10X_NUM_MCAST_GROUPS
);
5800 config
.num_mcast_table_elems
=
5801 __cpu_to_le32(TARGET_10X_NUM_MCAST_TABLE_ELEMS
);
5803 config
.mcast2ucast_mode
= __cpu_to_le32(TARGET_10X_MCAST2UCAST_MODE
);
5804 config
.tx_dbg_log_size
= __cpu_to_le32(TARGET_10X_TX_DBG_LOG_SIZE
);
5805 config
.num_wds_entries
= __cpu_to_le32(TARGET_10X_NUM_WDS_ENTRIES
);
5806 config
.dma_burst_size
= __cpu_to_le32(TARGET_10_2_DMA_BURST_SIZE
);
5807 config
.mac_aggr_delim
= __cpu_to_le32(TARGET_10X_MAC_AGGR_DELIM
);
5809 val
= TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK
;
5810 config
.rx_skip_defrag_timeout_dup_detection_check
= __cpu_to_le32(val
);
5812 config
.vow_config
= __cpu_to_le32(TARGET_10X_VOW_CONFIG
);
5814 config
.num_msdu_desc
= __cpu_to_le32(TARGET_10X_NUM_MSDU_DESC
);
5815 config
.max_frag_entries
= __cpu_to_le32(TARGET_10X_MAX_FRAG_ENTRIES
);
5817 len
= sizeof(*cmd
) +
5818 (sizeof(struct host_memory_chunk
) * ar
->wmi
.num_mem_chunks
);
5820 buf
= ath10k_wmi_alloc_skb(ar
, len
);
5822 return ERR_PTR(-ENOMEM
);
5824 cmd
= (struct wmi_init_cmd_10_2
*)buf
->data
;
5826 features
= WMI_10_2_RX_BATCH_MODE
;
5828 if (test_bit(ATH10K_FLAG_BTCOEX
, &ar
->dev_flags
) &&
5829 test_bit(WMI_SERVICE_COEX_GPIO
, ar
->wmi
.svc_map
))
5830 features
|= WMI_10_2_COEX_GPIO
;
5832 if (ath10k_peer_stats_enabled(ar
))
5833 features
|= WMI_10_2_PEER_STATS
;
5835 if (test_bit(WMI_SERVICE_BSS_CHANNEL_INFO_64
, ar
->wmi
.svc_map
))
5836 features
|= WMI_10_2_BSS_CHAN_INFO
;
5838 cmd
->resource_config
.feature_mask
= __cpu_to_le32(features
);
5840 memcpy(&cmd
->resource_config
.common
, &config
, sizeof(config
));
5841 ath10k_wmi_put_host_mem_chunks(ar
, &cmd
->mem_chunks
);
5843 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi init 10.2\n");
5847 static struct sk_buff
*ath10k_wmi_10_4_op_gen_init(struct ath10k
*ar
)
5849 struct wmi_init_cmd_10_4
*cmd
;
5850 struct sk_buff
*buf
;
5851 struct wmi_resource_config_10_4 config
= {};
5854 config
.num_vdevs
= __cpu_to_le32(ar
->max_num_vdevs
);
5855 config
.num_peers
= __cpu_to_le32(ar
->max_num_peers
);
5856 config
.num_active_peers
= __cpu_to_le32(ar
->num_active_peers
);
5857 config
.num_tids
= __cpu_to_le32(ar
->num_tids
);
5859 config
.num_offload_peers
= __cpu_to_le32(TARGET_10_4_NUM_OFFLOAD_PEERS
);
5860 config
.num_offload_reorder_buffs
=
5861 __cpu_to_le32(TARGET_10_4_NUM_OFFLOAD_REORDER_BUFFS
);
5862 config
.num_peer_keys
= __cpu_to_le32(TARGET_10_4_NUM_PEER_KEYS
);
5863 config
.ast_skid_limit
= __cpu_to_le32(TARGET_10_4_AST_SKID_LIMIT
);
5864 config
.tx_chain_mask
= __cpu_to_le32(ar
->hw_params
.tx_chain_mask
);
5865 config
.rx_chain_mask
= __cpu_to_le32(ar
->hw_params
.rx_chain_mask
);
5867 config
.rx_timeout_pri
[0] = __cpu_to_le32(TARGET_10_4_RX_TIMEOUT_LO_PRI
);
5868 config
.rx_timeout_pri
[1] = __cpu_to_le32(TARGET_10_4_RX_TIMEOUT_LO_PRI
);
5869 config
.rx_timeout_pri
[2] = __cpu_to_le32(TARGET_10_4_RX_TIMEOUT_LO_PRI
);
5870 config
.rx_timeout_pri
[3] = __cpu_to_le32(TARGET_10_4_RX_TIMEOUT_HI_PRI
);
5872 config
.rx_decap_mode
= __cpu_to_le32(ar
->wmi
.rx_decap_mode
);
5873 config
.scan_max_pending_req
= __cpu_to_le32(TARGET_10_4_SCAN_MAX_REQS
);
5874 config
.bmiss_offload_max_vdev
=
5875 __cpu_to_le32(TARGET_10_4_BMISS_OFFLOAD_MAX_VDEV
);
5876 config
.roam_offload_max_vdev
=
5877 __cpu_to_le32(TARGET_10_4_ROAM_OFFLOAD_MAX_VDEV
);
5878 config
.roam_offload_max_ap_profiles
=
5879 __cpu_to_le32(TARGET_10_4_ROAM_OFFLOAD_MAX_PROFILES
);
5880 config
.num_mcast_groups
= __cpu_to_le32(TARGET_10_4_NUM_MCAST_GROUPS
);
5881 config
.num_mcast_table_elems
=
5882 __cpu_to_le32(TARGET_10_4_NUM_MCAST_TABLE_ELEMS
);
5884 config
.mcast2ucast_mode
= __cpu_to_le32(TARGET_10_4_MCAST2UCAST_MODE
);
5885 config
.tx_dbg_log_size
= __cpu_to_le32(TARGET_10_4_TX_DBG_LOG_SIZE
);
5886 config
.num_wds_entries
= __cpu_to_le32(TARGET_10_4_NUM_WDS_ENTRIES
);
5887 config
.dma_burst_size
= __cpu_to_le32(TARGET_10_4_DMA_BURST_SIZE
);
5888 config
.mac_aggr_delim
= __cpu_to_le32(TARGET_10_4_MAC_AGGR_DELIM
);
5890 config
.rx_skip_defrag_timeout_dup_detection_check
=
5891 __cpu_to_le32(TARGET_10_4_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK
);
5893 config
.vow_config
= __cpu_to_le32(TARGET_10_4_VOW_CONFIG
);
5894 config
.gtk_offload_max_vdev
=
5895 __cpu_to_le32(TARGET_10_4_GTK_OFFLOAD_MAX_VDEV
);
5896 config
.num_msdu_desc
= __cpu_to_le32(ar
->htt
.max_num_pending_tx
);
5897 config
.max_frag_entries
= __cpu_to_le32(TARGET_10_4_11AC_TX_MAX_FRAGS
);
5898 config
.max_peer_ext_stats
=
5899 __cpu_to_le32(TARGET_10_4_MAX_PEER_EXT_STATS
);
5900 config
.smart_ant_cap
= __cpu_to_le32(TARGET_10_4_SMART_ANT_CAP
);
5902 config
.bk_minfree
= __cpu_to_le32(TARGET_10_4_BK_MIN_FREE
);
5903 config
.be_minfree
= __cpu_to_le32(TARGET_10_4_BE_MIN_FREE
);
5904 config
.vi_minfree
= __cpu_to_le32(TARGET_10_4_VI_MIN_FREE
);
5905 config
.vo_minfree
= __cpu_to_le32(TARGET_10_4_VO_MIN_FREE
);
5907 config
.rx_batchmode
= __cpu_to_le32(TARGET_10_4_RX_BATCH_MODE
);
5909 __cpu_to_le32(TARGET_10_4_THERMAL_THROTTLING_CONFIG
);
5910 config
.atf_config
= __cpu_to_le32(TARGET_10_4_ATF_CONFIG
);
5911 config
.iphdr_pad_config
= __cpu_to_le32(TARGET_10_4_IPHDR_PAD_CONFIG
);
5912 config
.qwrap_config
= __cpu_to_le32(TARGET_10_4_QWRAP_CONFIG
);
5914 len
= sizeof(*cmd
) +
5915 (sizeof(struct host_memory_chunk
) * ar
->wmi
.num_mem_chunks
);
5917 buf
= ath10k_wmi_alloc_skb(ar
, len
);
5919 return ERR_PTR(-ENOMEM
);
5921 cmd
= (struct wmi_init_cmd_10_4
*)buf
->data
;
5922 memcpy(&cmd
->resource_config
, &config
, sizeof(config
));
5923 ath10k_wmi_put_host_mem_chunks(ar
, &cmd
->mem_chunks
);
5925 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi init 10.4\n");
5929 int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg
*arg
)
5931 if (arg
->ie_len
&& !arg
->ie
)
5933 if (arg
->n_channels
&& !arg
->channels
)
5935 if (arg
->n_ssids
&& !arg
->ssids
)
5937 if (arg
->n_bssids
&& !arg
->bssids
)
5940 if (arg
->ie_len
> WLAN_SCAN_PARAMS_MAX_IE_LEN
)
5942 if (arg
->n_channels
> ARRAY_SIZE(arg
->channels
))
5944 if (arg
->n_ssids
> WLAN_SCAN_PARAMS_MAX_SSID
)
5946 if (arg
->n_bssids
> WLAN_SCAN_PARAMS_MAX_BSSID
)
5953 ath10k_wmi_start_scan_tlvs_len(const struct wmi_start_scan_arg
*arg
)
5958 len
+= sizeof(struct wmi_ie_data
);
5959 len
+= roundup(arg
->ie_len
, 4);
5962 if (arg
->n_channels
) {
5963 len
+= sizeof(struct wmi_chan_list
);
5964 len
+= sizeof(__le32
) * arg
->n_channels
;
5968 len
+= sizeof(struct wmi_ssid_list
);
5969 len
+= sizeof(struct wmi_ssid
) * arg
->n_ssids
;
5972 if (arg
->n_bssids
) {
5973 len
+= sizeof(struct wmi_bssid_list
);
5974 len
+= sizeof(struct wmi_mac_addr
) * arg
->n_bssids
;
5980 void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common
*cmn
,
5981 const struct wmi_start_scan_arg
*arg
)
5986 scan_id
= WMI_HOST_SCAN_REQ_ID_PREFIX
;
5987 scan_id
|= arg
->scan_id
;
5989 scan_req_id
= WMI_HOST_SCAN_REQUESTOR_ID_PREFIX
;
5990 scan_req_id
|= arg
->scan_req_id
;
5992 cmn
->scan_id
= __cpu_to_le32(scan_id
);
5993 cmn
->scan_req_id
= __cpu_to_le32(scan_req_id
);
5994 cmn
->vdev_id
= __cpu_to_le32(arg
->vdev_id
);
5995 cmn
->scan_priority
= __cpu_to_le32(arg
->scan_priority
);
5996 cmn
->notify_scan_events
= __cpu_to_le32(arg
->notify_scan_events
);
5997 cmn
->dwell_time_active
= __cpu_to_le32(arg
->dwell_time_active
);
5998 cmn
->dwell_time_passive
= __cpu_to_le32(arg
->dwell_time_passive
);
5999 cmn
->min_rest_time
= __cpu_to_le32(arg
->min_rest_time
);
6000 cmn
->max_rest_time
= __cpu_to_le32(arg
->max_rest_time
);
6001 cmn
->repeat_probe_time
= __cpu_to_le32(arg
->repeat_probe_time
);
6002 cmn
->probe_spacing_time
= __cpu_to_le32(arg
->probe_spacing_time
);
6003 cmn
->idle_time
= __cpu_to_le32(arg
->idle_time
);
6004 cmn
->max_scan_time
= __cpu_to_le32(arg
->max_scan_time
);
6005 cmn
->probe_delay
= __cpu_to_le32(arg
->probe_delay
);
6006 cmn
->scan_ctrl_flags
= __cpu_to_le32(arg
->scan_ctrl_flags
);
6010 ath10k_wmi_put_start_scan_tlvs(struct wmi_start_scan_tlvs
*tlvs
,
6011 const struct wmi_start_scan_arg
*arg
)
6013 struct wmi_ie_data
*ie
;
6014 struct wmi_chan_list
*channels
;
6015 struct wmi_ssid_list
*ssids
;
6016 struct wmi_bssid_list
*bssids
;
6017 void *ptr
= tlvs
->tlvs
;
6020 if (arg
->n_channels
) {
6022 channels
->tag
= __cpu_to_le32(WMI_CHAN_LIST_TAG
);
6023 channels
->num_chan
= __cpu_to_le32(arg
->n_channels
);
6025 for (i
= 0; i
< arg
->n_channels
; i
++)
6026 channels
->channel_list
[i
].freq
=
6027 __cpu_to_le16(arg
->channels
[i
]);
6029 ptr
+= sizeof(*channels
);
6030 ptr
+= sizeof(__le32
) * arg
->n_channels
;
6035 ssids
->tag
= __cpu_to_le32(WMI_SSID_LIST_TAG
);
6036 ssids
->num_ssids
= __cpu_to_le32(arg
->n_ssids
);
6038 for (i
= 0; i
< arg
->n_ssids
; i
++) {
6039 ssids
->ssids
[i
].ssid_len
=
6040 __cpu_to_le32(arg
->ssids
[i
].len
);
6041 memcpy(&ssids
->ssids
[i
].ssid
,
6046 ptr
+= sizeof(*ssids
);
6047 ptr
+= sizeof(struct wmi_ssid
) * arg
->n_ssids
;
6050 if (arg
->n_bssids
) {
6052 bssids
->tag
= __cpu_to_le32(WMI_BSSID_LIST_TAG
);
6053 bssids
->num_bssid
= __cpu_to_le32(arg
->n_bssids
);
6055 for (i
= 0; i
< arg
->n_bssids
; i
++)
6056 ether_addr_copy(bssids
->bssid_list
[i
].addr
,
6057 arg
->bssids
[i
].bssid
);
6059 ptr
+= sizeof(*bssids
);
6060 ptr
+= sizeof(struct wmi_mac_addr
) * arg
->n_bssids
;
6065 ie
->tag
= __cpu_to_le32(WMI_IE_TAG
);
6066 ie
->ie_len
= __cpu_to_le32(arg
->ie_len
);
6067 memcpy(ie
->ie_data
, arg
->ie
, arg
->ie_len
);
6070 ptr
+= roundup(arg
->ie_len
, 4);
6074 static struct sk_buff
*
6075 ath10k_wmi_op_gen_start_scan(struct ath10k
*ar
,
6076 const struct wmi_start_scan_arg
*arg
)
6078 struct wmi_start_scan_cmd
*cmd
;
6079 struct sk_buff
*skb
;
6083 ret
= ath10k_wmi_start_scan_verify(arg
);
6085 return ERR_PTR(ret
);
6087 len
= sizeof(*cmd
) + ath10k_wmi_start_scan_tlvs_len(arg
);
6088 skb
= ath10k_wmi_alloc_skb(ar
, len
);
6090 return ERR_PTR(-ENOMEM
);
6092 cmd
= (struct wmi_start_scan_cmd
*)skb
->data
;
6094 ath10k_wmi_put_start_scan_common(&cmd
->common
, arg
);
6095 ath10k_wmi_put_start_scan_tlvs(&cmd
->tlvs
, arg
);
6097 cmd
->burst_duration_ms
= __cpu_to_le32(0);
6099 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi start scan\n");
6103 static struct sk_buff
*
6104 ath10k_wmi_10x_op_gen_start_scan(struct ath10k
*ar
,
6105 const struct wmi_start_scan_arg
*arg
)
6107 struct wmi_10x_start_scan_cmd
*cmd
;
6108 struct sk_buff
*skb
;
6112 ret
= ath10k_wmi_start_scan_verify(arg
);
6114 return ERR_PTR(ret
);
6116 len
= sizeof(*cmd
) + ath10k_wmi_start_scan_tlvs_len(arg
);
6117 skb
= ath10k_wmi_alloc_skb(ar
, len
);
6119 return ERR_PTR(-ENOMEM
);
6121 cmd
= (struct wmi_10x_start_scan_cmd
*)skb
->data
;
6123 ath10k_wmi_put_start_scan_common(&cmd
->common
, arg
);
6124 ath10k_wmi_put_start_scan_tlvs(&cmd
->tlvs
, arg
);
6126 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi 10x start scan\n");
6130 void ath10k_wmi_start_scan_init(struct ath10k
*ar
,
6131 struct wmi_start_scan_arg
*arg
)
6133 /* setup commonly used values */
6134 arg
->scan_req_id
= 1;
6135 arg
->scan_priority
= WMI_SCAN_PRIORITY_LOW
;
6136 arg
->dwell_time_active
= 50;
6137 arg
->dwell_time_passive
= 150;
6138 arg
->min_rest_time
= 50;
6139 arg
->max_rest_time
= 500;
6140 arg
->repeat_probe_time
= 0;
6141 arg
->probe_spacing_time
= 0;
6143 arg
->max_scan_time
= 20000;
6144 arg
->probe_delay
= 5;
6145 arg
->notify_scan_events
= WMI_SCAN_EVENT_STARTED
6146 | WMI_SCAN_EVENT_COMPLETED
6147 | WMI_SCAN_EVENT_BSS_CHANNEL
6148 | WMI_SCAN_EVENT_FOREIGN_CHANNEL
6149 | WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT
6150 | WMI_SCAN_EVENT_DEQUEUED
;
6151 arg
->scan_ctrl_flags
|= WMI_SCAN_CHAN_STAT_EVENT
;
6153 arg
->bssids
[0].bssid
= "\xFF\xFF\xFF\xFF\xFF\xFF";
6156 static struct sk_buff
*
6157 ath10k_wmi_op_gen_stop_scan(struct ath10k
*ar
,
6158 const struct wmi_stop_scan_arg
*arg
)
6160 struct wmi_stop_scan_cmd
*cmd
;
6161 struct sk_buff
*skb
;
6165 if (arg
->req_id
> 0xFFF)
6166 return ERR_PTR(-EINVAL
);
6167 if (arg
->req_type
== WMI_SCAN_STOP_ONE
&& arg
->u
.scan_id
> 0xFFF)
6168 return ERR_PTR(-EINVAL
);
6170 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6172 return ERR_PTR(-ENOMEM
);
6174 scan_id
= arg
->u
.scan_id
;
6175 scan_id
|= WMI_HOST_SCAN_REQ_ID_PREFIX
;
6177 req_id
= arg
->req_id
;
6178 req_id
|= WMI_HOST_SCAN_REQUESTOR_ID_PREFIX
;
6180 cmd
= (struct wmi_stop_scan_cmd
*)skb
->data
;
6181 cmd
->req_type
= __cpu_to_le32(arg
->req_type
);
6182 cmd
->vdev_id
= __cpu_to_le32(arg
->u
.vdev_id
);
6183 cmd
->scan_id
= __cpu_to_le32(scan_id
);
6184 cmd
->scan_req_id
= __cpu_to_le32(req_id
);
6186 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6187 "wmi stop scan reqid %d req_type %d vdev/scan_id %d\n",
6188 arg
->req_id
, arg
->req_type
, arg
->u
.scan_id
);
6192 static struct sk_buff
*
6193 ath10k_wmi_op_gen_vdev_create(struct ath10k
*ar
, u32 vdev_id
,
6194 enum wmi_vdev_type type
,
6195 enum wmi_vdev_subtype subtype
,
6196 const u8 macaddr
[ETH_ALEN
])
6198 struct wmi_vdev_create_cmd
*cmd
;
6199 struct sk_buff
*skb
;
6201 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6203 return ERR_PTR(-ENOMEM
);
6205 cmd
= (struct wmi_vdev_create_cmd
*)skb
->data
;
6206 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6207 cmd
->vdev_type
= __cpu_to_le32(type
);
6208 cmd
->vdev_subtype
= __cpu_to_le32(subtype
);
6209 ether_addr_copy(cmd
->vdev_macaddr
.addr
, macaddr
);
6211 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6212 "WMI vdev create: id %d type %d subtype %d macaddr %pM\n",
6213 vdev_id
, type
, subtype
, macaddr
);
6217 static struct sk_buff
*
6218 ath10k_wmi_op_gen_vdev_delete(struct ath10k
*ar
, u32 vdev_id
)
6220 struct wmi_vdev_delete_cmd
*cmd
;
6221 struct sk_buff
*skb
;
6223 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6225 return ERR_PTR(-ENOMEM
);
6227 cmd
= (struct wmi_vdev_delete_cmd
*)skb
->data
;
6228 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6230 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6231 "WMI vdev delete id %d\n", vdev_id
);
6235 static struct sk_buff
*
6236 ath10k_wmi_op_gen_vdev_start(struct ath10k
*ar
,
6237 const struct wmi_vdev_start_request_arg
*arg
,
6240 struct wmi_vdev_start_request_cmd
*cmd
;
6241 struct sk_buff
*skb
;
6242 const char *cmdname
;
6245 if (WARN_ON(arg
->hidden_ssid
&& !arg
->ssid
))
6246 return ERR_PTR(-EINVAL
);
6247 if (WARN_ON(arg
->ssid_len
> sizeof(cmd
->ssid
.ssid
)))
6248 return ERR_PTR(-EINVAL
);
6251 cmdname
= "restart";
6255 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6257 return ERR_PTR(-ENOMEM
);
6259 if (arg
->hidden_ssid
)
6260 flags
|= WMI_VDEV_START_HIDDEN_SSID
;
6261 if (arg
->pmf_enabled
)
6262 flags
|= WMI_VDEV_START_PMF_ENABLED
;
6264 cmd
= (struct wmi_vdev_start_request_cmd
*)skb
->data
;
6265 cmd
->vdev_id
= __cpu_to_le32(arg
->vdev_id
);
6266 cmd
->disable_hw_ack
= __cpu_to_le32(arg
->disable_hw_ack
);
6267 cmd
->beacon_interval
= __cpu_to_le32(arg
->bcn_intval
);
6268 cmd
->dtim_period
= __cpu_to_le32(arg
->dtim_period
);
6269 cmd
->flags
= __cpu_to_le32(flags
);
6270 cmd
->bcn_tx_rate
= __cpu_to_le32(arg
->bcn_tx_rate
);
6271 cmd
->bcn_tx_power
= __cpu_to_le32(arg
->bcn_tx_power
);
6274 cmd
->ssid
.ssid_len
= __cpu_to_le32(arg
->ssid_len
);
6275 memcpy(cmd
->ssid
.ssid
, arg
->ssid
, arg
->ssid_len
);
6278 ath10k_wmi_put_wmi_channel(&cmd
->chan
, &arg
->channel
);
6280 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6281 "wmi vdev %s id 0x%x flags: 0x%0X, freq %d, mode %d, ch_flags: 0x%0X, max_power: %d\n",
6282 cmdname
, arg
->vdev_id
,
6283 flags
, arg
->channel
.freq
, arg
->channel
.mode
,
6284 cmd
->chan
.flags
, arg
->channel
.max_power
);
6289 static struct sk_buff
*
6290 ath10k_wmi_op_gen_vdev_stop(struct ath10k
*ar
, u32 vdev_id
)
6292 struct wmi_vdev_stop_cmd
*cmd
;
6293 struct sk_buff
*skb
;
6295 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6297 return ERR_PTR(-ENOMEM
);
6299 cmd
= (struct wmi_vdev_stop_cmd
*)skb
->data
;
6300 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6302 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi vdev stop id 0x%x\n", vdev_id
);
6306 static struct sk_buff
*
6307 ath10k_wmi_op_gen_vdev_up(struct ath10k
*ar
, u32 vdev_id
, u32 aid
,
6310 struct wmi_vdev_up_cmd
*cmd
;
6311 struct sk_buff
*skb
;
6313 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6315 return ERR_PTR(-ENOMEM
);
6317 cmd
= (struct wmi_vdev_up_cmd
*)skb
->data
;
6318 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6319 cmd
->vdev_assoc_id
= __cpu_to_le32(aid
);
6320 ether_addr_copy(cmd
->vdev_bssid
.addr
, bssid
);
6322 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6323 "wmi mgmt vdev up id 0x%x assoc id %d bssid %pM\n",
6324 vdev_id
, aid
, bssid
);
6328 static struct sk_buff
*
6329 ath10k_wmi_op_gen_vdev_down(struct ath10k
*ar
, u32 vdev_id
)
6331 struct wmi_vdev_down_cmd
*cmd
;
6332 struct sk_buff
*skb
;
6334 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6336 return ERR_PTR(-ENOMEM
);
6338 cmd
= (struct wmi_vdev_down_cmd
*)skb
->data
;
6339 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6341 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6342 "wmi mgmt vdev down id 0x%x\n", vdev_id
);
6346 static struct sk_buff
*
6347 ath10k_wmi_op_gen_vdev_set_param(struct ath10k
*ar
, u32 vdev_id
,
6348 u32 param_id
, u32 param_value
)
6350 struct wmi_vdev_set_param_cmd
*cmd
;
6351 struct sk_buff
*skb
;
6353 if (param_id
== WMI_VDEV_PARAM_UNSUPPORTED
) {
6354 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6355 "vdev param %d not supported by firmware\n",
6357 return ERR_PTR(-EOPNOTSUPP
);
6360 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6362 return ERR_PTR(-ENOMEM
);
6364 cmd
= (struct wmi_vdev_set_param_cmd
*)skb
->data
;
6365 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6366 cmd
->param_id
= __cpu_to_le32(param_id
);
6367 cmd
->param_value
= __cpu_to_le32(param_value
);
6369 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6370 "wmi vdev id 0x%x set param %d value %d\n",
6371 vdev_id
, param_id
, param_value
);
6375 static struct sk_buff
*
6376 ath10k_wmi_op_gen_vdev_install_key(struct ath10k
*ar
,
6377 const struct wmi_vdev_install_key_arg
*arg
)
6379 struct wmi_vdev_install_key_cmd
*cmd
;
6380 struct sk_buff
*skb
;
6382 if (arg
->key_cipher
== WMI_CIPHER_NONE
&& arg
->key_data
!= NULL
)
6383 return ERR_PTR(-EINVAL
);
6384 if (arg
->key_cipher
!= WMI_CIPHER_NONE
&& arg
->key_data
== NULL
)
6385 return ERR_PTR(-EINVAL
);
6387 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
) + arg
->key_len
);
6389 return ERR_PTR(-ENOMEM
);
6391 cmd
= (struct wmi_vdev_install_key_cmd
*)skb
->data
;
6392 cmd
->vdev_id
= __cpu_to_le32(arg
->vdev_id
);
6393 cmd
->key_idx
= __cpu_to_le32(arg
->key_idx
);
6394 cmd
->key_flags
= __cpu_to_le32(arg
->key_flags
);
6395 cmd
->key_cipher
= __cpu_to_le32(arg
->key_cipher
);
6396 cmd
->key_len
= __cpu_to_le32(arg
->key_len
);
6397 cmd
->key_txmic_len
= __cpu_to_le32(arg
->key_txmic_len
);
6398 cmd
->key_rxmic_len
= __cpu_to_le32(arg
->key_rxmic_len
);
6401 ether_addr_copy(cmd
->peer_macaddr
.addr
, arg
->macaddr
);
6403 memcpy(cmd
->key_data
, arg
->key_data
, arg
->key_len
);
6405 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6406 "wmi vdev install key idx %d cipher %d len %d\n",
6407 arg
->key_idx
, arg
->key_cipher
, arg
->key_len
);
6411 static struct sk_buff
*
6412 ath10k_wmi_op_gen_vdev_spectral_conf(struct ath10k
*ar
,
6413 const struct wmi_vdev_spectral_conf_arg
*arg
)
6415 struct wmi_vdev_spectral_conf_cmd
*cmd
;
6416 struct sk_buff
*skb
;
6418 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6420 return ERR_PTR(-ENOMEM
);
6422 cmd
= (struct wmi_vdev_spectral_conf_cmd
*)skb
->data
;
6423 cmd
->vdev_id
= __cpu_to_le32(arg
->vdev_id
);
6424 cmd
->scan_count
= __cpu_to_le32(arg
->scan_count
);
6425 cmd
->scan_period
= __cpu_to_le32(arg
->scan_period
);
6426 cmd
->scan_priority
= __cpu_to_le32(arg
->scan_priority
);
6427 cmd
->scan_fft_size
= __cpu_to_le32(arg
->scan_fft_size
);
6428 cmd
->scan_gc_ena
= __cpu_to_le32(arg
->scan_gc_ena
);
6429 cmd
->scan_restart_ena
= __cpu_to_le32(arg
->scan_restart_ena
);
6430 cmd
->scan_noise_floor_ref
= __cpu_to_le32(arg
->scan_noise_floor_ref
);
6431 cmd
->scan_init_delay
= __cpu_to_le32(arg
->scan_init_delay
);
6432 cmd
->scan_nb_tone_thr
= __cpu_to_le32(arg
->scan_nb_tone_thr
);
6433 cmd
->scan_str_bin_thr
= __cpu_to_le32(arg
->scan_str_bin_thr
);
6434 cmd
->scan_wb_rpt_mode
= __cpu_to_le32(arg
->scan_wb_rpt_mode
);
6435 cmd
->scan_rssi_rpt_mode
= __cpu_to_le32(arg
->scan_rssi_rpt_mode
);
6436 cmd
->scan_rssi_thr
= __cpu_to_le32(arg
->scan_rssi_thr
);
6437 cmd
->scan_pwr_format
= __cpu_to_le32(arg
->scan_pwr_format
);
6438 cmd
->scan_rpt_mode
= __cpu_to_le32(arg
->scan_rpt_mode
);
6439 cmd
->scan_bin_scale
= __cpu_to_le32(arg
->scan_bin_scale
);
6440 cmd
->scan_dbm_adj
= __cpu_to_le32(arg
->scan_dbm_adj
);
6441 cmd
->scan_chn_mask
= __cpu_to_le32(arg
->scan_chn_mask
);
6446 static struct sk_buff
*
6447 ath10k_wmi_op_gen_vdev_spectral_enable(struct ath10k
*ar
, u32 vdev_id
,
6448 u32 trigger
, u32 enable
)
6450 struct wmi_vdev_spectral_enable_cmd
*cmd
;
6451 struct sk_buff
*skb
;
6453 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6455 return ERR_PTR(-ENOMEM
);
6457 cmd
= (struct wmi_vdev_spectral_enable_cmd
*)skb
->data
;
6458 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6459 cmd
->trigger_cmd
= __cpu_to_le32(trigger
);
6460 cmd
->enable_cmd
= __cpu_to_le32(enable
);
6465 static struct sk_buff
*
6466 ath10k_wmi_op_gen_peer_create(struct ath10k
*ar
, u32 vdev_id
,
6467 const u8 peer_addr
[ETH_ALEN
],
6468 enum wmi_peer_type peer_type
)
6470 struct wmi_peer_create_cmd
*cmd
;
6471 struct sk_buff
*skb
;
6473 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6475 return ERR_PTR(-ENOMEM
);
6477 cmd
= (struct wmi_peer_create_cmd
*)skb
->data
;
6478 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6479 ether_addr_copy(cmd
->peer_macaddr
.addr
, peer_addr
);
6481 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6482 "wmi peer create vdev_id %d peer_addr %pM\n",
6483 vdev_id
, peer_addr
);
6487 static struct sk_buff
*
6488 ath10k_wmi_op_gen_peer_delete(struct ath10k
*ar
, u32 vdev_id
,
6489 const u8 peer_addr
[ETH_ALEN
])
6491 struct wmi_peer_delete_cmd
*cmd
;
6492 struct sk_buff
*skb
;
6494 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6496 return ERR_PTR(-ENOMEM
);
6498 cmd
= (struct wmi_peer_delete_cmd
*)skb
->data
;
6499 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6500 ether_addr_copy(cmd
->peer_macaddr
.addr
, peer_addr
);
6502 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6503 "wmi peer delete vdev_id %d peer_addr %pM\n",
6504 vdev_id
, peer_addr
);
6508 static struct sk_buff
*
6509 ath10k_wmi_op_gen_peer_flush(struct ath10k
*ar
, u32 vdev_id
,
6510 const u8 peer_addr
[ETH_ALEN
], u32 tid_bitmap
)
6512 struct wmi_peer_flush_tids_cmd
*cmd
;
6513 struct sk_buff
*skb
;
6515 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6517 return ERR_PTR(-ENOMEM
);
6519 cmd
= (struct wmi_peer_flush_tids_cmd
*)skb
->data
;
6520 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6521 cmd
->peer_tid_bitmap
= __cpu_to_le32(tid_bitmap
);
6522 ether_addr_copy(cmd
->peer_macaddr
.addr
, peer_addr
);
6524 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6525 "wmi peer flush vdev_id %d peer_addr %pM tids %08x\n",
6526 vdev_id
, peer_addr
, tid_bitmap
);
6530 static struct sk_buff
*
6531 ath10k_wmi_op_gen_peer_set_param(struct ath10k
*ar
, u32 vdev_id
,
6532 const u8
*peer_addr
,
6533 enum wmi_peer_param param_id
,
6536 struct wmi_peer_set_param_cmd
*cmd
;
6537 struct sk_buff
*skb
;
6539 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6541 return ERR_PTR(-ENOMEM
);
6543 cmd
= (struct wmi_peer_set_param_cmd
*)skb
->data
;
6544 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6545 cmd
->param_id
= __cpu_to_le32(param_id
);
6546 cmd
->param_value
= __cpu_to_le32(param_value
);
6547 ether_addr_copy(cmd
->peer_macaddr
.addr
, peer_addr
);
6549 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6550 "wmi vdev %d peer 0x%pM set param %d value %d\n",
6551 vdev_id
, peer_addr
, param_id
, param_value
);
6555 static struct sk_buff
*
6556 ath10k_wmi_op_gen_set_psmode(struct ath10k
*ar
, u32 vdev_id
,
6557 enum wmi_sta_ps_mode psmode
)
6559 struct wmi_sta_powersave_mode_cmd
*cmd
;
6560 struct sk_buff
*skb
;
6562 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6564 return ERR_PTR(-ENOMEM
);
6566 cmd
= (struct wmi_sta_powersave_mode_cmd
*)skb
->data
;
6567 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6568 cmd
->sta_ps_mode
= __cpu_to_le32(psmode
);
6570 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6571 "wmi set powersave id 0x%x mode %d\n",
6576 static struct sk_buff
*
6577 ath10k_wmi_op_gen_set_sta_ps(struct ath10k
*ar
, u32 vdev_id
,
6578 enum wmi_sta_powersave_param param_id
,
6581 struct wmi_sta_powersave_param_cmd
*cmd
;
6582 struct sk_buff
*skb
;
6584 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6586 return ERR_PTR(-ENOMEM
);
6588 cmd
= (struct wmi_sta_powersave_param_cmd
*)skb
->data
;
6589 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6590 cmd
->param_id
= __cpu_to_le32(param_id
);
6591 cmd
->param_value
= __cpu_to_le32(value
);
6593 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6594 "wmi sta ps param vdev_id 0x%x param %d value %d\n",
6595 vdev_id
, param_id
, value
);
6599 static struct sk_buff
*
6600 ath10k_wmi_op_gen_set_ap_ps(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
6601 enum wmi_ap_ps_peer_param param_id
, u32 value
)
6603 struct wmi_ap_ps_peer_cmd
*cmd
;
6604 struct sk_buff
*skb
;
6607 return ERR_PTR(-EINVAL
);
6609 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6611 return ERR_PTR(-ENOMEM
);
6613 cmd
= (struct wmi_ap_ps_peer_cmd
*)skb
->data
;
6614 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6615 cmd
->param_id
= __cpu_to_le32(param_id
);
6616 cmd
->param_value
= __cpu_to_le32(value
);
6617 ether_addr_copy(cmd
->peer_macaddr
.addr
, mac
);
6619 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6620 "wmi ap ps param vdev_id 0x%X param %d value %d mac_addr %pM\n",
6621 vdev_id
, param_id
, value
, mac
);
6625 static struct sk_buff
*
6626 ath10k_wmi_op_gen_scan_chan_list(struct ath10k
*ar
,
6627 const struct wmi_scan_chan_list_arg
*arg
)
6629 struct wmi_scan_chan_list_cmd
*cmd
;
6630 struct sk_buff
*skb
;
6631 struct wmi_channel_arg
*ch
;
6632 struct wmi_channel
*ci
;
6636 len
= sizeof(*cmd
) + arg
->n_channels
* sizeof(struct wmi_channel
);
6638 skb
= ath10k_wmi_alloc_skb(ar
, len
);
6640 return ERR_PTR(-EINVAL
);
6642 cmd
= (struct wmi_scan_chan_list_cmd
*)skb
->data
;
6643 cmd
->num_scan_chans
= __cpu_to_le32(arg
->n_channels
);
6645 for (i
= 0; i
< arg
->n_channels
; i
++) {
6646 ch
= &arg
->channels
[i
];
6647 ci
= &cmd
->chan_info
[i
];
6649 ath10k_wmi_put_wmi_channel(ci
, ch
);
6656 ath10k_wmi_peer_assoc_fill(struct ath10k
*ar
, void *buf
,
6657 const struct wmi_peer_assoc_complete_arg
*arg
)
6659 struct wmi_common_peer_assoc_complete_cmd
*cmd
= buf
;
6661 cmd
->vdev_id
= __cpu_to_le32(arg
->vdev_id
);
6662 cmd
->peer_new_assoc
= __cpu_to_le32(arg
->peer_reassoc
? 0 : 1);
6663 cmd
->peer_associd
= __cpu_to_le32(arg
->peer_aid
);
6664 cmd
->peer_flags
= __cpu_to_le32(arg
->peer_flags
);
6665 cmd
->peer_caps
= __cpu_to_le32(arg
->peer_caps
);
6666 cmd
->peer_listen_intval
= __cpu_to_le32(arg
->peer_listen_intval
);
6667 cmd
->peer_ht_caps
= __cpu_to_le32(arg
->peer_ht_caps
);
6668 cmd
->peer_max_mpdu
= __cpu_to_le32(arg
->peer_max_mpdu
);
6669 cmd
->peer_mpdu_density
= __cpu_to_le32(arg
->peer_mpdu_density
);
6670 cmd
->peer_rate_caps
= __cpu_to_le32(arg
->peer_rate_caps
);
6671 cmd
->peer_nss
= __cpu_to_le32(arg
->peer_num_spatial_streams
);
6672 cmd
->peer_vht_caps
= __cpu_to_le32(arg
->peer_vht_caps
);
6673 cmd
->peer_phymode
= __cpu_to_le32(arg
->peer_phymode
);
6675 ether_addr_copy(cmd
->peer_macaddr
.addr
, arg
->addr
);
6677 cmd
->peer_legacy_rates
.num_rates
=
6678 __cpu_to_le32(arg
->peer_legacy_rates
.num_rates
);
6679 memcpy(cmd
->peer_legacy_rates
.rates
, arg
->peer_legacy_rates
.rates
,
6680 arg
->peer_legacy_rates
.num_rates
);
6682 cmd
->peer_ht_rates
.num_rates
=
6683 __cpu_to_le32(arg
->peer_ht_rates
.num_rates
);
6684 memcpy(cmd
->peer_ht_rates
.rates
, arg
->peer_ht_rates
.rates
,
6685 arg
->peer_ht_rates
.num_rates
);
6687 cmd
->peer_vht_rates
.rx_max_rate
=
6688 __cpu_to_le32(arg
->peer_vht_rates
.rx_max_rate
);
6689 cmd
->peer_vht_rates
.rx_mcs_set
=
6690 __cpu_to_le32(arg
->peer_vht_rates
.rx_mcs_set
);
6691 cmd
->peer_vht_rates
.tx_max_rate
=
6692 __cpu_to_le32(arg
->peer_vht_rates
.tx_max_rate
);
6693 cmd
->peer_vht_rates
.tx_mcs_set
=
6694 __cpu_to_le32(arg
->peer_vht_rates
.tx_mcs_set
);
6698 ath10k_wmi_peer_assoc_fill_main(struct ath10k
*ar
, void *buf
,
6699 const struct wmi_peer_assoc_complete_arg
*arg
)
6701 struct wmi_main_peer_assoc_complete_cmd
*cmd
= buf
;
6703 ath10k_wmi_peer_assoc_fill(ar
, buf
, arg
);
6704 memset(cmd
->peer_ht_info
, 0, sizeof(cmd
->peer_ht_info
));
6708 ath10k_wmi_peer_assoc_fill_10_1(struct ath10k
*ar
, void *buf
,
6709 const struct wmi_peer_assoc_complete_arg
*arg
)
6711 ath10k_wmi_peer_assoc_fill(ar
, buf
, arg
);
6715 ath10k_wmi_peer_assoc_fill_10_2(struct ath10k
*ar
, void *buf
,
6716 const struct wmi_peer_assoc_complete_arg
*arg
)
6718 struct wmi_10_2_peer_assoc_complete_cmd
*cmd
= buf
;
6719 int max_mcs
, max_nss
;
6722 /* TODO: Is using max values okay with firmware? */
6726 info0
= SM(max_mcs
, WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX
) |
6727 SM(max_nss
, WMI_PEER_ASSOC_INFO0_MAX_NSS
);
6729 ath10k_wmi_peer_assoc_fill(ar
, buf
, arg
);
6730 cmd
->info0
= __cpu_to_le32(info0
);
6734 ath10k_wmi_peer_assoc_fill_10_4(struct ath10k
*ar
, void *buf
,
6735 const struct wmi_peer_assoc_complete_arg
*arg
)
6737 struct wmi_10_4_peer_assoc_complete_cmd
*cmd
= buf
;
6739 ath10k_wmi_peer_assoc_fill_10_2(ar
, buf
, arg
);
6740 cmd
->peer_bw_rxnss_override
= 0;
6744 ath10k_wmi_peer_assoc_check_arg(const struct wmi_peer_assoc_complete_arg
*arg
)
6746 if (arg
->peer_mpdu_density
> 16)
6748 if (arg
->peer_legacy_rates
.num_rates
> MAX_SUPPORTED_RATES
)
6750 if (arg
->peer_ht_rates
.num_rates
> MAX_SUPPORTED_RATES
)
6756 static struct sk_buff
*
6757 ath10k_wmi_op_gen_peer_assoc(struct ath10k
*ar
,
6758 const struct wmi_peer_assoc_complete_arg
*arg
)
6760 size_t len
= sizeof(struct wmi_main_peer_assoc_complete_cmd
);
6761 struct sk_buff
*skb
;
6764 ret
= ath10k_wmi_peer_assoc_check_arg(arg
);
6766 return ERR_PTR(ret
);
6768 skb
= ath10k_wmi_alloc_skb(ar
, len
);
6770 return ERR_PTR(-ENOMEM
);
6772 ath10k_wmi_peer_assoc_fill_main(ar
, skb
->data
, arg
);
6774 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6775 "wmi peer assoc vdev %d addr %pM (%s)\n",
6776 arg
->vdev_id
, arg
->addr
,
6777 arg
->peer_reassoc
? "reassociate" : "new");
6781 static struct sk_buff
*
6782 ath10k_wmi_10_1_op_gen_peer_assoc(struct ath10k
*ar
,
6783 const struct wmi_peer_assoc_complete_arg
*arg
)
6785 size_t len
= sizeof(struct wmi_10_1_peer_assoc_complete_cmd
);
6786 struct sk_buff
*skb
;
6789 ret
= ath10k_wmi_peer_assoc_check_arg(arg
);
6791 return ERR_PTR(ret
);
6793 skb
= ath10k_wmi_alloc_skb(ar
, len
);
6795 return ERR_PTR(-ENOMEM
);
6797 ath10k_wmi_peer_assoc_fill_10_1(ar
, skb
->data
, arg
);
6799 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6800 "wmi peer assoc vdev %d addr %pM (%s)\n",
6801 arg
->vdev_id
, arg
->addr
,
6802 arg
->peer_reassoc
? "reassociate" : "new");
6806 static struct sk_buff
*
6807 ath10k_wmi_10_2_op_gen_peer_assoc(struct ath10k
*ar
,
6808 const struct wmi_peer_assoc_complete_arg
*arg
)
6810 size_t len
= sizeof(struct wmi_10_2_peer_assoc_complete_cmd
);
6811 struct sk_buff
*skb
;
6814 ret
= ath10k_wmi_peer_assoc_check_arg(arg
);
6816 return ERR_PTR(ret
);
6818 skb
= ath10k_wmi_alloc_skb(ar
, len
);
6820 return ERR_PTR(-ENOMEM
);
6822 ath10k_wmi_peer_assoc_fill_10_2(ar
, skb
->data
, arg
);
6824 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6825 "wmi peer assoc vdev %d addr %pM (%s)\n",
6826 arg
->vdev_id
, arg
->addr
,
6827 arg
->peer_reassoc
? "reassociate" : "new");
6831 static struct sk_buff
*
6832 ath10k_wmi_10_4_op_gen_peer_assoc(struct ath10k
*ar
,
6833 const struct wmi_peer_assoc_complete_arg
*arg
)
6835 size_t len
= sizeof(struct wmi_10_4_peer_assoc_complete_cmd
);
6836 struct sk_buff
*skb
;
6839 ret
= ath10k_wmi_peer_assoc_check_arg(arg
);
6841 return ERR_PTR(ret
);
6843 skb
= ath10k_wmi_alloc_skb(ar
, len
);
6845 return ERR_PTR(-ENOMEM
);
6847 ath10k_wmi_peer_assoc_fill_10_4(ar
, skb
->data
, arg
);
6849 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6850 "wmi peer assoc vdev %d addr %pM (%s)\n",
6851 arg
->vdev_id
, arg
->addr
,
6852 arg
->peer_reassoc
? "reassociate" : "new");
6856 static struct sk_buff
*
6857 ath10k_wmi_10_2_op_gen_pdev_get_temperature(struct ath10k
*ar
)
6859 struct sk_buff
*skb
;
6861 skb
= ath10k_wmi_alloc_skb(ar
, 0);
6863 return ERR_PTR(-ENOMEM
);
6865 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi pdev get temperature\n");
6869 static struct sk_buff
*
6870 ath10k_wmi_10_2_op_gen_pdev_bss_chan_info(struct ath10k
*ar
,
6871 enum wmi_bss_survey_req_type type
)
6873 struct wmi_pdev_chan_info_req_cmd
*cmd
;
6874 struct sk_buff
*skb
;
6876 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6878 return ERR_PTR(-ENOMEM
);
6880 cmd
= (struct wmi_pdev_chan_info_req_cmd
*)skb
->data
;
6881 cmd
->type
= __cpu_to_le32(type
);
6883 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
6884 "wmi pdev bss info request type %d\n", type
);
6889 /* This function assumes the beacon is already DMA mapped */
6890 static struct sk_buff
*
6891 ath10k_wmi_op_gen_beacon_dma(struct ath10k
*ar
, u32 vdev_id
, const void *bcn
,
6892 size_t bcn_len
, u32 bcn_paddr
, bool dtim_zero
,
6895 struct wmi_bcn_tx_ref_cmd
*cmd
;
6896 struct sk_buff
*skb
;
6897 struct ieee80211_hdr
*hdr
;
6900 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6902 return ERR_PTR(-ENOMEM
);
6904 hdr
= (struct ieee80211_hdr
*)bcn
;
6905 fc
= le16_to_cpu(hdr
->frame_control
);
6907 cmd
= (struct wmi_bcn_tx_ref_cmd
*)skb
->data
;
6908 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
6909 cmd
->data_len
= __cpu_to_le32(bcn_len
);
6910 cmd
->data_ptr
= __cpu_to_le32(bcn_paddr
);
6912 cmd
->frame_control
= __cpu_to_le32(fc
);
6914 cmd
->antenna_mask
= __cpu_to_le32(WMI_BCN_TX_REF_DEF_ANTENNA
);
6917 cmd
->flags
|= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO
);
6920 cmd
->flags
|= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB
);
6925 void ath10k_wmi_set_wmm_param(struct wmi_wmm_params
*params
,
6926 const struct wmi_wmm_params_arg
*arg
)
6928 params
->cwmin
= __cpu_to_le32(arg
->cwmin
);
6929 params
->cwmax
= __cpu_to_le32(arg
->cwmax
);
6930 params
->aifs
= __cpu_to_le32(arg
->aifs
);
6931 params
->txop
= __cpu_to_le32(arg
->txop
);
6932 params
->acm
= __cpu_to_le32(arg
->acm
);
6933 params
->no_ack
= __cpu_to_le32(arg
->no_ack
);
6936 static struct sk_buff
*
6937 ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k
*ar
,
6938 const struct wmi_wmm_params_all_arg
*arg
)
6940 struct wmi_pdev_set_wmm_params
*cmd
;
6941 struct sk_buff
*skb
;
6943 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6945 return ERR_PTR(-ENOMEM
);
6947 cmd
= (struct wmi_pdev_set_wmm_params
*)skb
->data
;
6948 ath10k_wmi_set_wmm_param(&cmd
->ac_be
, &arg
->ac_be
);
6949 ath10k_wmi_set_wmm_param(&cmd
->ac_bk
, &arg
->ac_bk
);
6950 ath10k_wmi_set_wmm_param(&cmd
->ac_vi
, &arg
->ac_vi
);
6951 ath10k_wmi_set_wmm_param(&cmd
->ac_vo
, &arg
->ac_vo
);
6953 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi pdev set wmm params\n");
6957 static struct sk_buff
*
6958 ath10k_wmi_op_gen_request_stats(struct ath10k
*ar
, u32 stats_mask
)
6960 struct wmi_request_stats_cmd
*cmd
;
6961 struct sk_buff
*skb
;
6963 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6965 return ERR_PTR(-ENOMEM
);
6967 cmd
= (struct wmi_request_stats_cmd
*)skb
->data
;
6968 cmd
->stats_id
= __cpu_to_le32(stats_mask
);
6970 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi request stats 0x%08x\n",
6975 static struct sk_buff
*
6976 ath10k_wmi_op_gen_force_fw_hang(struct ath10k
*ar
,
6977 enum wmi_force_fw_hang_type type
, u32 delay_ms
)
6979 struct wmi_force_fw_hang_cmd
*cmd
;
6980 struct sk_buff
*skb
;
6982 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
6984 return ERR_PTR(-ENOMEM
);
6986 cmd
= (struct wmi_force_fw_hang_cmd
*)skb
->data
;
6987 cmd
->type
= __cpu_to_le32(type
);
6988 cmd
->delay_ms
= __cpu_to_le32(delay_ms
);
6990 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi force fw hang %d delay %d\n",
6995 static struct sk_buff
*
6996 ath10k_wmi_op_gen_dbglog_cfg(struct ath10k
*ar
, u64 module_enable
,
6999 struct wmi_dbglog_cfg_cmd
*cmd
;
7000 struct sk_buff
*skb
;
7003 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7005 return ERR_PTR(-ENOMEM
);
7007 cmd
= (struct wmi_dbglog_cfg_cmd
*)skb
->data
;
7009 if (module_enable
) {
7011 ATH10K_DBGLOG_CFG_LOG_LVL
);
7013 /* set back defaults, all modules with WARN level */
7014 cfg
= SM(ATH10K_DBGLOG_LEVEL_WARN
,
7015 ATH10K_DBGLOG_CFG_LOG_LVL
);
7019 cmd
->module_enable
= __cpu_to_le32(module_enable
);
7020 cmd
->module_valid
= __cpu_to_le32(~0);
7021 cmd
->config_enable
= __cpu_to_le32(cfg
);
7022 cmd
->config_valid
= __cpu_to_le32(ATH10K_DBGLOG_CFG_LOG_LVL_MASK
);
7024 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7025 "wmi dbglog cfg modules %08x %08x config %08x %08x\n",
7026 __le32_to_cpu(cmd
->module_enable
),
7027 __le32_to_cpu(cmd
->module_valid
),
7028 __le32_to_cpu(cmd
->config_enable
),
7029 __le32_to_cpu(cmd
->config_valid
));
7033 static struct sk_buff
*
7034 ath10k_wmi_10_4_op_gen_dbglog_cfg(struct ath10k
*ar
, u64 module_enable
,
7037 struct wmi_10_4_dbglog_cfg_cmd
*cmd
;
7038 struct sk_buff
*skb
;
7041 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7043 return ERR_PTR(-ENOMEM
);
7045 cmd
= (struct wmi_10_4_dbglog_cfg_cmd
*)skb
->data
;
7047 if (module_enable
) {
7049 ATH10K_DBGLOG_CFG_LOG_LVL
);
7051 /* set back defaults, all modules with WARN level */
7052 cfg
= SM(ATH10K_DBGLOG_LEVEL_WARN
,
7053 ATH10K_DBGLOG_CFG_LOG_LVL
);
7057 cmd
->module_enable
= __cpu_to_le64(module_enable
);
7058 cmd
->module_valid
= __cpu_to_le64(~0);
7059 cmd
->config_enable
= __cpu_to_le32(cfg
);
7060 cmd
->config_valid
= __cpu_to_le32(ATH10K_DBGLOG_CFG_LOG_LVL_MASK
);
7062 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7063 "wmi dbglog cfg modules 0x%016llx 0x%016llx config %08x %08x\n",
7064 __le64_to_cpu(cmd
->module_enable
),
7065 __le64_to_cpu(cmd
->module_valid
),
7066 __le32_to_cpu(cmd
->config_enable
),
7067 __le32_to_cpu(cmd
->config_valid
));
7071 static struct sk_buff
*
7072 ath10k_wmi_op_gen_pktlog_enable(struct ath10k
*ar
, u32 ev_bitmap
)
7074 struct wmi_pdev_pktlog_enable_cmd
*cmd
;
7075 struct sk_buff
*skb
;
7077 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7079 return ERR_PTR(-ENOMEM
);
7081 ev_bitmap
&= ATH10K_PKTLOG_ANY
;
7083 cmd
= (struct wmi_pdev_pktlog_enable_cmd
*)skb
->data
;
7084 cmd
->ev_bitmap
= __cpu_to_le32(ev_bitmap
);
7086 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi enable pktlog filter 0x%08x\n",
7091 static struct sk_buff
*
7092 ath10k_wmi_op_gen_pktlog_disable(struct ath10k
*ar
)
7094 struct sk_buff
*skb
;
7096 skb
= ath10k_wmi_alloc_skb(ar
, 0);
7098 return ERR_PTR(-ENOMEM
);
7100 ath10k_dbg(ar
, ATH10K_DBG_WMI
, "wmi disable pktlog\n");
7104 static struct sk_buff
*
7105 ath10k_wmi_op_gen_pdev_set_quiet_mode(struct ath10k
*ar
, u32 period
,
7106 u32 duration
, u32 next_offset
,
7109 struct wmi_pdev_set_quiet_cmd
*cmd
;
7110 struct sk_buff
*skb
;
7112 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7114 return ERR_PTR(-ENOMEM
);
7116 cmd
= (struct wmi_pdev_set_quiet_cmd
*)skb
->data
;
7117 cmd
->period
= __cpu_to_le32(period
);
7118 cmd
->duration
= __cpu_to_le32(duration
);
7119 cmd
->next_start
= __cpu_to_le32(next_offset
);
7120 cmd
->enabled
= __cpu_to_le32(enabled
);
7122 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7123 "wmi quiet param: period %u duration %u enabled %d\n",
7124 period
, duration
, enabled
);
7128 static struct sk_buff
*
7129 ath10k_wmi_op_gen_addba_clear_resp(struct ath10k
*ar
, u32 vdev_id
,
7132 struct wmi_addba_clear_resp_cmd
*cmd
;
7133 struct sk_buff
*skb
;
7136 return ERR_PTR(-EINVAL
);
7138 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7140 return ERR_PTR(-ENOMEM
);
7142 cmd
= (struct wmi_addba_clear_resp_cmd
*)skb
->data
;
7143 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
7144 ether_addr_copy(cmd
->peer_macaddr
.addr
, mac
);
7146 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7147 "wmi addba clear resp vdev_id 0x%X mac_addr %pM\n",
7152 static struct sk_buff
*
7153 ath10k_wmi_op_gen_addba_send(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
7154 u32 tid
, u32 buf_size
)
7156 struct wmi_addba_send_cmd
*cmd
;
7157 struct sk_buff
*skb
;
7160 return ERR_PTR(-EINVAL
);
7162 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7164 return ERR_PTR(-ENOMEM
);
7166 cmd
= (struct wmi_addba_send_cmd
*)skb
->data
;
7167 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
7168 ether_addr_copy(cmd
->peer_macaddr
.addr
, mac
);
7169 cmd
->tid
= __cpu_to_le32(tid
);
7170 cmd
->buffersize
= __cpu_to_le32(buf_size
);
7172 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7173 "wmi addba send vdev_id 0x%X mac_addr %pM tid %u bufsize %u\n",
7174 vdev_id
, mac
, tid
, buf_size
);
7178 static struct sk_buff
*
7179 ath10k_wmi_op_gen_addba_set_resp(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
7180 u32 tid
, u32 status
)
7182 struct wmi_addba_setresponse_cmd
*cmd
;
7183 struct sk_buff
*skb
;
7186 return ERR_PTR(-EINVAL
);
7188 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7190 return ERR_PTR(-ENOMEM
);
7192 cmd
= (struct wmi_addba_setresponse_cmd
*)skb
->data
;
7193 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
7194 ether_addr_copy(cmd
->peer_macaddr
.addr
, mac
);
7195 cmd
->tid
= __cpu_to_le32(tid
);
7196 cmd
->statuscode
= __cpu_to_le32(status
);
7198 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7199 "wmi addba set resp vdev_id 0x%X mac_addr %pM tid %u status %u\n",
7200 vdev_id
, mac
, tid
, status
);
7204 static struct sk_buff
*
7205 ath10k_wmi_op_gen_delba_send(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
7206 u32 tid
, u32 initiator
, u32 reason
)
7208 struct wmi_delba_send_cmd
*cmd
;
7209 struct sk_buff
*skb
;
7212 return ERR_PTR(-EINVAL
);
7214 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7216 return ERR_PTR(-ENOMEM
);
7218 cmd
= (struct wmi_delba_send_cmd
*)skb
->data
;
7219 cmd
->vdev_id
= __cpu_to_le32(vdev_id
);
7220 ether_addr_copy(cmd
->peer_macaddr
.addr
, mac
);
7221 cmd
->tid
= __cpu_to_le32(tid
);
7222 cmd
->initiator
= __cpu_to_le32(initiator
);
7223 cmd
->reasoncode
= __cpu_to_le32(reason
);
7225 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7226 "wmi delba send vdev_id 0x%X mac_addr %pM tid %u initiator %u reason %u\n",
7227 vdev_id
, mac
, tid
, initiator
, reason
);
7231 static struct sk_buff
*
7232 ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config(struct ath10k
*ar
, u32 param
)
7234 struct wmi_pdev_get_tpc_config_cmd
*cmd
;
7235 struct sk_buff
*skb
;
7237 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7239 return ERR_PTR(-ENOMEM
);
7241 cmd
= (struct wmi_pdev_get_tpc_config_cmd
*)skb
->data
;
7242 cmd
->param
= __cpu_to_le32(param
);
7244 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7245 "wmi pdev get tcp config param:%d\n", param
);
7249 size_t ath10k_wmi_fw_stats_num_peers(struct list_head
*head
)
7251 struct ath10k_fw_stats_peer
*i
;
7254 list_for_each_entry(i
, head
, list
)
7260 size_t ath10k_wmi_fw_stats_num_vdevs(struct list_head
*head
)
7262 struct ath10k_fw_stats_vdev
*i
;
7265 list_for_each_entry(i
, head
, list
)
7272 ath10k_wmi_fw_pdev_base_stats_fill(const struct ath10k_fw_stats_pdev
*pdev
,
7273 char *buf
, u32
*length
)
7276 u32 buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7278 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7279 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n",
7280 "ath10k PDEV stats");
7281 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7282 "=================");
7284 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7285 "Channel noise floor", pdev
->ch_noise_floor
);
7286 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7287 "Channel TX power", pdev
->chan_tx_power
);
7288 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7289 "TX frame count", pdev
->tx_frame_count
);
7290 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7291 "RX frame count", pdev
->rx_frame_count
);
7292 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7293 "RX clear count", pdev
->rx_clear_count
);
7294 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7295 "Cycle count", pdev
->cycle_count
);
7296 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7297 "PHY error count", pdev
->phy_err_count
);
7303 ath10k_wmi_fw_pdev_extra_stats_fill(const struct ath10k_fw_stats_pdev
*pdev
,
7304 char *buf
, u32
*length
)
7307 u32 buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7309 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7310 "RTS bad count", pdev
->rts_bad
);
7311 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7312 "RTS good count", pdev
->rts_good
);
7313 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7314 "FCS bad count", pdev
->fcs_bad
);
7315 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7316 "No beacon count", pdev
->no_beacons
);
7317 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10u\n",
7318 "MIB int count", pdev
->mib_int_count
);
7320 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7325 ath10k_wmi_fw_pdev_tx_stats_fill(const struct ath10k_fw_stats_pdev
*pdev
,
7326 char *buf
, u32
*length
)
7329 u32 buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7331 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n%30s\n",
7332 "ath10k PDEV TX stats");
7333 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7334 "=================");
7336 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7337 "HTT cookies queued", pdev
->comp_queued
);
7338 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7339 "HTT cookies disp.", pdev
->comp_delivered
);
7340 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7341 "MSDU queued", pdev
->msdu_enqued
);
7342 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7343 "MPDU queued", pdev
->mpdu_enqued
);
7344 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7345 "MSDUs dropped", pdev
->wmm_drop
);
7346 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7347 "Local enqued", pdev
->local_enqued
);
7348 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7349 "Local freed", pdev
->local_freed
);
7350 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7351 "HW queued", pdev
->hw_queued
);
7352 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7353 "PPDUs reaped", pdev
->hw_reaped
);
7354 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7355 "Num underruns", pdev
->underrun
);
7356 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7357 "PPDUs cleaned", pdev
->tx_abort
);
7358 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7359 "MPDUs requed", pdev
->mpdus_requed
);
7360 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7361 "Excessive retries", pdev
->tx_ko
);
7362 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7363 "HW rate", pdev
->data_rc
);
7364 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7365 "Sched self tiggers", pdev
->self_triggers
);
7366 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7367 "Dropped due to SW retries",
7368 pdev
->sw_retry_failure
);
7369 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7370 "Illegal rate phy errors",
7371 pdev
->illgl_rate_phy_err
);
7372 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7373 "Pdev continuous xretry", pdev
->pdev_cont_xretry
);
7374 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7375 "TX timeout", pdev
->pdev_tx_timeout
);
7376 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7377 "PDEV resets", pdev
->pdev_resets
);
7378 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7379 "PHY underrun", pdev
->phy_underrun
);
7380 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7381 "MPDU is more than txop limit", pdev
->txop_ovf
);
7386 ath10k_wmi_fw_pdev_rx_stats_fill(const struct ath10k_fw_stats_pdev
*pdev
,
7387 char *buf
, u32
*length
)
7390 u32 buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7392 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n%30s\n",
7393 "ath10k PDEV RX stats");
7394 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7395 "=================");
7397 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7398 "Mid PPDU route change",
7399 pdev
->mid_ppdu_route_change
);
7400 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7401 "Tot. number of statuses", pdev
->status_rcvd
);
7402 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7403 "Extra frags on rings 0", pdev
->r0_frags
);
7404 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7405 "Extra frags on rings 1", pdev
->r1_frags
);
7406 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7407 "Extra frags on rings 2", pdev
->r2_frags
);
7408 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7409 "Extra frags on rings 3", pdev
->r3_frags
);
7410 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7411 "MSDUs delivered to HTT", pdev
->htt_msdus
);
7412 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7413 "MPDUs delivered to HTT", pdev
->htt_mpdus
);
7414 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7415 "MSDUs delivered to stack", pdev
->loc_msdus
);
7416 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7417 "MPDUs delivered to stack", pdev
->loc_mpdus
);
7418 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7419 "Oversized AMSUs", pdev
->oversize_amsdu
);
7420 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7421 "PHY errors", pdev
->phy_errs
);
7422 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7423 "PHY errors drops", pdev
->phy_err_drop
);
7424 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7425 "MPDU errors (FCS, MIC, ENC)", pdev
->mpdu_errs
);
7430 ath10k_wmi_fw_vdev_stats_fill(const struct ath10k_fw_stats_vdev
*vdev
,
7431 char *buf
, u32
*length
)
7434 u32 buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7437 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7438 "vdev id", vdev
->vdev_id
);
7439 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7440 "beacon snr", vdev
->beacon_snr
);
7441 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7442 "data snr", vdev
->data_snr
);
7443 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7444 "num rx frames", vdev
->num_rx_frames
);
7445 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7446 "num rts fail", vdev
->num_rts_fail
);
7447 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7448 "num rts success", vdev
->num_rts_success
);
7449 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7450 "num rx err", vdev
->num_rx_err
);
7451 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7452 "num rx discard", vdev
->num_rx_discard
);
7453 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7454 "num tx not acked", vdev
->num_tx_not_acked
);
7456 for (i
= 0 ; i
< ARRAY_SIZE(vdev
->num_tx_frames
); i
++)
7457 len
+= scnprintf(buf
+ len
, buf_len
- len
,
7460 vdev
->num_tx_frames
[i
]);
7462 for (i
= 0 ; i
< ARRAY_SIZE(vdev
->num_tx_frames_retries
); i
++)
7463 len
+= scnprintf(buf
+ len
, buf_len
- len
,
7465 "num tx frames retries", i
,
7466 vdev
->num_tx_frames_retries
[i
]);
7468 for (i
= 0 ; i
< ARRAY_SIZE(vdev
->num_tx_frames_failures
); i
++)
7469 len
+= scnprintf(buf
+ len
, buf_len
- len
,
7471 "num tx frames failures", i
,
7472 vdev
->num_tx_frames_failures
[i
]);
7474 for (i
= 0 ; i
< ARRAY_SIZE(vdev
->tx_rate_history
); i
++)
7475 len
+= scnprintf(buf
+ len
, buf_len
- len
,
7476 "%25s [%02d] 0x%08x\n",
7477 "tx rate history", i
,
7478 vdev
->tx_rate_history
[i
]);
7480 for (i
= 0 ; i
< ARRAY_SIZE(vdev
->beacon_rssi_history
); i
++)
7481 len
+= scnprintf(buf
+ len
, buf_len
- len
,
7483 "beacon rssi history", i
,
7484 vdev
->beacon_rssi_history
[i
]);
7486 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7491 ath10k_wmi_fw_peer_stats_fill(const struct ath10k_fw_stats_peer
*peer
,
7492 char *buf
, u32
*length
)
7495 u32 buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7497 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %pM\n",
7498 "Peer MAC address", peer
->peer_macaddr
);
7499 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7500 "Peer RSSI", peer
->peer_rssi
);
7501 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7502 "Peer TX rate", peer
->peer_tx_rate
);
7503 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7504 "Peer RX rate", peer
->peer_rx_rate
);
7505 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %u\n",
7506 "Peer RX duration", peer
->rx_duration
);
7508 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7512 void ath10k_wmi_main_op_fw_stats_fill(struct ath10k
*ar
,
7513 struct ath10k_fw_stats
*fw_stats
,
7517 u32 buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7518 const struct ath10k_fw_stats_pdev
*pdev
;
7519 const struct ath10k_fw_stats_vdev
*vdev
;
7520 const struct ath10k_fw_stats_peer
*peer
;
7524 spin_lock_bh(&ar
->data_lock
);
7526 pdev
= list_first_entry_or_null(&fw_stats
->pdevs
,
7527 struct ath10k_fw_stats_pdev
, list
);
7529 ath10k_warn(ar
, "failed to get pdev stats\n");
7533 num_peers
= ath10k_wmi_fw_stats_num_peers(&fw_stats
->peers
);
7534 num_vdevs
= ath10k_wmi_fw_stats_num_vdevs(&fw_stats
->vdevs
);
7536 ath10k_wmi_fw_pdev_base_stats_fill(pdev
, buf
, &len
);
7537 ath10k_wmi_fw_pdev_tx_stats_fill(pdev
, buf
, &len
);
7538 ath10k_wmi_fw_pdev_rx_stats_fill(pdev
, buf
, &len
);
7540 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7541 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s (%zu)\n",
7542 "ath10k VDEV stats", num_vdevs
);
7543 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7544 "=================");
7546 list_for_each_entry(vdev
, &fw_stats
->vdevs
, list
) {
7547 ath10k_wmi_fw_vdev_stats_fill(vdev
, buf
, &len
);
7550 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7551 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s (%zu)\n",
7552 "ath10k PEER stats", num_peers
);
7553 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7554 "=================");
7556 list_for_each_entry(peer
, &fw_stats
->peers
, list
) {
7557 ath10k_wmi_fw_peer_stats_fill(peer
, buf
, &len
);
7561 spin_unlock_bh(&ar
->data_lock
);
7569 void ath10k_wmi_10x_op_fw_stats_fill(struct ath10k
*ar
,
7570 struct ath10k_fw_stats
*fw_stats
,
7573 unsigned int len
= 0;
7574 unsigned int buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7575 const struct ath10k_fw_stats_pdev
*pdev
;
7576 const struct ath10k_fw_stats_vdev
*vdev
;
7577 const struct ath10k_fw_stats_peer
*peer
;
7581 spin_lock_bh(&ar
->data_lock
);
7583 pdev
= list_first_entry_or_null(&fw_stats
->pdevs
,
7584 struct ath10k_fw_stats_pdev
, list
);
7586 ath10k_warn(ar
, "failed to get pdev stats\n");
7590 num_peers
= ath10k_wmi_fw_stats_num_peers(&fw_stats
->peers
);
7591 num_vdevs
= ath10k_wmi_fw_stats_num_vdevs(&fw_stats
->vdevs
);
7593 ath10k_wmi_fw_pdev_base_stats_fill(pdev
, buf
, &len
);
7594 ath10k_wmi_fw_pdev_extra_stats_fill(pdev
, buf
, &len
);
7595 ath10k_wmi_fw_pdev_tx_stats_fill(pdev
, buf
, &len
);
7596 ath10k_wmi_fw_pdev_rx_stats_fill(pdev
, buf
, &len
);
7598 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7599 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s (%zu)\n",
7600 "ath10k VDEV stats", num_vdevs
);
7601 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7602 "=================");
7604 list_for_each_entry(vdev
, &fw_stats
->vdevs
, list
) {
7605 ath10k_wmi_fw_vdev_stats_fill(vdev
, buf
, &len
);
7608 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7609 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s (%zu)\n",
7610 "ath10k PEER stats", num_peers
);
7611 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7612 "=================");
7614 list_for_each_entry(peer
, &fw_stats
->peers
, list
) {
7615 ath10k_wmi_fw_peer_stats_fill(peer
, buf
, &len
);
7619 spin_unlock_bh(&ar
->data_lock
);
7627 static struct sk_buff
*
7628 ath10k_wmi_op_gen_pdev_enable_adaptive_cca(struct ath10k
*ar
, u8 enable
,
7629 u32 detect_level
, u32 detect_margin
)
7631 struct wmi_pdev_set_adaptive_cca_params
*cmd
;
7632 struct sk_buff
*skb
;
7634 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7636 return ERR_PTR(-ENOMEM
);
7638 cmd
= (struct wmi_pdev_set_adaptive_cca_params
*)skb
->data
;
7639 cmd
->enable
= __cpu_to_le32(enable
);
7640 cmd
->cca_detect_level
= __cpu_to_le32(detect_level
);
7641 cmd
->cca_detect_margin
= __cpu_to_le32(detect_margin
);
7643 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7644 "wmi pdev set adaptive cca params enable:%d detection level:%d detection margin:%d\n",
7645 enable
, detect_level
, detect_margin
);
7649 void ath10k_wmi_10_4_op_fw_stats_fill(struct ath10k
*ar
,
7650 struct ath10k_fw_stats
*fw_stats
,
7654 u32 buf_len
= ATH10K_FW_STATS_BUF_SIZE
;
7655 const struct ath10k_fw_stats_pdev
*pdev
;
7656 const struct ath10k_fw_stats_vdev
*vdev
;
7657 const struct ath10k_fw_stats_peer
*peer
;
7661 spin_lock_bh(&ar
->data_lock
);
7663 pdev
= list_first_entry_or_null(&fw_stats
->pdevs
,
7664 struct ath10k_fw_stats_pdev
, list
);
7666 ath10k_warn(ar
, "failed to get pdev stats\n");
7670 num_peers
= ath10k_wmi_fw_stats_num_peers(&fw_stats
->peers
);
7671 num_vdevs
= ath10k_wmi_fw_stats_num_vdevs(&fw_stats
->vdevs
);
7673 ath10k_wmi_fw_pdev_base_stats_fill(pdev
, buf
, &len
);
7674 ath10k_wmi_fw_pdev_extra_stats_fill(pdev
, buf
, &len
);
7675 ath10k_wmi_fw_pdev_tx_stats_fill(pdev
, buf
, &len
);
7677 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7678 "HW paused", pdev
->hw_paused
);
7679 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7680 "Seqs posted", pdev
->seq_posted
);
7681 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7682 "Seqs failed queueing", pdev
->seq_failed_queueing
);
7683 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7684 "Seqs completed", pdev
->seq_completed
);
7685 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7686 "Seqs restarted", pdev
->seq_restarted
);
7687 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7688 "MU Seqs posted", pdev
->mu_seq_posted
);
7689 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7690 "MPDUs SW flushed", pdev
->mpdus_sw_flush
);
7691 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7692 "MPDUs HW filtered", pdev
->mpdus_hw_filter
);
7693 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7694 "MPDUs truncated", pdev
->mpdus_truncated
);
7695 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7696 "MPDUs receive no ACK", pdev
->mpdus_ack_failed
);
7697 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7698 "MPDUs expired", pdev
->mpdus_expired
);
7700 ath10k_wmi_fw_pdev_rx_stats_fill(pdev
, buf
, &len
);
7701 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s %10d\n",
7702 "Num Rx Overflow errors", pdev
->rx_ovfl_errs
);
7704 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7705 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s (%zu)\n",
7706 "ath10k VDEV stats", num_vdevs
);
7707 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7708 "=================");
7710 list_for_each_entry(vdev
, &fw_stats
->vdevs
, list
) {
7711 ath10k_wmi_fw_vdev_stats_fill(vdev
, buf
, &len
);
7714 len
+= scnprintf(buf
+ len
, buf_len
- len
, "\n");
7715 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s (%zu)\n",
7716 "ath10k PEER stats", num_peers
);
7717 len
+= scnprintf(buf
+ len
, buf_len
- len
, "%30s\n\n",
7718 "=================");
7720 list_for_each_entry(peer
, &fw_stats
->peers
, list
) {
7721 ath10k_wmi_fw_peer_stats_fill(peer
, buf
, &len
);
7725 spin_unlock_bh(&ar
->data_lock
);
7733 int ath10k_wmi_op_get_vdev_subtype(struct ath10k
*ar
,
7734 enum wmi_vdev_subtype subtype
)
7737 case WMI_VDEV_SUBTYPE_NONE
:
7738 return WMI_VDEV_SUBTYPE_LEGACY_NONE
;
7739 case WMI_VDEV_SUBTYPE_P2P_DEVICE
:
7740 return WMI_VDEV_SUBTYPE_LEGACY_P2P_DEV
;
7741 case WMI_VDEV_SUBTYPE_P2P_CLIENT
:
7742 return WMI_VDEV_SUBTYPE_LEGACY_P2P_CLI
;
7743 case WMI_VDEV_SUBTYPE_P2P_GO
:
7744 return WMI_VDEV_SUBTYPE_LEGACY_P2P_GO
;
7745 case WMI_VDEV_SUBTYPE_PROXY_STA
:
7746 return WMI_VDEV_SUBTYPE_LEGACY_PROXY_STA
;
7747 case WMI_VDEV_SUBTYPE_MESH_11S
:
7748 case WMI_VDEV_SUBTYPE_MESH_NON_11S
:
7754 static int ath10k_wmi_10_2_4_op_get_vdev_subtype(struct ath10k
*ar
,
7755 enum wmi_vdev_subtype subtype
)
7758 case WMI_VDEV_SUBTYPE_NONE
:
7759 return WMI_VDEV_SUBTYPE_10_2_4_NONE
;
7760 case WMI_VDEV_SUBTYPE_P2P_DEVICE
:
7761 return WMI_VDEV_SUBTYPE_10_2_4_P2P_DEV
;
7762 case WMI_VDEV_SUBTYPE_P2P_CLIENT
:
7763 return WMI_VDEV_SUBTYPE_10_2_4_P2P_CLI
;
7764 case WMI_VDEV_SUBTYPE_P2P_GO
:
7765 return WMI_VDEV_SUBTYPE_10_2_4_P2P_GO
;
7766 case WMI_VDEV_SUBTYPE_PROXY_STA
:
7767 return WMI_VDEV_SUBTYPE_10_2_4_PROXY_STA
;
7768 case WMI_VDEV_SUBTYPE_MESH_11S
:
7769 return WMI_VDEV_SUBTYPE_10_2_4_MESH_11S
;
7770 case WMI_VDEV_SUBTYPE_MESH_NON_11S
:
7776 static int ath10k_wmi_10_4_op_get_vdev_subtype(struct ath10k
*ar
,
7777 enum wmi_vdev_subtype subtype
)
7780 case WMI_VDEV_SUBTYPE_NONE
:
7781 return WMI_VDEV_SUBTYPE_10_4_NONE
;
7782 case WMI_VDEV_SUBTYPE_P2P_DEVICE
:
7783 return WMI_VDEV_SUBTYPE_10_4_P2P_DEV
;
7784 case WMI_VDEV_SUBTYPE_P2P_CLIENT
:
7785 return WMI_VDEV_SUBTYPE_10_4_P2P_CLI
;
7786 case WMI_VDEV_SUBTYPE_P2P_GO
:
7787 return WMI_VDEV_SUBTYPE_10_4_P2P_GO
;
7788 case WMI_VDEV_SUBTYPE_PROXY_STA
:
7789 return WMI_VDEV_SUBTYPE_10_4_PROXY_STA
;
7790 case WMI_VDEV_SUBTYPE_MESH_11S
:
7791 return WMI_VDEV_SUBTYPE_10_4_MESH_11S
;
7792 case WMI_VDEV_SUBTYPE_MESH_NON_11S
:
7793 return WMI_VDEV_SUBTYPE_10_4_MESH_NON_11S
;
7798 static struct sk_buff
*
7799 ath10k_wmi_10_4_ext_resource_config(struct ath10k
*ar
,
7800 enum wmi_host_platform_type type
,
7801 u32 fw_feature_bitmap
)
7803 struct wmi_ext_resource_config_10_4_cmd
*cmd
;
7804 struct sk_buff
*skb
;
7806 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7808 return ERR_PTR(-ENOMEM
);
7810 cmd
= (struct wmi_ext_resource_config_10_4_cmd
*)skb
->data
;
7811 cmd
->host_platform_config
= __cpu_to_le32(type
);
7812 cmd
->fw_feature_bitmap
= __cpu_to_le32(fw_feature_bitmap
);
7814 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7815 "wmi ext resource config host type %d firmware feature bitmap %08x\n",
7816 type
, fw_feature_bitmap
);
7820 static struct sk_buff
*
7821 ath10k_wmi_op_gen_echo(struct ath10k
*ar
, u32 value
)
7823 struct wmi_echo_cmd
*cmd
;
7824 struct sk_buff
*skb
;
7826 skb
= ath10k_wmi_alloc_skb(ar
, sizeof(*cmd
));
7828 return ERR_PTR(-ENOMEM
);
7830 cmd
= (struct wmi_echo_cmd
*)skb
->data
;
7831 cmd
->value
= cpu_to_le32(value
);
7833 ath10k_dbg(ar
, ATH10K_DBG_WMI
,
7834 "wmi echo value 0x%08x\n", value
);
7839 ath10k_wmi_barrier(struct ath10k
*ar
)
7844 spin_lock_bh(&ar
->data_lock
);
7845 reinit_completion(&ar
->wmi
.barrier
);
7846 spin_unlock_bh(&ar
->data_lock
);
7848 ret
= ath10k_wmi_echo(ar
, ATH10K_WMI_BARRIER_ECHO_ID
);
7850 ath10k_warn(ar
, "failed to submit wmi echo: %d\n", ret
);
7854 time_left
= wait_for_completion_timeout(&ar
->wmi
.barrier
,
7855 ATH10K_WMI_BARRIER_TIMEOUT_HZ
);
7862 static const struct wmi_ops wmi_ops
= {
7863 .rx
= ath10k_wmi_op_rx
,
7864 .map_svc
= wmi_main_svc_map
,
7866 .pull_scan
= ath10k_wmi_op_pull_scan_ev
,
7867 .pull_mgmt_rx
= ath10k_wmi_op_pull_mgmt_rx_ev
,
7868 .pull_ch_info
= ath10k_wmi_op_pull_ch_info_ev
,
7869 .pull_vdev_start
= ath10k_wmi_op_pull_vdev_start_ev
,
7870 .pull_peer_kick
= ath10k_wmi_op_pull_peer_kick_ev
,
7871 .pull_swba
= ath10k_wmi_op_pull_swba_ev
,
7872 .pull_phyerr_hdr
= ath10k_wmi_op_pull_phyerr_ev_hdr
,
7873 .pull_phyerr
= ath10k_wmi_op_pull_phyerr_ev
,
7874 .pull_svc_rdy
= ath10k_wmi_main_op_pull_svc_rdy_ev
,
7875 .pull_rdy
= ath10k_wmi_op_pull_rdy_ev
,
7876 .pull_fw_stats
= ath10k_wmi_main_op_pull_fw_stats
,
7877 .pull_roam_ev
= ath10k_wmi_op_pull_roam_ev
,
7878 .pull_echo_ev
= ath10k_wmi_op_pull_echo_ev
,
7880 .gen_pdev_suspend
= ath10k_wmi_op_gen_pdev_suspend
,
7881 .gen_pdev_resume
= ath10k_wmi_op_gen_pdev_resume
,
7882 .gen_pdev_set_rd
= ath10k_wmi_op_gen_pdev_set_rd
,
7883 .gen_pdev_set_param
= ath10k_wmi_op_gen_pdev_set_param
,
7884 .gen_init
= ath10k_wmi_op_gen_init
,
7885 .gen_start_scan
= ath10k_wmi_op_gen_start_scan
,
7886 .gen_stop_scan
= ath10k_wmi_op_gen_stop_scan
,
7887 .gen_vdev_create
= ath10k_wmi_op_gen_vdev_create
,
7888 .gen_vdev_delete
= ath10k_wmi_op_gen_vdev_delete
,
7889 .gen_vdev_start
= ath10k_wmi_op_gen_vdev_start
,
7890 .gen_vdev_stop
= ath10k_wmi_op_gen_vdev_stop
,
7891 .gen_vdev_up
= ath10k_wmi_op_gen_vdev_up
,
7892 .gen_vdev_down
= ath10k_wmi_op_gen_vdev_down
,
7893 .gen_vdev_set_param
= ath10k_wmi_op_gen_vdev_set_param
,
7894 .gen_vdev_install_key
= ath10k_wmi_op_gen_vdev_install_key
,
7895 .gen_vdev_spectral_conf
= ath10k_wmi_op_gen_vdev_spectral_conf
,
7896 .gen_vdev_spectral_enable
= ath10k_wmi_op_gen_vdev_spectral_enable
,
7897 /* .gen_vdev_wmm_conf not implemented */
7898 .gen_peer_create
= ath10k_wmi_op_gen_peer_create
,
7899 .gen_peer_delete
= ath10k_wmi_op_gen_peer_delete
,
7900 .gen_peer_flush
= ath10k_wmi_op_gen_peer_flush
,
7901 .gen_peer_set_param
= ath10k_wmi_op_gen_peer_set_param
,
7902 .gen_peer_assoc
= ath10k_wmi_op_gen_peer_assoc
,
7903 .gen_set_psmode
= ath10k_wmi_op_gen_set_psmode
,
7904 .gen_set_sta_ps
= ath10k_wmi_op_gen_set_sta_ps
,
7905 .gen_set_ap_ps
= ath10k_wmi_op_gen_set_ap_ps
,
7906 .gen_scan_chan_list
= ath10k_wmi_op_gen_scan_chan_list
,
7907 .gen_beacon_dma
= ath10k_wmi_op_gen_beacon_dma
,
7908 .gen_pdev_set_wmm
= ath10k_wmi_op_gen_pdev_set_wmm
,
7909 .gen_request_stats
= ath10k_wmi_op_gen_request_stats
,
7910 .gen_force_fw_hang
= ath10k_wmi_op_gen_force_fw_hang
,
7911 .gen_mgmt_tx
= ath10k_wmi_op_gen_mgmt_tx
,
7912 .gen_dbglog_cfg
= ath10k_wmi_op_gen_dbglog_cfg
,
7913 .gen_pktlog_enable
= ath10k_wmi_op_gen_pktlog_enable
,
7914 .gen_pktlog_disable
= ath10k_wmi_op_gen_pktlog_disable
,
7915 .gen_pdev_set_quiet_mode
= ath10k_wmi_op_gen_pdev_set_quiet_mode
,
7916 /* .gen_pdev_get_temperature not implemented */
7917 .gen_addba_clear_resp
= ath10k_wmi_op_gen_addba_clear_resp
,
7918 .gen_addba_send
= ath10k_wmi_op_gen_addba_send
,
7919 .gen_addba_set_resp
= ath10k_wmi_op_gen_addba_set_resp
,
7920 .gen_delba_send
= ath10k_wmi_op_gen_delba_send
,
7921 .fw_stats_fill
= ath10k_wmi_main_op_fw_stats_fill
,
7922 .get_vdev_subtype
= ath10k_wmi_op_get_vdev_subtype
,
7923 .gen_echo
= ath10k_wmi_op_gen_echo
,
7924 /* .gen_bcn_tmpl not implemented */
7925 /* .gen_prb_tmpl not implemented */
7926 /* .gen_p2p_go_bcn_ie not implemented */
7927 /* .gen_adaptive_qcs not implemented */
7928 /* .gen_pdev_enable_adaptive_cca not implemented */
7931 static const struct wmi_ops wmi_10_1_ops
= {
7932 .rx
= ath10k_wmi_10_1_op_rx
,
7933 .map_svc
= wmi_10x_svc_map
,
7934 .pull_svc_rdy
= ath10k_wmi_10x_op_pull_svc_rdy_ev
,
7935 .pull_fw_stats
= ath10k_wmi_10x_op_pull_fw_stats
,
7936 .gen_init
= ath10k_wmi_10_1_op_gen_init
,
7937 .gen_pdev_set_rd
= ath10k_wmi_10x_op_gen_pdev_set_rd
,
7938 .gen_start_scan
= ath10k_wmi_10x_op_gen_start_scan
,
7939 .gen_peer_assoc
= ath10k_wmi_10_1_op_gen_peer_assoc
,
7940 /* .gen_pdev_get_temperature not implemented */
7942 /* shared with main branch */
7943 .pull_scan
= ath10k_wmi_op_pull_scan_ev
,
7944 .pull_mgmt_rx
= ath10k_wmi_op_pull_mgmt_rx_ev
,
7945 .pull_ch_info
= ath10k_wmi_op_pull_ch_info_ev
,
7946 .pull_vdev_start
= ath10k_wmi_op_pull_vdev_start_ev
,
7947 .pull_peer_kick
= ath10k_wmi_op_pull_peer_kick_ev
,
7948 .pull_swba
= ath10k_wmi_op_pull_swba_ev
,
7949 .pull_phyerr_hdr
= ath10k_wmi_op_pull_phyerr_ev_hdr
,
7950 .pull_phyerr
= ath10k_wmi_op_pull_phyerr_ev
,
7951 .pull_rdy
= ath10k_wmi_op_pull_rdy_ev
,
7952 .pull_roam_ev
= ath10k_wmi_op_pull_roam_ev
,
7953 .pull_echo_ev
= ath10k_wmi_op_pull_echo_ev
,
7955 .gen_pdev_suspend
= ath10k_wmi_op_gen_pdev_suspend
,
7956 .gen_pdev_resume
= ath10k_wmi_op_gen_pdev_resume
,
7957 .gen_pdev_set_param
= ath10k_wmi_op_gen_pdev_set_param
,
7958 .gen_stop_scan
= ath10k_wmi_op_gen_stop_scan
,
7959 .gen_vdev_create
= ath10k_wmi_op_gen_vdev_create
,
7960 .gen_vdev_delete
= ath10k_wmi_op_gen_vdev_delete
,
7961 .gen_vdev_start
= ath10k_wmi_op_gen_vdev_start
,
7962 .gen_vdev_stop
= ath10k_wmi_op_gen_vdev_stop
,
7963 .gen_vdev_up
= ath10k_wmi_op_gen_vdev_up
,
7964 .gen_vdev_down
= ath10k_wmi_op_gen_vdev_down
,
7965 .gen_vdev_set_param
= ath10k_wmi_op_gen_vdev_set_param
,
7966 .gen_vdev_install_key
= ath10k_wmi_op_gen_vdev_install_key
,
7967 .gen_vdev_spectral_conf
= ath10k_wmi_op_gen_vdev_spectral_conf
,
7968 .gen_vdev_spectral_enable
= ath10k_wmi_op_gen_vdev_spectral_enable
,
7969 /* .gen_vdev_wmm_conf not implemented */
7970 .gen_peer_create
= ath10k_wmi_op_gen_peer_create
,
7971 .gen_peer_delete
= ath10k_wmi_op_gen_peer_delete
,
7972 .gen_peer_flush
= ath10k_wmi_op_gen_peer_flush
,
7973 .gen_peer_set_param
= ath10k_wmi_op_gen_peer_set_param
,
7974 .gen_set_psmode
= ath10k_wmi_op_gen_set_psmode
,
7975 .gen_set_sta_ps
= ath10k_wmi_op_gen_set_sta_ps
,
7976 .gen_set_ap_ps
= ath10k_wmi_op_gen_set_ap_ps
,
7977 .gen_scan_chan_list
= ath10k_wmi_op_gen_scan_chan_list
,
7978 .gen_beacon_dma
= ath10k_wmi_op_gen_beacon_dma
,
7979 .gen_pdev_set_wmm
= ath10k_wmi_op_gen_pdev_set_wmm
,
7980 .gen_request_stats
= ath10k_wmi_op_gen_request_stats
,
7981 .gen_force_fw_hang
= ath10k_wmi_op_gen_force_fw_hang
,
7982 .gen_mgmt_tx
= ath10k_wmi_op_gen_mgmt_tx
,
7983 .gen_dbglog_cfg
= ath10k_wmi_op_gen_dbglog_cfg
,
7984 .gen_pktlog_enable
= ath10k_wmi_op_gen_pktlog_enable
,
7985 .gen_pktlog_disable
= ath10k_wmi_op_gen_pktlog_disable
,
7986 .gen_pdev_set_quiet_mode
= ath10k_wmi_op_gen_pdev_set_quiet_mode
,
7987 .gen_addba_clear_resp
= ath10k_wmi_op_gen_addba_clear_resp
,
7988 .gen_addba_send
= ath10k_wmi_op_gen_addba_send
,
7989 .gen_addba_set_resp
= ath10k_wmi_op_gen_addba_set_resp
,
7990 .gen_delba_send
= ath10k_wmi_op_gen_delba_send
,
7991 .fw_stats_fill
= ath10k_wmi_10x_op_fw_stats_fill
,
7992 .get_vdev_subtype
= ath10k_wmi_op_get_vdev_subtype
,
7993 .gen_echo
= ath10k_wmi_op_gen_echo
,
7994 /* .gen_bcn_tmpl not implemented */
7995 /* .gen_prb_tmpl not implemented */
7996 /* .gen_p2p_go_bcn_ie not implemented */
7997 /* .gen_adaptive_qcs not implemented */
7998 /* .gen_pdev_enable_adaptive_cca not implemented */
8001 static const struct wmi_ops wmi_10_2_ops
= {
8002 .rx
= ath10k_wmi_10_2_op_rx
,
8003 .pull_fw_stats
= ath10k_wmi_10_2_op_pull_fw_stats
,
8004 .gen_init
= ath10k_wmi_10_2_op_gen_init
,
8005 .gen_peer_assoc
= ath10k_wmi_10_2_op_gen_peer_assoc
,
8006 /* .gen_pdev_get_temperature not implemented */
8008 /* shared with 10.1 */
8009 .map_svc
= wmi_10x_svc_map
,
8010 .pull_svc_rdy
= ath10k_wmi_10x_op_pull_svc_rdy_ev
,
8011 .gen_pdev_set_rd
= ath10k_wmi_10x_op_gen_pdev_set_rd
,
8012 .gen_start_scan
= ath10k_wmi_10x_op_gen_start_scan
,
8013 .gen_echo
= ath10k_wmi_op_gen_echo
,
8015 .pull_scan
= ath10k_wmi_op_pull_scan_ev
,
8016 .pull_mgmt_rx
= ath10k_wmi_op_pull_mgmt_rx_ev
,
8017 .pull_ch_info
= ath10k_wmi_op_pull_ch_info_ev
,
8018 .pull_vdev_start
= ath10k_wmi_op_pull_vdev_start_ev
,
8019 .pull_peer_kick
= ath10k_wmi_op_pull_peer_kick_ev
,
8020 .pull_swba
= ath10k_wmi_op_pull_swba_ev
,
8021 .pull_phyerr_hdr
= ath10k_wmi_op_pull_phyerr_ev_hdr
,
8022 .pull_phyerr
= ath10k_wmi_op_pull_phyerr_ev
,
8023 .pull_rdy
= ath10k_wmi_op_pull_rdy_ev
,
8024 .pull_roam_ev
= ath10k_wmi_op_pull_roam_ev
,
8025 .pull_echo_ev
= ath10k_wmi_op_pull_echo_ev
,
8027 .gen_pdev_suspend
= ath10k_wmi_op_gen_pdev_suspend
,
8028 .gen_pdev_resume
= ath10k_wmi_op_gen_pdev_resume
,
8029 .gen_pdev_set_param
= ath10k_wmi_op_gen_pdev_set_param
,
8030 .gen_stop_scan
= ath10k_wmi_op_gen_stop_scan
,
8031 .gen_vdev_create
= ath10k_wmi_op_gen_vdev_create
,
8032 .gen_vdev_delete
= ath10k_wmi_op_gen_vdev_delete
,
8033 .gen_vdev_start
= ath10k_wmi_op_gen_vdev_start
,
8034 .gen_vdev_stop
= ath10k_wmi_op_gen_vdev_stop
,
8035 .gen_vdev_up
= ath10k_wmi_op_gen_vdev_up
,
8036 .gen_vdev_down
= ath10k_wmi_op_gen_vdev_down
,
8037 .gen_vdev_set_param
= ath10k_wmi_op_gen_vdev_set_param
,
8038 .gen_vdev_install_key
= ath10k_wmi_op_gen_vdev_install_key
,
8039 .gen_vdev_spectral_conf
= ath10k_wmi_op_gen_vdev_spectral_conf
,
8040 .gen_vdev_spectral_enable
= ath10k_wmi_op_gen_vdev_spectral_enable
,
8041 /* .gen_vdev_wmm_conf not implemented */
8042 .gen_peer_create
= ath10k_wmi_op_gen_peer_create
,
8043 .gen_peer_delete
= ath10k_wmi_op_gen_peer_delete
,
8044 .gen_peer_flush
= ath10k_wmi_op_gen_peer_flush
,
8045 .gen_peer_set_param
= ath10k_wmi_op_gen_peer_set_param
,
8046 .gen_set_psmode
= ath10k_wmi_op_gen_set_psmode
,
8047 .gen_set_sta_ps
= ath10k_wmi_op_gen_set_sta_ps
,
8048 .gen_set_ap_ps
= ath10k_wmi_op_gen_set_ap_ps
,
8049 .gen_scan_chan_list
= ath10k_wmi_op_gen_scan_chan_list
,
8050 .gen_beacon_dma
= ath10k_wmi_op_gen_beacon_dma
,
8051 .gen_pdev_set_wmm
= ath10k_wmi_op_gen_pdev_set_wmm
,
8052 .gen_request_stats
= ath10k_wmi_op_gen_request_stats
,
8053 .gen_force_fw_hang
= ath10k_wmi_op_gen_force_fw_hang
,
8054 .gen_mgmt_tx
= ath10k_wmi_op_gen_mgmt_tx
,
8055 .gen_dbglog_cfg
= ath10k_wmi_op_gen_dbglog_cfg
,
8056 .gen_pktlog_enable
= ath10k_wmi_op_gen_pktlog_enable
,
8057 .gen_pktlog_disable
= ath10k_wmi_op_gen_pktlog_disable
,
8058 .gen_pdev_set_quiet_mode
= ath10k_wmi_op_gen_pdev_set_quiet_mode
,
8059 .gen_addba_clear_resp
= ath10k_wmi_op_gen_addba_clear_resp
,
8060 .gen_addba_send
= ath10k_wmi_op_gen_addba_send
,
8061 .gen_addba_set_resp
= ath10k_wmi_op_gen_addba_set_resp
,
8062 .gen_delba_send
= ath10k_wmi_op_gen_delba_send
,
8063 .fw_stats_fill
= ath10k_wmi_10x_op_fw_stats_fill
,
8064 .get_vdev_subtype
= ath10k_wmi_op_get_vdev_subtype
,
8065 /* .gen_pdev_enable_adaptive_cca not implemented */
8068 static const struct wmi_ops wmi_10_2_4_ops
= {
8069 .rx
= ath10k_wmi_10_2_op_rx
,
8070 .pull_fw_stats
= ath10k_wmi_10_2_4_op_pull_fw_stats
,
8071 .gen_init
= ath10k_wmi_10_2_op_gen_init
,
8072 .gen_peer_assoc
= ath10k_wmi_10_2_op_gen_peer_assoc
,
8073 .gen_pdev_get_temperature
= ath10k_wmi_10_2_op_gen_pdev_get_temperature
,
8074 .gen_pdev_bss_chan_info_req
= ath10k_wmi_10_2_op_gen_pdev_bss_chan_info
,
8076 /* shared with 10.1 */
8077 .map_svc
= wmi_10x_svc_map
,
8078 .pull_svc_rdy
= ath10k_wmi_10x_op_pull_svc_rdy_ev
,
8079 .gen_pdev_set_rd
= ath10k_wmi_10x_op_gen_pdev_set_rd
,
8080 .gen_start_scan
= ath10k_wmi_10x_op_gen_start_scan
,
8081 .gen_echo
= ath10k_wmi_op_gen_echo
,
8083 .pull_scan
= ath10k_wmi_op_pull_scan_ev
,
8084 .pull_mgmt_rx
= ath10k_wmi_op_pull_mgmt_rx_ev
,
8085 .pull_ch_info
= ath10k_wmi_op_pull_ch_info_ev
,
8086 .pull_vdev_start
= ath10k_wmi_op_pull_vdev_start_ev
,
8087 .pull_peer_kick
= ath10k_wmi_op_pull_peer_kick_ev
,
8088 .pull_swba
= ath10k_wmi_10_2_4_op_pull_swba_ev
,
8089 .pull_phyerr_hdr
= ath10k_wmi_op_pull_phyerr_ev_hdr
,
8090 .pull_phyerr
= ath10k_wmi_op_pull_phyerr_ev
,
8091 .pull_rdy
= ath10k_wmi_op_pull_rdy_ev
,
8092 .pull_roam_ev
= ath10k_wmi_op_pull_roam_ev
,
8093 .pull_echo_ev
= ath10k_wmi_op_pull_echo_ev
,
8095 .gen_pdev_suspend
= ath10k_wmi_op_gen_pdev_suspend
,
8096 .gen_pdev_resume
= ath10k_wmi_op_gen_pdev_resume
,
8097 .gen_pdev_set_param
= ath10k_wmi_op_gen_pdev_set_param
,
8098 .gen_stop_scan
= ath10k_wmi_op_gen_stop_scan
,
8099 .gen_vdev_create
= ath10k_wmi_op_gen_vdev_create
,
8100 .gen_vdev_delete
= ath10k_wmi_op_gen_vdev_delete
,
8101 .gen_vdev_start
= ath10k_wmi_op_gen_vdev_start
,
8102 .gen_vdev_stop
= ath10k_wmi_op_gen_vdev_stop
,
8103 .gen_vdev_up
= ath10k_wmi_op_gen_vdev_up
,
8104 .gen_vdev_down
= ath10k_wmi_op_gen_vdev_down
,
8105 .gen_vdev_set_param
= ath10k_wmi_op_gen_vdev_set_param
,
8106 .gen_vdev_install_key
= ath10k_wmi_op_gen_vdev_install_key
,
8107 .gen_vdev_spectral_conf
= ath10k_wmi_op_gen_vdev_spectral_conf
,
8108 .gen_vdev_spectral_enable
= ath10k_wmi_op_gen_vdev_spectral_enable
,
8109 .gen_peer_create
= ath10k_wmi_op_gen_peer_create
,
8110 .gen_peer_delete
= ath10k_wmi_op_gen_peer_delete
,
8111 .gen_peer_flush
= ath10k_wmi_op_gen_peer_flush
,
8112 .gen_peer_set_param
= ath10k_wmi_op_gen_peer_set_param
,
8113 .gen_set_psmode
= ath10k_wmi_op_gen_set_psmode
,
8114 .gen_set_sta_ps
= ath10k_wmi_op_gen_set_sta_ps
,
8115 .gen_set_ap_ps
= ath10k_wmi_op_gen_set_ap_ps
,
8116 .gen_scan_chan_list
= ath10k_wmi_op_gen_scan_chan_list
,
8117 .gen_beacon_dma
= ath10k_wmi_op_gen_beacon_dma
,
8118 .gen_pdev_set_wmm
= ath10k_wmi_op_gen_pdev_set_wmm
,
8119 .gen_request_stats
= ath10k_wmi_op_gen_request_stats
,
8120 .gen_force_fw_hang
= ath10k_wmi_op_gen_force_fw_hang
,
8121 .gen_mgmt_tx
= ath10k_wmi_op_gen_mgmt_tx
,
8122 .gen_dbglog_cfg
= ath10k_wmi_op_gen_dbglog_cfg
,
8123 .gen_pktlog_enable
= ath10k_wmi_op_gen_pktlog_enable
,
8124 .gen_pktlog_disable
= ath10k_wmi_op_gen_pktlog_disable
,
8125 .gen_pdev_set_quiet_mode
= ath10k_wmi_op_gen_pdev_set_quiet_mode
,
8126 .gen_addba_clear_resp
= ath10k_wmi_op_gen_addba_clear_resp
,
8127 .gen_addba_send
= ath10k_wmi_op_gen_addba_send
,
8128 .gen_addba_set_resp
= ath10k_wmi_op_gen_addba_set_resp
,
8129 .gen_delba_send
= ath10k_wmi_op_gen_delba_send
,
8130 .gen_pdev_get_tpc_config
= ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config
,
8131 .fw_stats_fill
= ath10k_wmi_10x_op_fw_stats_fill
,
8132 .gen_pdev_enable_adaptive_cca
=
8133 ath10k_wmi_op_gen_pdev_enable_adaptive_cca
,
8134 .get_vdev_subtype
= ath10k_wmi_10_2_4_op_get_vdev_subtype
,
8135 /* .gen_bcn_tmpl not implemented */
8136 /* .gen_prb_tmpl not implemented */
8137 /* .gen_p2p_go_bcn_ie not implemented */
8138 /* .gen_adaptive_qcs not implemented */
8141 static const struct wmi_ops wmi_10_4_ops
= {
8142 .rx
= ath10k_wmi_10_4_op_rx
,
8143 .map_svc
= wmi_10_4_svc_map
,
8145 .pull_fw_stats
= ath10k_wmi_10_4_op_pull_fw_stats
,
8146 .pull_scan
= ath10k_wmi_op_pull_scan_ev
,
8147 .pull_mgmt_rx
= ath10k_wmi_10_4_op_pull_mgmt_rx_ev
,
8148 .pull_ch_info
= ath10k_wmi_10_4_op_pull_ch_info_ev
,
8149 .pull_vdev_start
= ath10k_wmi_op_pull_vdev_start_ev
,
8150 .pull_peer_kick
= ath10k_wmi_op_pull_peer_kick_ev
,
8151 .pull_swba
= ath10k_wmi_10_4_op_pull_swba_ev
,
8152 .pull_phyerr_hdr
= ath10k_wmi_10_4_op_pull_phyerr_ev_hdr
,
8153 .pull_phyerr
= ath10k_wmi_10_4_op_pull_phyerr_ev
,
8154 .pull_svc_rdy
= ath10k_wmi_main_op_pull_svc_rdy_ev
,
8155 .pull_rdy
= ath10k_wmi_op_pull_rdy_ev
,
8156 .pull_roam_ev
= ath10k_wmi_op_pull_roam_ev
,
8157 .get_txbf_conf_scheme
= ath10k_wmi_10_4_txbf_conf_scheme
,
8159 .gen_pdev_suspend
= ath10k_wmi_op_gen_pdev_suspend
,
8160 .gen_pdev_resume
= ath10k_wmi_op_gen_pdev_resume
,
8161 .gen_pdev_set_rd
= ath10k_wmi_10x_op_gen_pdev_set_rd
,
8162 .gen_pdev_set_param
= ath10k_wmi_op_gen_pdev_set_param
,
8163 .gen_init
= ath10k_wmi_10_4_op_gen_init
,
8164 .gen_start_scan
= ath10k_wmi_op_gen_start_scan
,
8165 .gen_stop_scan
= ath10k_wmi_op_gen_stop_scan
,
8166 .gen_vdev_create
= ath10k_wmi_op_gen_vdev_create
,
8167 .gen_vdev_delete
= ath10k_wmi_op_gen_vdev_delete
,
8168 .gen_vdev_start
= ath10k_wmi_op_gen_vdev_start
,
8169 .gen_vdev_stop
= ath10k_wmi_op_gen_vdev_stop
,
8170 .gen_vdev_up
= ath10k_wmi_op_gen_vdev_up
,
8171 .gen_vdev_down
= ath10k_wmi_op_gen_vdev_down
,
8172 .gen_vdev_set_param
= ath10k_wmi_op_gen_vdev_set_param
,
8173 .gen_vdev_install_key
= ath10k_wmi_op_gen_vdev_install_key
,
8174 .gen_vdev_spectral_conf
= ath10k_wmi_op_gen_vdev_spectral_conf
,
8175 .gen_vdev_spectral_enable
= ath10k_wmi_op_gen_vdev_spectral_enable
,
8176 .gen_peer_create
= ath10k_wmi_op_gen_peer_create
,
8177 .gen_peer_delete
= ath10k_wmi_op_gen_peer_delete
,
8178 .gen_peer_flush
= ath10k_wmi_op_gen_peer_flush
,
8179 .gen_peer_set_param
= ath10k_wmi_op_gen_peer_set_param
,
8180 .gen_peer_assoc
= ath10k_wmi_10_4_op_gen_peer_assoc
,
8181 .gen_set_psmode
= ath10k_wmi_op_gen_set_psmode
,
8182 .gen_set_sta_ps
= ath10k_wmi_op_gen_set_sta_ps
,
8183 .gen_set_ap_ps
= ath10k_wmi_op_gen_set_ap_ps
,
8184 .gen_scan_chan_list
= ath10k_wmi_op_gen_scan_chan_list
,
8185 .gen_beacon_dma
= ath10k_wmi_op_gen_beacon_dma
,
8186 .gen_pdev_set_wmm
= ath10k_wmi_op_gen_pdev_set_wmm
,
8187 .gen_force_fw_hang
= ath10k_wmi_op_gen_force_fw_hang
,
8188 .gen_mgmt_tx
= ath10k_wmi_op_gen_mgmt_tx
,
8189 .gen_dbglog_cfg
= ath10k_wmi_10_4_op_gen_dbglog_cfg
,
8190 .gen_pktlog_enable
= ath10k_wmi_op_gen_pktlog_enable
,
8191 .gen_pktlog_disable
= ath10k_wmi_op_gen_pktlog_disable
,
8192 .gen_pdev_set_quiet_mode
= ath10k_wmi_op_gen_pdev_set_quiet_mode
,
8193 .gen_addba_clear_resp
= ath10k_wmi_op_gen_addba_clear_resp
,
8194 .gen_addba_send
= ath10k_wmi_op_gen_addba_send
,
8195 .gen_addba_set_resp
= ath10k_wmi_op_gen_addba_set_resp
,
8196 .gen_delba_send
= ath10k_wmi_op_gen_delba_send
,
8197 .fw_stats_fill
= ath10k_wmi_10_4_op_fw_stats_fill
,
8198 .ext_resource_config
= ath10k_wmi_10_4_ext_resource_config
,
8200 /* shared with 10.2 */
8201 .pull_echo_ev
= ath10k_wmi_op_pull_echo_ev
,
8202 .gen_request_stats
= ath10k_wmi_op_gen_request_stats
,
8203 .gen_pdev_get_temperature
= ath10k_wmi_10_2_op_gen_pdev_get_temperature
,
8204 .get_vdev_subtype
= ath10k_wmi_10_4_op_get_vdev_subtype
,
8205 .gen_pdev_bss_chan_info_req
= ath10k_wmi_10_2_op_gen_pdev_bss_chan_info
,
8206 .gen_echo
= ath10k_wmi_op_gen_echo
,
8207 .gen_pdev_get_tpc_config
= ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config
,
8210 int ath10k_wmi_attach(struct ath10k
*ar
)
8212 switch (ar
->running_fw
->fw_file
.wmi_op_version
) {
8213 case ATH10K_FW_WMI_OP_VERSION_10_4
:
8214 ar
->wmi
.ops
= &wmi_10_4_ops
;
8215 ar
->wmi
.cmd
= &wmi_10_4_cmd_map
;
8216 ar
->wmi
.vdev_param
= &wmi_10_4_vdev_param_map
;
8217 ar
->wmi
.pdev_param
= &wmi_10_4_pdev_param_map
;
8218 ar
->wmi
.peer_flags
= &wmi_10_2_peer_flags_map
;
8220 case ATH10K_FW_WMI_OP_VERSION_10_2_4
:
8221 ar
->wmi
.cmd
= &wmi_10_2_4_cmd_map
;
8222 ar
->wmi
.ops
= &wmi_10_2_4_ops
;
8223 ar
->wmi
.vdev_param
= &wmi_10_2_4_vdev_param_map
;
8224 ar
->wmi
.pdev_param
= &wmi_10_2_4_pdev_param_map
;
8225 ar
->wmi
.peer_flags
= &wmi_10_2_peer_flags_map
;
8227 case ATH10K_FW_WMI_OP_VERSION_10_2
:
8228 ar
->wmi
.cmd
= &wmi_10_2_cmd_map
;
8229 ar
->wmi
.ops
= &wmi_10_2_ops
;
8230 ar
->wmi
.vdev_param
= &wmi_10x_vdev_param_map
;
8231 ar
->wmi
.pdev_param
= &wmi_10x_pdev_param_map
;
8232 ar
->wmi
.peer_flags
= &wmi_10_2_peer_flags_map
;
8234 case ATH10K_FW_WMI_OP_VERSION_10_1
:
8235 ar
->wmi
.cmd
= &wmi_10x_cmd_map
;
8236 ar
->wmi
.ops
= &wmi_10_1_ops
;
8237 ar
->wmi
.vdev_param
= &wmi_10x_vdev_param_map
;
8238 ar
->wmi
.pdev_param
= &wmi_10x_pdev_param_map
;
8239 ar
->wmi
.peer_flags
= &wmi_10x_peer_flags_map
;
8241 case ATH10K_FW_WMI_OP_VERSION_MAIN
:
8242 ar
->wmi
.cmd
= &wmi_cmd_map
;
8243 ar
->wmi
.ops
= &wmi_ops
;
8244 ar
->wmi
.vdev_param
= &wmi_vdev_param_map
;
8245 ar
->wmi
.pdev_param
= &wmi_pdev_param_map
;
8246 ar
->wmi
.peer_flags
= &wmi_peer_flags_map
;
8248 case ATH10K_FW_WMI_OP_VERSION_TLV
:
8249 ath10k_wmi_tlv_attach(ar
);
8251 case ATH10K_FW_WMI_OP_VERSION_UNSET
:
8252 case ATH10K_FW_WMI_OP_VERSION_MAX
:
8253 ath10k_err(ar
, "unsupported WMI op version: %d\n",
8254 ar
->running_fw
->fw_file
.wmi_op_version
);
8258 init_completion(&ar
->wmi
.service_ready
);
8259 init_completion(&ar
->wmi
.unified_ready
);
8260 init_completion(&ar
->wmi
.barrier
);
8262 INIT_WORK(&ar
->svc_rdy_work
, ath10k_wmi_event_service_ready_work
);
8267 void ath10k_wmi_free_host_mem(struct ath10k
*ar
)
8271 /* free the host memory chunks requested by firmware */
8272 for (i
= 0; i
< ar
->wmi
.num_mem_chunks
; i
++) {
8273 dma_unmap_single(ar
->dev
,
8274 ar
->wmi
.mem_chunks
[i
].paddr
,
8275 ar
->wmi
.mem_chunks
[i
].len
,
8277 kfree(ar
->wmi
.mem_chunks
[i
].vaddr
);
8280 ar
->wmi
.num_mem_chunks
= 0;
8283 void ath10k_wmi_detach(struct ath10k
*ar
)
8285 cancel_work_sync(&ar
->svc_rdy_work
);
8287 if (ar
->svc_rdy_skb
)
8288 dev_kfree_skb(ar
->svc_rdy_skb
);