forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireless/ath/ath10k/wmi-tlv.c
....@@ -1,30 +1,19 @@
1
+// SPDX-License-Identifier: ISC
12 /*
23 * Copyright (c) 2005-2011 Atheros Communications Inc.
34 * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
4
- * 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.
5
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
176 */
187 #include "core.h"
198 #include "debug.h"
209 #include "mac.h"
2110 #include "hw.h"
22
-#include "mac.h"
2311 #include "wmi.h"
2412 #include "wmi-ops.h"
2513 #include "wmi-tlv.h"
2614 #include "p2p.h"
2715 #include "testmode.h"
16
+#include <linux/bitfield.h>
2817
2918 /***************/
3019 /* TLV helpers */
....@@ -223,6 +212,101 @@
223212 return 0;
224213 }
225214
215
+static void ath10k_wmi_tlv_event_vdev_delete_resp(struct ath10k *ar,
216
+ struct sk_buff *skb)
217
+{
218
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_DELETE_RESP_EVENTID\n");
219
+ complete(&ar->vdev_delete_done);
220
+}
221
+
222
+static int ath10k_wmi_tlv_parse_peer_stats_info(struct ath10k *ar, u16 tag, u16 len,
223
+ const void *ptr, void *data)
224
+{
225
+ const struct wmi_tlv_peer_stats_info *stat = ptr;
226
+ struct ieee80211_sta *sta;
227
+ struct ath10k_sta *arsta;
228
+
229
+ if (tag != WMI_TLV_TAG_STRUCT_PEER_STATS_INFO)
230
+ return -EPROTO;
231
+
232
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
233
+ "wmi tlv stats peer addr %pMF rx rate code 0x%x bit rate %d kbps\n",
234
+ stat->peer_macaddr.addr,
235
+ __le32_to_cpu(stat->last_rx_rate_code),
236
+ __le32_to_cpu(stat->last_rx_bitrate_kbps));
237
+
238
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
239
+ "wmi tlv stats tx rate code 0x%x bit rate %d kbps\n",
240
+ __le32_to_cpu(stat->last_tx_rate_code),
241
+ __le32_to_cpu(stat->last_tx_bitrate_kbps));
242
+
243
+ rcu_read_lock();
244
+ sta = ieee80211_find_sta_by_ifaddr(ar->hw, stat->peer_macaddr.addr, NULL);
245
+ if (!sta) {
246
+ rcu_read_unlock();
247
+ ath10k_warn(ar, "not found station for peer stats\n");
248
+ return -EINVAL;
249
+ }
250
+
251
+ arsta = (struct ath10k_sta *)sta->drv_priv;
252
+ arsta->rx_rate_code = __le32_to_cpu(stat->last_rx_rate_code);
253
+ arsta->rx_bitrate_kbps = __le32_to_cpu(stat->last_rx_bitrate_kbps);
254
+ arsta->tx_rate_code = __le32_to_cpu(stat->last_tx_rate_code);
255
+ arsta->tx_bitrate_kbps = __le32_to_cpu(stat->last_tx_bitrate_kbps);
256
+ rcu_read_unlock();
257
+
258
+ return 0;
259
+}
260
+
261
+static int ath10k_wmi_tlv_op_pull_peer_stats_info(struct ath10k *ar,
262
+ struct sk_buff *skb)
263
+{
264
+ const void **tb;
265
+ const struct wmi_tlv_peer_stats_info_ev *ev;
266
+ const void *data;
267
+ u32 num_peer_stats;
268
+ int ret;
269
+
270
+ tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
271
+ if (IS_ERR(tb)) {
272
+ ret = PTR_ERR(tb);
273
+ ath10k_warn(ar, "failed to parse tlv: %d\n", ret);
274
+ return ret;
275
+ }
276
+
277
+ ev = tb[WMI_TLV_TAG_STRUCT_PEER_STATS_INFO_EVENT];
278
+ data = tb[WMI_TLV_TAG_ARRAY_STRUCT];
279
+
280
+ if (!ev || !data) {
281
+ kfree(tb);
282
+ return -EPROTO;
283
+ }
284
+
285
+ num_peer_stats = __le32_to_cpu(ev->num_peers);
286
+
287
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
288
+ "wmi tlv peer stats info update peer vdev id %d peers %i more data %d\n",
289
+ __le32_to_cpu(ev->vdev_id),
290
+ num_peer_stats,
291
+ __le32_to_cpu(ev->more_data));
292
+
293
+ ret = ath10k_wmi_tlv_iter(ar, data, ath10k_wmi_tlv_len(data),
294
+ ath10k_wmi_tlv_parse_peer_stats_info, NULL);
295
+ if (ret)
296
+ ath10k_warn(ar, "failed to parse stats info tlv: %d\n", ret);
297
+
298
+ kfree(tb);
299
+ return 0;
300
+}
301
+
302
+static void ath10k_wmi_tlv_event_peer_stats_info(struct ath10k *ar,
303
+ struct sk_buff *skb)
304
+{
305
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_PEER_STATS_INFO_EVENTID\n");
306
+ ath10k_wmi_tlv_op_pull_peer_stats_info(ar, skb);
307
+ complete(&ar->peer_stats_info_complete);
308
+}
309
+
226310 static int ath10k_wmi_tlv_event_diag_data(struct ath10k *ar,
227311 struct sk_buff *skb)
228312 {
....@@ -413,6 +497,49 @@
413497 return 0;
414498 }
415499
500
+static void ath10k_wmi_tlv_event_rfkill_state_change(struct ath10k *ar,
501
+ struct sk_buff *skb)
502
+{
503
+ const struct wmi_tlv_rfkill_state_change_ev *ev;
504
+ const void **tb;
505
+ bool radio;
506
+ int ret;
507
+
508
+ tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
509
+ if (IS_ERR(tb)) {
510
+ ret = PTR_ERR(tb);
511
+ ath10k_warn(ar,
512
+ "failed to parse rfkill state change event: %d\n",
513
+ ret);
514
+ return;
515
+ }
516
+
517
+ ev = tb[WMI_TLV_TAG_STRUCT_RFKILL_EVENT];
518
+ if (!ev) {
519
+ kfree(tb);
520
+ return;
521
+ }
522
+
523
+ ath10k_dbg(ar, ATH10K_DBG_MAC,
524
+ "wmi tlv rfkill state change gpio %d type %d radio_state %d\n",
525
+ __le32_to_cpu(ev->gpio_pin_num),
526
+ __le32_to_cpu(ev->int_type),
527
+ __le32_to_cpu(ev->radio_state));
528
+
529
+ radio = (__le32_to_cpu(ev->radio_state) == WMI_TLV_RFKILL_RADIO_STATE_ON);
530
+
531
+ spin_lock_bh(&ar->data_lock);
532
+
533
+ if (!radio)
534
+ ar->hw_rfkill_on = true;
535
+
536
+ spin_unlock_bh(&ar->data_lock);
537
+
538
+ /* notify cfg80211 radio state change */
539
+ ath10k_mac_rfkill_enable_radio(ar, radio);
540
+ wiphy_rfkill_set_hw_state(ar->hw->wiphy, !radio);
541
+}
542
+
416543 static int ath10k_wmi_tlv_event_temperature(struct ath10k *ar,
417544 struct sk_buff *skb)
418545 {
....@@ -475,6 +602,24 @@
475602 kfree(tb);
476603 }
477604
605
+static int ath10k_wmi_tlv_event_peer_delete_resp(struct ath10k *ar,
606
+ struct sk_buff *skb)
607
+{
608
+ struct wmi_peer_delete_resp_ev_arg *arg;
609
+ struct wmi_tlv *tlv_hdr;
610
+
611
+ tlv_hdr = (struct wmi_tlv *)skb->data;
612
+ arg = (struct wmi_peer_delete_resp_ev_arg *)tlv_hdr->value;
613
+
614
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "vdev id %d", arg->vdev_id);
615
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "peer mac addr %pM", &arg->peer_addr);
616
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv peer delete response\n");
617
+
618
+ complete(&ar->peer_delete_done);
619
+
620
+ return 0;
621
+}
622
+
478623 /***********/
479624 /* TLV ops */
480625 /***********/
....@@ -525,11 +670,17 @@
525670 case WMI_TLV_UPDATE_STATS_EVENTID:
526671 ath10k_wmi_event_update_stats(ar, skb);
527672 break;
673
+ case WMI_TLV_PEER_STATS_INFO_EVENTID:
674
+ ath10k_wmi_tlv_event_peer_stats_info(ar, skb);
675
+ break;
528676 case WMI_TLV_VDEV_START_RESP_EVENTID:
529677 ath10k_wmi_event_vdev_start_resp(ar, skb);
530678 break;
531679 case WMI_TLV_VDEV_STOPPED_EVENTID:
532680 ath10k_wmi_event_vdev_stopped(ar, skb);
681
+ break;
682
+ case WMI_TLV_VDEV_DELETE_RESP_EVENTID:
683
+ ath10k_wmi_tlv_event_vdev_delete_resp(ar, skb);
533684 break;
534685 case WMI_TLV_PEER_STA_KICKOUT_EVENTID:
535686 ath10k_wmi_event_peer_sta_kickout(ar, skb);
....@@ -618,17 +769,26 @@
618769 case WMI_TLV_TX_PAUSE_EVENTID:
619770 ath10k_wmi_tlv_event_tx_pause(ar, skb);
620771 break;
772
+ case WMI_TLV_RFKILL_STATE_CHANGE_EVENTID:
773
+ ath10k_wmi_tlv_event_rfkill_state_change(ar, skb);
774
+ break;
621775 case WMI_TLV_PDEV_TEMPERATURE_EVENTID:
622776 ath10k_wmi_tlv_event_temperature(ar, skb);
623777 break;
624778 case WMI_TLV_TDLS_PEER_EVENTID:
625779 ath10k_wmi_event_tdls_peer(ar, skb);
626780 break;
781
+ case WMI_TLV_PEER_DELETE_RESP_EVENTID:
782
+ ath10k_wmi_tlv_event_peer_delete_resp(ar, skb);
783
+ break;
627784 case WMI_TLV_MGMT_TX_COMPLETION_EVENTID:
628785 ath10k_wmi_event_mgmt_tx_compl(ar, skb);
629786 break;
787
+ case WMI_TLV_MGMT_TX_BUNDLE_COMPLETION_EVENTID:
788
+ ath10k_wmi_event_mgmt_tx_bundle_compl(ar, skb);
789
+ break;
630790 default:
631
- ath10k_warn(ar, "Unknown eventid: %d\n", id);
791
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "Unknown eventid: %d\n", id);
632792 break;
633793 }
634794
....@@ -688,8 +848,85 @@
688848 arg->desc_id = ev->desc_id;
689849 arg->status = ev->status;
690850 arg->pdev_id = ev->pdev_id;
851
+ arg->ppdu_id = ev->ppdu_id;
852
+
853
+ if (test_bit(WMI_SERVICE_TX_DATA_ACK_RSSI, ar->wmi.svc_map))
854
+ arg->ack_rssi = ev->ack_rssi;
691855
692856 kfree(tb);
857
+ return 0;
858
+}
859
+
860
+struct wmi_tlv_tx_bundle_compl_parse {
861
+ const __le32 *num_reports;
862
+ const __le32 *desc_ids;
863
+ const __le32 *status;
864
+ const __le32 *ppdu_ids;
865
+ const __le32 *ack_rssi;
866
+ bool desc_ids_done;
867
+ bool status_done;
868
+ bool ppdu_ids_done;
869
+ bool ack_rssi_done;
870
+};
871
+
872
+static int
873
+ath10k_wmi_tlv_mgmt_tx_bundle_compl_parse(struct ath10k *ar, u16 tag, u16 len,
874
+ const void *ptr, void *data)
875
+{
876
+ struct wmi_tlv_tx_bundle_compl_parse *bundle_tx_compl = data;
877
+
878
+ switch (tag) {
879
+ case WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_BUNDLE_EVENT:
880
+ bundle_tx_compl->num_reports = ptr;
881
+ break;
882
+ case WMI_TLV_TAG_ARRAY_UINT32:
883
+ if (!bundle_tx_compl->desc_ids_done) {
884
+ bundle_tx_compl->desc_ids_done = true;
885
+ bundle_tx_compl->desc_ids = ptr;
886
+ } else if (!bundle_tx_compl->status_done) {
887
+ bundle_tx_compl->status_done = true;
888
+ bundle_tx_compl->status = ptr;
889
+ } else if (!bundle_tx_compl->ppdu_ids_done) {
890
+ bundle_tx_compl->ppdu_ids_done = true;
891
+ bundle_tx_compl->ppdu_ids = ptr;
892
+ } else if (!bundle_tx_compl->ack_rssi_done) {
893
+ bundle_tx_compl->ack_rssi_done = true;
894
+ bundle_tx_compl->ack_rssi = ptr;
895
+ }
896
+ break;
897
+ default:
898
+ break;
899
+ }
900
+ return 0;
901
+}
902
+
903
+static int ath10k_wmi_tlv_op_pull_mgmt_tx_bundle_compl_ev(
904
+ struct ath10k *ar, struct sk_buff *skb,
905
+ struct wmi_tlv_mgmt_tx_bundle_compl_ev_arg *arg)
906
+{
907
+ struct wmi_tlv_tx_bundle_compl_parse bundle_tx_compl = { };
908
+ int ret;
909
+
910
+ ret = ath10k_wmi_tlv_iter(ar, skb->data, skb->len,
911
+ ath10k_wmi_tlv_mgmt_tx_bundle_compl_parse,
912
+ &bundle_tx_compl);
913
+ if (ret) {
914
+ ath10k_warn(ar, "failed to parse tlv: %d\n", ret);
915
+ return ret;
916
+ }
917
+
918
+ if (!bundle_tx_compl.num_reports || !bundle_tx_compl.desc_ids ||
919
+ !bundle_tx_compl.status)
920
+ return -EPROTO;
921
+
922
+ arg->num_reports = *bundle_tx_compl.num_reports;
923
+ arg->desc_ids = bundle_tx_compl.desc_ids;
924
+ arg->status = bundle_tx_compl.status;
925
+ arg->ppdu_ids = bundle_tx_compl.ppdu_ids;
926
+
927
+ if (test_bit(WMI_SERVICE_TX_DATA_ACK_RSSI, ar->wmi.svc_map))
928
+ arg->ack_rssi = bundle_tx_compl.ack_rssi;
929
+
693930 return 0;
694931 }
695932
....@@ -701,7 +938,7 @@
701938 const struct wmi_tlv_mgmt_rx_ev *ev;
702939 const u8 *frame;
703940 u32 msdu_len;
704
- int ret;
941
+ int ret, i;
705942
706943 tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
707944 if (IS_ERR(tb)) {
....@@ -725,6 +962,9 @@
725962 arg->phy_mode = ev->phy_mode;
726963 arg->rate = ev->rate;
727964
965
+ for (i = 0; i < ARRAY_SIZE(ev->rssi); i++)
966
+ arg->rssi[i] = ev->rssi[i];
967
+
728968 msdu_len = __le32_to_cpu(arg->buf_len);
729969
730970 if (skb->len < (frame - skb->data) + msdu_len) {
....@@ -747,7 +987,7 @@
747987 struct wmi_ch_info_ev_arg *arg)
748988 {
749989 const void **tb;
750
- const struct wmi_chan_info_event *ev;
990
+ const struct wmi_tlv_chan_info_event *ev;
751991 int ret;
752992
753993 tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
....@@ -769,6 +1009,9 @@
7691009 arg->noise_floor = ev->noise_floor;
7701010 arg->rx_clear_count = ev->rx_clear_count;
7711011 arg->cycle_count = ev->cycle_count;
1012
+ if (test_bit(ATH10K_FW_FEATURE_SINGLE_CHAN_INFO_PER_CHANNEL,
1013
+ ar->running_fw->fw_file.fw_features))
1014
+ arg->mac_clk_mhz = ev->mac_clk_mhz;
7721015
7731016 kfree(tb);
7741017 return 0;
....@@ -1104,17 +1347,21 @@
11041347 arg->max_tx_power = ev->hw_max_tx_power;
11051348 arg->ht_cap = ev->ht_cap_info;
11061349 arg->vht_cap = ev->vht_cap_info;
1350
+ arg->vht_supp_mcs = ev->vht_supp_mcs;
11071351 arg->sw_ver0 = ev->abi.abi_ver0;
11081352 arg->sw_ver1 = ev->abi.abi_ver1;
11091353 arg->fw_build = ev->fw_build_vers;
11101354 arg->phy_capab = ev->phy_capability;
11111355 arg->num_rf_chains = ev->num_rf_chains;
11121356 arg->eeprom_rd = reg->eeprom_rd;
1357
+ arg->low_2ghz_chan = reg->low_2ghz_chan;
1358
+ arg->high_2ghz_chan = reg->high_2ghz_chan;
11131359 arg->low_5ghz_chan = reg->low_5ghz_chan;
11141360 arg->high_5ghz_chan = reg->high_5ghz_chan;
11151361 arg->num_mem_reqs = ev->num_mem_reqs;
11161362 arg->service_map = svc_bmap;
11171363 arg->service_map_len = ath10k_wmi_tlv_len(svc_bmap);
1364
+ arg->sys_cap_info = ev->sys_cap_info;
11181365
11191366 ret = ath10k_wmi_tlv_iter(ar, mem_reqs, ath10k_wmi_tlv_len(mem_reqs),
11201367 ath10k_wmi_tlv_parse_mem_reqs, arg);
....@@ -1233,6 +1480,7 @@
12331480 {
12341481 const void **tb;
12351482 const struct wmi_tlv_stats_ev *ev;
1483
+ u32 num_peer_stats_extd;
12361484 const void *data;
12371485 u32 num_pdev_stats;
12381486 u32 num_vdev_stats;
....@@ -1240,6 +1488,7 @@
12401488 u32 num_bcnflt_stats;
12411489 u32 num_chan_stats;
12421490 size_t data_len;
1491
+ u32 stats_id;
12431492 int ret;
12441493 int i;
12451494
....@@ -1264,11 +1513,13 @@
12641513 num_peer_stats = __le32_to_cpu(ev->num_peer_stats);
12651514 num_bcnflt_stats = __le32_to_cpu(ev->num_bcnflt_stats);
12661515 num_chan_stats = __le32_to_cpu(ev->num_chan_stats);
1516
+ stats_id = __le32_to_cpu(ev->stats_id);
1517
+ num_peer_stats_extd = __le32_to_cpu(ev->num_peer_stats_extd);
12671518
12681519 ath10k_dbg(ar, ATH10K_DBG_WMI,
1269
- "wmi tlv stats update pdev %i vdev %i peer %i bcnflt %i chan %i\n",
1520
+ "wmi tlv stats update pdev %i vdev %i peer %i bcnflt %i chan %i peer_extd %i\n",
12701521 num_pdev_stats, num_vdev_stats, num_peer_stats,
1271
- num_bcnflt_stats, num_chan_stats);
1522
+ num_bcnflt_stats, num_chan_stats, num_peer_stats_extd);
12721523
12731524 for (i = 0; i < num_pdev_stats; i++) {
12741525 const struct wmi_pdev_stats *src;
....@@ -1333,6 +1584,28 @@
13331584
13341585 ath10k_wmi_pull_peer_stats(&src->old, dst);
13351586 dst->peer_rx_rate = __le32_to_cpu(src->peer_rx_rate);
1587
+
1588
+ if (stats_id & WMI_TLV_STAT_PEER_EXTD) {
1589
+ const struct wmi_tlv_peer_stats_extd *extd;
1590
+ unsigned long rx_duration_high;
1591
+
1592
+ extd = data + sizeof(*src) * (num_peer_stats - i - 1)
1593
+ + sizeof(*extd) * i;
1594
+
1595
+ dst->rx_duration = __le32_to_cpu(extd->rx_duration);
1596
+ rx_duration_high = __le32_to_cpu
1597
+ (extd->rx_duration_high);
1598
+
1599
+ if (test_bit(WMI_TLV_PEER_RX_DURATION_HIGH_VALID_BIT,
1600
+ &rx_duration_high)) {
1601
+ rx_duration_high =
1602
+ FIELD_GET(WMI_TLV_PEER_RX_DURATION_HIGH_MASK,
1603
+ rx_duration_high);
1604
+ dst->rx_duration |= (u64)rx_duration_high <<
1605
+ WMI_TLV_PEER_RX_DURATION_SHIFT;
1606
+ }
1607
+ }
1608
+
13361609 list_add_tail(&dst->list, &stats->peers);
13371610 }
13381611
....@@ -1520,8 +1793,48 @@
15201793 cmd->param_id = __cpu_to_le32(param_id);
15211794 cmd->param_value = __cpu_to_le32(param_value);
15221795
1523
- ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv pdev set param\n");
1796
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv pdev set param %d value 0x%x\n",
1797
+ param_id, param_value);
15241798 return skb;
1799
+}
1800
+
1801
+static void
1802
+ath10k_wmi_tlv_put_host_mem_chunks(struct ath10k *ar, void *host_mem_chunks)
1803
+{
1804
+ struct host_memory_chunk_tlv *chunk;
1805
+ struct wmi_tlv *tlv;
1806
+ dma_addr_t paddr;
1807
+ int i;
1808
+ __le16 tlv_len, tlv_tag;
1809
+
1810
+ tlv_tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_WLAN_HOST_MEMORY_CHUNK);
1811
+ tlv_len = __cpu_to_le16(sizeof(*chunk));
1812
+ for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
1813
+ tlv = host_mem_chunks;
1814
+ tlv->tag = tlv_tag;
1815
+ tlv->len = tlv_len;
1816
+ chunk = (void *)tlv->value;
1817
+
1818
+ chunk->ptr = __cpu_to_le32(ar->wmi.mem_chunks[i].paddr);
1819
+ chunk->size = __cpu_to_le32(ar->wmi.mem_chunks[i].len);
1820
+ chunk->req_id = __cpu_to_le32(ar->wmi.mem_chunks[i].req_id);
1821
+
1822
+ if (test_bit(WMI_SERVICE_SUPPORT_EXTEND_ADDRESS,
1823
+ ar->wmi.svc_map)) {
1824
+ paddr = ar->wmi.mem_chunks[i].paddr;
1825
+ chunk->ptr_high = __cpu_to_le32(upper_32_bits(paddr));
1826
+ }
1827
+
1828
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
1829
+ "wmi-tlv chunk %d len %d, addr 0x%llx, id 0x%x\n",
1830
+ i,
1831
+ ar->wmi.mem_chunks[i].len,
1832
+ (unsigned long long)ar->wmi.mem_chunks[i].paddr,
1833
+ ar->wmi.mem_chunks[i].req_id);
1834
+
1835
+ host_mem_chunks += sizeof(*tlv);
1836
+ host_mem_chunks += sizeof(*chunk);
1837
+ }
15251838 }
15261839
15271840 static struct sk_buff *ath10k_wmi_tlv_op_gen_init(struct ath10k *ar)
....@@ -1530,11 +1843,12 @@
15301843 struct wmi_tlv *tlv;
15311844 struct wmi_tlv_init_cmd *cmd;
15321845 struct wmi_tlv_resource_config *cfg;
1533
- struct wmi_host_mem_chunks *chunks;
1846
+ void *chunks;
15341847 size_t len, chunks_len;
15351848 void *ptr;
15361849
1537
- chunks_len = ar->wmi.num_mem_chunks * sizeof(struct host_memory_chunk);
1850
+ chunks_len = ar->wmi.num_mem_chunks *
1851
+ (sizeof(struct host_memory_chunk_tlv) + sizeof(*tlv));
15381852 len = (sizeof(*tlv) + sizeof(*cmd)) +
15391853 (sizeof(*tlv) + sizeof(*cfg)) +
15401854 (sizeof(*tlv) + chunks_len);
....@@ -1577,7 +1891,10 @@
15771891
15781892 cfg->num_vdevs = __cpu_to_le32(TARGET_TLV_NUM_VDEVS);
15791893
1580
- cfg->num_peers = __cpu_to_le32(ar->hw_params.num_peers);
1894
+ if (ar->hw_params.num_peers)
1895
+ cfg->num_peers = __cpu_to_le32(ar->hw_params.num_peers);
1896
+ else
1897
+ cfg->num_peers = __cpu_to_le32(TARGET_TLV_NUM_PEERS);
15811898 cfg->ast_skid_limit = __cpu_to_le32(ar->hw_params.ast_skid_limit);
15821899 cfg->num_wds_entries = __cpu_to_le32(ar->hw_params.num_wds_entries);
15831900
....@@ -1590,7 +1907,10 @@
15901907 }
15911908
15921909 cfg->num_peer_keys = __cpu_to_le32(2);
1593
- cfg->num_tids = __cpu_to_le32(TARGET_TLV_NUM_TIDS);
1910
+ if (ar->hw_params.num_peers)
1911
+ cfg->num_tids = __cpu_to_le32(ar->hw_params.num_peers * 2);
1912
+ else
1913
+ cfg->num_tids = __cpu_to_le32(TARGET_TLV_NUM_TIDS);
15941914 cfg->tx_chain_mask = __cpu_to_le32(0x7);
15951915 cfg->rx_chain_mask = __cpu_to_le32(0x7);
15961916 cfg->rx_timeout_pri[0] = __cpu_to_le32(0x64);
....@@ -1611,7 +1931,7 @@
16111931 cfg->rx_skip_defrag_timeout_dup_detection_check = __cpu_to_le32(0);
16121932 cfg->vow_config = __cpu_to_le32(0);
16131933 cfg->gtk_offload_max_vdev = __cpu_to_le32(2);
1614
- cfg->num_msdu_desc = __cpu_to_le32(TARGET_TLV_NUM_MSDU_DESC);
1934
+ cfg->num_msdu_desc = __cpu_to_le32(ar->htt.max_num_pending_tx);
16151935 cfg->max_frag_entries = __cpu_to_le32(2);
16161936 cfg->num_tdls_vdevs = __cpu_to_le32(TARGET_TLV_NUM_TDLS_VDEVS);
16171937 cfg->num_tdls_conn_table_entries = __cpu_to_le32(0x20);
....@@ -1626,9 +1946,12 @@
16261946 cfg->num_ocb_vdevs = __cpu_to_le32(0);
16271947 cfg->num_ocb_channels = __cpu_to_le32(0);
16281948 cfg->num_ocb_schedules = __cpu_to_le32(0);
1629
- cfg->host_capab = __cpu_to_le32(0);
1949
+ cfg->host_capab = __cpu_to_le32(WMI_TLV_FLAG_MGMT_BUNDLE_TX_COMPL);
16301950
1631
- ath10k_wmi_put_host_mem_chunks(ar, chunks);
1951
+ if (test_bit(WMI_SERVICE_TX_DATA_ACK_RSSI, ar->wmi.svc_map))
1952
+ cfg->host_capab |= __cpu_to_le32(WMI_RSRC_CFG_FLAG_TX_ACK_RSSI);
1953
+
1954
+ ath10k_wmi_tlv_put_host_mem_chunks(ar, chunks);
16321955
16331956 ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv init\n");
16341957 return skb;
....@@ -1772,6 +2095,28 @@
17722095 return skb;
17732096 }
17742097
2098
+static int ath10k_wmi_tlv_op_get_vdev_subtype(struct ath10k *ar,
2099
+ enum wmi_vdev_subtype subtype)
2100
+{
2101
+ switch (subtype) {
2102
+ case WMI_VDEV_SUBTYPE_NONE:
2103
+ return WMI_TLV_VDEV_SUBTYPE_NONE;
2104
+ case WMI_VDEV_SUBTYPE_P2P_DEVICE:
2105
+ return WMI_TLV_VDEV_SUBTYPE_P2P_DEV;
2106
+ case WMI_VDEV_SUBTYPE_P2P_CLIENT:
2107
+ return WMI_TLV_VDEV_SUBTYPE_P2P_CLI;
2108
+ case WMI_VDEV_SUBTYPE_P2P_GO:
2109
+ return WMI_TLV_VDEV_SUBTYPE_P2P_GO;
2110
+ case WMI_VDEV_SUBTYPE_PROXY_STA:
2111
+ return WMI_TLV_VDEV_SUBTYPE_PROXY_STA;
2112
+ case WMI_VDEV_SUBTYPE_MESH_11S:
2113
+ return WMI_TLV_VDEV_SUBTYPE_MESH_11S;
2114
+ case WMI_VDEV_SUBTYPE_MESH_NON_11S:
2115
+ return -ENOTSUPP;
2116
+ }
2117
+ return -ENOTSUPP;
2118
+}
2119
+
17752120 static struct sk_buff *
17762121 ath10k_wmi_tlv_op_gen_vdev_create(struct ath10k *ar,
17772122 u32 vdev_id,
....@@ -1877,7 +2222,7 @@
18772222 tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_CHANNEL);
18782223 tlv->len = __cpu_to_le16(sizeof(*ch));
18792224 ch = (void *)tlv->value;
1880
- ath10k_wmi_put_wmi_channel(ch, &arg->channel);
2225
+ ath10k_wmi_put_wmi_channel(ar, ch, &arg->channel);
18812226
18822227 ptr += sizeof(*tlv);
18832228 ptr += sizeof(*ch);
....@@ -1984,7 +2329,8 @@
19842329 cmd->param_id = __cpu_to_le32(param_id);
19852330 cmd->param_value = __cpu_to_le32(param_value);
19862331
1987
- ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv vdev set param\n");
2332
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv vdev %d set param %d value 0x%x\n",
2333
+ vdev_id, param_id, param_value);
19882334 return skb;
19892335 }
19902336
....@@ -1998,9 +2344,11 @@
19982344 size_t len;
19992345 void *ptr;
20002346
2001
- if (arg->key_cipher == WMI_CIPHER_NONE && arg->key_data != NULL)
2347
+ if (arg->key_cipher == ar->wmi_key_cipher[WMI_CIPHER_NONE] &&
2348
+ arg->key_data)
20022349 return ERR_PTR(-EINVAL);
2003
- if (arg->key_cipher != WMI_CIPHER_NONE && arg->key_data == NULL)
2350
+ if (arg->key_cipher != ar->wmi_key_cipher[WMI_CIPHER_NONE] &&
2351
+ !arg->key_data)
20042352 return ERR_PTR(-EINVAL);
20052353
20062354 len = sizeof(*tlv) + sizeof(*cmd) +
....@@ -2298,7 +2646,9 @@
22982646 cmd->param_value = __cpu_to_le32(param_value);
22992647 ether_addr_copy(cmd->peer_macaddr.addr, peer_addr);
23002648
2301
- ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv peer set param\n");
2649
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
2650
+ "wmi tlv vdev %d peer %pM set param %d value 0x%x\n",
2651
+ vdev_id, peer_addr, param_id, param_value);
23022652 return skb;
23032653 }
23042654
....@@ -2512,7 +2862,7 @@
25122862 tlv->len = __cpu_to_le16(sizeof(*ci));
25132863 ci = (void *)tlv->value;
25142864
2515
- ath10k_wmi_put_wmi_channel(ci, ch);
2865
+ ath10k_wmi_put_wmi_channel(ar, ci, ch);
25162866
25172867 chans += sizeof(*tlv);
25182868 chans += sizeof(*ci);
....@@ -2646,6 +2996,36 @@
26462996 return skb;
26472997 }
26482998
2999
+static struct sk_buff *
3000
+ath10k_wmi_tlv_op_gen_request_peer_stats_info(struct ath10k *ar,
3001
+ u32 vdev_id,
3002
+ enum wmi_peer_stats_info_request_type type,
3003
+ u8 *addr,
3004
+ u32 reset)
3005
+{
3006
+ struct wmi_tlv_request_peer_stats_info *cmd;
3007
+ struct wmi_tlv *tlv;
3008
+ struct sk_buff *skb;
3009
+
3010
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*tlv) + sizeof(*cmd));
3011
+ if (!skb)
3012
+ return ERR_PTR(-ENOMEM);
3013
+
3014
+ tlv = (void *)skb->data;
3015
+ tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_REQUEST_PEER_STATS_INFO_CMD);
3016
+ tlv->len = __cpu_to_le16(sizeof(*cmd));
3017
+ cmd = (void *)tlv->value;
3018
+ cmd->vdev_id = __cpu_to_le32(vdev_id);
3019
+ cmd->request_type = __cpu_to_le32(type);
3020
+
3021
+ if (type == WMI_REQUEST_ONE_PEER_STATS_INFO)
3022
+ ether_addr_copy(cmd->peer_macaddr.addr, addr);
3023
+
3024
+ cmd->reset_after_request = __cpu_to_le32(reset);
3025
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv request peer stats info\n");
3026
+ return skb;
3027
+}
3028
+
26493029 static int
26503030 ath10k_wmi_tlv_op_cleanup_mgmt_tx_send(struct ath10k *ar,
26513031 struct sk_buff *msdu)
....@@ -2704,7 +3084,9 @@
27043084 arvif = (void *)cb->vif->drv_priv;
27053085 vdev_id = arvif->vdev_id;
27063086
2707
- if (WARN_ON_ONCE(!ieee80211_is_mgmt(hdr->frame_control)))
3087
+ if (WARN_ON_ONCE(!ieee80211_is_mgmt(hdr->frame_control) &&
3088
+ (!(ieee80211_is_nullfunc(hdr->frame_control) ||
3089
+ ieee80211_is_qos_nullfunc(hdr->frame_control)))))
27083090 return ERR_PTR(-EINVAL);
27093091
27103092 len = sizeof(*cmd) + 2 * sizeof(*tlv);
....@@ -3211,7 +3593,7 @@
32113593 tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_CHANNEL);
32123594 tlv->len = __cpu_to_le16(sizeof(*chan));
32133595 chan = (void *)tlv->value;
3214
- ath10k_wmi_put_wmi_channel(chan, &chan_arg[i]);
3596
+ ath10k_wmi_put_wmi_channel(ar, chan, &chan_arg[i]);
32153597
32163598 ptr += sizeof(*tlv);
32173599 ptr += sizeof(*chan);
....@@ -3273,6 +3655,8 @@
32733655 cmd = (void *)tlv->value;
32743656
32753657 cmd->enable = __cpu_to_le32(1);
3658
+ if (!ar->bus_param.link_can_suspend)
3659
+ cmd->pause_iface_config = __cpu_to_le32(WOW_IFACE_PAUSE_DISABLED);
32763660
32773661 ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv wow enable\n");
32783662 return skb;
....@@ -3456,6 +3840,192 @@
34563840 ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv wow del pattern vdev_id %d pattern_id %d\n",
34573841 vdev_id, pattern_id);
34583842 return skb;
3843
+}
3844
+
3845
+/* Request FW to start PNO operation */
3846
+static struct sk_buff *
3847
+ath10k_wmi_tlv_op_gen_config_pno_start(struct ath10k *ar,
3848
+ u32 vdev_id,
3849
+ struct wmi_pno_scan_req *pno)
3850
+{
3851
+ struct nlo_configured_parameters *nlo_list;
3852
+ struct wmi_tlv_wow_nlo_config_cmd *cmd;
3853
+ struct wmi_tlv *tlv;
3854
+ struct sk_buff *skb;
3855
+ __le32 *channel_list;
3856
+ u16 tlv_len;
3857
+ size_t len;
3858
+ void *ptr;
3859
+ u32 i;
3860
+
3861
+ len = sizeof(*tlv) + sizeof(*cmd) +
3862
+ sizeof(*tlv) +
3863
+ /* TLV place holder for array of structures
3864
+ * nlo_configured_parameters(nlo_list)
3865
+ */
3866
+ sizeof(*tlv);
3867
+ /* TLV place holder for array of uint32 channel_list */
3868
+
3869
+ len += sizeof(u32) * min_t(u8, pno->a_networks[0].channel_count,
3870
+ WMI_NLO_MAX_CHAN);
3871
+ len += sizeof(struct nlo_configured_parameters) *
3872
+ min_t(u8, pno->uc_networks_count, WMI_NLO_MAX_SSIDS);
3873
+
3874
+ skb = ath10k_wmi_alloc_skb(ar, len);
3875
+ if (!skb)
3876
+ return ERR_PTR(-ENOMEM);
3877
+
3878
+ ptr = (void *)skb->data;
3879
+ tlv = ptr;
3880
+ tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_NLO_CONFIG_CMD);
3881
+ tlv->len = __cpu_to_le16(sizeof(*cmd));
3882
+ cmd = (void *)tlv->value;
3883
+
3884
+ /* wmi_tlv_wow_nlo_config_cmd parameters*/
3885
+ cmd->vdev_id = __cpu_to_le32(pno->vdev_id);
3886
+ cmd->flags = __cpu_to_le32(WMI_NLO_CONFIG_START | WMI_NLO_CONFIG_SSID_HIDE_EN);
3887
+
3888
+ /* current FW does not support min-max range for dwell time */
3889
+ cmd->active_dwell_time = __cpu_to_le32(pno->active_max_time);
3890
+ cmd->passive_dwell_time = __cpu_to_le32(pno->passive_max_time);
3891
+
3892
+ if (pno->do_passive_scan)
3893
+ cmd->flags |= __cpu_to_le32(WMI_NLO_CONFIG_SCAN_PASSIVE);
3894
+
3895
+ /* copy scan interval */
3896
+ cmd->fast_scan_period = __cpu_to_le32(pno->fast_scan_period);
3897
+ cmd->slow_scan_period = __cpu_to_le32(pno->slow_scan_period);
3898
+ cmd->fast_scan_max_cycles = __cpu_to_le32(pno->fast_scan_max_cycles);
3899
+ cmd->delay_start_time = __cpu_to_le32(pno->delay_start_time);
3900
+
3901
+ if (pno->enable_pno_scan_randomization) {
3902
+ cmd->flags |= __cpu_to_le32(WMI_NLO_CONFIG_SPOOFED_MAC_IN_PROBE_REQ |
3903
+ WMI_NLO_CONFIG_RANDOM_SEQ_NO_IN_PROBE_REQ);
3904
+ ether_addr_copy(cmd->mac_addr.addr, pno->mac_addr);
3905
+ ether_addr_copy(cmd->mac_mask.addr, pno->mac_addr_mask);
3906
+ }
3907
+
3908
+ ptr += sizeof(*tlv);
3909
+ ptr += sizeof(*cmd);
3910
+
3911
+ /* nlo_configured_parameters(nlo_list) */
3912
+ cmd->no_of_ssids = __cpu_to_le32(min_t(u8, pno->uc_networks_count,
3913
+ WMI_NLO_MAX_SSIDS));
3914
+ tlv_len = __le32_to_cpu(cmd->no_of_ssids) *
3915
+ sizeof(struct nlo_configured_parameters);
3916
+
3917
+ tlv = ptr;
3918
+ tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_STRUCT);
3919
+ tlv->len = __cpu_to_le16(tlv_len);
3920
+
3921
+ ptr += sizeof(*tlv);
3922
+ nlo_list = ptr;
3923
+ for (i = 0; i < __le32_to_cpu(cmd->no_of_ssids); i++) {
3924
+ tlv = (struct wmi_tlv *)(&nlo_list[i].tlv_header);
3925
+ tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_BYTE);
3926
+ tlv->len = __cpu_to_le16(sizeof(struct nlo_configured_parameters) -
3927
+ sizeof(*tlv));
3928
+
3929
+ /* copy ssid and it's length */
3930
+ nlo_list[i].ssid.valid = __cpu_to_le32(true);
3931
+ nlo_list[i].ssid.ssid.ssid_len = pno->a_networks[i].ssid.ssid_len;
3932
+ memcpy(nlo_list[i].ssid.ssid.ssid,
3933
+ pno->a_networks[i].ssid.ssid,
3934
+ __le32_to_cpu(nlo_list[i].ssid.ssid.ssid_len));
3935
+
3936
+ /* copy rssi threshold */
3937
+ if (pno->a_networks[i].rssi_threshold &&
3938
+ pno->a_networks[i].rssi_threshold > -300) {
3939
+ nlo_list[i].rssi_cond.valid = __cpu_to_le32(true);
3940
+ nlo_list[i].rssi_cond.rssi =
3941
+ __cpu_to_le32(pno->a_networks[i].rssi_threshold);
3942
+ }
3943
+
3944
+ nlo_list[i].bcast_nw_type.valid = __cpu_to_le32(true);
3945
+ nlo_list[i].bcast_nw_type.bcast_nw_type =
3946
+ __cpu_to_le32(pno->a_networks[i].bcast_nw_type);
3947
+ }
3948
+
3949
+ ptr += __le32_to_cpu(cmd->no_of_ssids) * sizeof(struct nlo_configured_parameters);
3950
+
3951
+ /* copy channel info */
3952
+ cmd->num_of_channels = __cpu_to_le32(min_t(u8,
3953
+ pno->a_networks[0].channel_count,
3954
+ WMI_NLO_MAX_CHAN));
3955
+
3956
+ tlv = ptr;
3957
+ tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_UINT32);
3958
+ tlv->len = __cpu_to_le16(__le32_to_cpu(cmd->num_of_channels) *
3959
+ sizeof(u_int32_t));
3960
+ ptr += sizeof(*tlv);
3961
+
3962
+ channel_list = (__le32 *)ptr;
3963
+ for (i = 0; i < __le32_to_cpu(cmd->num_of_channels); i++)
3964
+ channel_list[i] = __cpu_to_le32(pno->a_networks[0].channels[i]);
3965
+
3966
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv start pno config vdev_id %d\n",
3967
+ vdev_id);
3968
+
3969
+ return skb;
3970
+}
3971
+
3972
+/* Request FW to stop ongoing PNO operation */
3973
+static struct sk_buff *ath10k_wmi_tlv_op_gen_config_pno_stop(struct ath10k *ar,
3974
+ u32 vdev_id)
3975
+{
3976
+ struct wmi_tlv_wow_nlo_config_cmd *cmd;
3977
+ struct wmi_tlv *tlv;
3978
+ struct sk_buff *skb;
3979
+ void *ptr;
3980
+ size_t len;
3981
+
3982
+ len = sizeof(*tlv) + sizeof(*cmd) +
3983
+ sizeof(*tlv) +
3984
+ /* TLV place holder for array of structures
3985
+ * nlo_configured_parameters(nlo_list)
3986
+ */
3987
+ sizeof(*tlv);
3988
+ /* TLV place holder for array of uint32 channel_list */
3989
+ skb = ath10k_wmi_alloc_skb(ar, len);
3990
+ if (!skb)
3991
+ return ERR_PTR(-ENOMEM);
3992
+
3993
+ ptr = (void *)skb->data;
3994
+ tlv = ptr;
3995
+ tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_NLO_CONFIG_CMD);
3996
+ tlv->len = __cpu_to_le16(sizeof(*cmd));
3997
+ cmd = (void *)tlv->value;
3998
+
3999
+ cmd->vdev_id = __cpu_to_le32(vdev_id);
4000
+ cmd->flags = __cpu_to_le32(WMI_NLO_CONFIG_STOP);
4001
+
4002
+ ptr += sizeof(*tlv);
4003
+ ptr += sizeof(*cmd);
4004
+
4005
+ /* nlo_configured_parameters(nlo_list) */
4006
+ tlv = ptr;
4007
+ tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_STRUCT);
4008
+ tlv->len = __cpu_to_le16(0);
4009
+
4010
+ ptr += sizeof(*tlv);
4011
+
4012
+ /* channel list */
4013
+ tlv = ptr;
4014
+ tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_UINT32);
4015
+ tlv->len = __cpu_to_le16(0);
4016
+
4017
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv stop pno config vdev_id %d\n", vdev_id);
4018
+ return skb;
4019
+}
4020
+
4021
+static struct sk_buff *
4022
+ath10k_wmi_tlv_op_gen_config_pno(struct ath10k *ar, u32 vdev_id,
4023
+ struct wmi_pno_scan_req *pno_scan)
4024
+{
4025
+ if (pno_scan->enable)
4026
+ return ath10k_wmi_tlv_op_gen_config_pno_start(ar, vdev_id, pno_scan);
4027
+ else
4028
+ return ath10k_wmi_tlv_op_gen_config_pno_stop(ar, vdev_id);
34594029 }
34604030
34614031 static struct sk_buff *
....@@ -3686,6 +4256,7 @@
36864256 .vdev_spectral_scan_configure_cmdid = WMI_TLV_SPECTRAL_SCAN_CONF_CMDID,
36874257 .vdev_spectral_scan_enable_cmdid = WMI_TLV_SPECTRAL_SCAN_ENABLE_CMDID,
36884258 .request_stats_cmdid = WMI_TLV_REQUEST_STATS_CMDID,
4259
+ .request_peer_stats_info_cmdid = WMI_TLV_REQUEST_PEER_STATS_INFO_CMDID,
36894260 .set_arp_ns_offload_cmdid = WMI_TLV_SET_ARP_NS_OFFLOAD_CMDID,
36904261 .network_list_offload_config_cmdid =
36914262 WMI_TLV_NETWORK_LIST_OFFLOAD_CONFIG_CMDID,
....@@ -3840,6 +4411,27 @@
38404411 .wapi_mbssid_offset = WMI_PDEV_PARAM_UNSUPPORTED,
38414412 .arp_srcaddr = WMI_PDEV_PARAM_UNSUPPORTED,
38424413 .arp_dstaddr = WMI_PDEV_PARAM_UNSUPPORTED,
4414
+ .rfkill_config = WMI_TLV_PDEV_PARAM_HW_RFKILL_CONFIG,
4415
+ .rfkill_enable = WMI_TLV_PDEV_PARAM_RFKILL_ENABLE,
4416
+ .peer_stats_info_enable = WMI_TLV_PDEV_PARAM_PEER_STATS_INFO_ENABLE,
4417
+};
4418
+
4419
+static struct wmi_peer_param_map wmi_tlv_peer_param_map = {
4420
+ .smps_state = WMI_TLV_PEER_SMPS_STATE,
4421
+ .ampdu = WMI_TLV_PEER_AMPDU,
4422
+ .authorize = WMI_TLV_PEER_AUTHORIZE,
4423
+ .chan_width = WMI_TLV_PEER_CHAN_WIDTH,
4424
+ .nss = WMI_TLV_PEER_NSS,
4425
+ .use_4addr = WMI_TLV_PEER_USE_4ADDR,
4426
+ .membership = WMI_TLV_PEER_MEMBERSHIP,
4427
+ .user_pos = WMI_TLV_PEER_USERPOS,
4428
+ .crit_proto_hint_enabled = WMI_TLV_PEER_CRIT_PROTO_HINT_ENABLED,
4429
+ .tx_fail_cnt_thr = WMI_TLV_PEER_TX_FAIL_CNT_THR,
4430
+ .set_hw_retry_cts2s = WMI_TLV_PEER_SET_HW_RETRY_CTS2S,
4431
+ .ibss_atim_win_len = WMI_TLV_PEER_IBSS_ATIM_WINDOW_LENGTH,
4432
+ .phymode = WMI_TLV_PEER_PHYMODE,
4433
+ .use_fixed_power = WMI_TLV_PEER_USE_FIXED_PWR,
4434
+ .dummy_var = WMI_TLV_PEER_DUMMY_VAR,
38434435 };
38444436
38454437 static struct wmi_vdev_param_map wmi_tlv_vdev_param_map = {
....@@ -3924,6 +4516,7 @@
39244516 .pull_scan = ath10k_wmi_tlv_op_pull_scan_ev,
39254517 .pull_mgmt_rx = ath10k_wmi_tlv_op_pull_mgmt_rx_ev,
39264518 .pull_mgmt_tx_compl = ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev,
4519
+ .pull_mgmt_tx_bundle_compl = ath10k_wmi_tlv_op_pull_mgmt_tx_bundle_compl_ev,
39274520 .pull_ch_info = ath10k_wmi_tlv_op_pull_ch_info_ev,
39284521 .pull_vdev_start = ath10k_wmi_tlv_op_pull_vdev_start_ev,
39294522 .pull_peer_kick = ath10k_wmi_tlv_op_pull_peer_kick_ev,
....@@ -3968,6 +4561,7 @@
39684561 .gen_beacon_dma = ath10k_wmi_tlv_op_gen_beacon_dma,
39694562 .gen_pdev_set_wmm = ath10k_wmi_tlv_op_gen_pdev_set_wmm,
39704563 .gen_request_stats = ath10k_wmi_tlv_op_gen_request_stats,
4564
+ .gen_request_peer_stats_info = ath10k_wmi_tlv_op_gen_request_peer_stats_info,
39714565 .gen_force_fw_hang = ath10k_wmi_tlv_op_gen_force_fw_hang,
39724566 /* .gen_mgmt_tx = not implemented; HTT is used */
39734567 .gen_mgmt_tx_send = ath10k_wmi_tlv_op_gen_mgmt_tx_send,
....@@ -3991,11 +4585,12 @@
39914585 .gen_wow_host_wakeup_ind = ath10k_wmi_tlv_gen_wow_host_wakeup_ind,
39924586 .gen_wow_add_pattern = ath10k_wmi_tlv_op_gen_wow_add_pattern,
39934587 .gen_wow_del_pattern = ath10k_wmi_tlv_op_gen_wow_del_pattern,
4588
+ .gen_wow_config_pno = ath10k_wmi_tlv_op_gen_config_pno,
39944589 .gen_update_fw_tdls_state = ath10k_wmi_tlv_op_gen_update_fw_tdls_state,
39954590 .gen_tdls_peer_update = ath10k_wmi_tlv_op_gen_tdls_peer_update,
39964591 .gen_adaptive_qcs = ath10k_wmi_tlv_op_gen_adaptive_qcs,
39974592 .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
3998
- .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
4593
+ .get_vdev_subtype = ath10k_wmi_tlv_op_get_vdev_subtype,
39994594 .gen_echo = ath10k_wmi_tlv_op_gen_echo,
40004595 .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
40014596 .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
....@@ -4029,6 +4624,7 @@
40294624 ar->wmi.cmd = &wmi_tlv_cmd_map;
40304625 ar->wmi.vdev_param = &wmi_tlv_vdev_param_map;
40314626 ar->wmi.pdev_param = &wmi_tlv_pdev_param_map;
4627
+ ar->wmi.peer_param = &wmi_tlv_peer_param_map;
40324628 ar->wmi.ops = &wmi_tlv_ops;
40334629 ar->wmi.peer_flags = &wmi_tlv_peer_flags_map;
40344630 }