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_wmm_params_all_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
,
140 struct sk_buff
*(*gen_vdev_sta_uapsd
)(struct ath10k
*ar
, u32 vdev_id
,
141 const u8 peer_addr
[ETH_ALEN
],
142 const struct wmi_sta_uapsd_auto_trig_arg
*args
,
146 int ath10k_wmi_cmd_send(struct ath10k
*ar
, struct sk_buff
*skb
, u32 cmd_id
);
149 ath10k_wmi_rx(struct ath10k
*ar
, struct sk_buff
*skb
)
151 if (WARN_ON_ONCE(!ar
->wmi
.ops
->rx
))
154 ar
->wmi
.ops
->rx(ar
, skb
);
159 ath10k_wmi_map_svc(struct ath10k
*ar
, const __le32
*in
, unsigned long *out
,
162 if (!ar
->wmi
.ops
->map_svc
)
165 ar
->wmi
.ops
->map_svc(in
, out
, len
);
170 ath10k_wmi_pull_scan(struct ath10k
*ar
, struct sk_buff
*skb
,
171 struct wmi_scan_ev_arg
*arg
)
173 if (!ar
->wmi
.ops
->pull_scan
)
176 return ar
->wmi
.ops
->pull_scan(ar
, skb
, arg
);
180 ath10k_wmi_pull_mgmt_rx(struct ath10k
*ar
, struct sk_buff
*skb
,
181 struct wmi_mgmt_rx_ev_arg
*arg
)
183 if (!ar
->wmi
.ops
->pull_mgmt_rx
)
186 return ar
->wmi
.ops
->pull_mgmt_rx(ar
, skb
, arg
);
190 ath10k_wmi_pull_ch_info(struct ath10k
*ar
, struct sk_buff
*skb
,
191 struct wmi_ch_info_ev_arg
*arg
)
193 if (!ar
->wmi
.ops
->pull_ch_info
)
196 return ar
->wmi
.ops
->pull_ch_info(ar
, skb
, arg
);
200 ath10k_wmi_pull_vdev_start(struct ath10k
*ar
, struct sk_buff
*skb
,
201 struct wmi_vdev_start_ev_arg
*arg
)
203 if (!ar
->wmi
.ops
->pull_vdev_start
)
206 return ar
->wmi
.ops
->pull_vdev_start(ar
, skb
, arg
);
210 ath10k_wmi_pull_peer_kick(struct ath10k
*ar
, struct sk_buff
*skb
,
211 struct wmi_peer_kick_ev_arg
*arg
)
213 if (!ar
->wmi
.ops
->pull_peer_kick
)
216 return ar
->wmi
.ops
->pull_peer_kick(ar
, skb
, arg
);
220 ath10k_wmi_pull_swba(struct ath10k
*ar
, struct sk_buff
*skb
,
221 struct wmi_swba_ev_arg
*arg
)
223 if (!ar
->wmi
.ops
->pull_swba
)
226 return ar
->wmi
.ops
->pull_swba(ar
, skb
, arg
);
230 ath10k_wmi_pull_phyerr(struct ath10k
*ar
, struct sk_buff
*skb
,
231 struct wmi_phyerr_ev_arg
*arg
)
233 if (!ar
->wmi
.ops
->pull_phyerr
)
236 return ar
->wmi
.ops
->pull_phyerr(ar
, skb
, arg
);
240 ath10k_wmi_pull_svc_rdy(struct ath10k
*ar
, struct sk_buff
*skb
,
241 struct wmi_svc_rdy_ev_arg
*arg
)
243 if (!ar
->wmi
.ops
->pull_svc_rdy
)
246 return ar
->wmi
.ops
->pull_svc_rdy(ar
, skb
, arg
);
250 ath10k_wmi_pull_rdy(struct ath10k
*ar
, struct sk_buff
*skb
,
251 struct wmi_rdy_ev_arg
*arg
)
253 if (!ar
->wmi
.ops
->pull_rdy
)
256 return ar
->wmi
.ops
->pull_rdy(ar
, skb
, arg
);
260 ath10k_wmi_pull_fw_stats(struct ath10k
*ar
, struct sk_buff
*skb
,
261 struct ath10k_fw_stats
*stats
)
263 if (!ar
->wmi
.ops
->pull_fw_stats
)
266 return ar
->wmi
.ops
->pull_fw_stats(ar
, skb
, stats
);
270 ath10k_wmi_mgmt_tx(struct ath10k
*ar
, struct sk_buff
*msdu
)
272 struct ieee80211_tx_info
*info
= IEEE80211_SKB_CB(msdu
);
276 if (!ar
->wmi
.ops
->gen_mgmt_tx
)
279 skb
= ar
->wmi
.ops
->gen_mgmt_tx(ar
, msdu
);
283 ret
= ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->mgmt_tx_cmdid
);
287 /* FIXME There's no ACK event for Management Tx. This probably
288 * shouldn't be called here either. */
289 info
->flags
|= IEEE80211_TX_STAT_ACK
;
290 ieee80211_tx_status_irqsafe(ar
->hw
, msdu
);
296 ath10k_wmi_pdev_set_regdomain(struct ath10k
*ar
, u16 rd
, u16 rd2g
, u16 rd5g
,
297 u16 ctl2g
, u16 ctl5g
,
298 enum wmi_dfs_region dfs_reg
)
302 if (!ar
->wmi
.ops
->gen_pdev_set_rd
)
305 skb
= ar
->wmi
.ops
->gen_pdev_set_rd(ar
, rd
, rd2g
, rd5g
, ctl2g
, ctl5g
,
310 return ath10k_wmi_cmd_send(ar
, skb
,
311 ar
->wmi
.cmd
->pdev_set_regdomain_cmdid
);
315 ath10k_wmi_pdev_suspend_target(struct ath10k
*ar
, u32 suspend_opt
)
319 if (!ar
->wmi
.ops
->gen_pdev_suspend
)
322 skb
= ar
->wmi
.ops
->gen_pdev_suspend(ar
, suspend_opt
);
326 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->pdev_suspend_cmdid
);
330 ath10k_wmi_pdev_resume_target(struct ath10k
*ar
)
334 if (!ar
->wmi
.ops
->gen_pdev_resume
)
337 skb
= ar
->wmi
.ops
->gen_pdev_resume(ar
);
341 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->pdev_resume_cmdid
);
345 ath10k_wmi_pdev_set_param(struct ath10k
*ar
, u32 id
, u32 value
)
349 if (!ar
->wmi
.ops
->gen_pdev_set_param
)
352 skb
= ar
->wmi
.ops
->gen_pdev_set_param(ar
, id
, value
);
356 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->pdev_set_param_cmdid
);
360 ath10k_wmi_cmd_init(struct ath10k
*ar
)
364 if (!ar
->wmi
.ops
->gen_init
)
367 skb
= ar
->wmi
.ops
->gen_init(ar
);
371 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->init_cmdid
);
375 ath10k_wmi_start_scan(struct ath10k
*ar
,
376 const struct wmi_start_scan_arg
*arg
)
380 if (!ar
->wmi
.ops
->gen_start_scan
)
383 skb
= ar
->wmi
.ops
->gen_start_scan(ar
, arg
);
387 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->start_scan_cmdid
);
391 ath10k_wmi_stop_scan(struct ath10k
*ar
, const struct wmi_stop_scan_arg
*arg
)
395 if (!ar
->wmi
.ops
->gen_stop_scan
)
398 skb
= ar
->wmi
.ops
->gen_stop_scan(ar
, arg
);
402 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->stop_scan_cmdid
);
406 ath10k_wmi_vdev_create(struct ath10k
*ar
, u32 vdev_id
,
407 enum wmi_vdev_type type
,
408 enum wmi_vdev_subtype subtype
,
409 const u8 macaddr
[ETH_ALEN
])
413 if (!ar
->wmi
.ops
->gen_vdev_create
)
416 skb
= ar
->wmi
.ops
->gen_vdev_create(ar
, vdev_id
, type
, subtype
, macaddr
);
420 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_create_cmdid
);
424 ath10k_wmi_vdev_delete(struct ath10k
*ar
, u32 vdev_id
)
428 if (!ar
->wmi
.ops
->gen_vdev_delete
)
431 skb
= ar
->wmi
.ops
->gen_vdev_delete(ar
, vdev_id
);
435 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_delete_cmdid
);
439 ath10k_wmi_vdev_start(struct ath10k
*ar
,
440 const struct wmi_vdev_start_request_arg
*arg
)
444 if (!ar
->wmi
.ops
->gen_vdev_start
)
447 skb
= ar
->wmi
.ops
->gen_vdev_start(ar
, arg
, false);
451 return ath10k_wmi_cmd_send(ar
, skb
,
452 ar
->wmi
.cmd
->vdev_start_request_cmdid
);
456 ath10k_wmi_vdev_restart(struct ath10k
*ar
,
457 const struct wmi_vdev_start_request_arg
*arg
)
461 if (!ar
->wmi
.ops
->gen_vdev_start
)
464 skb
= ar
->wmi
.ops
->gen_vdev_start(ar
, arg
, true);
468 return ath10k_wmi_cmd_send(ar
, skb
,
469 ar
->wmi
.cmd
->vdev_restart_request_cmdid
);
473 ath10k_wmi_vdev_stop(struct ath10k
*ar
, u32 vdev_id
)
477 if (!ar
->wmi
.ops
->gen_vdev_stop
)
480 skb
= ar
->wmi
.ops
->gen_vdev_stop(ar
, vdev_id
);
484 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_stop_cmdid
);
488 ath10k_wmi_vdev_up(struct ath10k
*ar
, u32 vdev_id
, u32 aid
, const u8
*bssid
)
492 if (!ar
->wmi
.ops
->gen_vdev_up
)
495 skb
= ar
->wmi
.ops
->gen_vdev_up(ar
, vdev_id
, aid
, bssid
);
499 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_up_cmdid
);
503 ath10k_wmi_vdev_down(struct ath10k
*ar
, u32 vdev_id
)
507 if (!ar
->wmi
.ops
->gen_vdev_down
)
510 skb
= ar
->wmi
.ops
->gen_vdev_down(ar
, vdev_id
);
514 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_down_cmdid
);
518 ath10k_wmi_vdev_set_param(struct ath10k
*ar
, u32 vdev_id
, u32 param_id
,
523 if (!ar
->wmi
.ops
->gen_vdev_set_param
)
526 skb
= ar
->wmi
.ops
->gen_vdev_set_param(ar
, vdev_id
, param_id
,
531 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->vdev_set_param_cmdid
);
535 ath10k_wmi_vdev_install_key(struct ath10k
*ar
,
536 const struct wmi_vdev_install_key_arg
*arg
)
540 if (!ar
->wmi
.ops
->gen_vdev_install_key
)
543 skb
= ar
->wmi
.ops
->gen_vdev_install_key(ar
, arg
);
547 return ath10k_wmi_cmd_send(ar
, skb
,
548 ar
->wmi
.cmd
->vdev_install_key_cmdid
);
552 ath10k_wmi_vdev_spectral_conf(struct ath10k
*ar
,
553 const struct wmi_vdev_spectral_conf_arg
*arg
)
558 skb
= ar
->wmi
.ops
->gen_vdev_spectral_conf(ar
, arg
);
562 cmd_id
= ar
->wmi
.cmd
->vdev_spectral_scan_configure_cmdid
;
563 return ath10k_wmi_cmd_send(ar
, skb
, cmd_id
);
567 ath10k_wmi_vdev_spectral_enable(struct ath10k
*ar
, u32 vdev_id
, u32 trigger
,
573 skb
= ar
->wmi
.ops
->gen_vdev_spectral_enable(ar
, vdev_id
, trigger
,
578 cmd_id
= ar
->wmi
.cmd
->vdev_spectral_scan_enable_cmdid
;
579 return ath10k_wmi_cmd_send(ar
, skb
, cmd_id
);
583 ath10k_wmi_vdev_sta_uapsd(struct ath10k
*ar
, u32 vdev_id
,
584 const u8 peer_addr
[ETH_ALEN
],
585 const struct wmi_sta_uapsd_auto_trig_arg
*args
,
591 if (!ar
->wmi
.ops
->gen_vdev_sta_uapsd
)
594 skb
= ar
->wmi
.ops
->gen_vdev_sta_uapsd(ar
, vdev_id
, peer_addr
, args
,
599 cmd_id
= ar
->wmi
.cmd
->sta_uapsd_auto_trig_cmdid
;
600 return ath10k_wmi_cmd_send(ar
, skb
, cmd_id
);
604 ath10k_wmi_peer_create(struct ath10k
*ar
, u32 vdev_id
,
605 const u8 peer_addr
[ETH_ALEN
])
609 if (!ar
->wmi
.ops
->gen_peer_create
)
612 skb
= ar
->wmi
.ops
->gen_peer_create(ar
, vdev_id
, peer_addr
);
616 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_create_cmdid
);
620 ath10k_wmi_peer_delete(struct ath10k
*ar
, u32 vdev_id
,
621 const u8 peer_addr
[ETH_ALEN
])
625 if (!ar
->wmi
.ops
->gen_peer_delete
)
628 skb
= ar
->wmi
.ops
->gen_peer_delete(ar
, vdev_id
, peer_addr
);
632 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_delete_cmdid
);
636 ath10k_wmi_peer_flush(struct ath10k
*ar
, u32 vdev_id
,
637 const u8 peer_addr
[ETH_ALEN
], u32 tid_bitmap
)
641 if (!ar
->wmi
.ops
->gen_peer_flush
)
644 skb
= ar
->wmi
.ops
->gen_peer_flush(ar
, vdev_id
, peer_addr
, tid_bitmap
);
648 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_flush_tids_cmdid
);
652 ath10k_wmi_peer_set_param(struct ath10k
*ar
, u32 vdev_id
, const u8
*peer_addr
,
653 enum wmi_peer_param param_id
, u32 param_value
)
657 if (!ar
->wmi
.ops
->gen_peer_set_param
)
660 skb
= ar
->wmi
.ops
->gen_peer_set_param(ar
, vdev_id
, peer_addr
, param_id
,
665 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_set_param_cmdid
);
669 ath10k_wmi_set_psmode(struct ath10k
*ar
, u32 vdev_id
,
670 enum wmi_sta_ps_mode psmode
)
674 if (!ar
->wmi
.ops
->gen_set_psmode
)
677 skb
= ar
->wmi
.ops
->gen_set_psmode(ar
, vdev_id
, psmode
);
681 return ath10k_wmi_cmd_send(ar
, skb
,
682 ar
->wmi
.cmd
->sta_powersave_mode_cmdid
);
686 ath10k_wmi_set_sta_ps_param(struct ath10k
*ar
, u32 vdev_id
,
687 enum wmi_sta_powersave_param param_id
, u32 value
)
691 if (!ar
->wmi
.ops
->gen_set_sta_ps
)
694 skb
= ar
->wmi
.ops
->gen_set_sta_ps(ar
, vdev_id
, param_id
, value
);
698 return ath10k_wmi_cmd_send(ar
, skb
,
699 ar
->wmi
.cmd
->sta_powersave_param_cmdid
);
703 ath10k_wmi_set_ap_ps_param(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
704 enum wmi_ap_ps_peer_param param_id
, u32 value
)
708 if (!ar
->wmi
.ops
->gen_set_ap_ps
)
711 skb
= ar
->wmi
.ops
->gen_set_ap_ps(ar
, vdev_id
, mac
, param_id
, value
);
715 return ath10k_wmi_cmd_send(ar
, skb
,
716 ar
->wmi
.cmd
->ap_ps_peer_param_cmdid
);
720 ath10k_wmi_scan_chan_list(struct ath10k
*ar
,
721 const struct wmi_scan_chan_list_arg
*arg
)
725 if (!ar
->wmi
.ops
->gen_scan_chan_list
)
728 skb
= ar
->wmi
.ops
->gen_scan_chan_list(ar
, arg
);
732 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->scan_chan_list_cmdid
);
736 ath10k_wmi_peer_assoc(struct ath10k
*ar
,
737 const struct wmi_peer_assoc_complete_arg
*arg
)
741 if (!ar
->wmi
.ops
->gen_peer_assoc
)
744 skb
= ar
->wmi
.ops
->gen_peer_assoc(ar
, arg
);
748 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->peer_assoc_cmdid
);
752 ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif
*arvif
)
754 struct ath10k
*ar
= arvif
->ar
;
758 if (!ar
->wmi
.ops
->gen_beacon_dma
)
761 skb
= ar
->wmi
.ops
->gen_beacon_dma(arvif
);
765 ret
= ath10k_wmi_cmd_send_nowait(ar
, skb
,
766 ar
->wmi
.cmd
->pdev_send_bcn_cmdid
);
776 ath10k_wmi_pdev_set_wmm_params(struct ath10k
*ar
,
777 const struct wmi_wmm_params_all_arg
*arg
)
781 if (!ar
->wmi
.ops
->gen_pdev_set_wmm
)
784 skb
= ar
->wmi
.ops
->gen_pdev_set_wmm(ar
, arg
);
788 return ath10k_wmi_cmd_send(ar
, skb
,
789 ar
->wmi
.cmd
->pdev_set_wmm_params_cmdid
);
793 ath10k_wmi_request_stats(struct ath10k
*ar
, enum wmi_stats_id stats_id
)
797 if (!ar
->wmi
.ops
->gen_request_stats
)
800 skb
= ar
->wmi
.ops
->gen_request_stats(ar
, stats_id
);
804 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->request_stats_cmdid
);
808 ath10k_wmi_force_fw_hang(struct ath10k
*ar
,
809 enum wmi_force_fw_hang_type type
, u32 delay_ms
)
813 if (!ar
->wmi
.ops
->gen_force_fw_hang
)
816 skb
= ar
->wmi
.ops
->gen_force_fw_hang(ar
, type
, delay_ms
);
820 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->force_fw_hang_cmdid
);
824 ath10k_wmi_dbglog_cfg(struct ath10k
*ar
, u32 module_enable
)
828 if (!ar
->wmi
.ops
->gen_dbglog_cfg
)
831 skb
= ar
->wmi
.ops
->gen_dbglog_cfg(ar
, module_enable
);
835 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->dbglog_cfg_cmdid
);
839 ath10k_wmi_pdev_pktlog_enable(struct ath10k
*ar
, u32 filter
)
843 if (!ar
->wmi
.ops
->gen_pktlog_enable
)
846 skb
= ar
->wmi
.ops
->gen_pktlog_enable(ar
, filter
);
850 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->pdev_pktlog_enable_cmdid
);
854 ath10k_wmi_pdev_pktlog_disable(struct ath10k
*ar
)
858 if (!ar
->wmi
.ops
->gen_pktlog_disable
)
861 skb
= ar
->wmi
.ops
->gen_pktlog_disable(ar
);
865 return ath10k_wmi_cmd_send(ar
, skb
,
866 ar
->wmi
.cmd
->pdev_pktlog_disable_cmdid
);
870 ath10k_wmi_pdev_set_quiet_mode(struct ath10k
*ar
, u32 period
, u32 duration
,
871 u32 next_offset
, u32 enabled
)
875 if (!ar
->wmi
.ops
->gen_pdev_set_quiet_mode
)
878 skb
= ar
->wmi
.ops
->gen_pdev_set_quiet_mode(ar
, period
, duration
,
879 next_offset
, enabled
);
883 return ath10k_wmi_cmd_send(ar
, skb
,
884 ar
->wmi
.cmd
->pdev_set_quiet_mode_cmdid
);
888 ath10k_wmi_pdev_get_temperature(struct ath10k
*ar
)
892 if (!ar
->wmi
.ops
->gen_pdev_get_temperature
)
895 skb
= ar
->wmi
.ops
->gen_pdev_get_temperature(ar
);
899 return ath10k_wmi_cmd_send(ar
, skb
,
900 ar
->wmi
.cmd
->pdev_get_temperature_cmdid
);
904 ath10k_wmi_addba_clear_resp(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
)
908 if (!ar
->wmi
.ops
->gen_addba_clear_resp
)
911 skb
= ar
->wmi
.ops
->gen_addba_clear_resp(ar
, vdev_id
, mac
);
915 return ath10k_wmi_cmd_send(ar
, skb
,
916 ar
->wmi
.cmd
->addba_clear_resp_cmdid
);
920 ath10k_wmi_addba_send(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
921 u32 tid
, u32 buf_size
)
925 if (!ar
->wmi
.ops
->gen_addba_send
)
928 skb
= ar
->wmi
.ops
->gen_addba_send(ar
, vdev_id
, mac
, tid
, buf_size
);
932 return ath10k_wmi_cmd_send(ar
, skb
,
933 ar
->wmi
.cmd
->addba_send_cmdid
);
937 ath10k_wmi_addba_set_resp(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
942 if (!ar
->wmi
.ops
->gen_addba_set_resp
)
945 skb
= ar
->wmi
.ops
->gen_addba_set_resp(ar
, vdev_id
, mac
, tid
, status
);
949 return ath10k_wmi_cmd_send(ar
, skb
,
950 ar
->wmi
.cmd
->addba_set_resp_cmdid
);
954 ath10k_wmi_delba_send(struct ath10k
*ar
, u32 vdev_id
, const u8
*mac
,
955 u32 tid
, u32 initiator
, u32 reason
)
959 if (!ar
->wmi
.ops
->gen_delba_send
)
962 skb
= ar
->wmi
.ops
->gen_delba_send(ar
, vdev_id
, mac
, tid
, initiator
,
967 return ath10k_wmi_cmd_send(ar
, skb
,
968 ar
->wmi
.cmd
->delba_send_cmdid
);
972 ath10k_wmi_bcn_tmpl(struct ath10k
*ar
, u32 vdev_id
, u32 tim_ie_offset
,
973 struct sk_buff
*bcn
, u32 prb_caps
, u32 prb_erp
,
974 void *prb_ies
, size_t prb_ies_len
)
978 if (!ar
->wmi
.ops
->gen_bcn_tmpl
)
981 skb
= ar
->wmi
.ops
->gen_bcn_tmpl(ar
, vdev_id
, tim_ie_offset
, bcn
,
982 prb_caps
, prb_erp
, prb_ies
,
987 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->bcn_tmpl_cmdid
);
991 ath10k_wmi_prb_tmpl(struct ath10k
*ar
, u32 vdev_id
, struct sk_buff
*prb
)
995 if (!ar
->wmi
.ops
->gen_prb_tmpl
)
998 skb
= ar
->wmi
.ops
->gen_prb_tmpl(ar
, vdev_id
, prb
);
1000 return PTR_ERR(skb
);
1002 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->prb_tmpl_cmdid
);
1006 ath10k_wmi_p2p_go_bcn_ie(struct ath10k
*ar
, u32 vdev_id
, const u8
*p2p_ie
)
1008 struct sk_buff
*skb
;
1010 if (!ar
->wmi
.ops
->gen_p2p_go_bcn_ie
)
1013 skb
= ar
->wmi
.ops
->gen_p2p_go_bcn_ie(ar
, vdev_id
, p2p_ie
);
1015 return PTR_ERR(skb
);
1017 return ath10k_wmi_cmd_send(ar
, skb
, ar
->wmi
.cmd
->p2p_go_set_beacon_ie
);