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)(struct ath10k *ar, struct sk_buff *skb,
41 struct wmi_phyerr_ev_arg *arg);
42 int (*pull_svc_rdy)(struct ath10k *ar, struct sk_buff *skb,
43 struct wmi_svc_rdy_ev_arg *arg);
44 int (*pull_rdy)(struct ath10k *ar, struct sk_buff *skb,
45 struct wmi_rdy_ev_arg *arg);
46 int (*pull_fw_stats)(struct ath10k *ar, struct sk_buff *skb,
47 struct ath10k_fw_stats *stats);
49 struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar, u32 suspend_opt);
50 struct sk_buff *(*gen_pdev_resume)(struct ath10k *ar);
51 struct sk_buff *(*gen_pdev_set_rd)(struct ath10k *ar, u16 rd, u16 rd2g,
52 u16 rd5g, u16 ctl2g, u16 ctl5g,
53 enum wmi_dfs_region dfs_reg);
54 struct sk_buff *(*gen_pdev_set_param)(struct ath10k *ar, u32 id,
56 struct sk_buff *(*gen_init)(struct ath10k *ar);
57 struct sk_buff *(*gen_start_scan)(struct ath10k *ar,
58 const struct wmi_start_scan_arg *arg);
59 struct sk_buff *(*gen_stop_scan)(struct ath10k *ar,
60 const struct wmi_stop_scan_arg *arg);
61 struct sk_buff *(*gen_vdev_create)(struct ath10k *ar, u32 vdev_id,
62 enum wmi_vdev_type type,
63 enum wmi_vdev_subtype subtype,
64 const u8 macaddr[ETH_ALEN]);
65 struct sk_buff *(*gen_vdev_delete)(struct ath10k *ar, u32 vdev_id);
66 struct sk_buff *(*gen_vdev_start)(struct ath10k *ar,
67 const struct wmi_vdev_start_request_arg *arg,
69 struct sk_buff *(*gen_vdev_stop)(struct ath10k *ar, u32 vdev_id);
70 struct sk_buff *(*gen_vdev_up)(struct ath10k *ar, u32 vdev_id, u32 aid,
72 struct sk_buff *(*gen_vdev_down)(struct ath10k *ar, u32 vdev_id);
73 struct sk_buff *(*gen_vdev_set_param)(struct ath10k *ar, u32 vdev_id,
74 u32 param_id, u32 param_value);
75 struct sk_buff *(*gen_vdev_install_key)(struct ath10k *ar,
76 const struct wmi_vdev_install_key_arg *arg);
77 struct sk_buff *(*gen_vdev_spectral_conf)(struct ath10k *ar,
78 const struct wmi_vdev_spectral_conf_arg *arg);
79 struct sk_buff *(*gen_vdev_spectral_enable)(struct ath10k *ar, u32 vdev_id,
80 u32 trigger, u32 enable);
81 struct sk_buff *(*gen_vdev_wmm_conf)(struct ath10k *ar, u32 vdev_id,
82 const struct wmi_wmm_params_all_arg *arg);
83 struct sk_buff *(*gen_peer_create)(struct ath10k *ar, u32 vdev_id,
84 const u8 peer_addr[ETH_ALEN]);
85 struct sk_buff *(*gen_peer_delete)(struct ath10k *ar, u32 vdev_id,
86 const u8 peer_addr[ETH_ALEN]);
87 struct sk_buff *(*gen_peer_flush)(struct ath10k *ar, u32 vdev_id,
88 const u8 peer_addr[ETH_ALEN],
90 struct sk_buff *(*gen_peer_set_param)(struct ath10k *ar, u32 vdev_id,
92 enum wmi_peer_param param_id,
94 struct sk_buff *(*gen_peer_assoc)(struct ath10k *ar,
95 const struct wmi_peer_assoc_complete_arg *arg);
96 struct sk_buff *(*gen_set_psmode)(struct ath10k *ar, u32 vdev_id,
97 enum wmi_sta_ps_mode psmode);
98 struct sk_buff *(*gen_set_sta_ps)(struct ath10k *ar, u32 vdev_id,
99 enum wmi_sta_powersave_param param_id,
101 struct sk_buff *(*gen_set_ap_ps)(struct ath10k *ar, u32 vdev_id,
103 enum wmi_ap_ps_peer_param param_id,
105 struct sk_buff *(*gen_scan_chan_list)(struct ath10k *ar,
106 const struct wmi_scan_chan_list_arg *arg);
107 struct sk_buff *(*gen_beacon_dma)(struct ath10k *ar, u32 vdev_id,
108 const void *bcn, size_t bcn_len,
109 u32 bcn_paddr, bool dtim_zero,
111 struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar,
112 const struct wmi_wmm_params_all_arg *arg);
113 struct sk_buff *(*gen_request_stats)(struct ath10k *ar,
114 enum wmi_stats_id stats_id);
115 struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar,
116 enum wmi_force_fw_hang_type type,
118 struct sk_buff *(*gen_mgmt_tx)(struct ath10k *ar, struct sk_buff *skb);
119 struct sk_buff *(*gen_dbglog_cfg)(struct ath10k *ar, u32 module_enable,
121 struct sk_buff *(*gen_pktlog_enable)(struct ath10k *ar, u32 filter);
122 struct sk_buff *(*gen_pktlog_disable)(struct ath10k *ar);
123 struct sk_buff *(*gen_pdev_set_quiet_mode)(struct ath10k *ar,
124 u32 period, u32 duration,
127 struct sk_buff *(*gen_pdev_get_temperature)(struct ath10k *ar);
128 struct sk_buff *(*gen_addba_clear_resp)(struct ath10k *ar, u32 vdev_id,
130 struct sk_buff *(*gen_addba_send)(struct ath10k *ar, u32 vdev_id,
131 const u8 *mac, u32 tid, u32 buf_size);
132 struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id,
133 const u8 *mac, u32 tid,
135 struct sk_buff *(*gen_delba_send)(struct ath10k *ar, u32 vdev_id,
136 const u8 *mac, u32 tid, u32 initiator,
138 struct sk_buff *(*gen_bcn_tmpl)(struct ath10k *ar, u32 vdev_id,
139 u32 tim_ie_offset, struct sk_buff *bcn,
140 u32 prb_caps, u32 prb_erp,
141 void *prb_ies, size_t prb_ies_len);
142 struct sk_buff *(*gen_prb_tmpl)(struct ath10k *ar, u32 vdev_id,
143 struct sk_buff *bcn);
144 struct sk_buff *(*gen_p2p_go_bcn_ie)(struct ath10k *ar, u32 vdev_id,
146 struct sk_buff *(*gen_vdev_sta_uapsd)(struct ath10k *ar, u32 vdev_id,
147 const u8 peer_addr[ETH_ALEN],
148 const struct wmi_sta_uapsd_auto_trig_arg *args,
150 struct sk_buff *(*gen_sta_keepalive)(struct ath10k *ar,
151 const struct wmi_sta_keepalive_arg *arg);
154 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
157 ath10k_wmi_rx(struct ath10k *ar, struct sk_buff *skb)
159 if (WARN_ON_ONCE(!ar->wmi.ops->rx))
162 ar->wmi.ops->rx(ar, skb);
167 ath10k_wmi_map_svc(struct ath10k *ar, const __le32 *in, unsigned long *out,
170 if (!ar->wmi.ops->map_svc)
173 ar->wmi.ops->map_svc(in, out, len);
178 ath10k_wmi_pull_scan(struct ath10k *ar, struct sk_buff *skb,
179 struct wmi_scan_ev_arg *arg)
181 if (!ar->wmi.ops->pull_scan)
184 return ar->wmi.ops->pull_scan(ar, skb, arg);
188 ath10k_wmi_pull_mgmt_rx(struct ath10k *ar, struct sk_buff *skb,
189 struct wmi_mgmt_rx_ev_arg *arg)
191 if (!ar->wmi.ops->pull_mgmt_rx)
194 return ar->wmi.ops->pull_mgmt_rx(ar, skb, arg);
198 ath10k_wmi_pull_ch_info(struct ath10k *ar, struct sk_buff *skb,
199 struct wmi_ch_info_ev_arg *arg)
201 if (!ar->wmi.ops->pull_ch_info)
204 return ar->wmi.ops->pull_ch_info(ar, skb, arg);
208 ath10k_wmi_pull_vdev_start(struct ath10k *ar, struct sk_buff *skb,
209 struct wmi_vdev_start_ev_arg *arg)
211 if (!ar->wmi.ops->pull_vdev_start)
214 return ar->wmi.ops->pull_vdev_start(ar, skb, arg);
218 ath10k_wmi_pull_peer_kick(struct ath10k *ar, struct sk_buff *skb,
219 struct wmi_peer_kick_ev_arg *arg)
221 if (!ar->wmi.ops->pull_peer_kick)
224 return ar->wmi.ops->pull_peer_kick(ar, skb, arg);
228 ath10k_wmi_pull_swba(struct ath10k *ar, struct sk_buff *skb,
229 struct wmi_swba_ev_arg *arg)
231 if (!ar->wmi.ops->pull_swba)
234 return ar->wmi.ops->pull_swba(ar, skb, arg);
238 ath10k_wmi_pull_phyerr(struct ath10k *ar, struct sk_buff *skb,
239 struct wmi_phyerr_ev_arg *arg)
241 if (!ar->wmi.ops->pull_phyerr)
244 return ar->wmi.ops->pull_phyerr(ar, skb, arg);
248 ath10k_wmi_pull_svc_rdy(struct ath10k *ar, struct sk_buff *skb,
249 struct wmi_svc_rdy_ev_arg *arg)
251 if (!ar->wmi.ops->pull_svc_rdy)
254 return ar->wmi.ops->pull_svc_rdy(ar, skb, arg);
258 ath10k_wmi_pull_rdy(struct ath10k *ar, struct sk_buff *skb,
259 struct wmi_rdy_ev_arg *arg)
261 if (!ar->wmi.ops->pull_rdy)
264 return ar->wmi.ops->pull_rdy(ar, skb, arg);
268 ath10k_wmi_pull_fw_stats(struct ath10k *ar, struct sk_buff *skb,
269 struct ath10k_fw_stats *stats)
271 if (!ar->wmi.ops->pull_fw_stats)
274 return ar->wmi.ops->pull_fw_stats(ar, skb, stats);
278 ath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *msdu)
280 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(msdu);
284 if (!ar->wmi.ops->gen_mgmt_tx)
287 skb = ar->wmi.ops->gen_mgmt_tx(ar, msdu);
291 ret = ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->mgmt_tx_cmdid);
295 /* FIXME There's no ACK event for Management Tx. This probably
296 * shouldn't be called here either. */
297 info->flags |= IEEE80211_TX_STAT_ACK;
298 ieee80211_tx_status_irqsafe(ar->hw, msdu);
304 ath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g, u16 rd5g,
305 u16 ctl2g, u16 ctl5g,
306 enum wmi_dfs_region dfs_reg)
310 if (!ar->wmi.ops->gen_pdev_set_rd)
313 skb = ar->wmi.ops->gen_pdev_set_rd(ar, rd, rd2g, rd5g, ctl2g, ctl5g,
318 return ath10k_wmi_cmd_send(ar, skb,
319 ar->wmi.cmd->pdev_set_regdomain_cmdid);
323 ath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt)
327 if (!ar->wmi.ops->gen_pdev_suspend)
330 skb = ar->wmi.ops->gen_pdev_suspend(ar, suspend_opt);
334 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_suspend_cmdid);
338 ath10k_wmi_pdev_resume_target(struct ath10k *ar)
342 if (!ar->wmi.ops->gen_pdev_resume)
345 skb = ar->wmi.ops->gen_pdev_resume(ar);
349 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_resume_cmdid);
353 ath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value)
357 if (!ar->wmi.ops->gen_pdev_set_param)
360 skb = ar->wmi.ops->gen_pdev_set_param(ar, id, value);
364 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid);
368 ath10k_wmi_cmd_init(struct ath10k *ar)
372 if (!ar->wmi.ops->gen_init)
375 skb = ar->wmi.ops->gen_init(ar);
379 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->init_cmdid);
383 ath10k_wmi_start_scan(struct ath10k *ar,
384 const struct wmi_start_scan_arg *arg)
388 if (!ar->wmi.ops->gen_start_scan)
391 skb = ar->wmi.ops->gen_start_scan(ar, arg);
395 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->start_scan_cmdid);
399 ath10k_wmi_stop_scan(struct ath10k *ar, const struct wmi_stop_scan_arg *arg)
403 if (!ar->wmi.ops->gen_stop_scan)
406 skb = ar->wmi.ops->gen_stop_scan(ar, arg);
410 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->stop_scan_cmdid);
414 ath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
415 enum wmi_vdev_type type,
416 enum wmi_vdev_subtype subtype,
417 const u8 macaddr[ETH_ALEN])
421 if (!ar->wmi.ops->gen_vdev_create)
424 skb = ar->wmi.ops->gen_vdev_create(ar, vdev_id, type, subtype, macaddr);
428 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_create_cmdid);
432 ath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)
436 if (!ar->wmi.ops->gen_vdev_delete)
439 skb = ar->wmi.ops->gen_vdev_delete(ar, vdev_id);
443 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_delete_cmdid);
447 ath10k_wmi_vdev_start(struct ath10k *ar,
448 const struct wmi_vdev_start_request_arg *arg)
452 if (!ar->wmi.ops->gen_vdev_start)
455 skb = ar->wmi.ops->gen_vdev_start(ar, arg, false);
459 return ath10k_wmi_cmd_send(ar, skb,
460 ar->wmi.cmd->vdev_start_request_cmdid);
464 ath10k_wmi_vdev_restart(struct ath10k *ar,
465 const struct wmi_vdev_start_request_arg *arg)
469 if (!ar->wmi.ops->gen_vdev_start)
472 skb = ar->wmi.ops->gen_vdev_start(ar, arg, true);
476 return ath10k_wmi_cmd_send(ar, skb,
477 ar->wmi.cmd->vdev_restart_request_cmdid);
481 ath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id)
485 if (!ar->wmi.ops->gen_vdev_stop)
488 skb = ar->wmi.ops->gen_vdev_stop(ar, vdev_id);
492 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_stop_cmdid);
496 ath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
500 if (!ar->wmi.ops->gen_vdev_up)
503 skb = ar->wmi.ops->gen_vdev_up(ar, vdev_id, aid, bssid);
507 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_up_cmdid);
511 ath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id)
515 if (!ar->wmi.ops->gen_vdev_down)
518 skb = ar->wmi.ops->gen_vdev_down(ar, vdev_id);
522 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_down_cmdid);
526 ath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id, u32 param_id,
531 if (!ar->wmi.ops->gen_vdev_set_param)
534 skb = ar->wmi.ops->gen_vdev_set_param(ar, vdev_id, param_id,
539 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_set_param_cmdid);
543 ath10k_wmi_vdev_install_key(struct ath10k *ar,
544 const struct wmi_vdev_install_key_arg *arg)
548 if (!ar->wmi.ops->gen_vdev_install_key)
551 skb = ar->wmi.ops->gen_vdev_install_key(ar, arg);
555 return ath10k_wmi_cmd_send(ar, skb,
556 ar->wmi.cmd->vdev_install_key_cmdid);
560 ath10k_wmi_vdev_spectral_conf(struct ath10k *ar,
561 const struct wmi_vdev_spectral_conf_arg *arg)
566 skb = ar->wmi.ops->gen_vdev_spectral_conf(ar, arg);
570 cmd_id = ar->wmi.cmd->vdev_spectral_scan_configure_cmdid;
571 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
575 ath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger,
581 skb = ar->wmi.ops->gen_vdev_spectral_enable(ar, vdev_id, trigger,
586 cmd_id = ar->wmi.cmd->vdev_spectral_scan_enable_cmdid;
587 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
591 ath10k_wmi_vdev_sta_uapsd(struct ath10k *ar, u32 vdev_id,
592 const u8 peer_addr[ETH_ALEN],
593 const struct wmi_sta_uapsd_auto_trig_arg *args,
599 if (!ar->wmi.ops->gen_vdev_sta_uapsd)
602 skb = ar->wmi.ops->gen_vdev_sta_uapsd(ar, vdev_id, peer_addr, args,
607 cmd_id = ar->wmi.cmd->sta_uapsd_auto_trig_cmdid;
608 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
612 ath10k_wmi_vdev_wmm_conf(struct ath10k *ar, u32 vdev_id,
613 const struct wmi_wmm_params_all_arg *arg)
618 skb = ar->wmi.ops->gen_vdev_wmm_conf(ar, vdev_id, arg);
622 cmd_id = ar->wmi.cmd->vdev_set_wmm_params_cmdid;
623 return ath10k_wmi_cmd_send(ar, skb, cmd_id);
627 ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
628 const u8 peer_addr[ETH_ALEN])
632 if (!ar->wmi.ops->gen_peer_create)
635 skb = ar->wmi.ops->gen_peer_create(ar, vdev_id, peer_addr);
639 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_create_cmdid);
643 ath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
644 const u8 peer_addr[ETH_ALEN])
648 if (!ar->wmi.ops->gen_peer_delete)
651 skb = ar->wmi.ops->gen_peer_delete(ar, vdev_id, peer_addr);
655 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_delete_cmdid);
659 ath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
660 const u8 peer_addr[ETH_ALEN], u32 tid_bitmap)
664 if (!ar->wmi.ops->gen_peer_flush)
667 skb = ar->wmi.ops->gen_peer_flush(ar, vdev_id, peer_addr, tid_bitmap);
671 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_flush_tids_cmdid);
675 ath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id, const u8 *peer_addr,
676 enum wmi_peer_param param_id, u32 param_value)
680 if (!ar->wmi.ops->gen_peer_set_param)
683 skb = ar->wmi.ops->gen_peer_set_param(ar, vdev_id, peer_addr, param_id,
688 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_set_param_cmdid);
692 ath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
693 enum wmi_sta_ps_mode psmode)
697 if (!ar->wmi.ops->gen_set_psmode)
700 skb = ar->wmi.ops->gen_set_psmode(ar, vdev_id, psmode);
704 return ath10k_wmi_cmd_send(ar, skb,
705 ar->wmi.cmd->sta_powersave_mode_cmdid);
709 ath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
710 enum wmi_sta_powersave_param param_id, u32 value)
714 if (!ar->wmi.ops->gen_set_sta_ps)
717 skb = ar->wmi.ops->gen_set_sta_ps(ar, vdev_id, param_id, value);
721 return ath10k_wmi_cmd_send(ar, skb,
722 ar->wmi.cmd->sta_powersave_param_cmdid);
726 ath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
727 enum wmi_ap_ps_peer_param param_id, u32 value)
731 if (!ar->wmi.ops->gen_set_ap_ps)
734 skb = ar->wmi.ops->gen_set_ap_ps(ar, vdev_id, mac, param_id, value);
738 return ath10k_wmi_cmd_send(ar, skb,
739 ar->wmi.cmd->ap_ps_peer_param_cmdid);
743 ath10k_wmi_scan_chan_list(struct ath10k *ar,
744 const struct wmi_scan_chan_list_arg *arg)
748 if (!ar->wmi.ops->gen_scan_chan_list)
751 skb = ar->wmi.ops->gen_scan_chan_list(ar, arg);
755 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->scan_chan_list_cmdid);
759 ath10k_wmi_peer_assoc(struct ath10k *ar,
760 const struct wmi_peer_assoc_complete_arg *arg)
764 if (!ar->wmi.ops->gen_peer_assoc)
767 skb = ar->wmi.ops->gen_peer_assoc(ar, arg);
771 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_assoc_cmdid);
775 ath10k_wmi_beacon_send_ref_nowait(struct ath10k *ar, u32 vdev_id,
776 const void *bcn, size_t bcn_len,
777 u32 bcn_paddr, bool dtim_zero,
783 if (!ar->wmi.ops->gen_beacon_dma)
786 skb = ar->wmi.ops->gen_beacon_dma(ar, vdev_id, bcn, bcn_len, bcn_paddr,
787 dtim_zero, deliver_cab);
791 ret = ath10k_wmi_cmd_send_nowait(ar, skb,
792 ar->wmi.cmd->pdev_send_bcn_cmdid);
802 ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
803 const struct wmi_wmm_params_all_arg *arg)
807 if (!ar->wmi.ops->gen_pdev_set_wmm)
810 skb = ar->wmi.ops->gen_pdev_set_wmm(ar, arg);
814 return ath10k_wmi_cmd_send(ar, skb,
815 ar->wmi.cmd->pdev_set_wmm_params_cmdid);
819 ath10k_wmi_request_stats(struct ath10k *ar, enum wmi_stats_id stats_id)
823 if (!ar->wmi.ops->gen_request_stats)
826 skb = ar->wmi.ops->gen_request_stats(ar, stats_id);
830 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_stats_cmdid);
834 ath10k_wmi_force_fw_hang(struct ath10k *ar,
835 enum wmi_force_fw_hang_type type, u32 delay_ms)
839 if (!ar->wmi.ops->gen_force_fw_hang)
842 skb = ar->wmi.ops->gen_force_fw_hang(ar, type, delay_ms);
846 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
850 ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable, u32 log_level)
854 if (!ar->wmi.ops->gen_dbglog_cfg)
857 skb = ar->wmi.ops->gen_dbglog_cfg(ar, module_enable, log_level);
861 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->dbglog_cfg_cmdid);
865 ath10k_wmi_pdev_pktlog_enable(struct ath10k *ar, u32 filter)
869 if (!ar->wmi.ops->gen_pktlog_enable)
872 skb = ar->wmi.ops->gen_pktlog_enable(ar, filter);
876 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_pktlog_enable_cmdid);
880 ath10k_wmi_pdev_pktlog_disable(struct ath10k *ar)
884 if (!ar->wmi.ops->gen_pktlog_disable)
887 skb = ar->wmi.ops->gen_pktlog_disable(ar);
891 return ath10k_wmi_cmd_send(ar, skb,
892 ar->wmi.cmd->pdev_pktlog_disable_cmdid);
896 ath10k_wmi_pdev_set_quiet_mode(struct ath10k *ar, u32 period, u32 duration,
897 u32 next_offset, u32 enabled)
901 if (!ar->wmi.ops->gen_pdev_set_quiet_mode)
904 skb = ar->wmi.ops->gen_pdev_set_quiet_mode(ar, period, duration,
905 next_offset, enabled);
909 return ath10k_wmi_cmd_send(ar, skb,
910 ar->wmi.cmd->pdev_set_quiet_mode_cmdid);
914 ath10k_wmi_pdev_get_temperature(struct ath10k *ar)
918 if (!ar->wmi.ops->gen_pdev_get_temperature)
921 skb = ar->wmi.ops->gen_pdev_get_temperature(ar);
925 return ath10k_wmi_cmd_send(ar, skb,
926 ar->wmi.cmd->pdev_get_temperature_cmdid);
930 ath10k_wmi_addba_clear_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac)
934 if (!ar->wmi.ops->gen_addba_clear_resp)
937 skb = ar->wmi.ops->gen_addba_clear_resp(ar, vdev_id, mac);
941 return ath10k_wmi_cmd_send(ar, skb,
942 ar->wmi.cmd->addba_clear_resp_cmdid);
946 ath10k_wmi_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
947 u32 tid, u32 buf_size)
951 if (!ar->wmi.ops->gen_addba_send)
954 skb = ar->wmi.ops->gen_addba_send(ar, vdev_id, mac, tid, buf_size);
958 return ath10k_wmi_cmd_send(ar, skb,
959 ar->wmi.cmd->addba_send_cmdid);
963 ath10k_wmi_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac,
968 if (!ar->wmi.ops->gen_addba_set_resp)
971 skb = ar->wmi.ops->gen_addba_set_resp(ar, vdev_id, mac, tid, status);
975 return ath10k_wmi_cmd_send(ar, skb,
976 ar->wmi.cmd->addba_set_resp_cmdid);
980 ath10k_wmi_delba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
981 u32 tid, u32 initiator, u32 reason)
985 if (!ar->wmi.ops->gen_delba_send)
988 skb = ar->wmi.ops->gen_delba_send(ar, vdev_id, mac, tid, initiator,
993 return ath10k_wmi_cmd_send(ar, skb,
994 ar->wmi.cmd->delba_send_cmdid);
998 ath10k_wmi_bcn_tmpl(struct ath10k *ar, u32 vdev_id, u32 tim_ie_offset,
999 struct sk_buff *bcn, u32 prb_caps, u32 prb_erp,
1000 void *prb_ies, size_t prb_ies_len)
1002 struct sk_buff *skb;
1004 if (!ar->wmi.ops->gen_bcn_tmpl)
1007 skb = ar->wmi.ops->gen_bcn_tmpl(ar, vdev_id, tim_ie_offset, bcn,
1008 prb_caps, prb_erp, prb_ies,
1011 return PTR_ERR(skb);
1013 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->bcn_tmpl_cmdid);
1017 ath10k_wmi_prb_tmpl(struct ath10k *ar, u32 vdev_id, struct sk_buff *prb)
1019 struct sk_buff *skb;
1021 if (!ar->wmi.ops->gen_prb_tmpl)
1024 skb = ar->wmi.ops->gen_prb_tmpl(ar, vdev_id, prb);
1026 return PTR_ERR(skb);
1028 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->prb_tmpl_cmdid);
1032 ath10k_wmi_p2p_go_bcn_ie(struct ath10k *ar, u32 vdev_id, const u8 *p2p_ie)
1034 struct sk_buff *skb;
1036 if (!ar->wmi.ops->gen_p2p_go_bcn_ie)
1039 skb = ar->wmi.ops->gen_p2p_go_bcn_ie(ar, vdev_id, p2p_ie);
1041 return PTR_ERR(skb);
1043 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->p2p_go_set_beacon_ie);
1047 ath10k_wmi_sta_keepalive(struct ath10k *ar,
1048 const struct wmi_sta_keepalive_arg *arg)
1050 struct sk_buff *skb;
1053 if (!ar->wmi.ops->gen_sta_keepalive)
1056 skb = ar->wmi.ops->gen_sta_keepalive(ar, arg);
1058 return PTR_ERR(skb);
1060 cmd_id = ar->wmi.cmd->sta_keepalive_cmd;
1061 return ath10k_wmi_cmd_send(ar, skb, cmd_id);