forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireless/ath/ath10k/wmi-ops.h
....@@ -1,19 +1,8 @@
1
+/* SPDX-License-Identifier: ISC */
12 /*
23 * Copyright (c) 2005-2011 Atheros Communications Inc.
34 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
45 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
5
- *
6
- * Permission to use, copy, modify, and/or distribute this software for any
7
- * purpose with or without fee is hereby granted, provided that the above
8
- * copyright notice and this permission notice appear in all copies.
9
- *
10
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
176 */
187
198 #ifndef _WMI_OPS_H_
....@@ -33,6 +22,9 @@
3322 struct wmi_mgmt_rx_ev_arg *arg);
3423 int (*pull_mgmt_tx_compl)(struct ath10k *ar, struct sk_buff *skb,
3524 struct wmi_tlv_mgmt_tx_compl_ev_arg *arg);
25
+ int (*pull_mgmt_tx_bundle_compl)(
26
+ struct ath10k *ar, struct sk_buff *skb,
27
+ struct wmi_tlv_mgmt_tx_bundle_compl_ev_arg *arg);
3628 int (*pull_ch_info)(struct ath10k *ar, struct sk_buff *skb,
3729 struct wmi_ch_info_ev_arg *arg);
3830 int (*pull_vdev_start)(struct ath10k *ar, struct sk_buff *skb,
....@@ -66,6 +58,8 @@
6658
6759 struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar, u32 suspend_opt);
6860 struct sk_buff *(*gen_pdev_resume)(struct ath10k *ar);
61
+ struct sk_buff *(*gen_pdev_set_base_macaddr)(struct ath10k *ar,
62
+ const u8 macaddr[ETH_ALEN]);
6963 struct sk_buff *(*gen_pdev_set_rd)(struct ath10k *ar, u16 rd, u16 rd2g,
7064 u16 rd5g, u16 ctl2g, u16 ctl5g,
7165 enum wmi_dfs_region dfs_reg);
....@@ -132,6 +126,13 @@
132126 struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar,
133127 const struct wmi_wmm_params_all_arg *arg);
134128 struct sk_buff *(*gen_request_stats)(struct ath10k *ar, u32 stats_mask);
129
+ struct sk_buff *(*gen_request_peer_stats_info)(struct ath10k *ar,
130
+ u32 vdev_id,
131
+ enum
132
+ wmi_peer_stats_info_request_type
133
+ type,
134
+ u8 *addr,
135
+ u32 reset);
135136 struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar,
136137 enum wmi_force_fw_hang_type type,
137138 u32 delay_ms);
....@@ -211,12 +212,20 @@
211212 u32 fw_feature_bitmap);
212213 int (*get_vdev_subtype)(struct ath10k *ar,
213214 enum wmi_vdev_subtype subtype);
215
+ struct sk_buff *(*gen_wow_config_pno)(struct ath10k *ar,
216
+ u32 vdev_id,
217
+ struct wmi_pno_scan_req *pno_scan);
214218 struct sk_buff *(*gen_pdev_bss_chan_info_req)
215219 (struct ath10k *ar,
216220 enum wmi_bss_survey_req_type type);
217221 struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
218222 struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar,
219223 u32 param);
224
+ struct sk_buff *(*gen_bb_timing)
225
+ (struct ath10k *ar,
226
+ const struct wmi_bb_timing_cfg_arg *arg);
227
+ struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar,
228
+ const struct wmi_per_peer_per_tid_cfg_arg *arg);
220229
221230 };
222231
....@@ -272,6 +281,16 @@
272281 return -EOPNOTSUPP;
273282
274283 return ar->wmi.ops->pull_mgmt_tx_compl(ar, skb, arg);
284
+}
285
+
286
+static inline int
287
+ath10k_wmi_pull_mgmt_tx_bundle_compl(struct ath10k *ar, struct sk_buff *skb,
288
+ struct wmi_tlv_mgmt_tx_bundle_compl_ev_arg *arg)
289
+{
290
+ if (!ar->wmi.ops->pull_mgmt_tx_bundle_compl)
291
+ return -EOPNOTSUPP;
292
+
293
+ return ar->wmi.ops->pull_mgmt_tx_bundle_compl(ar, skb, arg);
275294 }
276295
277296 static inline int
....@@ -508,6 +527,22 @@
508527
509528 return ath10k_wmi_cmd_send(ar, skb,
510529 ar->wmi.cmd->pdev_set_regdomain_cmdid);
530
+}
531
+
532
+static inline int
533
+ath10k_wmi_pdev_set_base_macaddr(struct ath10k *ar, const u8 macaddr[ETH_ALEN])
534
+{
535
+ struct sk_buff *skb;
536
+
537
+ if (!ar->wmi.ops->gen_pdev_set_base_macaddr)
538
+ return -EOPNOTSUPP;
539
+
540
+ skb = ar->wmi.ops->gen_pdev_set_base_macaddr(ar, macaddr);
541
+ if (IS_ERR(skb))
542
+ return PTR_ERR(skb);
543
+
544
+ return ath10k_wmi_cmd_send(ar, skb,
545
+ ar->wmi.cmd->pdev_set_base_macaddr_cmdid);
511546 }
512547
513548 static inline int
....@@ -1049,6 +1084,29 @@
10491084 }
10501085
10511086 static inline int
1087
+ath10k_wmi_request_peer_stats_info(struct ath10k *ar,
1088
+ u32 vdev_id,
1089
+ enum wmi_peer_stats_info_request_type type,
1090
+ u8 *addr,
1091
+ u32 reset)
1092
+{
1093
+ struct sk_buff *skb;
1094
+
1095
+ if (!ar->wmi.ops->gen_request_peer_stats_info)
1096
+ return -EOPNOTSUPP;
1097
+
1098
+ skb = ar->wmi.ops->gen_request_peer_stats_info(ar,
1099
+ vdev_id,
1100
+ type,
1101
+ addr,
1102
+ reset);
1103
+ if (IS_ERR(skb))
1104
+ return PTR_ERR(skb);
1105
+
1106
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->request_peer_stats_info_cmdid);
1107
+}
1108
+
1109
+static inline int
10521110 ath10k_wmi_force_fw_hang(struct ath10k *ar,
10531111 enum wmi_force_fw_hang_type type, u32 delay_ms)
10541112 {
....@@ -1371,6 +1429,24 @@
13711429 }
13721430
13731431 static inline int
1432
+ath10k_wmi_wow_config_pno(struct ath10k *ar, u32 vdev_id,
1433
+ struct wmi_pno_scan_req *pno_scan)
1434
+{
1435
+ struct sk_buff *skb;
1436
+ u32 cmd_id;
1437
+
1438
+ if (!ar->wmi.ops->gen_wow_config_pno)
1439
+ return -EOPNOTSUPP;
1440
+
1441
+ skb = ar->wmi.ops->gen_wow_config_pno(ar, vdev_id, pno_scan);
1442
+ if (IS_ERR(skb))
1443
+ return PTR_ERR(skb);
1444
+
1445
+ cmd_id = ar->wmi.cmd->network_list_offload_config_cmdid;
1446
+ return ath10k_wmi_cmd_send(ar, skb, cmd_id);
1447
+}
1448
+
1449
+static inline int
13741450 ath10k_wmi_update_fw_tdls_state(struct ath10k *ar, u32 vdev_id,
13751451 enum wmi_tdls_state state)
13761452 {
....@@ -1565,4 +1641,38 @@
15651641 ar->wmi.cmd->radar_found_cmdid);
15661642 }
15671643
1644
+static inline int
1645
+ath10k_wmi_pdev_bb_timing(struct ath10k *ar,
1646
+ const struct wmi_bb_timing_cfg_arg *arg)
1647
+{
1648
+ struct sk_buff *skb;
1649
+
1650
+ if (!ar->wmi.ops->gen_bb_timing)
1651
+ return -EOPNOTSUPP;
1652
+
1653
+ skb = ar->wmi.ops->gen_bb_timing(ar, arg);
1654
+
1655
+ if (IS_ERR(skb))
1656
+ return PTR_ERR(skb);
1657
+
1658
+ return ath10k_wmi_cmd_send(ar, skb,
1659
+ ar->wmi.cmd->set_bb_timing_cmdid);
1660
+}
1661
+
1662
+static inline int
1663
+ath10k_wmi_set_per_peer_per_tid_cfg(struct ath10k *ar,
1664
+ const struct wmi_per_peer_per_tid_cfg_arg *arg)
1665
+{
1666
+ struct sk_buff *skb;
1667
+
1668
+ if (!ar->wmi.ops->gen_per_peer_per_tid_cfg)
1669
+ return -EOPNOTSUPP;
1670
+
1671
+ skb = ar->wmi.ops->gen_per_peer_per_tid_cfg(ar, arg);
1672
+ if (IS_ERR(skb))
1673
+ return PTR_ERR(skb);
1674
+
1675
+ return ath10k_wmi_cmd_send(ar, skb,
1676
+ ar->wmi.cmd->per_peer_per_tid_config_cmdid);
1677
+}
15681678 #endif