18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: ISC */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2005-2011 Atheros Communications Inc.
48c2ecf20Sopenharmony_ci * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
58c2ecf20Sopenharmony_ci * Copyright (c) 2018, The Linux Foundation. All rights reserved.
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef _WMI_OPS_H_
98c2ecf20Sopenharmony_ci#define _WMI_OPS_H_
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_cistruct ath10k;
128c2ecf20Sopenharmony_cistruct sk_buff;
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_cistruct wmi_ops {
158c2ecf20Sopenharmony_ci	void (*rx)(struct ath10k *ar, struct sk_buff *skb);
168c2ecf20Sopenharmony_ci	void (*map_svc)(const __le32 *in, unsigned long *out, size_t len);
178c2ecf20Sopenharmony_ci	void (*map_svc_ext)(const __le32 *in, unsigned long *out, size_t len);
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci	int (*pull_scan)(struct ath10k *ar, struct sk_buff *skb,
208c2ecf20Sopenharmony_ci			 struct wmi_scan_ev_arg *arg);
218c2ecf20Sopenharmony_ci	int (*pull_mgmt_rx)(struct ath10k *ar, struct sk_buff *skb,
228c2ecf20Sopenharmony_ci			    struct wmi_mgmt_rx_ev_arg *arg);
238c2ecf20Sopenharmony_ci	int (*pull_mgmt_tx_compl)(struct ath10k *ar, struct sk_buff *skb,
248c2ecf20Sopenharmony_ci				  struct wmi_tlv_mgmt_tx_compl_ev_arg *arg);
258c2ecf20Sopenharmony_ci	int (*pull_mgmt_tx_bundle_compl)(
268c2ecf20Sopenharmony_ci				struct ath10k *ar, struct sk_buff *skb,
278c2ecf20Sopenharmony_ci				struct wmi_tlv_mgmt_tx_bundle_compl_ev_arg *arg);
288c2ecf20Sopenharmony_ci	int (*pull_ch_info)(struct ath10k *ar, struct sk_buff *skb,
298c2ecf20Sopenharmony_ci			    struct wmi_ch_info_ev_arg *arg);
308c2ecf20Sopenharmony_ci	int (*pull_vdev_start)(struct ath10k *ar, struct sk_buff *skb,
318c2ecf20Sopenharmony_ci			       struct wmi_vdev_start_ev_arg *arg);
328c2ecf20Sopenharmony_ci	int (*pull_peer_kick)(struct ath10k *ar, struct sk_buff *skb,
338c2ecf20Sopenharmony_ci			      struct wmi_peer_kick_ev_arg *arg);
348c2ecf20Sopenharmony_ci	int (*pull_swba)(struct ath10k *ar, struct sk_buff *skb,
358c2ecf20Sopenharmony_ci			 struct wmi_swba_ev_arg *arg);
368c2ecf20Sopenharmony_ci	int (*pull_phyerr_hdr)(struct ath10k *ar, struct sk_buff *skb,
378c2ecf20Sopenharmony_ci			       struct wmi_phyerr_hdr_arg *arg);
388c2ecf20Sopenharmony_ci	int (*pull_phyerr)(struct ath10k *ar, const void *phyerr_buf,
398c2ecf20Sopenharmony_ci			   int left_len, struct wmi_phyerr_ev_arg *arg);
408c2ecf20Sopenharmony_ci	int (*pull_svc_rdy)(struct ath10k *ar, struct sk_buff *skb,
418c2ecf20Sopenharmony_ci			    struct wmi_svc_rdy_ev_arg *arg);
428c2ecf20Sopenharmony_ci	int (*pull_rdy)(struct ath10k *ar, struct sk_buff *skb,
438c2ecf20Sopenharmony_ci			struct wmi_rdy_ev_arg *arg);
448c2ecf20Sopenharmony_ci	int (*pull_fw_stats)(struct ath10k *ar, struct sk_buff *skb,
458c2ecf20Sopenharmony_ci			     struct ath10k_fw_stats *stats);
468c2ecf20Sopenharmony_ci	int (*pull_roam_ev)(struct ath10k *ar, struct sk_buff *skb,
478c2ecf20Sopenharmony_ci			    struct wmi_roam_ev_arg *arg);
488c2ecf20Sopenharmony_ci	int (*pull_wow_event)(struct ath10k *ar, struct sk_buff *skb,
498c2ecf20Sopenharmony_ci			      struct wmi_wow_ev_arg *arg);
508c2ecf20Sopenharmony_ci	int (*pull_echo_ev)(struct ath10k *ar, struct sk_buff *skb,
518c2ecf20Sopenharmony_ci			    struct wmi_echo_ev_arg *arg);
528c2ecf20Sopenharmony_ci	int (*pull_dfs_status_ev)(struct ath10k *ar, struct sk_buff *skb,
538c2ecf20Sopenharmony_ci				  struct wmi_dfs_status_ev_arg *arg);
548c2ecf20Sopenharmony_ci	int (*pull_svc_avail)(struct ath10k *ar, struct sk_buff *skb,
558c2ecf20Sopenharmony_ci			      struct wmi_svc_avail_ev_arg *arg);
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci	enum wmi_txbf_conf (*get_txbf_conf_scheme)(struct ath10k *ar);
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar, u32 suspend_opt);
608c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_resume)(struct ath10k *ar);
618c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_set_base_macaddr)(struct ath10k *ar,
628c2ecf20Sopenharmony_ci						     const u8 macaddr[ETH_ALEN]);
638c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_set_rd)(struct ath10k *ar, u16 rd, u16 rd2g,
648c2ecf20Sopenharmony_ci					   u16 rd5g, u16 ctl2g, u16 ctl5g,
658c2ecf20Sopenharmony_ci					   enum wmi_dfs_region dfs_reg);
668c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_set_param)(struct ath10k *ar, u32 id,
678c2ecf20Sopenharmony_ci					      u32 value);
688c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_init)(struct ath10k *ar);
698c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_start_scan)(struct ath10k *ar,
708c2ecf20Sopenharmony_ci					  const struct wmi_start_scan_arg *arg);
718c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_stop_scan)(struct ath10k *ar,
728c2ecf20Sopenharmony_ci					 const struct wmi_stop_scan_arg *arg);
738c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_create)(struct ath10k *ar, u32 vdev_id,
748c2ecf20Sopenharmony_ci					   enum wmi_vdev_type type,
758c2ecf20Sopenharmony_ci					   enum wmi_vdev_subtype subtype,
768c2ecf20Sopenharmony_ci					   const u8 macaddr[ETH_ALEN]);
778c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_delete)(struct ath10k *ar, u32 vdev_id);
788c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_start)(struct ath10k *ar,
798c2ecf20Sopenharmony_ci					  const struct wmi_vdev_start_request_arg *arg,
808c2ecf20Sopenharmony_ci					  bool restart);
818c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_stop)(struct ath10k *ar, u32 vdev_id);
828c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_up)(struct ath10k *ar, u32 vdev_id, u32 aid,
838c2ecf20Sopenharmony_ci				       const u8 *bssid);
848c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_down)(struct ath10k *ar, u32 vdev_id);
858c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_set_param)(struct ath10k *ar, u32 vdev_id,
868c2ecf20Sopenharmony_ci					      u32 param_id, u32 param_value);
878c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_install_key)(struct ath10k *ar,
888c2ecf20Sopenharmony_ci						const struct wmi_vdev_install_key_arg *arg);
898c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_spectral_conf)(struct ath10k *ar,
908c2ecf20Sopenharmony_ci						  const struct wmi_vdev_spectral_conf_arg *arg);
918c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_spectral_enable)(struct ath10k *ar, u32 vdev_id,
928c2ecf20Sopenharmony_ci						    u32 trigger, u32 enable);
938c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_wmm_conf)(struct ath10k *ar, u32 vdev_id,
948c2ecf20Sopenharmony_ci					     const struct wmi_wmm_params_all_arg *arg);
958c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_peer_create)(struct ath10k *ar, u32 vdev_id,
968c2ecf20Sopenharmony_ci					   const u8 peer_addr[ETH_ALEN],
978c2ecf20Sopenharmony_ci					   enum wmi_peer_type peer_type);
988c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_peer_delete)(struct ath10k *ar, u32 vdev_id,
998c2ecf20Sopenharmony_ci					   const u8 peer_addr[ETH_ALEN]);
1008c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_peer_flush)(struct ath10k *ar, u32 vdev_id,
1018c2ecf20Sopenharmony_ci					  const u8 peer_addr[ETH_ALEN],
1028c2ecf20Sopenharmony_ci					  u32 tid_bitmap);
1038c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_peer_set_param)(struct ath10k *ar, u32 vdev_id,
1048c2ecf20Sopenharmony_ci					      const u8 *peer_addr,
1058c2ecf20Sopenharmony_ci					      enum wmi_peer_param param_id,
1068c2ecf20Sopenharmony_ci					      u32 param_value);
1078c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_peer_assoc)(struct ath10k *ar,
1088c2ecf20Sopenharmony_ci					  const struct wmi_peer_assoc_complete_arg *arg);
1098c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_set_psmode)(struct ath10k *ar, u32 vdev_id,
1108c2ecf20Sopenharmony_ci					  enum wmi_sta_ps_mode psmode);
1118c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_set_sta_ps)(struct ath10k *ar, u32 vdev_id,
1128c2ecf20Sopenharmony_ci					  enum wmi_sta_powersave_param param_id,
1138c2ecf20Sopenharmony_ci					  u32 value);
1148c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_set_ap_ps)(struct ath10k *ar, u32 vdev_id,
1158c2ecf20Sopenharmony_ci					 const u8 *mac,
1168c2ecf20Sopenharmony_ci					 enum wmi_ap_ps_peer_param param_id,
1178c2ecf20Sopenharmony_ci					 u32 value);
1188c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_scan_chan_list)(struct ath10k *ar,
1198c2ecf20Sopenharmony_ci					      const struct wmi_scan_chan_list_arg *arg);
1208c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_scan_prob_req_oui)(struct ath10k *ar,
1218c2ecf20Sopenharmony_ci						 u32 prob_req_oui);
1228c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_beacon_dma)(struct ath10k *ar, u32 vdev_id,
1238c2ecf20Sopenharmony_ci					  const void *bcn, size_t bcn_len,
1248c2ecf20Sopenharmony_ci					  u32 bcn_paddr, bool dtim_zero,
1258c2ecf20Sopenharmony_ci					  bool deliver_cab);
1268c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar,
1278c2ecf20Sopenharmony_ci					    const struct wmi_wmm_params_all_arg *arg);
1288c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_request_stats)(struct ath10k *ar, u32 stats_mask);
1298c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_request_peer_stats_info)(struct ath10k *ar,
1308c2ecf20Sopenharmony_ci						       u32 vdev_id,
1318c2ecf20Sopenharmony_ci						       enum
1328c2ecf20Sopenharmony_ci						       wmi_peer_stats_info_request_type
1338c2ecf20Sopenharmony_ci						       type,
1348c2ecf20Sopenharmony_ci						       u8 *addr,
1358c2ecf20Sopenharmony_ci						       u32 reset);
1368c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar,
1378c2ecf20Sopenharmony_ci					     enum wmi_force_fw_hang_type type,
1388c2ecf20Sopenharmony_ci					     u32 delay_ms);
1398c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_mgmt_tx)(struct ath10k *ar, struct sk_buff *skb);
1408c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_mgmt_tx_send)(struct ath10k *ar,
1418c2ecf20Sopenharmony_ci					    struct sk_buff *skb,
1428c2ecf20Sopenharmony_ci					    dma_addr_t paddr);
1438c2ecf20Sopenharmony_ci	int (*cleanup_mgmt_tx_send)(struct ath10k *ar, struct sk_buff *msdu);
1448c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_dbglog_cfg)(struct ath10k *ar, u64 module_enable,
1458c2ecf20Sopenharmony_ci					  u32 log_level);
1468c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pktlog_enable)(struct ath10k *ar, u32 filter);
1478c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pktlog_disable)(struct ath10k *ar);
1488c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_set_quiet_mode)(struct ath10k *ar,
1498c2ecf20Sopenharmony_ci						   u32 period, u32 duration,
1508c2ecf20Sopenharmony_ci						   u32 next_offset,
1518c2ecf20Sopenharmony_ci						   u32 enabled);
1528c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_get_temperature)(struct ath10k *ar);
1538c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_addba_clear_resp)(struct ath10k *ar, u32 vdev_id,
1548c2ecf20Sopenharmony_ci						const u8 *mac);
1558c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_addba_send)(struct ath10k *ar, u32 vdev_id,
1568c2ecf20Sopenharmony_ci					  const u8 *mac, u32 tid, u32 buf_size);
1578c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_addba_set_resp)(struct ath10k *ar, u32 vdev_id,
1588c2ecf20Sopenharmony_ci					      const u8 *mac, u32 tid,
1598c2ecf20Sopenharmony_ci					      u32 status);
1608c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_delba_send)(struct ath10k *ar, u32 vdev_id,
1618c2ecf20Sopenharmony_ci					  const u8 *mac, u32 tid, u32 initiator,
1628c2ecf20Sopenharmony_ci					  u32 reason);
1638c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_bcn_tmpl)(struct ath10k *ar, u32 vdev_id,
1648c2ecf20Sopenharmony_ci					u32 tim_ie_offset, struct sk_buff *bcn,
1658c2ecf20Sopenharmony_ci					u32 prb_caps, u32 prb_erp,
1668c2ecf20Sopenharmony_ci					void *prb_ies, size_t prb_ies_len);
1678c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_prb_tmpl)(struct ath10k *ar, u32 vdev_id,
1688c2ecf20Sopenharmony_ci					struct sk_buff *bcn);
1698c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_p2p_go_bcn_ie)(struct ath10k *ar, u32 vdev_id,
1708c2ecf20Sopenharmony_ci					     const u8 *p2p_ie);
1718c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_vdev_sta_uapsd)(struct ath10k *ar, u32 vdev_id,
1728c2ecf20Sopenharmony_ci					      const u8 peer_addr[ETH_ALEN],
1738c2ecf20Sopenharmony_ci					      const struct wmi_sta_uapsd_auto_trig_arg *args,
1748c2ecf20Sopenharmony_ci					      u32 num_ac);
1758c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_sta_keepalive)(struct ath10k *ar,
1768c2ecf20Sopenharmony_ci					     const struct wmi_sta_keepalive_arg *arg);
1778c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_wow_enable)(struct ath10k *ar);
1788c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_wow_add_wakeup_event)(struct ath10k *ar, u32 vdev_id,
1798c2ecf20Sopenharmony_ci						    enum wmi_wow_wakeup_event event,
1808c2ecf20Sopenharmony_ci						    u32 enable);
1818c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_wow_host_wakeup_ind)(struct ath10k *ar);
1828c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_wow_add_pattern)(struct ath10k *ar, u32 vdev_id,
1838c2ecf20Sopenharmony_ci					       u32 pattern_id,
1848c2ecf20Sopenharmony_ci					       const u8 *pattern,
1858c2ecf20Sopenharmony_ci					       const u8 *mask,
1868c2ecf20Sopenharmony_ci					       int pattern_len,
1878c2ecf20Sopenharmony_ci					       int pattern_offset);
1888c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_wow_del_pattern)(struct ath10k *ar, u32 vdev_id,
1898c2ecf20Sopenharmony_ci					       u32 pattern_id);
1908c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_update_fw_tdls_state)(struct ath10k *ar,
1918c2ecf20Sopenharmony_ci						    u32 vdev_id,
1928c2ecf20Sopenharmony_ci						    enum wmi_tdls_state state);
1938c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_tdls_peer_update)(struct ath10k *ar,
1948c2ecf20Sopenharmony_ci						const struct wmi_tdls_peer_update_cmd_arg *arg,
1958c2ecf20Sopenharmony_ci						const struct wmi_tdls_peer_capab_arg *cap,
1968c2ecf20Sopenharmony_ci						const struct wmi_channel_arg *chan);
1978c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_radar_found)
1988c2ecf20Sopenharmony_ci			(struct ath10k *ar,
1998c2ecf20Sopenharmony_ci			 const struct ath10k_radar_found_info *arg);
2008c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_adaptive_qcs)(struct ath10k *ar, bool enable);
2018c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_get_tpc_config)(struct ath10k *ar,
2028c2ecf20Sopenharmony_ci						   u32 param);
2038c2ecf20Sopenharmony_ci	void (*fw_stats_fill)(struct ath10k *ar,
2048c2ecf20Sopenharmony_ci			      struct ath10k_fw_stats *fw_stats,
2058c2ecf20Sopenharmony_ci			      char *buf);
2068c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_enable_adaptive_cca)(struct ath10k *ar,
2078c2ecf20Sopenharmony_ci							u8 enable,
2088c2ecf20Sopenharmony_ci							u32 detect_level,
2098c2ecf20Sopenharmony_ci							u32 detect_margin);
2108c2ecf20Sopenharmony_ci	struct sk_buff *(*ext_resource_config)(struct ath10k *ar,
2118c2ecf20Sopenharmony_ci					       enum wmi_host_platform_type type,
2128c2ecf20Sopenharmony_ci					       u32 fw_feature_bitmap);
2138c2ecf20Sopenharmony_ci	int (*get_vdev_subtype)(struct ath10k *ar,
2148c2ecf20Sopenharmony_ci				enum wmi_vdev_subtype subtype);
2158c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_wow_config_pno)(struct ath10k *ar,
2168c2ecf20Sopenharmony_ci					      u32 vdev_id,
2178c2ecf20Sopenharmony_ci					      struct wmi_pno_scan_req *pno_scan);
2188c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_bss_chan_info_req)
2198c2ecf20Sopenharmony_ci					(struct ath10k *ar,
2208c2ecf20Sopenharmony_ci					 enum wmi_bss_survey_req_type type);
2218c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
2228c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar,
2238c2ecf20Sopenharmony_ci							u32 param);
2248c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_bb_timing)
2258c2ecf20Sopenharmony_ci			(struct ath10k *ar,
2268c2ecf20Sopenharmony_ci			 const struct wmi_bb_timing_cfg_arg *arg);
2278c2ecf20Sopenharmony_ci	struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar,
2288c2ecf20Sopenharmony_ci						    const struct wmi_per_peer_per_tid_cfg_arg *arg);
2298c2ecf20Sopenharmony_ci
2308c2ecf20Sopenharmony_ci};
2318c2ecf20Sopenharmony_ci
2328c2ecf20Sopenharmony_ciint ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
2338c2ecf20Sopenharmony_ci
2348c2ecf20Sopenharmony_cistatic inline int
2358c2ecf20Sopenharmony_ciath10k_wmi_rx(struct ath10k *ar, struct sk_buff *skb)
2368c2ecf20Sopenharmony_ci{
2378c2ecf20Sopenharmony_ci	if (WARN_ON_ONCE(!ar->wmi.ops->rx))
2388c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci	ar->wmi.ops->rx(ar, skb);
2418c2ecf20Sopenharmony_ci	return 0;
2428c2ecf20Sopenharmony_ci}
2438c2ecf20Sopenharmony_ci
2448c2ecf20Sopenharmony_cistatic inline int
2458c2ecf20Sopenharmony_ciath10k_wmi_map_svc(struct ath10k *ar, const __le32 *in, unsigned long *out,
2468c2ecf20Sopenharmony_ci		   size_t len)
2478c2ecf20Sopenharmony_ci{
2488c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->map_svc)
2498c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci	ar->wmi.ops->map_svc(in, out, len);
2528c2ecf20Sopenharmony_ci	return 0;
2538c2ecf20Sopenharmony_ci}
2548c2ecf20Sopenharmony_ci
2558c2ecf20Sopenharmony_cistatic inline int
2568c2ecf20Sopenharmony_ciath10k_wmi_map_svc_ext(struct ath10k *ar, const __le32 *in, unsigned long *out,
2578c2ecf20Sopenharmony_ci		       size_t len)
2588c2ecf20Sopenharmony_ci{
2598c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->map_svc_ext)
2608c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci	ar->wmi.ops->map_svc_ext(in, out, len);
2638c2ecf20Sopenharmony_ci	return 0;
2648c2ecf20Sopenharmony_ci}
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_cistatic inline int
2678c2ecf20Sopenharmony_ciath10k_wmi_pull_scan(struct ath10k *ar, struct sk_buff *skb,
2688c2ecf20Sopenharmony_ci		     struct wmi_scan_ev_arg *arg)
2698c2ecf20Sopenharmony_ci{
2708c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_scan)
2718c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_scan(ar, skb, arg);
2748c2ecf20Sopenharmony_ci}
2758c2ecf20Sopenharmony_ci
2768c2ecf20Sopenharmony_cistatic inline int
2778c2ecf20Sopenharmony_ciath10k_wmi_pull_mgmt_tx_compl(struct ath10k *ar, struct sk_buff *skb,
2788c2ecf20Sopenharmony_ci			      struct wmi_tlv_mgmt_tx_compl_ev_arg *arg)
2798c2ecf20Sopenharmony_ci{
2808c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_mgmt_tx_compl)
2818c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_mgmt_tx_compl(ar, skb, arg);
2848c2ecf20Sopenharmony_ci}
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_cistatic inline int
2878c2ecf20Sopenharmony_ciath10k_wmi_pull_mgmt_tx_bundle_compl(struct ath10k *ar, struct sk_buff *skb,
2888c2ecf20Sopenharmony_ci				     struct wmi_tlv_mgmt_tx_bundle_compl_ev_arg *arg)
2898c2ecf20Sopenharmony_ci{
2908c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_mgmt_tx_bundle_compl)
2918c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_mgmt_tx_bundle_compl(ar, skb, arg);
2948c2ecf20Sopenharmony_ci}
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_cistatic inline int
2978c2ecf20Sopenharmony_ciath10k_wmi_pull_mgmt_rx(struct ath10k *ar, struct sk_buff *skb,
2988c2ecf20Sopenharmony_ci			struct wmi_mgmt_rx_ev_arg *arg)
2998c2ecf20Sopenharmony_ci{
3008c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_mgmt_rx)
3018c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3028c2ecf20Sopenharmony_ci
3038c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_mgmt_rx(ar, skb, arg);
3048c2ecf20Sopenharmony_ci}
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_cistatic inline int
3078c2ecf20Sopenharmony_ciath10k_wmi_pull_ch_info(struct ath10k *ar, struct sk_buff *skb,
3088c2ecf20Sopenharmony_ci			struct wmi_ch_info_ev_arg *arg)
3098c2ecf20Sopenharmony_ci{
3108c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_ch_info)
3118c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_ch_info(ar, skb, arg);
3148c2ecf20Sopenharmony_ci}
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_cistatic inline int
3178c2ecf20Sopenharmony_ciath10k_wmi_pull_vdev_start(struct ath10k *ar, struct sk_buff *skb,
3188c2ecf20Sopenharmony_ci			   struct wmi_vdev_start_ev_arg *arg)
3198c2ecf20Sopenharmony_ci{
3208c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_vdev_start)
3218c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_vdev_start(ar, skb, arg);
3248c2ecf20Sopenharmony_ci}
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_cistatic inline int
3278c2ecf20Sopenharmony_ciath10k_wmi_pull_peer_kick(struct ath10k *ar, struct sk_buff *skb,
3288c2ecf20Sopenharmony_ci			  struct wmi_peer_kick_ev_arg *arg)
3298c2ecf20Sopenharmony_ci{
3308c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_peer_kick)
3318c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_peer_kick(ar, skb, arg);
3348c2ecf20Sopenharmony_ci}
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_cistatic inline int
3378c2ecf20Sopenharmony_ciath10k_wmi_pull_swba(struct ath10k *ar, struct sk_buff *skb,
3388c2ecf20Sopenharmony_ci		     struct wmi_swba_ev_arg *arg)
3398c2ecf20Sopenharmony_ci{
3408c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_swba)
3418c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_swba(ar, skb, arg);
3448c2ecf20Sopenharmony_ci}
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_cistatic inline int
3478c2ecf20Sopenharmony_ciath10k_wmi_pull_phyerr_hdr(struct ath10k *ar, struct sk_buff *skb,
3488c2ecf20Sopenharmony_ci			   struct wmi_phyerr_hdr_arg *arg)
3498c2ecf20Sopenharmony_ci{
3508c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_phyerr_hdr)
3518c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3528c2ecf20Sopenharmony_ci
3538c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_phyerr_hdr(ar, skb, arg);
3548c2ecf20Sopenharmony_ci}
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_cistatic inline int
3578c2ecf20Sopenharmony_ciath10k_wmi_pull_phyerr(struct ath10k *ar, const void *phyerr_buf,
3588c2ecf20Sopenharmony_ci		       int left_len, struct wmi_phyerr_ev_arg *arg)
3598c2ecf20Sopenharmony_ci{
3608c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_phyerr)
3618c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_phyerr(ar, phyerr_buf, left_len, arg);
3648c2ecf20Sopenharmony_ci}
3658c2ecf20Sopenharmony_ci
3668c2ecf20Sopenharmony_cistatic inline int
3678c2ecf20Sopenharmony_ciath10k_wmi_pull_svc_rdy(struct ath10k *ar, struct sk_buff *skb,
3688c2ecf20Sopenharmony_ci			struct wmi_svc_rdy_ev_arg *arg)
3698c2ecf20Sopenharmony_ci{
3708c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_svc_rdy)
3718c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3728c2ecf20Sopenharmony_ci
3738c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_svc_rdy(ar, skb, arg);
3748c2ecf20Sopenharmony_ci}
3758c2ecf20Sopenharmony_ci
3768c2ecf20Sopenharmony_cistatic inline int
3778c2ecf20Sopenharmony_ciath10k_wmi_pull_rdy(struct ath10k *ar, struct sk_buff *skb,
3788c2ecf20Sopenharmony_ci		    struct wmi_rdy_ev_arg *arg)
3798c2ecf20Sopenharmony_ci{
3808c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_rdy)
3818c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3828c2ecf20Sopenharmony_ci
3838c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_rdy(ar, skb, arg);
3848c2ecf20Sopenharmony_ci}
3858c2ecf20Sopenharmony_ci
3868c2ecf20Sopenharmony_cistatic inline int
3878c2ecf20Sopenharmony_ciath10k_wmi_pull_svc_avail(struct ath10k *ar, struct sk_buff *skb,
3888c2ecf20Sopenharmony_ci			  struct wmi_svc_avail_ev_arg *arg)
3898c2ecf20Sopenharmony_ci{
3908c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_svc_avail)
3918c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
3928c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_svc_avail(ar, skb, arg);
3938c2ecf20Sopenharmony_ci}
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_cistatic inline int
3968c2ecf20Sopenharmony_ciath10k_wmi_pull_fw_stats(struct ath10k *ar, struct sk_buff *skb,
3978c2ecf20Sopenharmony_ci			 struct ath10k_fw_stats *stats)
3988c2ecf20Sopenharmony_ci{
3998c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_fw_stats)
4008c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_fw_stats(ar, skb, stats);
4038c2ecf20Sopenharmony_ci}
4048c2ecf20Sopenharmony_ci
4058c2ecf20Sopenharmony_cistatic inline int
4068c2ecf20Sopenharmony_ciath10k_wmi_pull_roam_ev(struct ath10k *ar, struct sk_buff *skb,
4078c2ecf20Sopenharmony_ci			struct wmi_roam_ev_arg *arg)
4088c2ecf20Sopenharmony_ci{
4098c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_roam_ev)
4108c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
4118c2ecf20Sopenharmony_ci
4128c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_roam_ev(ar, skb, arg);
4138c2ecf20Sopenharmony_ci}
4148c2ecf20Sopenharmony_ci
4158c2ecf20Sopenharmony_cistatic inline int
4168c2ecf20Sopenharmony_ciath10k_wmi_pull_wow_event(struct ath10k *ar, struct sk_buff *skb,
4178c2ecf20Sopenharmony_ci			  struct wmi_wow_ev_arg *arg)
4188c2ecf20Sopenharmony_ci{
4198c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_wow_event)
4208c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
4218c2ecf20Sopenharmony_ci
4228c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_wow_event(ar, skb, arg);
4238c2ecf20Sopenharmony_ci}
4248c2ecf20Sopenharmony_ci
4258c2ecf20Sopenharmony_cistatic inline int
4268c2ecf20Sopenharmony_ciath10k_wmi_pull_echo_ev(struct ath10k *ar, struct sk_buff *skb,
4278c2ecf20Sopenharmony_ci			struct wmi_echo_ev_arg *arg)
4288c2ecf20Sopenharmony_ci{
4298c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_echo_ev)
4308c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
4318c2ecf20Sopenharmony_ci
4328c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_echo_ev(ar, skb, arg);
4338c2ecf20Sopenharmony_ci}
4348c2ecf20Sopenharmony_ci
4358c2ecf20Sopenharmony_cistatic inline int
4368c2ecf20Sopenharmony_ciath10k_wmi_pull_dfs_status(struct ath10k *ar, struct sk_buff *skb,
4378c2ecf20Sopenharmony_ci			   struct wmi_dfs_status_ev_arg *arg)
4388c2ecf20Sopenharmony_ci{
4398c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->pull_dfs_status_ev)
4408c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
4418c2ecf20Sopenharmony_ci
4428c2ecf20Sopenharmony_ci	return ar->wmi.ops->pull_dfs_status_ev(ar, skb, arg);
4438c2ecf20Sopenharmony_ci}
4448c2ecf20Sopenharmony_ci
4458c2ecf20Sopenharmony_cistatic inline enum wmi_txbf_conf
4468c2ecf20Sopenharmony_ciath10k_wmi_get_txbf_conf_scheme(struct ath10k *ar)
4478c2ecf20Sopenharmony_ci{
4488c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->get_txbf_conf_scheme)
4498c2ecf20Sopenharmony_ci		return WMI_TXBF_CONF_UNSUPPORTED;
4508c2ecf20Sopenharmony_ci
4518c2ecf20Sopenharmony_ci	return ar->wmi.ops->get_txbf_conf_scheme(ar);
4528c2ecf20Sopenharmony_ci}
4538c2ecf20Sopenharmony_ci
4548c2ecf20Sopenharmony_cistatic inline int
4558c2ecf20Sopenharmony_ciath10k_wmi_cleanup_mgmt_tx_send(struct ath10k *ar, struct sk_buff *msdu)
4568c2ecf20Sopenharmony_ci{
4578c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->cleanup_mgmt_tx_send)
4588c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ci	return ar->wmi.ops->cleanup_mgmt_tx_send(ar, msdu);
4618c2ecf20Sopenharmony_ci}
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_cistatic inline int
4648c2ecf20Sopenharmony_ciath10k_wmi_mgmt_tx_send(struct ath10k *ar, struct sk_buff *msdu,
4658c2ecf20Sopenharmony_ci			dma_addr_t paddr)
4668c2ecf20Sopenharmony_ci{
4678c2ecf20Sopenharmony_ci	struct sk_buff *skb;
4688c2ecf20Sopenharmony_ci	int ret;
4698c2ecf20Sopenharmony_ci
4708c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_mgmt_tx_send)
4718c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
4728c2ecf20Sopenharmony_ci
4738c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_mgmt_tx_send(ar, msdu, paddr);
4748c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
4758c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
4768c2ecf20Sopenharmony_ci
4778c2ecf20Sopenharmony_ci	ret = ath10k_wmi_cmd_send(ar, skb,
4788c2ecf20Sopenharmony_ci				  ar->wmi.cmd->mgmt_tx_send_cmdid);
4798c2ecf20Sopenharmony_ci	if (ret)
4808c2ecf20Sopenharmony_ci		return ret;
4818c2ecf20Sopenharmony_ci
4828c2ecf20Sopenharmony_ci	return 0;
4838c2ecf20Sopenharmony_ci}
4848c2ecf20Sopenharmony_ci
4858c2ecf20Sopenharmony_cistatic inline int
4868c2ecf20Sopenharmony_ciath10k_wmi_mgmt_tx(struct ath10k *ar, struct sk_buff *msdu)
4878c2ecf20Sopenharmony_ci{
4888c2ecf20Sopenharmony_ci	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(msdu);
4898c2ecf20Sopenharmony_ci	struct sk_buff *skb;
4908c2ecf20Sopenharmony_ci	int ret;
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_mgmt_tx)
4938c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_mgmt_tx(ar, msdu);
4968c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
4978c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
4988c2ecf20Sopenharmony_ci
4998c2ecf20Sopenharmony_ci	ret = ath10k_wmi_cmd_send(ar, skb,
5008c2ecf20Sopenharmony_ci				  ar->wmi.cmd->mgmt_tx_cmdid);
5018c2ecf20Sopenharmony_ci	if (ret)
5028c2ecf20Sopenharmony_ci		return ret;
5038c2ecf20Sopenharmony_ci
5048c2ecf20Sopenharmony_ci	/* FIXME There's no ACK event for Management Tx. This probably
5058c2ecf20Sopenharmony_ci	 * shouldn't be called here either.
5068c2ecf20Sopenharmony_ci	 */
5078c2ecf20Sopenharmony_ci	info->flags |= IEEE80211_TX_STAT_ACK;
5088c2ecf20Sopenharmony_ci	ieee80211_tx_status_irqsafe(ar->hw, msdu);
5098c2ecf20Sopenharmony_ci
5108c2ecf20Sopenharmony_ci	return 0;
5118c2ecf20Sopenharmony_ci}
5128c2ecf20Sopenharmony_ci
5138c2ecf20Sopenharmony_cistatic inline int
5148c2ecf20Sopenharmony_ciath10k_wmi_pdev_set_regdomain(struct ath10k *ar, u16 rd, u16 rd2g, u16 rd5g,
5158c2ecf20Sopenharmony_ci			      u16 ctl2g, u16 ctl5g,
5168c2ecf20Sopenharmony_ci			      enum wmi_dfs_region dfs_reg)
5178c2ecf20Sopenharmony_ci{
5188c2ecf20Sopenharmony_ci	struct sk_buff *skb;
5198c2ecf20Sopenharmony_ci
5208c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_set_rd)
5218c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
5228c2ecf20Sopenharmony_ci
5238c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_set_rd(ar, rd, rd2g, rd5g, ctl2g, ctl5g,
5248c2ecf20Sopenharmony_ci					   dfs_reg);
5258c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
5268c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
5278c2ecf20Sopenharmony_ci
5288c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
5298c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_set_regdomain_cmdid);
5308c2ecf20Sopenharmony_ci}
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_cistatic inline int
5338c2ecf20Sopenharmony_ciath10k_wmi_pdev_set_base_macaddr(struct ath10k *ar, const u8 macaddr[ETH_ALEN])
5348c2ecf20Sopenharmony_ci{
5358c2ecf20Sopenharmony_ci	struct sk_buff *skb;
5368c2ecf20Sopenharmony_ci
5378c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_set_base_macaddr)
5388c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
5398c2ecf20Sopenharmony_ci
5408c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_set_base_macaddr(ar, macaddr);
5418c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
5428c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
5438c2ecf20Sopenharmony_ci
5448c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
5458c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_set_base_macaddr_cmdid);
5468c2ecf20Sopenharmony_ci}
5478c2ecf20Sopenharmony_ci
5488c2ecf20Sopenharmony_cistatic inline int
5498c2ecf20Sopenharmony_ciath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt)
5508c2ecf20Sopenharmony_ci{
5518c2ecf20Sopenharmony_ci	struct sk_buff *skb;
5528c2ecf20Sopenharmony_ci
5538c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_suspend)
5548c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
5558c2ecf20Sopenharmony_ci
5568c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_suspend(ar, suspend_opt);
5578c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
5588c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_suspend_cmdid);
5618c2ecf20Sopenharmony_ci}
5628c2ecf20Sopenharmony_ci
5638c2ecf20Sopenharmony_cistatic inline int
5648c2ecf20Sopenharmony_ciath10k_wmi_pdev_resume_target(struct ath10k *ar)
5658c2ecf20Sopenharmony_ci{
5668c2ecf20Sopenharmony_ci	struct sk_buff *skb;
5678c2ecf20Sopenharmony_ci
5688c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_resume)
5698c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
5708c2ecf20Sopenharmony_ci
5718c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_resume(ar);
5728c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
5738c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
5748c2ecf20Sopenharmony_ci
5758c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_resume_cmdid);
5768c2ecf20Sopenharmony_ci}
5778c2ecf20Sopenharmony_ci
5788c2ecf20Sopenharmony_cistatic inline int
5798c2ecf20Sopenharmony_ciath10k_wmi_pdev_set_param(struct ath10k *ar, u32 id, u32 value)
5808c2ecf20Sopenharmony_ci{
5818c2ecf20Sopenharmony_ci	struct sk_buff *skb;
5828c2ecf20Sopenharmony_ci
5838c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_set_param)
5848c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
5858c2ecf20Sopenharmony_ci
5868c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_set_param(ar, id, value);
5878c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
5888c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
5898c2ecf20Sopenharmony_ci
5908c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_set_param_cmdid);
5918c2ecf20Sopenharmony_ci}
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_cistatic inline int
5948c2ecf20Sopenharmony_ciath10k_wmi_cmd_init(struct ath10k *ar)
5958c2ecf20Sopenharmony_ci{
5968c2ecf20Sopenharmony_ci	struct sk_buff *skb;
5978c2ecf20Sopenharmony_ci
5988c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_init)
5998c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
6008c2ecf20Sopenharmony_ci
6018c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_init(ar);
6028c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
6038c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
6048c2ecf20Sopenharmony_ci
6058c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->init_cmdid);
6068c2ecf20Sopenharmony_ci}
6078c2ecf20Sopenharmony_ci
6088c2ecf20Sopenharmony_cistatic inline int
6098c2ecf20Sopenharmony_ciath10k_wmi_start_scan(struct ath10k *ar,
6108c2ecf20Sopenharmony_ci		      const struct wmi_start_scan_arg *arg)
6118c2ecf20Sopenharmony_ci{
6128c2ecf20Sopenharmony_ci	struct sk_buff *skb;
6138c2ecf20Sopenharmony_ci
6148c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_start_scan)
6158c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
6168c2ecf20Sopenharmony_ci
6178c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_start_scan(ar, arg);
6188c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
6198c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
6208c2ecf20Sopenharmony_ci
6218c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->start_scan_cmdid);
6228c2ecf20Sopenharmony_ci}
6238c2ecf20Sopenharmony_ci
6248c2ecf20Sopenharmony_cistatic inline int
6258c2ecf20Sopenharmony_ciath10k_wmi_stop_scan(struct ath10k *ar, const struct wmi_stop_scan_arg *arg)
6268c2ecf20Sopenharmony_ci{
6278c2ecf20Sopenharmony_ci	struct sk_buff *skb;
6288c2ecf20Sopenharmony_ci
6298c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_stop_scan)
6308c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
6318c2ecf20Sopenharmony_ci
6328c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_stop_scan(ar, arg);
6338c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
6348c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
6358c2ecf20Sopenharmony_ci
6368c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->stop_scan_cmdid);
6378c2ecf20Sopenharmony_ci}
6388c2ecf20Sopenharmony_ci
6398c2ecf20Sopenharmony_cistatic inline int
6408c2ecf20Sopenharmony_ciath10k_wmi_vdev_create(struct ath10k *ar, u32 vdev_id,
6418c2ecf20Sopenharmony_ci		       enum wmi_vdev_type type,
6428c2ecf20Sopenharmony_ci		       enum wmi_vdev_subtype subtype,
6438c2ecf20Sopenharmony_ci		       const u8 macaddr[ETH_ALEN])
6448c2ecf20Sopenharmony_ci{
6458c2ecf20Sopenharmony_ci	struct sk_buff *skb;
6468c2ecf20Sopenharmony_ci
6478c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_create)
6488c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
6498c2ecf20Sopenharmony_ci
6508c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_create(ar, vdev_id, type, subtype, macaddr);
6518c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
6528c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
6538c2ecf20Sopenharmony_ci
6548c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_create_cmdid);
6558c2ecf20Sopenharmony_ci}
6568c2ecf20Sopenharmony_ci
6578c2ecf20Sopenharmony_cistatic inline int
6588c2ecf20Sopenharmony_ciath10k_wmi_vdev_delete(struct ath10k *ar, u32 vdev_id)
6598c2ecf20Sopenharmony_ci{
6608c2ecf20Sopenharmony_ci	struct sk_buff *skb;
6618c2ecf20Sopenharmony_ci
6628c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_delete)
6638c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
6648c2ecf20Sopenharmony_ci
6658c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_delete(ar, vdev_id);
6668c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
6678c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
6688c2ecf20Sopenharmony_ci
6698c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_delete_cmdid);
6708c2ecf20Sopenharmony_ci}
6718c2ecf20Sopenharmony_ci
6728c2ecf20Sopenharmony_cistatic inline int
6738c2ecf20Sopenharmony_ciath10k_wmi_vdev_start(struct ath10k *ar,
6748c2ecf20Sopenharmony_ci		      const struct wmi_vdev_start_request_arg *arg)
6758c2ecf20Sopenharmony_ci{
6768c2ecf20Sopenharmony_ci	struct sk_buff *skb;
6778c2ecf20Sopenharmony_ci
6788c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_start)
6798c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
6808c2ecf20Sopenharmony_ci
6818c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_start(ar, arg, false);
6828c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
6838c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
6848c2ecf20Sopenharmony_ci
6858c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
6868c2ecf20Sopenharmony_ci				   ar->wmi.cmd->vdev_start_request_cmdid);
6878c2ecf20Sopenharmony_ci}
6888c2ecf20Sopenharmony_ci
6898c2ecf20Sopenharmony_cistatic inline int
6908c2ecf20Sopenharmony_ciath10k_wmi_vdev_restart(struct ath10k *ar,
6918c2ecf20Sopenharmony_ci			const struct wmi_vdev_start_request_arg *arg)
6928c2ecf20Sopenharmony_ci{
6938c2ecf20Sopenharmony_ci	struct sk_buff *skb;
6948c2ecf20Sopenharmony_ci
6958c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_start)
6968c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
6978c2ecf20Sopenharmony_ci
6988c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_start(ar, arg, true);
6998c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
7008c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
7018c2ecf20Sopenharmony_ci
7028c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
7038c2ecf20Sopenharmony_ci				   ar->wmi.cmd->vdev_restart_request_cmdid);
7048c2ecf20Sopenharmony_ci}
7058c2ecf20Sopenharmony_ci
7068c2ecf20Sopenharmony_cistatic inline int
7078c2ecf20Sopenharmony_ciath10k_wmi_vdev_stop(struct ath10k *ar, u32 vdev_id)
7088c2ecf20Sopenharmony_ci{
7098c2ecf20Sopenharmony_ci	struct sk_buff *skb;
7108c2ecf20Sopenharmony_ci
7118c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_stop)
7128c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
7138c2ecf20Sopenharmony_ci
7148c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_stop(ar, vdev_id);
7158c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
7168c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
7178c2ecf20Sopenharmony_ci
7188c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_stop_cmdid);
7198c2ecf20Sopenharmony_ci}
7208c2ecf20Sopenharmony_ci
7218c2ecf20Sopenharmony_cistatic inline int
7228c2ecf20Sopenharmony_ciath10k_wmi_vdev_up(struct ath10k *ar, u32 vdev_id, u32 aid, const u8 *bssid)
7238c2ecf20Sopenharmony_ci{
7248c2ecf20Sopenharmony_ci	struct sk_buff *skb;
7258c2ecf20Sopenharmony_ci
7268c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_up)
7278c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
7288c2ecf20Sopenharmony_ci
7298c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_up(ar, vdev_id, aid, bssid);
7308c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
7318c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
7328c2ecf20Sopenharmony_ci
7338c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_up_cmdid);
7348c2ecf20Sopenharmony_ci}
7358c2ecf20Sopenharmony_ci
7368c2ecf20Sopenharmony_cistatic inline int
7378c2ecf20Sopenharmony_ciath10k_wmi_vdev_down(struct ath10k *ar, u32 vdev_id)
7388c2ecf20Sopenharmony_ci{
7398c2ecf20Sopenharmony_ci	struct sk_buff *skb;
7408c2ecf20Sopenharmony_ci
7418c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_down)
7428c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
7438c2ecf20Sopenharmony_ci
7448c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_down(ar, vdev_id);
7458c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
7468c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
7478c2ecf20Sopenharmony_ci
7488c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_down_cmdid);
7498c2ecf20Sopenharmony_ci}
7508c2ecf20Sopenharmony_ci
7518c2ecf20Sopenharmony_cistatic inline int
7528c2ecf20Sopenharmony_ciath10k_wmi_vdev_set_param(struct ath10k *ar, u32 vdev_id, u32 param_id,
7538c2ecf20Sopenharmony_ci			  u32 param_value)
7548c2ecf20Sopenharmony_ci{
7558c2ecf20Sopenharmony_ci	struct sk_buff *skb;
7568c2ecf20Sopenharmony_ci
7578c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_set_param)
7588c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
7598c2ecf20Sopenharmony_ci
7608c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_set_param(ar, vdev_id, param_id,
7618c2ecf20Sopenharmony_ci					      param_value);
7628c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
7638c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
7648c2ecf20Sopenharmony_ci
7658c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->vdev_set_param_cmdid);
7668c2ecf20Sopenharmony_ci}
7678c2ecf20Sopenharmony_ci
7688c2ecf20Sopenharmony_cistatic inline int
7698c2ecf20Sopenharmony_ciath10k_wmi_vdev_install_key(struct ath10k *ar,
7708c2ecf20Sopenharmony_ci			    const struct wmi_vdev_install_key_arg *arg)
7718c2ecf20Sopenharmony_ci{
7728c2ecf20Sopenharmony_ci	struct sk_buff *skb;
7738c2ecf20Sopenharmony_ci
7748c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_install_key)
7758c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
7768c2ecf20Sopenharmony_ci
7778c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_install_key(ar, arg);
7788c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
7798c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
7808c2ecf20Sopenharmony_ci
7818c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
7828c2ecf20Sopenharmony_ci				   ar->wmi.cmd->vdev_install_key_cmdid);
7838c2ecf20Sopenharmony_ci}
7848c2ecf20Sopenharmony_ci
7858c2ecf20Sopenharmony_cistatic inline int
7868c2ecf20Sopenharmony_ciath10k_wmi_vdev_spectral_conf(struct ath10k *ar,
7878c2ecf20Sopenharmony_ci			      const struct wmi_vdev_spectral_conf_arg *arg)
7888c2ecf20Sopenharmony_ci{
7898c2ecf20Sopenharmony_ci	struct sk_buff *skb;
7908c2ecf20Sopenharmony_ci	u32 cmd_id;
7918c2ecf20Sopenharmony_ci
7928c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_spectral_conf)
7938c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
7948c2ecf20Sopenharmony_ci
7958c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_spectral_conf(ar, arg);
7968c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
7978c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
7988c2ecf20Sopenharmony_ci
7998c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->vdev_spectral_scan_configure_cmdid;
8008c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
8018c2ecf20Sopenharmony_ci}
8028c2ecf20Sopenharmony_ci
8038c2ecf20Sopenharmony_cistatic inline int
8048c2ecf20Sopenharmony_ciath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger,
8058c2ecf20Sopenharmony_ci				u32 enable)
8068c2ecf20Sopenharmony_ci{
8078c2ecf20Sopenharmony_ci	struct sk_buff *skb;
8088c2ecf20Sopenharmony_ci	u32 cmd_id;
8098c2ecf20Sopenharmony_ci
8108c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_spectral_enable)
8118c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
8128c2ecf20Sopenharmony_ci
8138c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_spectral_enable(ar, vdev_id, trigger,
8148c2ecf20Sopenharmony_ci						    enable);
8158c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
8168c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
8178c2ecf20Sopenharmony_ci
8188c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->vdev_spectral_scan_enable_cmdid;
8198c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
8208c2ecf20Sopenharmony_ci}
8218c2ecf20Sopenharmony_ci
8228c2ecf20Sopenharmony_cistatic inline int
8238c2ecf20Sopenharmony_ciath10k_wmi_vdev_sta_uapsd(struct ath10k *ar, u32 vdev_id,
8248c2ecf20Sopenharmony_ci			  const u8 peer_addr[ETH_ALEN],
8258c2ecf20Sopenharmony_ci			  const struct wmi_sta_uapsd_auto_trig_arg *args,
8268c2ecf20Sopenharmony_ci			  u32 num_ac)
8278c2ecf20Sopenharmony_ci{
8288c2ecf20Sopenharmony_ci	struct sk_buff *skb;
8298c2ecf20Sopenharmony_ci	u32 cmd_id;
8308c2ecf20Sopenharmony_ci
8318c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_vdev_sta_uapsd)
8328c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
8338c2ecf20Sopenharmony_ci
8348c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_sta_uapsd(ar, vdev_id, peer_addr, args,
8358c2ecf20Sopenharmony_ci					      num_ac);
8368c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
8378c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
8388c2ecf20Sopenharmony_ci
8398c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->sta_uapsd_auto_trig_cmdid;
8408c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
8418c2ecf20Sopenharmony_ci}
8428c2ecf20Sopenharmony_ci
8438c2ecf20Sopenharmony_cistatic inline int
8448c2ecf20Sopenharmony_ciath10k_wmi_vdev_wmm_conf(struct ath10k *ar, u32 vdev_id,
8458c2ecf20Sopenharmony_ci			 const struct wmi_wmm_params_all_arg *arg)
8468c2ecf20Sopenharmony_ci{
8478c2ecf20Sopenharmony_ci	struct sk_buff *skb;
8488c2ecf20Sopenharmony_ci	u32 cmd_id;
8498c2ecf20Sopenharmony_ci
8508c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_vdev_wmm_conf(ar, vdev_id, arg);
8518c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
8528c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
8538c2ecf20Sopenharmony_ci
8548c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->vdev_set_wmm_params_cmdid;
8558c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
8568c2ecf20Sopenharmony_ci}
8578c2ecf20Sopenharmony_ci
8588c2ecf20Sopenharmony_cistatic inline int
8598c2ecf20Sopenharmony_ciath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
8608c2ecf20Sopenharmony_ci		       const u8 peer_addr[ETH_ALEN],
8618c2ecf20Sopenharmony_ci		       enum wmi_peer_type peer_type)
8628c2ecf20Sopenharmony_ci{
8638c2ecf20Sopenharmony_ci	struct sk_buff *skb;
8648c2ecf20Sopenharmony_ci
8658c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_peer_create)
8668c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
8678c2ecf20Sopenharmony_ci
8688c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_peer_create(ar, vdev_id, peer_addr, peer_type);
8698c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
8708c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
8718c2ecf20Sopenharmony_ci
8728c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_create_cmdid);
8738c2ecf20Sopenharmony_ci}
8748c2ecf20Sopenharmony_ci
8758c2ecf20Sopenharmony_cistatic inline int
8768c2ecf20Sopenharmony_ciath10k_wmi_peer_delete(struct ath10k *ar, u32 vdev_id,
8778c2ecf20Sopenharmony_ci		       const u8 peer_addr[ETH_ALEN])
8788c2ecf20Sopenharmony_ci{
8798c2ecf20Sopenharmony_ci	struct sk_buff *skb;
8808c2ecf20Sopenharmony_ci
8818c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_peer_delete)
8828c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
8838c2ecf20Sopenharmony_ci
8848c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_peer_delete(ar, vdev_id, peer_addr);
8858c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
8868c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
8878c2ecf20Sopenharmony_ci
8888c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_delete_cmdid);
8898c2ecf20Sopenharmony_ci}
8908c2ecf20Sopenharmony_ci
8918c2ecf20Sopenharmony_cistatic inline int
8928c2ecf20Sopenharmony_ciath10k_wmi_peer_flush(struct ath10k *ar, u32 vdev_id,
8938c2ecf20Sopenharmony_ci		      const u8 peer_addr[ETH_ALEN], u32 tid_bitmap)
8948c2ecf20Sopenharmony_ci{
8958c2ecf20Sopenharmony_ci	struct sk_buff *skb;
8968c2ecf20Sopenharmony_ci
8978c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_peer_flush)
8988c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
8998c2ecf20Sopenharmony_ci
9008c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_peer_flush(ar, vdev_id, peer_addr, tid_bitmap);
9018c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
9028c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
9038c2ecf20Sopenharmony_ci
9048c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_flush_tids_cmdid);
9058c2ecf20Sopenharmony_ci}
9068c2ecf20Sopenharmony_ci
9078c2ecf20Sopenharmony_cistatic inline int
9088c2ecf20Sopenharmony_ciath10k_wmi_peer_set_param(struct ath10k *ar, u32 vdev_id, const u8 *peer_addr,
9098c2ecf20Sopenharmony_ci			  enum wmi_peer_param param_id, u32 param_value)
9108c2ecf20Sopenharmony_ci{
9118c2ecf20Sopenharmony_ci	struct sk_buff *skb;
9128c2ecf20Sopenharmony_ci
9138c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_peer_set_param)
9148c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
9158c2ecf20Sopenharmony_ci
9168c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_peer_set_param(ar, vdev_id, peer_addr, param_id,
9178c2ecf20Sopenharmony_ci					      param_value);
9188c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
9198c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
9208c2ecf20Sopenharmony_ci
9218c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_set_param_cmdid);
9228c2ecf20Sopenharmony_ci}
9238c2ecf20Sopenharmony_ci
9248c2ecf20Sopenharmony_cistatic inline int
9258c2ecf20Sopenharmony_ciath10k_wmi_set_psmode(struct ath10k *ar, u32 vdev_id,
9268c2ecf20Sopenharmony_ci		      enum wmi_sta_ps_mode psmode)
9278c2ecf20Sopenharmony_ci{
9288c2ecf20Sopenharmony_ci	struct sk_buff *skb;
9298c2ecf20Sopenharmony_ci
9308c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_set_psmode)
9318c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
9328c2ecf20Sopenharmony_ci
9338c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_set_psmode(ar, vdev_id, psmode);
9348c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
9358c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
9368c2ecf20Sopenharmony_ci
9378c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
9388c2ecf20Sopenharmony_ci				   ar->wmi.cmd->sta_powersave_mode_cmdid);
9398c2ecf20Sopenharmony_ci}
9408c2ecf20Sopenharmony_ci
9418c2ecf20Sopenharmony_cistatic inline int
9428c2ecf20Sopenharmony_ciath10k_wmi_set_sta_ps_param(struct ath10k *ar, u32 vdev_id,
9438c2ecf20Sopenharmony_ci			    enum wmi_sta_powersave_param param_id, u32 value)
9448c2ecf20Sopenharmony_ci{
9458c2ecf20Sopenharmony_ci	struct sk_buff *skb;
9468c2ecf20Sopenharmony_ci
9478c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_set_sta_ps)
9488c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
9498c2ecf20Sopenharmony_ci
9508c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_set_sta_ps(ar, vdev_id, param_id, value);
9518c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
9528c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
9538c2ecf20Sopenharmony_ci
9548c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
9558c2ecf20Sopenharmony_ci				   ar->wmi.cmd->sta_powersave_param_cmdid);
9568c2ecf20Sopenharmony_ci}
9578c2ecf20Sopenharmony_ci
9588c2ecf20Sopenharmony_cistatic inline int
9598c2ecf20Sopenharmony_ciath10k_wmi_set_ap_ps_param(struct ath10k *ar, u32 vdev_id, const u8 *mac,
9608c2ecf20Sopenharmony_ci			   enum wmi_ap_ps_peer_param param_id, u32 value)
9618c2ecf20Sopenharmony_ci{
9628c2ecf20Sopenharmony_ci	struct sk_buff *skb;
9638c2ecf20Sopenharmony_ci
9648c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_set_ap_ps)
9658c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
9668c2ecf20Sopenharmony_ci
9678c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_set_ap_ps(ar, vdev_id, mac, param_id, value);
9688c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
9698c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
9708c2ecf20Sopenharmony_ci
9718c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
9728c2ecf20Sopenharmony_ci				   ar->wmi.cmd->ap_ps_peer_param_cmdid);
9738c2ecf20Sopenharmony_ci}
9748c2ecf20Sopenharmony_ci
9758c2ecf20Sopenharmony_cistatic inline int
9768c2ecf20Sopenharmony_ciath10k_wmi_scan_chan_list(struct ath10k *ar,
9778c2ecf20Sopenharmony_ci			  const struct wmi_scan_chan_list_arg *arg)
9788c2ecf20Sopenharmony_ci{
9798c2ecf20Sopenharmony_ci	struct sk_buff *skb;
9808c2ecf20Sopenharmony_ci
9818c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_scan_chan_list)
9828c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
9838c2ecf20Sopenharmony_ci
9848c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_scan_chan_list(ar, arg);
9858c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
9868c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
9878c2ecf20Sopenharmony_ci
9888c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->scan_chan_list_cmdid);
9898c2ecf20Sopenharmony_ci}
9908c2ecf20Sopenharmony_ci
9918c2ecf20Sopenharmony_cistatic inline int
9928c2ecf20Sopenharmony_ciath10k_wmi_scan_prob_req_oui(struct ath10k *ar, const u8 mac_addr[ETH_ALEN])
9938c2ecf20Sopenharmony_ci{
9948c2ecf20Sopenharmony_ci	struct sk_buff *skb;
9958c2ecf20Sopenharmony_ci	u32 prob_req_oui;
9968c2ecf20Sopenharmony_ci
9978c2ecf20Sopenharmony_ci	prob_req_oui = (((u32)mac_addr[0]) << 16) |
9988c2ecf20Sopenharmony_ci		       (((u32)mac_addr[1]) << 8) | mac_addr[2];
9998c2ecf20Sopenharmony_ci
10008c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_scan_prob_req_oui)
10018c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
10028c2ecf20Sopenharmony_ci
10038c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_scan_prob_req_oui(ar, prob_req_oui);
10048c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
10058c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
10068c2ecf20Sopenharmony_ci
10078c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
10088c2ecf20Sopenharmony_ci			ar->wmi.cmd->scan_prob_req_oui_cmdid);
10098c2ecf20Sopenharmony_ci}
10108c2ecf20Sopenharmony_ci
10118c2ecf20Sopenharmony_cistatic inline int
10128c2ecf20Sopenharmony_ciath10k_wmi_peer_assoc(struct ath10k *ar,
10138c2ecf20Sopenharmony_ci		      const struct wmi_peer_assoc_complete_arg *arg)
10148c2ecf20Sopenharmony_ci{
10158c2ecf20Sopenharmony_ci	struct sk_buff *skb;
10168c2ecf20Sopenharmony_ci
10178c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_peer_assoc)
10188c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
10198c2ecf20Sopenharmony_ci
10208c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_peer_assoc(ar, arg);
10218c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
10228c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
10238c2ecf20Sopenharmony_ci
10248c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_assoc_cmdid);
10258c2ecf20Sopenharmony_ci}
10268c2ecf20Sopenharmony_ci
10278c2ecf20Sopenharmony_cistatic inline int
10288c2ecf20Sopenharmony_ciath10k_wmi_beacon_send_ref_nowait(struct ath10k *ar, u32 vdev_id,
10298c2ecf20Sopenharmony_ci				  const void *bcn, size_t bcn_len,
10308c2ecf20Sopenharmony_ci				  u32 bcn_paddr, bool dtim_zero,
10318c2ecf20Sopenharmony_ci				  bool deliver_cab)
10328c2ecf20Sopenharmony_ci{
10338c2ecf20Sopenharmony_ci	struct sk_buff *skb;
10348c2ecf20Sopenharmony_ci	int ret;
10358c2ecf20Sopenharmony_ci
10368c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_beacon_dma)
10378c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
10388c2ecf20Sopenharmony_ci
10398c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_beacon_dma(ar, vdev_id, bcn, bcn_len, bcn_paddr,
10408c2ecf20Sopenharmony_ci					  dtim_zero, deliver_cab);
10418c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
10428c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
10438c2ecf20Sopenharmony_ci
10448c2ecf20Sopenharmony_ci	ret = ath10k_wmi_cmd_send_nowait(ar, skb,
10458c2ecf20Sopenharmony_ci					 ar->wmi.cmd->pdev_send_bcn_cmdid);
10468c2ecf20Sopenharmony_ci	if (ret) {
10478c2ecf20Sopenharmony_ci		dev_kfree_skb(skb);
10488c2ecf20Sopenharmony_ci		return ret;
10498c2ecf20Sopenharmony_ci	}
10508c2ecf20Sopenharmony_ci
10518c2ecf20Sopenharmony_ci	return 0;
10528c2ecf20Sopenharmony_ci}
10538c2ecf20Sopenharmony_ci
10548c2ecf20Sopenharmony_cistatic inline int
10558c2ecf20Sopenharmony_ciath10k_wmi_pdev_set_wmm_params(struct ath10k *ar,
10568c2ecf20Sopenharmony_ci			       const struct wmi_wmm_params_all_arg *arg)
10578c2ecf20Sopenharmony_ci{
10588c2ecf20Sopenharmony_ci	struct sk_buff *skb;
10598c2ecf20Sopenharmony_ci
10608c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_set_wmm)
10618c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
10628c2ecf20Sopenharmony_ci
10638c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_set_wmm(ar, arg);
10648c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
10658c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
10668c2ecf20Sopenharmony_ci
10678c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
10688c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_set_wmm_params_cmdid);
10698c2ecf20Sopenharmony_ci}
10708c2ecf20Sopenharmony_ci
10718c2ecf20Sopenharmony_cistatic inline int
10728c2ecf20Sopenharmony_ciath10k_wmi_request_stats(struct ath10k *ar, u32 stats_mask)
10738c2ecf20Sopenharmony_ci{
10748c2ecf20Sopenharmony_ci	struct sk_buff *skb;
10758c2ecf20Sopenharmony_ci
10768c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_request_stats)
10778c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
10788c2ecf20Sopenharmony_ci
10798c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_request_stats(ar, stats_mask);
10808c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
10818c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
10828c2ecf20Sopenharmony_ci
10838c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_stats_cmdid);
10848c2ecf20Sopenharmony_ci}
10858c2ecf20Sopenharmony_ci
10868c2ecf20Sopenharmony_cistatic inline int
10878c2ecf20Sopenharmony_ciath10k_wmi_request_peer_stats_info(struct ath10k *ar,
10888c2ecf20Sopenharmony_ci				   u32 vdev_id,
10898c2ecf20Sopenharmony_ci				   enum wmi_peer_stats_info_request_type type,
10908c2ecf20Sopenharmony_ci				   u8 *addr,
10918c2ecf20Sopenharmony_ci				   u32 reset)
10928c2ecf20Sopenharmony_ci{
10938c2ecf20Sopenharmony_ci	struct sk_buff *skb;
10948c2ecf20Sopenharmony_ci
10958c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_request_peer_stats_info)
10968c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
10978c2ecf20Sopenharmony_ci
10988c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_request_peer_stats_info(ar,
10998c2ecf20Sopenharmony_ci						       vdev_id,
11008c2ecf20Sopenharmony_ci						       type,
11018c2ecf20Sopenharmony_ci						       addr,
11028c2ecf20Sopenharmony_ci						       reset);
11038c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
11048c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
11058c2ecf20Sopenharmony_ci
11068c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_peer_stats_info_cmdid);
11078c2ecf20Sopenharmony_ci}
11088c2ecf20Sopenharmony_ci
11098c2ecf20Sopenharmony_cistatic inline int
11108c2ecf20Sopenharmony_ciath10k_wmi_force_fw_hang(struct ath10k *ar,
11118c2ecf20Sopenharmony_ci			 enum wmi_force_fw_hang_type type, u32 delay_ms)
11128c2ecf20Sopenharmony_ci{
11138c2ecf20Sopenharmony_ci	struct sk_buff *skb;
11148c2ecf20Sopenharmony_ci
11158c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_force_fw_hang)
11168c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
11178c2ecf20Sopenharmony_ci
11188c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_force_fw_hang(ar, type, delay_ms);
11198c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
11208c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
11218c2ecf20Sopenharmony_ci
11228c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
11238c2ecf20Sopenharmony_ci}
11248c2ecf20Sopenharmony_ci
11258c2ecf20Sopenharmony_cistatic inline int
11268c2ecf20Sopenharmony_ciath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
11278c2ecf20Sopenharmony_ci{
11288c2ecf20Sopenharmony_ci	struct sk_buff *skb;
11298c2ecf20Sopenharmony_ci
11308c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_dbglog_cfg)
11318c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
11328c2ecf20Sopenharmony_ci
11338c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_dbglog_cfg(ar, module_enable, log_level);
11348c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
11358c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
11368c2ecf20Sopenharmony_ci
11378c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->dbglog_cfg_cmdid);
11388c2ecf20Sopenharmony_ci}
11398c2ecf20Sopenharmony_ci
11408c2ecf20Sopenharmony_cistatic inline int
11418c2ecf20Sopenharmony_ciath10k_wmi_pdev_pktlog_enable(struct ath10k *ar, u32 filter)
11428c2ecf20Sopenharmony_ci{
11438c2ecf20Sopenharmony_ci	struct sk_buff *skb;
11448c2ecf20Sopenharmony_ci
11458c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pktlog_enable)
11468c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
11478c2ecf20Sopenharmony_ci
11488c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pktlog_enable(ar, filter);
11498c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
11508c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
11518c2ecf20Sopenharmony_ci
11528c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->pdev_pktlog_enable_cmdid);
11538c2ecf20Sopenharmony_ci}
11548c2ecf20Sopenharmony_ci
11558c2ecf20Sopenharmony_cistatic inline int
11568c2ecf20Sopenharmony_ciath10k_wmi_pdev_pktlog_disable(struct ath10k *ar)
11578c2ecf20Sopenharmony_ci{
11588c2ecf20Sopenharmony_ci	struct sk_buff *skb;
11598c2ecf20Sopenharmony_ci
11608c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pktlog_disable)
11618c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
11628c2ecf20Sopenharmony_ci
11638c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pktlog_disable(ar);
11648c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
11658c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
11668c2ecf20Sopenharmony_ci
11678c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
11688c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_pktlog_disable_cmdid);
11698c2ecf20Sopenharmony_ci}
11708c2ecf20Sopenharmony_ci
11718c2ecf20Sopenharmony_cistatic inline int
11728c2ecf20Sopenharmony_ciath10k_wmi_pdev_set_quiet_mode(struct ath10k *ar, u32 period, u32 duration,
11738c2ecf20Sopenharmony_ci			       u32 next_offset, u32 enabled)
11748c2ecf20Sopenharmony_ci{
11758c2ecf20Sopenharmony_ci	struct sk_buff *skb;
11768c2ecf20Sopenharmony_ci
11778c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_set_quiet_mode)
11788c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
11798c2ecf20Sopenharmony_ci
11808c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_set_quiet_mode(ar, period, duration,
11818c2ecf20Sopenharmony_ci						   next_offset, enabled);
11828c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
11838c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
11848c2ecf20Sopenharmony_ci
11858c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
11868c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_set_quiet_mode_cmdid);
11878c2ecf20Sopenharmony_ci}
11888c2ecf20Sopenharmony_ci
11898c2ecf20Sopenharmony_cistatic inline int
11908c2ecf20Sopenharmony_ciath10k_wmi_pdev_get_temperature(struct ath10k *ar)
11918c2ecf20Sopenharmony_ci{
11928c2ecf20Sopenharmony_ci	struct sk_buff *skb;
11938c2ecf20Sopenharmony_ci
11948c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_get_temperature)
11958c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
11968c2ecf20Sopenharmony_ci
11978c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_get_temperature(ar);
11988c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
11998c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
12008c2ecf20Sopenharmony_ci
12018c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
12028c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_get_temperature_cmdid);
12038c2ecf20Sopenharmony_ci}
12048c2ecf20Sopenharmony_ci
12058c2ecf20Sopenharmony_cistatic inline int
12068c2ecf20Sopenharmony_ciath10k_wmi_addba_clear_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac)
12078c2ecf20Sopenharmony_ci{
12088c2ecf20Sopenharmony_ci	struct sk_buff *skb;
12098c2ecf20Sopenharmony_ci
12108c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_addba_clear_resp)
12118c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
12128c2ecf20Sopenharmony_ci
12138c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_addba_clear_resp(ar, vdev_id, mac);
12148c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
12158c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
12168c2ecf20Sopenharmony_ci
12178c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
12188c2ecf20Sopenharmony_ci				   ar->wmi.cmd->addba_clear_resp_cmdid);
12198c2ecf20Sopenharmony_ci}
12208c2ecf20Sopenharmony_ci
12218c2ecf20Sopenharmony_cistatic inline int
12228c2ecf20Sopenharmony_ciath10k_wmi_addba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
12238c2ecf20Sopenharmony_ci		      u32 tid, u32 buf_size)
12248c2ecf20Sopenharmony_ci{
12258c2ecf20Sopenharmony_ci	struct sk_buff *skb;
12268c2ecf20Sopenharmony_ci
12278c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_addba_send)
12288c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
12298c2ecf20Sopenharmony_ci
12308c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_addba_send(ar, vdev_id, mac, tid, buf_size);
12318c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
12328c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
12338c2ecf20Sopenharmony_ci
12348c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
12358c2ecf20Sopenharmony_ci				   ar->wmi.cmd->addba_send_cmdid);
12368c2ecf20Sopenharmony_ci}
12378c2ecf20Sopenharmony_ci
12388c2ecf20Sopenharmony_cistatic inline int
12398c2ecf20Sopenharmony_ciath10k_wmi_addba_set_resp(struct ath10k *ar, u32 vdev_id, const u8 *mac,
12408c2ecf20Sopenharmony_ci			  u32 tid, u32 status)
12418c2ecf20Sopenharmony_ci{
12428c2ecf20Sopenharmony_ci	struct sk_buff *skb;
12438c2ecf20Sopenharmony_ci
12448c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_addba_set_resp)
12458c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
12468c2ecf20Sopenharmony_ci
12478c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_addba_set_resp(ar, vdev_id, mac, tid, status);
12488c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
12498c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
12508c2ecf20Sopenharmony_ci
12518c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
12528c2ecf20Sopenharmony_ci				   ar->wmi.cmd->addba_set_resp_cmdid);
12538c2ecf20Sopenharmony_ci}
12548c2ecf20Sopenharmony_ci
12558c2ecf20Sopenharmony_cistatic inline int
12568c2ecf20Sopenharmony_ciath10k_wmi_delba_send(struct ath10k *ar, u32 vdev_id, const u8 *mac,
12578c2ecf20Sopenharmony_ci		      u32 tid, u32 initiator, u32 reason)
12588c2ecf20Sopenharmony_ci{
12598c2ecf20Sopenharmony_ci	struct sk_buff *skb;
12608c2ecf20Sopenharmony_ci
12618c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_delba_send)
12628c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
12638c2ecf20Sopenharmony_ci
12648c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_delba_send(ar, vdev_id, mac, tid, initiator,
12658c2ecf20Sopenharmony_ci					  reason);
12668c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
12678c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
12688c2ecf20Sopenharmony_ci
12698c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
12708c2ecf20Sopenharmony_ci				   ar->wmi.cmd->delba_send_cmdid);
12718c2ecf20Sopenharmony_ci}
12728c2ecf20Sopenharmony_ci
12738c2ecf20Sopenharmony_cistatic inline int
12748c2ecf20Sopenharmony_ciath10k_wmi_bcn_tmpl(struct ath10k *ar, u32 vdev_id, u32 tim_ie_offset,
12758c2ecf20Sopenharmony_ci		    struct sk_buff *bcn, u32 prb_caps, u32 prb_erp,
12768c2ecf20Sopenharmony_ci		    void *prb_ies, size_t prb_ies_len)
12778c2ecf20Sopenharmony_ci{
12788c2ecf20Sopenharmony_ci	struct sk_buff *skb;
12798c2ecf20Sopenharmony_ci
12808c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_bcn_tmpl)
12818c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
12828c2ecf20Sopenharmony_ci
12838c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_bcn_tmpl(ar, vdev_id, tim_ie_offset, bcn,
12848c2ecf20Sopenharmony_ci					prb_caps, prb_erp, prb_ies,
12858c2ecf20Sopenharmony_ci					prb_ies_len);
12868c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
12878c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
12888c2ecf20Sopenharmony_ci
12898c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->bcn_tmpl_cmdid);
12908c2ecf20Sopenharmony_ci}
12918c2ecf20Sopenharmony_ci
12928c2ecf20Sopenharmony_cistatic inline int
12938c2ecf20Sopenharmony_ciath10k_wmi_prb_tmpl(struct ath10k *ar, u32 vdev_id, struct sk_buff *prb)
12948c2ecf20Sopenharmony_ci{
12958c2ecf20Sopenharmony_ci	struct sk_buff *skb;
12968c2ecf20Sopenharmony_ci
12978c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_prb_tmpl)
12988c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
12998c2ecf20Sopenharmony_ci
13008c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_prb_tmpl(ar, vdev_id, prb);
13018c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
13028c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
13038c2ecf20Sopenharmony_ci
13048c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->prb_tmpl_cmdid);
13058c2ecf20Sopenharmony_ci}
13068c2ecf20Sopenharmony_ci
13078c2ecf20Sopenharmony_cistatic inline int
13088c2ecf20Sopenharmony_ciath10k_wmi_p2p_go_bcn_ie(struct ath10k *ar, u32 vdev_id, const u8 *p2p_ie)
13098c2ecf20Sopenharmony_ci{
13108c2ecf20Sopenharmony_ci	struct sk_buff *skb;
13118c2ecf20Sopenharmony_ci
13128c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_p2p_go_bcn_ie)
13138c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
13148c2ecf20Sopenharmony_ci
13158c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_p2p_go_bcn_ie(ar, vdev_id, p2p_ie);
13168c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
13178c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
13188c2ecf20Sopenharmony_ci
13198c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->p2p_go_set_beacon_ie);
13208c2ecf20Sopenharmony_ci}
13218c2ecf20Sopenharmony_ci
13228c2ecf20Sopenharmony_cistatic inline int
13238c2ecf20Sopenharmony_ciath10k_wmi_sta_keepalive(struct ath10k *ar,
13248c2ecf20Sopenharmony_ci			 const struct wmi_sta_keepalive_arg *arg)
13258c2ecf20Sopenharmony_ci{
13268c2ecf20Sopenharmony_ci	struct sk_buff *skb;
13278c2ecf20Sopenharmony_ci	u32 cmd_id;
13288c2ecf20Sopenharmony_ci
13298c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_sta_keepalive)
13308c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
13318c2ecf20Sopenharmony_ci
13328c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_sta_keepalive(ar, arg);
13338c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
13348c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
13358c2ecf20Sopenharmony_ci
13368c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->sta_keepalive_cmd;
13378c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
13388c2ecf20Sopenharmony_ci}
13398c2ecf20Sopenharmony_ci
13408c2ecf20Sopenharmony_cistatic inline int
13418c2ecf20Sopenharmony_ciath10k_wmi_wow_enable(struct ath10k *ar)
13428c2ecf20Sopenharmony_ci{
13438c2ecf20Sopenharmony_ci	struct sk_buff *skb;
13448c2ecf20Sopenharmony_ci	u32 cmd_id;
13458c2ecf20Sopenharmony_ci
13468c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_wow_enable)
13478c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
13488c2ecf20Sopenharmony_ci
13498c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_wow_enable(ar);
13508c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
13518c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
13528c2ecf20Sopenharmony_ci
13538c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->wow_enable_cmdid;
13548c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
13558c2ecf20Sopenharmony_ci}
13568c2ecf20Sopenharmony_ci
13578c2ecf20Sopenharmony_cistatic inline int
13588c2ecf20Sopenharmony_ciath10k_wmi_wow_add_wakeup_event(struct ath10k *ar, u32 vdev_id,
13598c2ecf20Sopenharmony_ci				enum wmi_wow_wakeup_event event,
13608c2ecf20Sopenharmony_ci				u32 enable)
13618c2ecf20Sopenharmony_ci{
13628c2ecf20Sopenharmony_ci	struct sk_buff *skb;
13638c2ecf20Sopenharmony_ci	u32 cmd_id;
13648c2ecf20Sopenharmony_ci
13658c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_wow_add_wakeup_event)
13668c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
13678c2ecf20Sopenharmony_ci
13688c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_wow_add_wakeup_event(ar, vdev_id, event, enable);
13698c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
13708c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
13718c2ecf20Sopenharmony_ci
13728c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->wow_enable_disable_wake_event_cmdid;
13738c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
13748c2ecf20Sopenharmony_ci}
13758c2ecf20Sopenharmony_ci
13768c2ecf20Sopenharmony_cistatic inline int
13778c2ecf20Sopenharmony_ciath10k_wmi_wow_host_wakeup_ind(struct ath10k *ar)
13788c2ecf20Sopenharmony_ci{
13798c2ecf20Sopenharmony_ci	struct sk_buff *skb;
13808c2ecf20Sopenharmony_ci	u32 cmd_id;
13818c2ecf20Sopenharmony_ci
13828c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_wow_host_wakeup_ind)
13838c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
13848c2ecf20Sopenharmony_ci
13858c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_wow_host_wakeup_ind(ar);
13868c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
13878c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
13888c2ecf20Sopenharmony_ci
13898c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->wow_hostwakeup_from_sleep_cmdid;
13908c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
13918c2ecf20Sopenharmony_ci}
13928c2ecf20Sopenharmony_ci
13938c2ecf20Sopenharmony_cistatic inline int
13948c2ecf20Sopenharmony_ciath10k_wmi_wow_add_pattern(struct ath10k *ar, u32 vdev_id, u32 pattern_id,
13958c2ecf20Sopenharmony_ci			   const u8 *pattern, const u8 *mask,
13968c2ecf20Sopenharmony_ci			   int pattern_len, int pattern_offset)
13978c2ecf20Sopenharmony_ci{
13988c2ecf20Sopenharmony_ci	struct sk_buff *skb;
13998c2ecf20Sopenharmony_ci	u32 cmd_id;
14008c2ecf20Sopenharmony_ci
14018c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_wow_add_pattern)
14028c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
14038c2ecf20Sopenharmony_ci
14048c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_wow_add_pattern(ar, vdev_id, pattern_id,
14058c2ecf20Sopenharmony_ci					       pattern, mask, pattern_len,
14068c2ecf20Sopenharmony_ci					       pattern_offset);
14078c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
14088c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
14098c2ecf20Sopenharmony_ci
14108c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->wow_add_wake_pattern_cmdid;
14118c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
14128c2ecf20Sopenharmony_ci}
14138c2ecf20Sopenharmony_ci
14148c2ecf20Sopenharmony_cistatic inline int
14158c2ecf20Sopenharmony_ciath10k_wmi_wow_del_pattern(struct ath10k *ar, u32 vdev_id, u32 pattern_id)
14168c2ecf20Sopenharmony_ci{
14178c2ecf20Sopenharmony_ci	struct sk_buff *skb;
14188c2ecf20Sopenharmony_ci	u32 cmd_id;
14198c2ecf20Sopenharmony_ci
14208c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_wow_del_pattern)
14218c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
14228c2ecf20Sopenharmony_ci
14238c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_wow_del_pattern(ar, vdev_id, pattern_id);
14248c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
14258c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
14268c2ecf20Sopenharmony_ci
14278c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->wow_del_wake_pattern_cmdid;
14288c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
14298c2ecf20Sopenharmony_ci}
14308c2ecf20Sopenharmony_ci
14318c2ecf20Sopenharmony_cistatic inline int
14328c2ecf20Sopenharmony_ciath10k_wmi_wow_config_pno(struct ath10k *ar, u32 vdev_id,
14338c2ecf20Sopenharmony_ci			  struct wmi_pno_scan_req  *pno_scan)
14348c2ecf20Sopenharmony_ci{
14358c2ecf20Sopenharmony_ci	struct sk_buff *skb;
14368c2ecf20Sopenharmony_ci	u32 cmd_id;
14378c2ecf20Sopenharmony_ci
14388c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_wow_config_pno)
14398c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
14408c2ecf20Sopenharmony_ci
14418c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_wow_config_pno(ar, vdev_id, pno_scan);
14428c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
14438c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
14448c2ecf20Sopenharmony_ci
14458c2ecf20Sopenharmony_ci	cmd_id = ar->wmi.cmd->network_list_offload_config_cmdid;
14468c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
14478c2ecf20Sopenharmony_ci}
14488c2ecf20Sopenharmony_ci
14498c2ecf20Sopenharmony_cistatic inline int
14508c2ecf20Sopenharmony_ciath10k_wmi_update_fw_tdls_state(struct ath10k *ar, u32 vdev_id,
14518c2ecf20Sopenharmony_ci				enum wmi_tdls_state state)
14528c2ecf20Sopenharmony_ci{
14538c2ecf20Sopenharmony_ci	struct sk_buff *skb;
14548c2ecf20Sopenharmony_ci
14558c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_update_fw_tdls_state)
14568c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
14578c2ecf20Sopenharmony_ci
14588c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_update_fw_tdls_state(ar, vdev_id, state);
14598c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
14608c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
14618c2ecf20Sopenharmony_ci
14628c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->tdls_set_state_cmdid);
14638c2ecf20Sopenharmony_ci}
14648c2ecf20Sopenharmony_ci
14658c2ecf20Sopenharmony_cistatic inline int
14668c2ecf20Sopenharmony_ciath10k_wmi_tdls_peer_update(struct ath10k *ar,
14678c2ecf20Sopenharmony_ci			    const struct wmi_tdls_peer_update_cmd_arg *arg,
14688c2ecf20Sopenharmony_ci			    const struct wmi_tdls_peer_capab_arg *cap,
14698c2ecf20Sopenharmony_ci			    const struct wmi_channel_arg *chan)
14708c2ecf20Sopenharmony_ci{
14718c2ecf20Sopenharmony_ci	struct sk_buff *skb;
14728c2ecf20Sopenharmony_ci
14738c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_tdls_peer_update)
14748c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
14758c2ecf20Sopenharmony_ci
14768c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_tdls_peer_update(ar, arg, cap, chan);
14778c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
14788c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
14798c2ecf20Sopenharmony_ci
14808c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
14818c2ecf20Sopenharmony_ci				   ar->wmi.cmd->tdls_peer_update_cmdid);
14828c2ecf20Sopenharmony_ci}
14838c2ecf20Sopenharmony_ci
14848c2ecf20Sopenharmony_cistatic inline int
14858c2ecf20Sopenharmony_ciath10k_wmi_adaptive_qcs(struct ath10k *ar, bool enable)
14868c2ecf20Sopenharmony_ci{
14878c2ecf20Sopenharmony_ci	struct sk_buff *skb;
14888c2ecf20Sopenharmony_ci
14898c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_adaptive_qcs)
14908c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
14918c2ecf20Sopenharmony_ci
14928c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_adaptive_qcs(ar, enable);
14938c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
14948c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
14958c2ecf20Sopenharmony_ci
14968c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->adaptive_qcs_cmdid);
14978c2ecf20Sopenharmony_ci}
14988c2ecf20Sopenharmony_ci
14998c2ecf20Sopenharmony_cistatic inline int
15008c2ecf20Sopenharmony_ciath10k_wmi_pdev_get_tpc_config(struct ath10k *ar, u32 param)
15018c2ecf20Sopenharmony_ci{
15028c2ecf20Sopenharmony_ci	struct sk_buff *skb;
15038c2ecf20Sopenharmony_ci
15048c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_get_tpc_config)
15058c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
15068c2ecf20Sopenharmony_ci
15078c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_get_tpc_config(ar, param);
15088c2ecf20Sopenharmony_ci
15098c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
15108c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
15118c2ecf20Sopenharmony_ci
15128c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
15138c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_get_tpc_config_cmdid);
15148c2ecf20Sopenharmony_ci}
15158c2ecf20Sopenharmony_ci
15168c2ecf20Sopenharmony_cistatic inline int
15178c2ecf20Sopenharmony_ciath10k_wmi_fw_stats_fill(struct ath10k *ar, struct ath10k_fw_stats *fw_stats,
15188c2ecf20Sopenharmony_ci			 char *buf)
15198c2ecf20Sopenharmony_ci{
15208c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->fw_stats_fill)
15218c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
15228c2ecf20Sopenharmony_ci
15238c2ecf20Sopenharmony_ci	ar->wmi.ops->fw_stats_fill(ar, fw_stats, buf);
15248c2ecf20Sopenharmony_ci	return 0;
15258c2ecf20Sopenharmony_ci}
15268c2ecf20Sopenharmony_ci
15278c2ecf20Sopenharmony_cistatic inline int
15288c2ecf20Sopenharmony_ciath10k_wmi_pdev_enable_adaptive_cca(struct ath10k *ar, u8 enable,
15298c2ecf20Sopenharmony_ci				    u32 detect_level, u32 detect_margin)
15308c2ecf20Sopenharmony_ci{
15318c2ecf20Sopenharmony_ci	struct sk_buff *skb;
15328c2ecf20Sopenharmony_ci
15338c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_enable_adaptive_cca)
15348c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
15358c2ecf20Sopenharmony_ci
15368c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_enable_adaptive_cca(ar, enable,
15378c2ecf20Sopenharmony_ci							detect_level,
15388c2ecf20Sopenharmony_ci							detect_margin);
15398c2ecf20Sopenharmony_ci
15408c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
15418c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
15428c2ecf20Sopenharmony_ci
15438c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
15448c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_enable_adaptive_cca_cmdid);
15458c2ecf20Sopenharmony_ci}
15468c2ecf20Sopenharmony_ci
15478c2ecf20Sopenharmony_cistatic inline int
15488c2ecf20Sopenharmony_ciath10k_wmi_ext_resource_config(struct ath10k *ar,
15498c2ecf20Sopenharmony_ci			       enum wmi_host_platform_type type,
15508c2ecf20Sopenharmony_ci			       u32 fw_feature_bitmap)
15518c2ecf20Sopenharmony_ci{
15528c2ecf20Sopenharmony_ci	struct sk_buff *skb;
15538c2ecf20Sopenharmony_ci
15548c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->ext_resource_config)
15558c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
15568c2ecf20Sopenharmony_ci
15578c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->ext_resource_config(ar, type,
15588c2ecf20Sopenharmony_ci					       fw_feature_bitmap);
15598c2ecf20Sopenharmony_ci
15608c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
15618c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
15628c2ecf20Sopenharmony_ci
15638c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
15648c2ecf20Sopenharmony_ci				   ar->wmi.cmd->ext_resource_cfg_cmdid);
15658c2ecf20Sopenharmony_ci}
15668c2ecf20Sopenharmony_ci
15678c2ecf20Sopenharmony_cistatic inline int
15688c2ecf20Sopenharmony_ciath10k_wmi_get_vdev_subtype(struct ath10k *ar, enum wmi_vdev_subtype subtype)
15698c2ecf20Sopenharmony_ci{
15708c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->get_vdev_subtype)
15718c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
15728c2ecf20Sopenharmony_ci
15738c2ecf20Sopenharmony_ci	return ar->wmi.ops->get_vdev_subtype(ar, subtype);
15748c2ecf20Sopenharmony_ci}
15758c2ecf20Sopenharmony_ci
15768c2ecf20Sopenharmony_cistatic inline int
15778c2ecf20Sopenharmony_ciath10k_wmi_pdev_bss_chan_info_request(struct ath10k *ar,
15788c2ecf20Sopenharmony_ci				      enum wmi_bss_survey_req_type type)
15798c2ecf20Sopenharmony_ci{
15808c2ecf20Sopenharmony_ci	struct ath10k_wmi *wmi = &ar->wmi;
15818c2ecf20Sopenharmony_ci	struct sk_buff *skb;
15828c2ecf20Sopenharmony_ci
15838c2ecf20Sopenharmony_ci	if (!wmi->ops->gen_pdev_bss_chan_info_req)
15848c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
15858c2ecf20Sopenharmony_ci
15868c2ecf20Sopenharmony_ci	skb = wmi->ops->gen_pdev_bss_chan_info_req(ar, type);
15878c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
15888c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
15898c2ecf20Sopenharmony_ci
15908c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
15918c2ecf20Sopenharmony_ci				   wmi->cmd->pdev_bss_chan_info_request_cmdid);
15928c2ecf20Sopenharmony_ci}
15938c2ecf20Sopenharmony_ci
15948c2ecf20Sopenharmony_cistatic inline int
15958c2ecf20Sopenharmony_ciath10k_wmi_echo(struct ath10k *ar, u32 value)
15968c2ecf20Sopenharmony_ci{
15978c2ecf20Sopenharmony_ci	struct ath10k_wmi *wmi = &ar->wmi;
15988c2ecf20Sopenharmony_ci	struct sk_buff *skb;
15998c2ecf20Sopenharmony_ci
16008c2ecf20Sopenharmony_ci	if (!wmi->ops->gen_echo)
16018c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
16028c2ecf20Sopenharmony_ci
16038c2ecf20Sopenharmony_ci	skb = wmi->ops->gen_echo(ar, value);
16048c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
16058c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
16068c2ecf20Sopenharmony_ci
16078c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb, wmi->cmd->echo_cmdid);
16088c2ecf20Sopenharmony_ci}
16098c2ecf20Sopenharmony_ci
16108c2ecf20Sopenharmony_cistatic inline int
16118c2ecf20Sopenharmony_ciath10k_wmi_pdev_get_tpc_table_cmdid(struct ath10k *ar, u32 param)
16128c2ecf20Sopenharmony_ci{
16138c2ecf20Sopenharmony_ci	struct sk_buff *skb;
16148c2ecf20Sopenharmony_ci
16158c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_pdev_get_tpc_table_cmdid)
16168c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
16178c2ecf20Sopenharmony_ci
16188c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_pdev_get_tpc_table_cmdid(ar, param);
16198c2ecf20Sopenharmony_ci
16208c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
16218c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
16228c2ecf20Sopenharmony_ci
16238c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
16248c2ecf20Sopenharmony_ci				   ar->wmi.cmd->pdev_get_tpc_table_cmdid);
16258c2ecf20Sopenharmony_ci}
16268c2ecf20Sopenharmony_ci
16278c2ecf20Sopenharmony_cistatic inline int
16288c2ecf20Sopenharmony_ciath10k_wmi_report_radar_found(struct ath10k *ar,
16298c2ecf20Sopenharmony_ci			      const struct ath10k_radar_found_info *arg)
16308c2ecf20Sopenharmony_ci{
16318c2ecf20Sopenharmony_ci	struct sk_buff *skb;
16328c2ecf20Sopenharmony_ci
16338c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_radar_found)
16348c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
16358c2ecf20Sopenharmony_ci
16368c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_radar_found(ar, arg);
16378c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
16388c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
16398c2ecf20Sopenharmony_ci
16408c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
16418c2ecf20Sopenharmony_ci				   ar->wmi.cmd->radar_found_cmdid);
16428c2ecf20Sopenharmony_ci}
16438c2ecf20Sopenharmony_ci
16448c2ecf20Sopenharmony_cistatic inline int
16458c2ecf20Sopenharmony_ciath10k_wmi_pdev_bb_timing(struct ath10k *ar,
16468c2ecf20Sopenharmony_ci			  const struct wmi_bb_timing_cfg_arg *arg)
16478c2ecf20Sopenharmony_ci{
16488c2ecf20Sopenharmony_ci	struct sk_buff *skb;
16498c2ecf20Sopenharmony_ci
16508c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_bb_timing)
16518c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
16528c2ecf20Sopenharmony_ci
16538c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_bb_timing(ar, arg);
16548c2ecf20Sopenharmony_ci
16558c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
16568c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
16578c2ecf20Sopenharmony_ci
16588c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
16598c2ecf20Sopenharmony_ci				   ar->wmi.cmd->set_bb_timing_cmdid);
16608c2ecf20Sopenharmony_ci}
16618c2ecf20Sopenharmony_ci
16628c2ecf20Sopenharmony_cistatic inline int
16638c2ecf20Sopenharmony_ciath10k_wmi_set_per_peer_per_tid_cfg(struct ath10k *ar,
16648c2ecf20Sopenharmony_ci				    const struct wmi_per_peer_per_tid_cfg_arg *arg)
16658c2ecf20Sopenharmony_ci{
16668c2ecf20Sopenharmony_ci	struct sk_buff *skb;
16678c2ecf20Sopenharmony_ci
16688c2ecf20Sopenharmony_ci	if (!ar->wmi.ops->gen_per_peer_per_tid_cfg)
16698c2ecf20Sopenharmony_ci		return -EOPNOTSUPP;
16708c2ecf20Sopenharmony_ci
16718c2ecf20Sopenharmony_ci	skb = ar->wmi.ops->gen_per_peer_per_tid_cfg(ar, arg);
16728c2ecf20Sopenharmony_ci	if (IS_ERR(skb))
16738c2ecf20Sopenharmony_ci		return PTR_ERR(skb);
16748c2ecf20Sopenharmony_ci
16758c2ecf20Sopenharmony_ci	return ath10k_wmi_cmd_send(ar, skb,
16768c2ecf20Sopenharmony_ci				   ar->wmi.cmd->per_peer_per_tid_config_cmdid);
16778c2ecf20Sopenharmony_ci}
16788c2ecf20Sopenharmony_ci#endif
1679