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_peer_create
)(struct ath10k
*ar
, u32 vdev_id
,
82 const u8 peer_addr
[ETH_ALEN
]);
83 struct sk_buff
*(*gen_peer_delete
)(struct ath10k
*ar
, u32 vdev_id
,
84 const u8 peer_addr
[ETH_ALEN
]);
85 struct sk_buff
*(*gen_peer_flush
)(struct ath10k
*ar
, u32 vdev_id
,
86 const u8 peer_addr
[ETH_ALEN
],
88 struct sk_buff
*(*gen_peer_set_param
)(struct ath10k
*ar
, u32 vdev_id
,
90 enum wmi_peer_param param_id
,
92 struct sk_buff
*(*gen_peer_assoc
)(struct ath10k
*ar
,
93 const struct wmi_peer_assoc_complete_arg
*arg
);
94 struct sk_buff
*(*gen_set_psmode
)(struct ath10k
*ar
, u32 vdev_id
,
95 enum wmi_sta_ps_mode psmode
);
96 struct sk_buff
*(*gen_set_sta_ps
)(struct ath10k
*ar
, u32 vdev_id
,
97 enum wmi_sta_powersave_param param_id
,
99 struct sk_buff
*(*gen_set_ap_ps
)(struct ath10k
*ar
, u32 vdev_id
,
101 enum wmi_ap_ps_peer_param param_id
,
103 struct sk_buff
*(*gen_scan_chan_list
)(struct ath10k
*ar
,
104 const struct wmi_scan_chan_list_arg
*arg
);
105 struct sk_buff
*(*gen_beacon_dma
)(struct ath10k_vif
*arvif
);
106 struct sk_buff
*(*gen_pdev_set_wmm
)(struct ath10k
*ar
,
107 const struct wmi_pdev_set_wmm_params_arg
*arg
);
108 struct sk_buff
*(*gen_request_stats
)(struct ath10k
*ar
,
109 enum wmi_stats_id stats_id
);
110 struct sk_buff
*(*gen_force_fw_hang
)(struct ath10k
*ar
,
111 enum wmi_force_fw_hang_type type
,
113 struct sk_buff
*(*gen_mgmt_tx
)(struct ath10k
*ar
, struct sk_buff
*skb
);
114 struct sk_buff
*(*gen_dbglog_cfg
)(struct ath10k
*ar
, u32 module_enable
);
115 struct sk_buff
*(*gen_pktlog_enable
)(struct ath10k
*ar
, u32 filter
);
116 struct sk_buff
*(*gen_pktlog_disable
)(struct ath10k
*ar
);
117 struct sk_buff
*(*gen_pdev_set_quiet_mode
)(struct ath10k
*ar
,
118 u32 period
, u32 duration
,
121 struct sk_buff
*(*gen_pdev_get_temperature
)(struct ath10k
*ar
);
122 struct sk_buff
*(*gen_addba_clear_resp
)(struct ath10k
*ar
, u32 vdev_id
,
124 struct sk_buff
*(*gen_addba_send
)(struct ath10k
*ar
, u32 vdev_id
,
125 const u8
*mac
, u32 tid
, u32 buf_size
);
126 struct sk_buff
*(*gen_addba_set_resp
)(struct ath10k
*ar
, u32 vdev_id
,
127 const u8
*mac
, u32 tid
,
129 struct sk_buff
*(*gen_delba_send
)(struct ath10k
*ar
, u32 vdev_id
,
130 const u8
*mac
, u32 tid
, u32 initiator
,
132 struct sk_buff
*(*gen_bcn_tmpl
)(struct ath10k
*ar
, u32 vdev_id
,
133 u32 tim_ie_offset
, struct sk_buff
*bcn
,
134 u32 prb_caps
, u32 prb_erp
,
135 void *prb_ies
, size_t prb_ies_len
);
136 struct sk_buff
*(*gen_prb_tmpl
)(struct ath10k
*ar
, u32 vdev_id
,
137 struct sk_buff
*bcn
);
138 struct sk_buff
*(*gen_p2p_go_bcn_ie
)(struct ath10k
*ar
, u32 vdev_id
,
142 int ath10k_wmi_cmd_send(struct ath10k
*ar
, struct sk_buff
*skb
, u32 cmd_id
);
145 ath10k_wmi_rx(struct ath10k
*ar
, struct sk_buff
*skb
)
147 if (WARN_ON_ONCE(!ar
->wmi
.ops
->rx
))
150 ar
->wmi
.ops
->rx(ar
, skb
);
155 ath10k_wmi_map_svc(struct ath10k
*ar
, const __le32
*in
, unsigned long *out
,
158 if (!ar
->wmi
.ops
->map_svc
)
161 ar
->wmi
.ops
->map_svc(in
, out
, len
);
166 ath10k_wmi_pull_scan(struct ath10k
*ar
, struct sk_buff
*skb
,
167 struct wmi_scan_ev_arg
*arg
)
169 if (!ar
->wmi
.ops
->pull_scan
)
172 return ar
->wmi
.ops
->pull_scan(ar
, skb
, arg
);
176 ath10k_wmi_pull_mgmt_rx(struct ath10k
*ar
, struct sk_buff
*skb
,
177 struct wmi_mgmt_rx_ev_arg
*arg
)
179 if (!ar
->wmi
.ops
->pull_mgmt_rx
)
182 return ar
->wmi
.ops
->pull_mgmt_rx(ar
, skb
, arg
);
186 ath10k_wmi_pull_ch_info(struct ath10k
*ar
, struct sk_buff
*skb
,
187 struct wmi_ch_info_ev_arg
*arg
)
189 if (!ar
->wmi
.ops
->pull_ch_info
)
192 return ar
->wmi
.ops
->pull_ch_info(ar
, skb
, arg
);
196 ath10k_wmi_pull_vdev_start(struct ath10k
*ar
, struct sk_buff
*skb
,
197 struct wmi_vdev_start_ev_arg
*arg
)
199 if (!ar
->wmi
.ops
->pull_vdev_start
)
202 return ar
->wmi
.ops
->pull_vdev_start(ar
, skb
, arg
);
206 ath10k_wmi_pull_peer_kick(struct ath10k
*ar
, struct sk_buff
*skb
,
207 struct wmi_peer_kick_ev_arg
*arg
)
209 if (!ar
->wmi
.ops
->pull_peer_kick
)
212 return ar
->wmi
.ops
->pull_peer_kick(ar
, skb
, arg
);
216 ath10k_wmi_pull_swba(struct ath10k
*ar
, struct sk_buff
*skb
,
217 struct wmi_swba_ev_arg
*arg
)
219 if (!ar
->wmi
.ops
->pull_swba
)
222 return ar
->wmi
.ops
->pull_swba(ar
, skb
, arg
);
226 ath10k_wmi_pull_phyerr(struct ath10k
*ar
, struct sk_buff
*skb
,
227 struct wmi_phyerr_ev_arg
*arg
)
229 if (!ar
->wmi
.ops
->pull_phyerr
)
232 return ar
->wmi
.ops
->pull_phyerr(ar
, skb
, arg
);
236 ath10k_wmi_pull_svc_rdy(struct ath10k
*ar
, struct sk_buff
*skb
,
237 struct wmi_svc_rdy_ev_arg
*arg
)
239 if (!ar
->wmi
.ops
->pull_svc_rdy
)
242 return ar
->wmi
.ops
->pull_svc_rdy(ar
, skb
, arg
);
246 ath10k_wmi_pull_rdy(struct ath10k
*ar
, struct sk_buff
*skb
,
247 struct wmi_rdy_ev_arg
*arg
)
249 if (!ar
->wmi
.ops
->pull_rdy
)
252 return ar
->wmi
.ops
->pull_rdy(ar
, skb
, arg
);
256 ath10k_wmi_pull_fw_stats(struct ath10k
*ar
, struct sk_buff
*skb
,
257 struct ath10k_fw_stats
*stats
)
259 if (!ar
->wmi
.ops
->pull_fw_stats
)
262 return ar
->wmi
.ops
->pull_fw_stats(ar
, skb
, stats
);
266 ath10k_wmi_mgmt_tx(struct ath10k
*ar
, struct sk_buff
*msdu
)
268 struct ieee80211_tx_info
*info
= IEEE80211_SKB_CB(msdu
);
272 if (!ar
->wmi
.ops
->gen_mgmt_tx
)
275 skb
= ar
->wmi
.ops
->gen_mgmt_tx(ar
, msdu
);
279 ret
= ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->mgmt_tx_cmdid
);
283 /* FIXME There's no ACK event for Management Tx. This probably
284 * shouldn't be called here either. */
285 info
->flags
|= IEEE80211_TX_STAT_ACK
;
286 ieee80211_tx_status_irqsafe(ar
->hw
, msdu
);
292 ath10k_wmi_pdev_set_regdomain(struct ath10k
*ar
, u16 rd
, u16 rd2g
, u16 rd5g
,
293 u16 ctl2g
, u16 ctl5g
,
294 enum wmi_dfs_region dfs_reg
)
298 if (!ar
->wmi
.ops
->gen_pdev_set_rd
)
301 skb
= ar
->wmi
.ops
->gen_pdev_set_rd(ar
, rd
, rd2g
, rd5g
, ctl2g
, ctl5g
,
306 return ath10k_wmi_cmd_send(ar
, skb
,
307 ar
->wmi
.cmd
->pdev_set_regdomain_cmdid
);
311 ath10k_wmi_pdev_suspend_target(struct ath10k
*ar
, u32 suspend_opt
)
315 if (!ar
->wmi
.ops
->gen_pdev_suspend
)
318 skb
= ar
->wmi
.ops
->gen_pdev_suspend(ar
, suspend_opt
);
322 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->pdev_suspend_cmdid
);
326 ath10k_wmi_pdev_resume_target(struct ath10k
*ar
)
330 if (!ar
->wmi
.ops
->gen_pdev_resume
)
333 skb
= ar
->wmi
.ops
->gen_pdev_resume(ar
);
337 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->pdev_resume_cmdid
);
341 ath10k_wmi_pdev_set_param(struct ath10k
*ar
, u32 id
, u32 value
)
345 if (!ar
->wmi
.ops
->gen_pdev_set_param
)
348 skb
= ar
->wmi
.ops
->gen_pdev_set_param(ar
, id
, value
);
352 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->pdev_set_param_cmdid
);
356 ath10k_wmi_cmd_init(struct ath10k
*ar
)
360 if (!ar
->wmi
.ops
->gen_init
)
363 skb
= ar
->wmi
.ops
->gen_init(ar
);
367 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->init_cmdid
);
371 ath10k_wmi_start_scan(struct ath10k
*ar
,
372 const struct wmi_start_scan_arg
*arg
)
376 if (!ar
->wmi
.ops
->gen_start_scan
)
379 skb
= ar
->wmi
.ops
->gen_start_scan(ar
, arg
);
383 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->start_scan_cmdid
);
387 ath10k_wmi_stop_scan(struct ath10k
*ar
, const struct wmi_stop_scan_arg
*arg
)
391 if (!ar
->wmi
.ops
->gen_stop_scan
)
394 skb
= ar
->wmi
.ops
->gen_stop_scan(ar
, arg
);
398 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->stop_scan_cmdid
);
402 ath10k_wmi_vdev_create(struct ath10k
*ar
, u32 vdev_id
,
403 enum wmi_vdev_type type
,
404 enum wmi_vdev_subtype subtype
,
405 const u8 macaddr
[ETH_ALEN
])
409 if (!ar
->wmi
.ops
->gen_vdev_create
)
412 skb
= ar
->wmi
.ops
->gen_vdev_create(ar
, vdev_id
, type
, subtype
, macaddr
);
416 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_create_cmdid
);
420 ath10k_wmi_vdev_delete(struct ath10k
*ar
, u32 vdev_id
)
424 if (!ar
->wmi
.ops
->gen_vdev_delete
)
427 skb
= ar
->wmi
.ops
->gen_vdev_delete(ar
, vdev_id
);
431 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_delete_cmdid
);
435 ath10k_wmi_vdev_start(struct ath10k
*ar
,
436 const struct wmi_vdev_start_request_arg
*arg
)
440 if (!ar
->wmi
.ops
->gen_vdev_start
)
443 skb
= ar
->wmi
.ops
->gen_vdev_start(ar
, arg
, false);
447 return ath10k_wmi_cmd_send(ar
, skb
,
448 ar
->wmi
.cmd
->vdev_start_request_cmdid
);
452 ath10k_wmi_vdev_restart(struct ath10k
*ar
,
453 const struct wmi_vdev_start_request_arg
*arg
)
457 if (!ar
->wmi
.ops
->gen_vdev_start
)
460 skb
= ar
->wmi
.ops
->gen_vdev_start(ar
, arg
, true);
464 return ath10k_wmi_cmd_send(ar
, skb
,
465 ar
->wmi
.cmd
->vdev_restart_request_cmdid
);
469 ath10k_wmi_vdev_stop(struct ath10k
*ar
, u32 vdev_id
)
473 if (!ar
->wmi
.ops
->gen_vdev_stop
)
476 skb
= ar
->wmi
.ops
->gen_vdev_stop(ar
, vdev_id
);
480 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_stop_cmdid
);
484 ath10k_wmi_vdev_up(struct ath10k
*ar
, u32 vdev_id
, u32 aid
, const u8
*bssid
)
488 if (!ar
->wmi
.ops
->gen_vdev_up
)
491 skb
= ar
->wmi
.ops
->gen_vdev_up(ar
, vdev_id
, aid
, bssid
);
495 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_up_cmdid
);
499 ath10k_wmi_vdev_down(struct ath10k
*ar
, u32 vdev_id
)
503 if (!ar
->wmi
.ops
->gen_vdev_down
)
506 skb
= ar
->wmi
.ops
->gen_vdev_down(ar
, vdev_id
);
510 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_down_cmdid
);
514 ath10k_wmi_vdev_set_param(struct ath10k
*ar
, u32 vdev_id
, u32 param_id
,
519 if (!ar
->wmi
.ops
->gen_vdev_set_param
)
522 skb
= ar
->wmi
.ops
->gen_vdev_set_param(ar
, vdev_id
, param_id
,
527 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_set_param_cmdid
);
531 ath10k_wmi_vdev_install_key(struct ath10k
*ar
,
532 const struct wmi_vdev_install_key_arg
*arg
)
536 if (!ar
->wmi
.ops
->gen_vdev_install_key
)
539 skb
= ar
->wmi
.ops
->gen_vdev_install_key(ar
, arg
);
543 return ath10k_wmi_cmd_send(ar
, skb
,
544 ar
->wmi
.cmd
->vdev_install_key_cmdid
);
548 ath10k_wmi_vdev_spectral_conf(struct ath10k
*ar
,
549 const struct wmi_vdev_spectral_conf_arg
*arg
)
554 skb
= ar
->wmi
.ops
->gen_vdev_spectral_conf(ar
, arg
);
558 cmd_id
= ar
->wmi
.cmd
->vdev_spectral_scan_configure_cmdid
;
559 return ath10k_wmi_cmd_send(ar
, skb
, cmd_id
);
563 ath10k_wmi_vdev_spectral_enable(struct ath10k
*ar
, u32 vdev_id
, u32 trigger
,
569 skb
= ar
->wmi
.ops
->gen_vdev_spectral_enable(ar
, vdev_id
, trigger
,
574 cmd_id
= ar
->wmi
.cmd
->vdev_spectral_scan_enable_cmdid
;
575 return ath10k_wmi_cmd_send(ar
, skb
, cmd_id
);
579 ath10k_wmi_peer_create(struct ath10k
*ar
, u32 vdev_id
,
580 const u8 peer_addr
[ETH_ALEN
])
584 if (!ar
->wmi
.ops
->gen_peer_create
)
587 skb
= ar
->wmi
.ops
->gen_peer_create(ar
, vdev_id
, peer_addr
);
591 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_create_cmdid
);
595 ath10k_wmi_peer_delete(struct ath10k
*ar
, u32 vdev_id
,
596 const u8 peer_addr
[ETH_ALEN
])
600 if (!ar
->wmi
.ops
->gen_peer_delete
)
603 skb
= ar
->wmi
.ops
->gen_peer_delete(ar
, vdev_id
, peer_addr
);
607 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_delete_cmdid
);
611 ath10k_wmi_peer_flush(struct ath10k
*ar
, u32 vdev_id
,
612 const u8 peer_addr
[ETH_ALEN
], u32 tid_bitmap
)
616 if (!ar
->wmi
.ops
->gen_peer_flush
)
619 skb
= ar
->wmi
.ops
->gen_peer_flush(ar
, vdev_id
, peer_addr
, tid_bitmap
);
623 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_flush_tids_cmdid
);
627 ath10k_wmi_peer_set_param(struct ath10k
*ar
, u32 vdev_id
, const u8
*peer_addr
,
628 enum wmi_peer_param param_id
, u32 param_value
)
632 if (!ar
->wmi
.ops
->gen_peer_set_param
)
635 skb
= ar
->wmi
.ops
->gen_peer_set_param(ar
, vdev_id
, peer_addr
, param_id
,
640 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_set_param_cmdid
);
644 ath10k_wmi_set_psmode(struct ath10k
*ar
, u32 vdev_id
,
645 enum wmi_sta_ps_mode psmode
)
649 if (!ar
->wmi
.ops
->gen_set_psmode
)
652 skb
= ar
->wmi
.ops
->gen_set_psmode(ar
, vdev_id
, psmode
);
656 return ath10k_wmi_cmd_send(ar
, skb
,
657 ar
->wmi
.cmd
->sta_powersave_mode_cmdid
);
661 ath10k_wmi_set_sta_ps_param(struct ath10k
*ar
, u32 vdev_id
,
662 enum wmi_sta_powersave_param param_id
, u32 value
)
666 if (!ar
->wmi
.ops
->gen_set_sta_ps
)
669 skb
= ar
->wmi
.ops
->gen_set_sta_ps(ar
, vdev_id
, param_id
, value
);
673 return ath10k_wmi_cmd_send(ar
, skb
,
674 ar
->wmi
.cmd
->sta_powersave_param_cmdid
);
678 ath10k_wmi_set_ap_ps_param(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
679 enum wmi_ap_ps_peer_param param_id
, u32 value
)
683 if (!ar
->wmi
.ops
->gen_set_ap_ps
)
686 skb
= ar
->wmi
.ops
->gen_set_ap_ps(ar
, vdev_id
, mac
, param_id
, value
);
690 return ath10k_wmi_cmd_send(ar
, skb
,
691 ar
->wmi
.cmd
->ap_ps_peer_param_cmdid
);
695 ath10k_wmi_scan_chan_list(struct ath10k
*ar
,
696 const struct wmi_scan_chan_list_arg
*arg
)
700 if (!ar
->wmi
.ops
->gen_scan_chan_list
)
703 skb
= ar
->wmi
.ops
->gen_scan_chan_list(ar
, arg
);
707 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->scan_chan_list_cmdid
);
711 ath10k_wmi_peer_assoc(struct ath10k
*ar
,
712 const struct wmi_peer_assoc_complete_arg
*arg
)
716 if (!ar
->wmi
.ops
->gen_peer_assoc
)
719 skb
= ar
->wmi
.ops
->gen_peer_assoc(ar
, arg
);
723 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_assoc_cmdid
);
727 ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif
*arvif
)
729 struct ath10k
*ar
= arvif
->ar
;
733 if (!ar
->wmi
.ops
->gen_beacon_dma
)
736 skb
= ar
->wmi
.ops
->gen_beacon_dma(arvif
);
740 ret
= ath10k_wmi_cmd_send_nowait(ar
, skb
,
741 ar
->wmi
.cmd
->pdev_send_bcn_cmdid
);
751 ath10k_wmi_pdev_set_wmm_params(struct ath10k
*ar
,
752 const struct wmi_pdev_set_wmm_params_arg
*arg
)
756 if (!ar
->wmi
.ops
->gen_pdev_set_wmm
)
759 skb
= ar
->wmi
.ops
->gen_pdev_set_wmm(ar
, arg
);
763 return ath10k_wmi_cmd_send(ar
, skb
,
764 ar
->wmi
.cmd
->pdev_set_wmm_params_cmdid
);
768 ath10k_wmi_request_stats(struct ath10k
*ar
, enum wmi_stats_id stats_id
)
772 if (!ar
->wmi
.ops
->gen_request_stats
)
775 skb
= ar
->wmi
.ops
->gen_request_stats(ar
, stats_id
);
779 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->request_stats_cmdid
);
783 ath10k_wmi_force_fw_hang(struct ath10k
*ar
,
784 enum wmi_force_fw_hang_type type
, u32 delay_ms
)
788 if (!ar
->wmi
.ops
->gen_force_fw_hang
)
791 skb
= ar
->wmi
.ops
->gen_force_fw_hang(ar
, type
, delay_ms
);
795 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->force_fw_hang_cmdid
);
799 ath10k_wmi_dbglog_cfg(struct ath10k
*ar
, u32 module_enable
)
803 if (!ar
->wmi
.ops
->gen_dbglog_cfg
)
806 skb
= ar
->wmi
.ops
->gen_dbglog_cfg(ar
, module_enable
);
810 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->dbglog_cfg_cmdid
);
814 ath10k_wmi_pdev_pktlog_enable(struct ath10k
*ar
, u32 filter
)
818 if (!ar
->wmi
.ops
->gen_pktlog_enable
)
821 skb
= ar
->wmi
.ops
->gen_pktlog_enable(ar
, filter
);
825 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->pdev_pktlog_enable_cmdid
);
829 ath10k_wmi_pdev_pktlog_disable(struct ath10k
*ar
)
833 if (!ar
->wmi
.ops
->gen_pktlog_disable
)
836 skb
= ar
->wmi
.ops
->gen_pktlog_disable(ar
);
840 return ath10k_wmi_cmd_send(ar
, skb
,
841 ar
->wmi
.cmd
->pdev_pktlog_disable_cmdid
);
845 ath10k_wmi_pdev_set_quiet_mode(struct ath10k
*ar
, u32 period
, u32 duration
,
846 u32 next_offset
, u32 enabled
)
850 if (!ar
->wmi
.ops
->gen_pdev_set_quiet_mode
)
853 skb
= ar
->wmi
.ops
->gen_pdev_set_quiet_mode(ar
, period
, duration
,
854 next_offset
, enabled
);
858 return ath10k_wmi_cmd_send(ar
, skb
,
859 ar
->wmi
.cmd
->pdev_set_quiet_mode_cmdid
);
863 ath10k_wmi_pdev_get_temperature(struct ath10k
*ar
)
867 if (!ar
->wmi
.ops
->gen_pdev_get_temperature
)
870 skb
= ar
->wmi
.ops
->gen_pdev_get_temperature(ar
);
874 return ath10k_wmi_cmd_send(ar
, skb
,
875 ar
->wmi
.cmd
->pdev_get_temperature_cmdid
);
879 ath10k_wmi_addba_clear_resp(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
)
883 if (!ar
->wmi
.ops
->gen_addba_clear_resp
)
886 skb
= ar
->wmi
.ops
->gen_addba_clear_resp(ar
, vdev_id
, mac
);
890 return ath10k_wmi_cmd_send(ar
, skb
,
891 ar
->wmi
.cmd
->addba_clear_resp_cmdid
);
895 ath10k_wmi_addba_send(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
896 u32 tid
, u32 buf_size
)
900 if (!ar
->wmi
.ops
->gen_addba_send
)
903 skb
= ar
->wmi
.ops
->gen_addba_send(ar
, vdev_id
, mac
, tid
, buf_size
);
907 return ath10k_wmi_cmd_send(ar
, skb
,
908 ar
->wmi
.cmd
->addba_send_cmdid
);
912 ath10k_wmi_addba_set_resp(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
917 if (!ar
->wmi
.ops
->gen_addba_set_resp
)
920 skb
= ar
->wmi
.ops
->gen_addba_set_resp(ar
, vdev_id
, mac
, tid
, status
);
924 return ath10k_wmi_cmd_send(ar
, skb
,
925 ar
->wmi
.cmd
->addba_set_resp_cmdid
);
929 ath10k_wmi_delba_send(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
930 u32 tid
, u32 initiator
, u32 reason
)
934 if (!ar
->wmi
.ops
->gen_delba_send
)
937 skb
= ar
->wmi
.ops
->gen_delba_send(ar
, vdev_id
, mac
, tid
, initiator
,
942 return ath10k_wmi_cmd_send(ar
, skb
,
943 ar
->wmi
.cmd
->delba_send_cmdid
);
947 ath10k_wmi_bcn_tmpl(struct ath10k
*ar
, u32 vdev_id
, u32 tim_ie_offset
,
948 struct sk_buff
*bcn
, u32 prb_caps
, u32 prb_erp
,
949 void *prb_ies
, size_t prb_ies_len
)
953 if (!ar
->wmi
.ops
->gen_bcn_tmpl
)
956 skb
= ar
->wmi
.ops
->gen_bcn_tmpl(ar
, vdev_id
, tim_ie_offset
, bcn
,
957 prb_caps
, prb_erp
, prb_ies
,
962 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->bcn_tmpl_cmdid
);
966 ath10k_wmi_prb_tmpl(struct ath10k
*ar
, u32 vdev_id
, struct sk_buff
*prb
)
970 if (!ar
->wmi
.ops
->gen_prb_tmpl
)
973 skb
= ar
->wmi
.ops
->gen_prb_tmpl(ar
, vdev_id
, prb
);
977 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->prb_tmpl_cmdid
);
981 ath10k_wmi_p2p_go_bcn_ie(struct ath10k
*ar
, u32 vdev_id
, const u8
*p2p_ie
)
985 if (!ar
->wmi
.ops
->gen_p2p_go_bcn_ie
)
988 skb
= ar
->wmi
.ops
->gen_p2p_go_bcn_ie(ar
, vdev_id
, p2p_ie
);
992 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->p2p_go_set_beacon_ie
);