2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2014 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.
25 void (*rx)(struct ath10k *ar, struct sk_buff *skb);
26 void (*map_svc)(const __le32 *in, unsigned long *out, size_t len);
28 int (*pull_scan)(struct ath10k *ar, struct sk_buff *skb,
29 struct wmi_scan_ev_arg *arg);
30 int (*pull_mgmt_rx)(struct ath10k *ar, struct sk_buff *skb,
31 struct wmi_mgmt_rx_ev_arg *arg);
32 int (*pull_ch_info)(struct ath10k *ar, struct sk_buff *skb,
33 struct wmi_ch_info_ev_arg *arg);
34 int (*pull_vdev_start)(struct ath10k *ar, struct sk_buff *skb,
35 struct wmi_vdev_start_ev_arg *arg);
36 int (*pull_peer_kick)(struct ath10k *ar, struct sk_buff *skb,
37 struct wmi_peer_kick_ev_arg *arg);
38 int (*pull_swba)(struct ath10k *ar, struct sk_buff *skb,
39 struct wmi_swba_ev_arg *arg);
40 int (*pull_phyerr_hdr)(struct ath10k *ar, struct sk_buff *skb,
41 struct wmi_phyerr_hdr_arg *arg);
42 int (*pull_phyerr)(struct ath10k *ar, const void *phyerr_buf,
43 int left_len, struct wmi_phyerr_ev_arg *arg);
44 int (*pull_svc_rdy)(struct ath10k *ar, struct sk_buff *skb,
45 struct wmi_svc_rdy_ev_arg *arg);
46 int (*pull_rdy)(struct ath10k *ar, struct sk_buff *skb,
47 struct wmi_rdy_ev_arg *arg);
48 int (*pull_fw_stats)(struct ath10k *ar, struct sk_buff *skb,
49 struct ath10k_fw_stats *stats);
50 int (*pull_roam_ev)(struct ath10k *ar, struct sk_buff *skb,
51 struct wmi_roam_ev_arg *arg);
52 int (*pull_wow_event)(struct ath10k *ar, struct sk_buff *skb,
53 struct wmi_wow_ev_arg *arg);
54 int (*pull_echo_ev)(struct ath10k *ar, struct sk_buff *skb,
55 struct wmi_echo_ev_arg *arg);
56 enum wmi_txbf_conf (*get_txbf_conf_scheme)(struct ath10k *ar);
58 struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar, u32 suspend_opt);
59 struct sk_buff *(*gen_pdev_resume)(struct ath10k *ar);
60 struct sk_buff *(*gen_pdev_set_rd)(struct ath10k *ar, u16 rd, u16 rd2g,
61 u16 rd5g, u16 ctl2g, u16 ctl5g,
62 enum wmi_dfs_region dfs_reg);
63 struct sk_buff *(*gen_pdev_set_param)(struct ath10k *ar, u32 id,
65 struct sk_buff *(*gen_init)(struct ath10k *ar);
66 struct sk_buff *(*gen_start_scan)(struct ath10k *ar,
67 const struct wmi_start_scan_arg *arg);
68 struct sk_buff *(*gen_stop_scan)(struct ath10k *ar,
69 const struct wmi_stop_scan_arg *arg);
70 struct sk_buff *(*gen_vdev_create)(struct ath10k *ar, u32 vdev_id,
71 enum wmi_vdev_type type,
72 enum wmi_vdev_subtype subtype,
73 const u8 macaddr[ETH_ALEN]);
74 struct sk_buff *(*gen_vdev_delete)(struct ath10k *ar, u32 vdev_id);
75 struct sk_buff *(*gen_vdev_start)(struct ath10k *ar,
76 const struct wmi_vdev_start_request_arg *arg,
78 struct sk_buff *(*gen_vdev_stop)(struct ath10k *ar, u32 vdev_id);
79 struct sk_buff *(*gen_vdev_up)(struct ath10k *ar, u32 vdev_id, u32 aid,
81 struct sk_buff *(*gen_vdev_down)(struct ath10k *ar, u32 vdev_id);
82 struct sk_buff *(*gen_vdev_set_param)(struct ath10k *ar, u32 vdev_id,
83 u32 param_id, u32 param_value);
84 struct sk_buff *(*gen_vdev_install_key)(struct ath10k *ar,
85 const struct wmi_vdev_install_key_arg *arg);
86 struct sk_buff *(*gen_vdev_spectral_conf)(struct ath10k *ar,
87 const struct wmi_vdev_spectral_conf_arg *arg);
88 struct sk_buff *(*gen_vdev_spectral_enable)(struct ath10k *ar, u32 vdev_id,
89 u32 trigger, u32 enable);
90 struct sk_buff *(*gen_vdev_wmm_conf)(struct ath10k *ar, u32 vdev_id,
91 const struct wmi_wmm_params_all_arg *arg);
92 struct sk_buff *(*gen_peer_create)(struct ath10k *ar, u32 vdev_id,
93 const u8 peer_addr[ETH_ALEN],
94 enum wmi_peer_type peer_type);
95 struct sk_buff *(*gen_peer_delete)(struct ath10k *ar, u32 vdev_id,
96 const u8 peer_addr[ETH_ALEN]);
97 struct sk_buff *(*gen_peer_flush)(struct ath10k *ar, u32 vdev_id,
98 const u8 peer_addr[ETH_ALEN],
100 struct sk_buff *(*gen_peer_set_param)(struct ath10k *ar, u32 vdev_id,
102 enum wmi_peer_param param_id,
104 struct sk_buff *(*gen_peer_assoc)(struct ath10k *ar,
105 const struct wmi_peer_assoc_complete_arg *arg);
106 struct sk_buff *(*gen_set_psmode)(struct ath10k *ar, u32 vdev_id,
107 enum wmi_sta_ps_mode psmode);
108 struct sk_buff *(*gen_set_sta_ps)(struct ath10k *ar, u32 vdev_id,
109 enum wmi_sta_powersave_param param_id,
111 struct sk_buff *(*gen_set_ap_ps)(struct ath10k *ar, u32 vdev_id,
113 enum wmi_ap_ps_peer_param param_id,
115 struct sk_buff *(*gen_scan_chan_list)(struct ath10k *ar,
116 const struct wmi_scan_chan_list_arg *arg);
117 struct sk_buff *(*gen_beacon_dma)(struct ath10k *ar, u32 vdev_id,
118 const void *bcn, size_t bcn_len,
119 u32 bcn_paddr, bool dtim_zero,
121 struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar,
122 const struct wmi_wmm_params_all_arg *arg);
123 struct sk_buff *(*gen_request_stats)(struct ath10k *ar, u32 stats_mask);
124 struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar,
125 enum wmi_force_fw_hang_type type,
127 struct sk_buff *(*gen_mgmt_tx)(struct ath10k *ar, struct sk_buff *skb);
128 struct sk_buff *(*gen_dbglog_cfg)(struct ath10k *ar, u64 module_enable,
130 struct sk_buff *(*gen_pktlog_enable)(struct ath10k *ar, u32 filter);
131 struct sk_buff *(*gen_pktlog_disable)(struct ath10k *ar);
132 struct sk_buff *(*gen_pdev_set_quiet_mode)(struct ath10k *ar,
133 u32 period, u32 duration,
136 struct sk_buff *(*gen_pdev_get_temperature)(struct ath10k *ar);
137 struct sk_buff *(*gen_addba_clear_resp)(struct ath10k *ar, u32 vdev_id,
139 struct sk_buff *(*gen_addba_send)(struct ath10k *ar, u32 vdev_id,
140 const u8 *mac, u32 tid, u32 buf_size);
141 struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id,
142 const u8 *mac, u32 tid,
144 struct sk_buff *(*gen_delba_send)(struct ath10k *ar, u32 vdev_id,
145 const u8 *mac, u32 tid, u32 initiator,
147 struct sk_buff *(*gen_bcn_tmpl)(struct ath10k *ar, u32 vdev_id,
148 u32 tim_ie_offset, struct sk_buff *bcn,
149 u32 prb_caps, u32 prb_erp,
150 void *prb_ies, size_t prb_ies_len);
151 struct sk_buff *(*gen_prb_tmpl)(struct ath10k *ar, u32 vdev_id,
152 struct sk_buff *bcn);
153 struct sk_buff *(*gen_p2p_go_bcn_ie)(struct ath10k *ar, u32 vdev_id,
155 struct sk_buff *(*gen_vdev_sta_uapsd)(struct ath10k *ar, u32 vdev_id,
156 const u8 peer_addr[ETH_ALEN],
157 const struct wmi_sta_uapsd_auto_trig_arg *args,
159 struct sk_buff *(*gen_sta_keepalive)(struct ath10k *ar,
160 const struct wmi_sta_keepalive_arg *arg);
161 struct sk_buff *(*gen_wow_enable)(struct ath10k *ar);
162 struct sk_buff *(*gen_wow_add_wakeup_event)(struct ath10k *ar, u32 vdev_id,
163 enum wmi_wow_wakeup_event event,
165 struct sk_buff *(*gen_wow_host_wakeup_ind)(struct ath10k *ar);
166 struct sk_buff *(*gen_wow_add_pattern)(struct ath10k *ar, u32 vdev_id,
172 struct sk_buff *(*gen_wow_del_pattern)(struct ath10k *ar, u32 vdev_id,
174 struct sk_buff *(*gen_update_fw_tdls_state)(struct ath10k *ar,
176 enum wmi_tdls_state state);
177 struct sk_buff *(*gen_tdls_peer_update)(struct ath10k *ar,
178 const struct wmi_tdls_peer_update_cmd_arg *arg,
179 const struct wmi_tdls_peer_capab_arg *cap,
180 const struct wmi_channel_arg *chan);
181 struct sk_buff *(*gen_adaptive_qcs)(struct ath10k *ar, bool enable);
182 struct sk_buff *(*gen_pdev_get_tpc_config)(struct ath10k *ar,
184 void (*fw_stats_fill)(struct ath10k *ar,
185 struct ath10k_fw_stats *fw_stats,
187 struct sk_buff *(*gen_pdev_enable_adaptive_cca)(struct ath10k *ar,
191 struct sk_buff *(*ext_resource_config)(struct ath10k *ar,
192 enum wmi_host_platform_type type,
193 u32 fw_feature_bitmap);
194 int (*get_vdev_subtype)(struct ath10k *ar,
195 enum wmi_vdev_subtype subtype);
196 struct sk_buff *(*gen_pdev_bss_chan_info_req)
198 enum wmi_bss_survey_req_type type);
199 struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
202 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
205 ath10k_wmi_rx(struct ath10k *ar, struct sk_buff *skb)
207 if (WARN_ON_ONCE(!ar->wmi.ops->rx))
210 ar->wmi.ops->rx(ar, skb);
215 ath10k_wmi_map_svc(struct ath10k *ar, const __le32 *in, unsigned long *out,
218 if (!ar->wmi.ops->map_svc)
221 ar->wmi.ops->map_svc(in, out, len);
226 ath10k_wmi_pull_scan(struct ath10k *ar, struct sk_buff *skb,
227 struct wmi_scan_ev_arg *arg)
229 if (!ar->wmi.ops->pull_scan)
232 return ar->wmi.ops->pull_scan(ar, skb, arg);
236 ath10k_wmi_pull_mgmt_rx(struct ath10k *ar, struct sk_buff *skb,
237 struct wmi_mgmt_rx_ev_arg *arg)
239 if (!ar->wmi.ops->pull_mgmt_rx)
242 return ar->wmi.ops->pull_mgmt_rx(ar, skb, arg);
246 ath10k_wmi_pull_ch_info(struct ath10k *ar, struct sk_buff *skb,
247 struct wmi_ch_info_ev_arg *arg)
249 if (!ar->wmi.ops->pull_ch_info)
252 return ar->wmi.ops->pull_ch_info(ar, skb, arg);
256 ath10k_wmi_pull_vdev_start(struct ath10k *ar, struct sk_buff *skb,
257 struct wmi_vdev_start_ev_arg *arg)
259 if (!ar->wmi.ops->pull_vdev_start)
262 return ar->wmi.ops->pull_vdev_start(ar, skb, arg);
266 ath10k_wmi_pull_peer_kick(struct ath10k *ar, struct sk_buff *skb,
267 struct wmi_peer_kick_ev_arg *arg)
269 if (!ar->wmi.ops->pull_peer_kick)
272 return ar->wmi.ops->pull_peer_kick(ar, skb, arg);
276 ath10k_wmi_pull_swba(struct ath10k *ar, struct sk_buff *skb,
277 struct wmi_swba_ev_arg *arg)
279 if (!ar->wmi.ops->pull_swba)
282 return ar->wmi.ops->pull_swba(ar, skb, arg);
286 ath10k_wmi_pull_phyerr_hdr(struct ath10k *ar, struct sk_buff *skb,
287 struct wmi_phyerr_hdr_arg *arg)
289 if (!ar->wmi.ops->pull_phyerr_hdr)
292 return ar->wmi.ops->pull_phyerr_hdr(ar, skb, arg);
296 ath10k_wmi_pull_phyerr(struct ath10k *ar, const void *phyerr_buf,
297 int left_len, struct wmi_phyerr_ev_arg *arg)
299 if (!ar->wmi.ops->pull_phyerr)
302 return ar->wmi.ops->pull_phyerr(ar, phyerr_buf, left_len, arg);
306 ath10k_wmi_pull_svc_rdy(struct ath10k *ar, struct sk_buff *skb,
307 struct wmi_svc_rdy_ev_arg *arg)
309 if (!ar->wmi.ops->pull_svc_rdy)
312 return ar->wmi.ops->pull_svc_rdy(ar, skb, arg);
316 ath10k_wmi_pull_rdy(struct ath10k *ar, struct sk_buff *skb,
317 struct wmi_rdy_ev_arg *arg)
319 if (!ar->wmi.ops->pull_rdy)
322 return ar->wmi.ops->pull_rdy(ar, skb, arg);
326 ath10k_wmi_pull_fw_stats(struct ath10k *ar, struct sk_buff *skb,
327 struct ath10k_fw_stats *stats)
329 if (!ar->wmi.ops->pull_fw_stats)
332 return ar->wmi.ops->pull_fw_stats(ar, skb, stats);
336 ath10k_wmi_pull_roam_ev(struct ath10k *ar, struct sk_buff *skb,
337 struct wmi_roam_ev_arg *arg)
339 if (!ar->wmi.ops->pull_roam_ev)
342 return ar->wmi.ops->pull_roam_ev(ar, skb, arg);
346 ath10k_wmi_pull_wow_event(struct ath10k *ar, struct sk_buff *skb,
347 struct wmi_wow_ev_arg *arg)
349 if (!ar->wmi.ops->pull_wow_event)
352 return ar->wmi.ops->pull_wow_event(ar, skb, arg);
356 ath10k_wmi_pull_echo_ev(struct ath10k *ar, struct sk_buff *skb,
357 struct wmi_echo_ev_arg *arg)
359 if (!ar->wmi.ops->pull_echo_ev)
362 return ar->wmi.ops->pull_echo_ev(ar, skb, arg);
365 static inline enum wmi_txbf_conf
366 ath10k_wmi_get_txbf_conf_scheme(struct ath10k *ar)
368 if (!ar->wmi.ops->get_txbf_conf_scheme)
369 return WMI_TXBF_CONF_UNSUPPORTED;
371 return ar->wmi.ops->get_txbf_conf_scheme(ar);
375 ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *msdu)
377 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(msdu);
381 if (!ar->wmi.ops->gen_mgmt_tx)
384 skb = ar->wmi.ops->gen_mgmt_tx(ar, msdu);
388 ret = ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->mgmt_tx_cmdid);
392 /* FIXME There's no ACK event for Management Tx. This probably
393 * shouldn't be called here either. */
394 info->flags |= IEEE80211_TX_STAT_ACK;
395 ieee80211_tx_status_irqsafe(ar->hw, msdu);
401 ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g, u16 rd5g,
402 u16 ctl2g, u16 ctl5g,
403 enum wmi_dfs_region dfs_reg)
407 if (!ar->wmi.ops->gen_pdev_set_rd)
410 skb = ar->wmi.ops->gen_pdev_set_rd(ar, rd, rd2g, rd5g, ctl2g, ctl5g,
415 return ath10k_wmi_cmd_send(ar, skb,
416 ar->wmi.cmd->pdev_set_regdomain_cmdid);
420 ath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt)
424 if (!ar->wmi.ops->gen_pdev_suspend)
427 skb = ar->wmi.ops->gen_pdev_suspend(ar, suspend_opt);
431 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_suspend_cmdid);
435 ath10k_wmi_pdev_resume_target(struct ath10k *ar)
439 if (!ar->wmi.ops->gen_pdev_resume)
442 skb = ar->wmi.ops->gen_pdev_resume(ar);
446 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_resume_cmdid);
450 ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value)
454 if (!ar->wmi.ops->gen_pdev_set_param)
457 skb = ar->wmi.ops->gen_pdev_set_param(ar, id, value);
461 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid);
465 ath10k_wmi_cmd_init(struct ath10k *ar)
469 if (!ar->wmi.ops->gen_init)
472 skb = ar->wmi.ops->gen_init(ar);
476 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->init_cmdid);
480 ath10k_wmi_start_scan(struct ath10k *ar,
481 const struct wmi_start_scan_arg *arg)
485 if (!ar->wmi.ops->gen_start_scan)
488 skb = ar->wmi.ops->gen_start_scan(ar, arg);
492 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->start_scan_cmdid);
496 ath10k_wmi_stop_scan(struct ath10k *ar, const struct wmi_stop_scan_arg *arg)
500 if (!ar->wmi.ops->gen_stop_scan)
503 skb = ar->wmi.ops->gen_stop_scan(ar, arg);
507 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->stop_scan_cmdid);
511 ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
512 enum wmi_vdev_type type,
513 enum wmi_vdev_subtype subtype,
514 const u8 macaddr[ETH_ALEN])
518 if (!ar->wmi.ops->gen_vdev_create)
521 skb = ar->wmi.ops->gen_vdev_create(ar, vdev_id, type, subtype, macaddr);
525 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_create_cmdid);
529 ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)
533 if (!ar->wmi.ops->gen_vdev_delete)
536 skb = ar->wmi.ops->gen_vdev_delete(ar, vdev_id);
540 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_delete_cmdid);
544 ath10k_wmi_vdev_start(struct ath10k *ar,
545 const struct wmi_vdev_start_request_arg *arg)
549 if (!ar->wmi.ops->gen_vdev_start)
552 skb = ar->wmi.ops->gen_vdev_start(ar, arg, false);
556 return ath10k_wmi_cmd_send(ar, skb,
557 ar->wmi.cmd->vdev_start_request_cmdid);
561 ath10k_wmi_vdev_restart(struct ath10k *ar,
562 const struct wmi_vdev_start_request_arg *arg)
566 if (!ar->wmi.ops->gen_vdev_start)
569 skb = ar->wmi.ops->gen_vdev_start(ar, arg, true);
573 return ath10k_wmi_cmd_send(ar, skb,
574 ar->wmi.cmd->vdev_restart_request_cmdid);
578 ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id)
582 if (!ar->wmi.ops->gen_vdev_stop)
585 skb = ar->wmi.ops->gen_vdev_stop(ar, vdev_id);
589 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_stop_cmdid);
593 ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
597 if (!ar->wmi.ops->gen_vdev_up)
600 skb = ar->wmi.ops->gen_vdev_up(ar, vdev_id, aid, bssid);
604 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_up_cmdid);
608 ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id)
612 if (!ar->wmi.ops->gen_vdev_down)
615 skb = ar->wmi.ops->gen_vdev_down(ar, vdev_id);
619 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_down_cmdid);
623 ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id, u32 param_id,
628 if (!ar->wmi.ops->gen_vdev_set_param)
631 skb = ar->wmi.ops->gen_vdev_set_param(ar, vdev_id, param_id,
636 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_set_param_cmdid);
640 ath10k_wmi_vdev_install_key(struct ath10k *ar,
641 const struct wmi_vdev_install_key_arg *arg)
645 if (!ar->wmi.ops->gen_vdev_install_key)
648 skb = ar->wmi.ops->gen_vdev_install_key(ar, arg);
652 return ath10k_wmi_cmd_send(ar, skb,
653 ar->wmi.cmd->vdev_install_key_cmdid);
657 ath10k_wmi_vdev_spectral_conf(struct ath10k *ar,
658 const struct wmi_vdev_spectral_conf_arg *arg)
663 skb = ar->wmi.ops->gen_vdev_spectral_conf(ar, arg);
667 cmd_id = ar->wmi.cmd->vdev_spectral_scan_configure_cmdid;
668 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
672 ath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger,
678 skb = ar->wmi.ops->gen_vdev_spectral_enable(ar, vdev_id, trigger,
683 cmd_id = ar->wmi.cmd->vdev_spectral_scan_enable_cmdid;
684 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
688 ath10k_wmi_vdev_sta_uapsd(struct ath10k *ar, u32 vdev_id,
689 const u8 peer_addr[ETH_ALEN],
690 const struct wmi_sta_uapsd_auto_trig_arg *args,
696 if (!ar->wmi.ops->gen_vdev_sta_uapsd)
699 skb = ar->wmi.ops->gen_vdev_sta_uapsd(ar, vdev_id, peer_addr, args,
704 cmd_id = ar->wmi.cmd->sta_uapsd_auto_trig_cmdid;
705 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
709 ath10k_wmi_vdev_wmm_conf(struct ath10k *ar, u32 vdev_id,
710 const struct wmi_wmm_params_all_arg *arg)
715 skb = ar->wmi.ops->gen_vdev_wmm_conf(ar, vdev_id, arg);
719 cmd_id = ar->wmi.cmd->vdev_set_wmm_params_cmdid;
720 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
724 ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
725 const u8 peer_addr[ETH_ALEN],
726 enum wmi_peer_type peer_type)
730 if (!ar->wmi.ops->gen_peer_create)
733 skb = ar->wmi.ops->gen_peer_create(ar, vdev_id, peer_addr, peer_type);
737 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_create_cmdid);
741 ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
742 const u8 peer_addr[ETH_ALEN])
746 if (!ar->wmi.ops->gen_peer_delete)
749 skb = ar->wmi.ops->gen_peer_delete(ar, vdev_id, peer_addr);
753 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_delete_cmdid);
757 ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
758 const u8 peer_addr[ETH_ALEN], u32 tid_bitmap)
762 if (!ar->wmi.ops->gen_peer_flush)
765 skb = ar->wmi.ops->gen_peer_flush(ar, vdev_id, peer_addr, tid_bitmap);
769 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_flush_tids_cmdid);
773 ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id, const u8 *peer_addr,
774 enum wmi_peer_param param_id, u32 param_value)
778 if (!ar->wmi.ops->gen_peer_set_param)
781 skb = ar->wmi.ops->gen_peer_set_param(ar, vdev_id, peer_addr, param_id,
786 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_set_param_cmdid);
790 ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
791 enum wmi_sta_ps_mode psmode)
795 if (!ar->wmi.ops->gen_set_psmode)
798 skb = ar->wmi.ops->gen_set_psmode(ar, vdev_id, psmode);
802 return ath10k_wmi_cmd_send(ar, skb,
803 ar->wmi.cmd->sta_powersave_mode_cmdid);
807 ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
808 enum wmi_sta_powersave_param param_id, u32 value)
812 if (!ar->wmi.ops->gen_set_sta_ps)
815 skb = ar->wmi.ops->gen_set_sta_ps(ar, vdev_id, param_id, value);
819 return ath10k_wmi_cmd_send(ar, skb,
820 ar->wmi.cmd->sta_powersave_param_cmdid);
824 ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
825 enum wmi_ap_ps_peer_param param_id, u32 value)
829 if (!ar->wmi.ops->gen_set_ap_ps)
832 skb = ar->wmi.ops->gen_set_ap_ps(ar, vdev_id, mac, param_id, value);
836 return ath10k_wmi_cmd_send(ar, skb,
837 ar->wmi.cmd->ap_ps_peer_param_cmdid);
841 ath10k_wmi_scan_chan_list(struct ath10k *ar,
842 const struct wmi_scan_chan_list_arg *arg)
846 if (!ar->wmi.ops->gen_scan_chan_list)
849 skb = ar->wmi.ops->gen_scan_chan_list(ar, arg);
853 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->scan_chan_list_cmdid);
857 ath10k_wmi_peer_assoc(struct ath10k *ar,
858 const struct wmi_peer_assoc_complete_arg *arg)
862 if (!ar->wmi.ops->gen_peer_assoc)
865 skb = ar->wmi.ops->gen_peer_assoc(ar, arg);
869 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_assoc_cmdid);
873 ath10k_wmi_beacon_send_ref_nowait(struct ath10k *ar, u32 vdev_id,
874 const void *bcn, size_t bcn_len,
875 u32 bcn_paddr, bool dtim_zero,
881 if (!ar->wmi.ops->gen_beacon_dma)
884 skb = ar->wmi.ops->gen_beacon_dma(ar, vdev_id, bcn, bcn_len, bcn_paddr,
885 dtim_zero, deliver_cab);
889 ret = ath10k_wmi_cmd_send_nowait(ar, skb,
890 ar->wmi.cmd->pdev_send_bcn_cmdid);
900 ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
901 const struct wmi_wmm_params_all_arg *arg)
905 if (!ar->wmi.ops->gen_pdev_set_wmm)
908 skb = ar->wmi.ops->gen_pdev_set_wmm(ar, arg);
912 return ath10k_wmi_cmd_send(ar, skb,
913 ar->wmi.cmd->pdev_set_wmm_params_cmdid);
917 ath10k_wmi_request_stats(struct ath10k *ar, u32 stats_mask)
921 if (!ar->wmi.ops->gen_request_stats)
924 skb = ar->wmi.ops->gen_request_stats(ar, stats_mask);
928 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_stats_cmdid);
932 ath10k_wmi_force_fw_hang(struct ath10k *ar,
933 enum wmi_force_fw_hang_type type, u32 delay_ms)
937 if (!ar->wmi.ops->gen_force_fw_hang)
940 skb = ar->wmi.ops->gen_force_fw_hang(ar, type, delay_ms);
944 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
948 ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
952 if (!ar->wmi.ops->gen_dbglog_cfg)
955 skb = ar->wmi.ops->gen_dbglog_cfg(ar, module_enable, log_level);
959 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->dbglog_cfg_cmdid);
963 ath10k_wmi_pdev_pktlog_enable(struct ath10k *ar, u32 filter)
967 if (!ar->wmi.ops->gen_pktlog_enable)
970 skb = ar->wmi.ops->gen_pktlog_enable(ar, filter);
974 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_pktlog_enable_cmdid);
978 ath10k_wmi_pdev_pktlog_disable(struct ath10k *ar)
982 if (!ar->wmi.ops->gen_pktlog_disable)
985 skb = ar->wmi.ops->gen_pktlog_disable(ar);
989 return ath10k_wmi_cmd_send(ar, skb,
990 ar->wmi.cmd->pdev_pktlog_disable_cmdid);
994 ath10k_wmi_pdev_set_quiet_mode(struct ath10k *ar, u32 period, u32 duration,
995 u32 next_offset, u32 enabled)
999 if (!ar->wmi.ops->gen_pdev_set_quiet_mode)
1002 skb = ar->wmi.ops->gen_pdev_set_quiet_mode(ar, period, duration,
1003 next_offset, enabled);
1005 return PTR_ERR(skb);
1007 return ath10k_wmi_cmd_send(ar, skb,
1008 ar->wmi.cmd->pdev_set_quiet_mode_cmdid);
1012 ath10k_wmi_pdev_get_temperature(struct ath10k *ar)
1014 struct sk_buff *skb;
1016 if (!ar->wmi.ops->gen_pdev_get_temperature)
1019 skb = ar->wmi.ops->gen_pdev_get_temperature(ar);
1021 return PTR_ERR(skb);
1023 return ath10k_wmi_cmd_send(ar, skb,
1024 ar->wmi.cmd->pdev_get_temperature_cmdid);
1028 ath10k_wmi_addba_clear_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac)
1030 struct sk_buff *skb;
1032 if (!ar->wmi.ops->gen_addba_clear_resp)
1035 skb = ar->wmi.ops->gen_addba_clear_resp(ar, vdev_id, mac);
1037 return PTR_ERR(skb);
1039 return ath10k_wmi_cmd_send(ar, skb,
1040 ar->wmi.cmd->addba_clear_resp_cmdid);
1044 ath10k_wmi_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
1045 u32 tid, u32 buf_size)
1047 struct sk_buff *skb;
1049 if (!ar->wmi.ops->gen_addba_send)
1052 skb = ar->wmi.ops->gen_addba_send(ar, vdev_id, mac, tid, buf_size);
1054 return PTR_ERR(skb);
1056 return ath10k_wmi_cmd_send(ar, skb,
1057 ar->wmi.cmd->addba_send_cmdid);
1061 ath10k_wmi_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac,
1062 u32 tid, u32 status)
1064 struct sk_buff *skb;
1066 if (!ar->wmi.ops->gen_addba_set_resp)
1069 skb = ar->wmi.ops->gen_addba_set_resp(ar, vdev_id, mac, tid, status);
1071 return PTR_ERR(skb);
1073 return ath10k_wmi_cmd_send(ar, skb,
1074 ar->wmi.cmd->addba_set_resp_cmdid);
1078 ath10k_wmi_delba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
1079 u32 tid, u32 initiator, u32 reason)
1081 struct sk_buff *skb;
1083 if (!ar->wmi.ops->gen_delba_send)
1086 skb = ar->wmi.ops->gen_delba_send(ar, vdev_id, mac, tid, initiator,
1089 return PTR_ERR(skb);
1091 return ath10k_wmi_cmd_send(ar, skb,
1092 ar->wmi.cmd->delba_send_cmdid);
1096 ath10k_wmi_bcn_tmpl(struct ath10k *ar, u32 vdev_id, u32 tim_ie_offset,
1097 struct sk_buff *bcn, u32 prb_caps, u32 prb_erp,
1098 void *prb_ies, size_t prb_ies_len)
1100 struct sk_buff *skb;
1102 if (!ar->wmi.ops->gen_bcn_tmpl)
1105 skb = ar->wmi.ops->gen_bcn_tmpl(ar, vdev_id, tim_ie_offset, bcn,
1106 prb_caps, prb_erp, prb_ies,
1109 return PTR_ERR(skb);
1111 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->bcn_tmpl_cmdid);
1115 ath10k_wmi_prb_tmpl(struct ath10k *ar, u32 vdev_id, struct sk_buff *prb)
1117 struct sk_buff *skb;
1119 if (!ar->wmi.ops->gen_prb_tmpl)
1122 skb = ar->wmi.ops->gen_prb_tmpl(ar, vdev_id, prb);
1124 return PTR_ERR(skb);
1126 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->prb_tmpl_cmdid);
1130 ath10k_wmi_p2p_go_bcn_ie(struct ath10k *ar, u32 vdev_id, const u8 *p2p_ie)
1132 struct sk_buff *skb;
1134 if (!ar->wmi.ops->gen_p2p_go_bcn_ie)
1137 skb = ar->wmi.ops->gen_p2p_go_bcn_ie(ar, vdev_id, p2p_ie);
1139 return PTR_ERR(skb);
1141 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->p2p_go_set_beacon_ie);
1145 ath10k_wmi_sta_keepalive(struct ath10k *ar,
1146 const struct wmi_sta_keepalive_arg *arg)
1148 struct sk_buff *skb;
1151 if (!ar->wmi.ops->gen_sta_keepalive)
1154 skb = ar->wmi.ops->gen_sta_keepalive(ar, arg);
1156 return PTR_ERR(skb);
1158 cmd_id = ar->wmi.cmd->sta_keepalive_cmd;
1159 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1163 ath10k_wmi_wow_enable(struct ath10k *ar)
1165 struct sk_buff *skb;
1168 if (!ar->wmi.ops->gen_wow_enable)
1171 skb = ar->wmi.ops->gen_wow_enable(ar);
1173 return PTR_ERR(skb);
1175 cmd_id = ar->wmi.cmd->wow_enable_cmdid;
1176 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1180 ath10k_wmi_wow_add_wakeup_event(struct ath10k *ar, u32 vdev_id,
1181 enum wmi_wow_wakeup_event event,
1184 struct sk_buff *skb;
1187 if (!ar->wmi.ops->gen_wow_add_wakeup_event)
1190 skb = ar->wmi.ops->gen_wow_add_wakeup_event(ar, vdev_id, event, enable);
1192 return PTR_ERR(skb);
1194 cmd_id = ar->wmi.cmd->wow_enable_disable_wake_event_cmdid;
1195 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1199 ath10k_wmi_wow_host_wakeup_ind(struct ath10k *ar)
1201 struct sk_buff *skb;
1204 if (!ar->wmi.ops->gen_wow_host_wakeup_ind)
1207 skb = ar->wmi.ops->gen_wow_host_wakeup_ind(ar);
1209 return PTR_ERR(skb);
1211 cmd_id = ar->wmi.cmd->wow_hostwakeup_from_sleep_cmdid;
1212 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1216 ath10k_wmi_wow_add_pattern(struct ath10k *ar, u32 vdev_id, u32 pattern_id,
1217 const u8 *pattern, const u8 *mask,
1218 int pattern_len, int pattern_offset)
1220 struct sk_buff *skb;
1223 if (!ar->wmi.ops->gen_wow_add_pattern)
1226 skb = ar->wmi.ops->gen_wow_add_pattern(ar, vdev_id, pattern_id,
1227 pattern, mask, pattern_len,
1230 return PTR_ERR(skb);
1232 cmd_id = ar->wmi.cmd->wow_add_wake_pattern_cmdid;
1233 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1237 ath10k_wmi_wow_del_pattern(struct ath10k *ar, u32 vdev_id, u32 pattern_id)
1239 struct sk_buff *skb;
1242 if (!ar->wmi.ops->gen_wow_del_pattern)
1245 skb = ar->wmi.ops->gen_wow_del_pattern(ar, vdev_id, pattern_id);
1247 return PTR_ERR(skb);
1249 cmd_id = ar->wmi.cmd->wow_del_wake_pattern_cmdid;
1250 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1254 ath10k_wmi_update_fw_tdls_state(struct ath10k *ar, u32 vdev_id,
1255 enum wmi_tdls_state state)
1257 struct sk_buff *skb;
1259 if (!ar->wmi.ops->gen_update_fw_tdls_state)
1262 skb = ar->wmi.ops->gen_update_fw_tdls_state(ar, vdev_id, state);
1264 return PTR_ERR(skb);
1266 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->tdls_set_state_cmdid);
1270 ath10k_wmi_tdls_peer_update(struct ath10k *ar,
1271 const struct wmi_tdls_peer_update_cmd_arg *arg,
1272 const struct wmi_tdls_peer_capab_arg *cap,
1273 const struct wmi_channel_arg *chan)
1275 struct sk_buff *skb;
1277 if (!ar->wmi.ops->gen_tdls_peer_update)
1280 skb = ar->wmi.ops->gen_tdls_peer_update(ar, arg, cap, chan);
1282 return PTR_ERR(skb);
1284 return ath10k_wmi_cmd_send(ar, skb,
1285 ar->wmi.cmd->tdls_peer_update_cmdid);
1289 ath10k_wmi_adaptive_qcs(struct ath10k *ar, bool enable)
1291 struct sk_buff *skb;
1293 if (!ar->wmi.ops->gen_adaptive_qcs)
1296 skb = ar->wmi.ops->gen_adaptive_qcs(ar, enable);
1298 return PTR_ERR(skb);
1300 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->adaptive_qcs_cmdid);
1304 ath10k_wmi_pdev_get_tpc_config(struct ath10k *ar, u32 param)
1306 struct sk_buff *skb;
1308 if (!ar->wmi.ops->gen_pdev_get_tpc_config)
1311 skb = ar->wmi.ops->gen_pdev_get_tpc_config(ar, param);
1314 return PTR_ERR(skb);
1316 return ath10k_wmi_cmd_send(ar, skb,
1317 ar->wmi.cmd->pdev_get_tpc_config_cmdid);
1321 ath10k_wmi_fw_stats_fill(struct ath10k *ar, struct ath10k_fw_stats *fw_stats,
1324 if (!ar->wmi.ops->fw_stats_fill)
1327 ar->wmi.ops->fw_stats_fill(ar, fw_stats, buf);
1332 ath10k_wmi_pdev_enable_adaptive_cca(struct ath10k *ar, u8 enable,
1333 u32 detect_level, u32 detect_margin)
1335 struct sk_buff *skb;
1337 if (!ar->wmi.ops->gen_pdev_enable_adaptive_cca)
1340 skb = ar->wmi.ops->gen_pdev_enable_adaptive_cca(ar, enable,
1345 return PTR_ERR(skb);
1347 return ath10k_wmi_cmd_send(ar, skb,
1348 ar->wmi.cmd->pdev_enable_adaptive_cca_cmdid);
1352 ath10k_wmi_ext_resource_config(struct ath10k *ar,
1353 enum wmi_host_platform_type type,
1354 u32 fw_feature_bitmap)
1356 struct sk_buff *skb;
1358 if (!ar->wmi.ops->ext_resource_config)
1361 skb = ar->wmi.ops->ext_resource_config(ar, type,
1365 return PTR_ERR(skb);
1367 return ath10k_wmi_cmd_send(ar, skb,
1368 ar->wmi.cmd->ext_resource_cfg_cmdid);
1372 ath10k_wmi_get_vdev_subtype(struct ath10k *ar, enum wmi_vdev_subtype subtype)
1374 if (!ar->wmi.ops->get_vdev_subtype)
1377 return ar->wmi.ops->get_vdev_subtype(ar, subtype);
1381 ath10k_wmi_pdev_bss_chan_info_request(struct ath10k *ar,
1382 enum wmi_bss_survey_req_type type)
1384 struct ath10k_wmi *wmi = &ar->wmi;
1385 struct sk_buff *skb;
1387 if (!wmi->ops->gen_pdev_bss_chan_info_req)
1390 skb = wmi->ops->gen_pdev_bss_chan_info_req(ar, type);
1392 return PTR_ERR(skb);
1394 return ath10k_wmi_cmd_send(ar, skb,
1395 wmi->cmd->pdev_bss_chan_info_request_cmdid);
1399 ath10k_wmi_echo(struct ath10k *ar, u32 value)
1401 struct ath10k_wmi *wmi = &ar->wmi;
1402 struct sk_buff *skb;
1404 if (!wmi->ops->gen_echo)
1407 skb = wmi->ops->gen_echo(ar, value);
1409 return PTR_ERR(skb);
1411 return ath10k_wmi_cmd_send(ar, skb, wmi->cmd->echo_cmdid);