| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: ISC */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2005-2011 Atheros Communications Inc. |
|---|
| 3 | 4 | * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. |
|---|
| 4 | 5 | * 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. |
|---|
| 17 | 6 | */ |
|---|
| 18 | 7 | |
|---|
| 19 | 8 | #ifndef _WMI_OPS_H_ |
|---|
| .. | .. |
|---|
| 33 | 22 | struct wmi_mgmt_rx_ev_arg *arg); |
|---|
| 34 | 23 | int (*pull_mgmt_tx_compl)(struct ath10k *ar, struct sk_buff *skb, |
|---|
| 35 | 24 | 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); |
|---|
| 36 | 28 | int (*pull_ch_info)(struct ath10k *ar, struct sk_buff *skb, |
|---|
| 37 | 29 | struct wmi_ch_info_ev_arg *arg); |
|---|
| 38 | 30 | int (*pull_vdev_start)(struct ath10k *ar, struct sk_buff *skb, |
|---|
| .. | .. |
|---|
| 66 | 58 | |
|---|
| 67 | 59 | struct sk_buff *(*gen_pdev_suspend)(struct ath10k *ar, u32 suspend_opt); |
|---|
| 68 | 60 | 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]); |
|---|
| 69 | 63 | struct sk_buff *(*gen_pdev_set_rd)(struct ath10k *ar, u16 rd, u16 rd2g, |
|---|
| 70 | 64 | u16 rd5g, u16 ctl2g, u16 ctl5g, |
|---|
| 71 | 65 | enum wmi_dfs_region dfs_reg); |
|---|
| .. | .. |
|---|
| 132 | 126 | struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar, |
|---|
| 133 | 127 | const struct wmi_wmm_params_all_arg *arg); |
|---|
| 134 | 128 | 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); |
|---|
| 135 | 136 | struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar, |
|---|
| 136 | 137 | enum wmi_force_fw_hang_type type, |
|---|
| 137 | 138 | u32 delay_ms); |
|---|
| .. | .. |
|---|
| 211 | 212 | u32 fw_feature_bitmap); |
|---|
| 212 | 213 | int (*get_vdev_subtype)(struct ath10k *ar, |
|---|
| 213 | 214 | 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); |
|---|
| 214 | 218 | struct sk_buff *(*gen_pdev_bss_chan_info_req) |
|---|
| 215 | 219 | (struct ath10k *ar, |
|---|
| 216 | 220 | enum wmi_bss_survey_req_type type); |
|---|
| 217 | 221 | struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value); |
|---|
| 218 | 222 | struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar, |
|---|
| 219 | 223 | 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); |
|---|
| 220 | 229 | |
|---|
| 221 | 230 | }; |
|---|
| 222 | 231 | |
|---|
| .. | .. |
|---|
| 272 | 281 | return -EOPNOTSUPP; |
|---|
| 273 | 282 | |
|---|
| 274 | 283 | 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); |
|---|
| 275 | 294 | } |
|---|
| 276 | 295 | |
|---|
| 277 | 296 | static inline int |
|---|
| .. | .. |
|---|
| 508 | 527 | |
|---|
| 509 | 528 | return ath10k_wmi_cmd_send(ar, skb, |
|---|
| 510 | 529 | 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); |
|---|
| 511 | 546 | } |
|---|
| 512 | 547 | |
|---|
| 513 | 548 | static inline int |
|---|
| .. | .. |
|---|
| 1049 | 1084 | } |
|---|
| 1050 | 1085 | |
|---|
| 1051 | 1086 | 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 |
|---|
| 1052 | 1110 | ath10k_wmi_force_fw_hang(struct ath10k *ar, |
|---|
| 1053 | 1111 | enum wmi_force_fw_hang_type type, u32 delay_ms) |
|---|
| 1054 | 1112 | { |
|---|
| .. | .. |
|---|
| 1371 | 1429 | } |
|---|
| 1372 | 1430 | |
|---|
| 1373 | 1431 | 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 |
|---|
| 1374 | 1450 | ath10k_wmi_update_fw_tdls_state(struct ath10k *ar, u32 vdev_id, |
|---|
| 1375 | 1451 | enum wmi_tdls_state state) |
|---|
| 1376 | 1452 | { |
|---|
| .. | .. |
|---|
| 1565 | 1641 | ar->wmi.cmd->radar_found_cmdid); |
|---|
| 1566 | 1642 | } |
|---|
| 1567 | 1643 | |
|---|
| 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 | +} |
|---|
| 1568 | 1678 | #endif |
|---|