forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/wireless/ath/ath10k/wmi-tlv.h
....@@ -1,22 +1,13 @@
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 #ifndef _WMI_TLV_H
198 #define _WMI_TLV_H
9
+
10
+#include <linux/bitops.h>
2011
2112 #define WMI_TLV_CMD(grp_id) (((grp_id) << 12) | 0x1)
2213 #define WMI_TLV_EV(grp_id) (((grp_id) << 12) | 0x1)
....@@ -24,6 +15,8 @@
2415 #define WMI_TLV_PDEV_PARAM_UNSUPPORTED 0
2516 #define WMI_TLV_VDEV_PARAM_UNSUPPORTED 0
2617 #define WMI_TLV_MGMT_TX_FRAME_MAX_LEN 64
18
+
19
+#define WMI_RSRC_CFG_FLAG_TX_ACK_RSSI BIT(18)
2720
2821 enum wmi_tlv_grp_id {
2922 WMI_TLV_GRP_START = 0x3,
....@@ -205,6 +198,12 @@
205198 WMI_TLV_REQUEST_LINK_STATS_CMDID,
206199 WMI_TLV_START_LINK_STATS_CMDID,
207200 WMI_TLV_CLEAR_LINK_STATS_CMDID,
201
+ WMI_TLV_CGET_FW_MEM_DUMP_CMDID,
202
+ WMI_TLV_CDEBUG_MESG_FLUSH_CMDID,
203
+ WMI_TLV_CDIAG_EVENT_LOG_CONFIG_CMDID,
204
+ WMI_TLV_CREQUEST_WLAN_STATS_CMDID,
205
+ WMI_TLV_CREQUEST_RCPI_CMDID,
206
+ WMI_TLV_REQUEST_PEER_STATS_INFO_CMDID,
208207 WMI_TLV_SET_ARP_NS_OFFLOAD_CMDID = WMI_TLV_CMD(WMI_TLV_GRP_ARP_NS_OFL),
209208 WMI_TLV_ADD_PROACTIVE_ARP_RSP_PATTERN_CMDID,
210209 WMI_TLV_DEL_PROACTIVE_ARP_RSP_PATTERN_CMDID,
....@@ -310,17 +309,22 @@
310309 WMI_TLV_VDEV_STOPPED_EVENTID,
311310 WMI_TLV_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
312311 WMI_TLV_VDEV_MCC_BCN_INTERVAL_CHANGE_REQ_EVENTID,
312
+ WMI_TLV_VDEV_TSF_REPORT_EVENTID,
313
+ WMI_TLV_VDEV_DELETE_RESP_EVENTID,
313314 WMI_TLV_PEER_STA_KICKOUT_EVENTID = WMI_TLV_EV(WMI_TLV_GRP_PEER),
314315 WMI_TLV_PEER_INFO_EVENTID,
315316 WMI_TLV_PEER_TX_FAIL_CNT_THR_EVENTID,
316317 WMI_TLV_PEER_ESTIMATED_LINKSPEED_EVENTID,
317318 WMI_TLV_PEER_STATE_EVENTID,
319
+ WMI_TLV_PEER_ASSOC_CONF_EVENTID,
320
+ WMI_TLV_PEER_DELETE_RESP_EVENTID,
318321 WMI_TLV_MGMT_RX_EVENTID = WMI_TLV_EV(WMI_TLV_GRP_MGMT),
319322 WMI_TLV_HOST_SWBA_EVENTID,
320323 WMI_TLV_TBTTOFFSET_UPDATE_EVENTID,
321324 WMI_TLV_OFFLOAD_BCN_TX_STATUS_EVENTID,
322325 WMI_TLV_OFFLOAD_PROB_RESP_TX_STATUS_EVENTID,
323326 WMI_TLV_MGMT_TX_COMPLETION_EVENTID,
327
+ WMI_TLV_MGMT_TX_BUNDLE_COMPLETION_EVENTID,
324328 WMI_TLV_TX_DELBA_COMPLETE_EVENTID = WMI_TLV_EV(WMI_TLV_GRP_BA_NEG),
325329 WMI_TLV_TX_ADDBA_COMPLETE_EVENTID,
326330 WMI_TLV_BA_RSP_SSN_EVENTID,
....@@ -340,6 +344,13 @@
340344 WMI_TLV_IFACE_LINK_STATS_EVENTID,
341345 WMI_TLV_PEER_LINK_STATS_EVENTID,
342346 WMI_TLV_RADIO_LINK_STATS_EVENTID,
347
+ WMI_TLV_UPDATE_FW_MEM_DUMP_EVENTID,
348
+ WMI_TLV_DIAG_EVENT_LOG_SUPPORTED_EVENTID,
349
+ WMI_TLV_INST_RSSI_STATS_EVENTID,
350
+ WMI_TLV_RADIO_TX_POWER_LEVEL_STATS_EVENTID,
351
+ WMI_TLV_REPORT_STATS_EVENTID,
352
+ WMI_TLV_UPDATE_RCPI_EVENTID,
353
+ WMI_TLV_PEER_STATS_INFO_EVENTID,
343354 WMI_TLV_NLO_MATCH_EVENTID = WMI_TLV_EV(WMI_TLV_GRP_NLO_OFL),
344355 WMI_TLV_NLO_SCAN_COMPLETE_EVENTID,
345356 WMI_TLV_APFIND_EVENTID,
....@@ -453,6 +464,7 @@
453464 WMI_TLV_PDEV_PARAM_VDEV_RATE_STATS_UPDATE_PERIOD,
454465 WMI_TLV_PDEV_PARAM_TXPOWER_REASON_NONE,
455466 WMI_TLV_PDEV_PARAM_TXPOWER_REASON_SAR,
467
+ WMI_TLV_PDEV_PARAM_PEER_STATS_INFO_ENABLE = 0x8b,
456468 WMI_TLV_PDEV_PARAM_TXPOWER_REASON_MAX,
457469 };
458470
....@@ -530,6 +542,24 @@
530542 WMI_TLV_VDEV_PARAM_DTIM_POLICY,
531543 WMI_TLV_VDEV_PARAM_IBSS_PS_WARMUP_TIME_SECS,
532544 WMI_TLV_VDEV_PARAM_IBSS_PS_1RX_CHAIN_IN_ATIM_WINDOW_ENABLE,
545
+};
546
+
547
+enum wmi_tlv_peer_param {
548
+ WMI_TLV_PEER_SMPS_STATE = 0x1, /* see %wmi_peer_smps_state */
549
+ WMI_TLV_PEER_AMPDU = 0x2,
550
+ WMI_TLV_PEER_AUTHORIZE = 0x3,
551
+ WMI_TLV_PEER_CHAN_WIDTH = 0x4,
552
+ WMI_TLV_PEER_NSS = 0x5,
553
+ WMI_TLV_PEER_USE_4ADDR = 0x6,
554
+ WMI_TLV_PEER_MEMBERSHIP = 0x7,
555
+ WMI_TLV_PEER_USERPOS = 0x8,
556
+ WMI_TLV_PEER_CRIT_PROTO_HINT_ENABLED = 0x9,
557
+ WMI_TLV_PEER_TX_FAIL_CNT_THR = 0xa,
558
+ WMI_TLV_PEER_SET_HW_RETRY_CTS2S = 0xb,
559
+ WMI_TLV_PEER_IBSS_ATIM_WINDOW_LENGTH = 0xc,
560
+ WMI_TLV_PEER_PHYMODE = 0xd,
561
+ WMI_TLV_PEER_USE_FIXED_PWR = 0xe,
562
+ WMI_TLV_PEER_DUMMY_VAR = 0xff,
533563 };
534564
535565 enum wmi_tlv_peer_flags {
....@@ -1394,6 +1424,30 @@
13941424 WMI_TLV_SERVICE_AP_TWT = 153,
13951425 WMI_TLV_SERVICE_GMAC_OFFLOAD_SUPPORT = 154,
13961426 WMI_TLV_SERVICE_SPOOF_MAC_SUPPORT = 155,
1427
+ WMI_TLV_SERVICE_PEER_TID_CONFIGS_SUPPORT = 156,
1428
+ WMI_TLV_SERVICE_VDEV_SWRETRY_PER_AC_CONFIG_SUPPORT = 157,
1429
+ WMI_TLV_SERVICE_DUAL_BEACON_ON_SINGLE_MAC_SCC_SUPPORT = 158,
1430
+ WMI_TLV_SERVICE_DUAL_BEACON_ON_SINGLE_MAC_MCC_SUPPORT = 159,
1431
+ WMI_TLV_SERVICE_MOTION_DET = 160,
1432
+ WMI_TLV_SERVICE_INFRA_MBSSID = 161,
1433
+ WMI_TLV_SERVICE_OBSS_SPATIAL_REUSE = 162,
1434
+ WMI_TLV_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT = 163,
1435
+ WMI_TLV_SERVICE_NAN_DBS_SUPPORT = 164,
1436
+ WMI_TLV_SERVICE_NDI_DBS_SUPPORT = 165,
1437
+ WMI_TLV_SERVICE_NAN_SAP_SUPPORT = 166,
1438
+ WMI_TLV_SERVICE_NDI_SAP_SUPPORT = 167,
1439
+ WMI_TLV_SERVICE_CFR_CAPTURE_SUPPORT = 168,
1440
+ WMI_TLV_SERVICE_CFR_CAPTURE_IND_MSG_TYPE_1 = 169,
1441
+ WMI_TLV_SERVICE_ESP_SUPPORT = 170,
1442
+ WMI_TLV_SERVICE_PEER_CHWIDTH_CHANGE = 171,
1443
+ WMI_TLV_SERVICE_WLAN_HPCS_PULSE = 172,
1444
+ WMI_TLV_SERVICE_PER_VDEV_CHAINMASK_CONFIG_SUPPORT = 173,
1445
+ WMI_TLV_SERVICE_TX_DATA_MGMT_ACK_RSSI = 174,
1446
+ WMI_TLV_SERVICE_NAN_DISABLE_SUPPORT = 175,
1447
+ WMI_TLV_SERVICE_HTT_H2T_NO_HTC_HDR_LEN_IN_MSG_LEN = 176,
1448
+ WMI_TLV_SERVICE_COEX_SUPPORT_UNEQUAL_ISOLATION = 177,
1449
+ WMI_TLV_SERVICE_HW_DB2DBM_CONVERSION_SUPPORT = 178,
1450
+ WMI_TLV_SERVICE_SUPPORT_EXTEND_ADDRESS = 179,
13971451
13981452 WMI_TLV_MAX_EXT_SERVICE = 256,
13991453 };
....@@ -1556,6 +1610,12 @@
15561610 WMI_SERVICE_SAP_AUTH_OFFLOAD, len);
15571611 SVCMAP(WMI_TLV_SERVICE_MGMT_TX_WMI,
15581612 WMI_SERVICE_MGMT_TX_WMI, len);
1613
+ SVCMAP(WMI_TLV_SERVICE_MESH_11S,
1614
+ WMI_SERVICE_MESH_11S, len);
1615
+ SVCMAP(WMI_TLV_SERVICE_SYNC_DELETE_CMDS,
1616
+ WMI_SERVICE_SYNC_DELETE_CMDS, len);
1617
+ SVCMAP(WMI_TLV_SERVICE_PEER_STATS_INFO,
1618
+ WMI_SERVICE_PEER_STATS, len);
15591619 }
15601620
15611621 static inline void
....@@ -1564,6 +1624,14 @@
15641624 SVCMAP(WMI_TLV_SERVICE_SPOOF_MAC_SUPPORT,
15651625 WMI_SERVICE_SPOOF_MAC_SUPPORT,
15661626 WMI_TLV_MAX_SERVICE);
1627
+ SVCMAP(WMI_TLV_SERVICE_THERM_THROT,
1628
+ WMI_SERVICE_THERM_THROT,
1629
+ WMI_TLV_MAX_SERVICE);
1630
+ SVCMAP(WMI_TLV_SERVICE_TX_DATA_MGMT_ACK_RSSI,
1631
+ WMI_SERVICE_TX_DATA_ACK_RSSI, WMI_TLV_MAX_SERVICE);
1632
+ SVCMAP(WMI_TLV_SERVICE_SUPPORT_EXTEND_ADDRESS,
1633
+ WMI_SERVICE_SUPPORT_EXTEND_ADDRESS,
1634
+ WMI_TLV_MAX_SERVICE);
15671635 }
15681636
15691637 #undef SVCMAP
....@@ -1571,7 +1639,7 @@
15711639 struct wmi_tlv {
15721640 __le16 len;
15731641 __le16 tag;
1574
- u8 value[0];
1642
+ u8 value[];
15751643 } __packed;
15761644
15771645 struct ath10k_mgmt_tx_pkt_addr {
....@@ -1579,10 +1647,40 @@
15791647 dma_addr_t paddr;
15801648 };
15811649
1650
+struct chan_info_params {
1651
+ u32 err_code;
1652
+ u32 freq;
1653
+ u32 cmd_flags;
1654
+ u32 noise_floor;
1655
+ u32 rx_clear_count;
1656
+ u32 cycle_count;
1657
+ u32 mac_clk_mhz;
1658
+};
1659
+
1660
+#define WMI_TLV_FLAG_MGMT_BUNDLE_TX_COMPL BIT(9)
1661
+
1662
+struct wmi_tlv_chan_info_event {
1663
+ __le32 err_code;
1664
+ __le32 freq;
1665
+ __le32 cmd_flags;
1666
+ __le32 noise_floor;
1667
+ __le32 rx_clear_count;
1668
+ __le32 cycle_count;
1669
+ __le32 chan_tx_pwr_range;
1670
+ __le32 chan_tx_pwr_tp;
1671
+ __le32 rx_frame_count;
1672
+ __le32 my_bss_rx_cycle_count;
1673
+ __le32 rx_11b_mode_data_duration;
1674
+ __le32 tx_frame_cnt;
1675
+ __le32 mac_clk_mhz;
1676
+} __packed;
1677
+
15821678 struct wmi_tlv_mgmt_tx_compl_ev {
15831679 __le32 desc_id;
15841680 __le32 status;
15851681 __le32 pdev_id;
1682
+ __le32 ppdu_id;
1683
+ __le32 ack_rssi;
15861684 };
15871685
15881686 #define WMI_TLV_MGMT_RX_NUM_RSSI 4
....@@ -1689,6 +1787,21 @@
16891787 __le32 host_capab;
16901788 } __packed;
16911789
1790
+/* structure describing host memory chunk. */
1791
+struct host_memory_chunk_tlv {
1792
+ /* id of the request that is passed up in service ready */
1793
+ __le32 req_id;
1794
+
1795
+ /* the physical address the memory chunk */
1796
+ __le32 ptr;
1797
+
1798
+ /* size of the chunk */
1799
+ __le32 size;
1800
+
1801
+ /* the upper 32 bit address valid only for more than 32 bit target */
1802
+ __le32 ptr_high;
1803
+} __packed;
1804
+
16921805 struct wmi_tlv_init_cmd {
16931806 struct wmi_tlv_abi_version abi;
16941807 __le32 num_host_mem_chunks;
....@@ -1744,6 +1857,16 @@
17441857 struct wmi_mac_addr mac_addr;
17451858 struct wmi_mac_addr mac_mask;
17461859 } __packed;
1860
+
1861
+enum wmi_tlv_vdev_subtype {
1862
+ WMI_TLV_VDEV_SUBTYPE_NONE = 0,
1863
+ WMI_TLV_VDEV_SUBTYPE_P2P_DEV = 1,
1864
+ WMI_TLV_VDEV_SUBTYPE_P2P_CLI = 2,
1865
+ WMI_TLV_VDEV_SUBTYPE_P2P_GO = 3,
1866
+ WMI_TLV_VDEV_SUBTYPE_PROXY_STA = 4,
1867
+ WMI_TLV_VDEV_SUBTYPE_MESH = 5,
1868
+ WMI_TLV_VDEV_SUBTYPE_MESH_11S = 6,
1869
+};
17471870
17481871 struct wmi_tlv_vdev_start_cmd {
17491872 __le32 vdev_id;
....@@ -1859,6 +1982,22 @@
18591982 struct wmi_mac_addr peer_macaddr;
18601983 } __packed;
18611984
1985
+#define WMI_TLV_PEER_RX_DURATION_HIGH_VALID_BIT 31
1986
+#define WMI_TLV_PEER_RX_DURATION_HIGH_MASK GENMASK(30, 0)
1987
+#define WMI_TLV_PEER_RX_DURATION_SHIFT 32
1988
+
1989
+struct wmi_tlv_peer_stats_extd {
1990
+ struct wmi_mac_addr peer_macaddr;
1991
+ __le32 rx_duration;
1992
+ __le32 peer_tx_bytes;
1993
+ __le32 peer_rx_bytes;
1994
+ __le32 last_tx_rate_code;
1995
+ __le32 last_tx_power;
1996
+ __le32 rx_mc_bc_cnt;
1997
+ __le32 rx_duration_high;
1998
+ __le32 reserved[2];
1999
+} __packed;
2000
+
18622001 struct wmi_tlv_vdev_stats {
18632002 __le32 vdev_id;
18642003 __le32 beacon_snr;
....@@ -1900,7 +2039,7 @@
19002039 struct wmi_tlv_bcn_prb_info {
19012040 __le32 caps;
19022041 __le32 erp;
1903
- u8 ies[0];
2042
+ u8 ies[];
19042043 } __packed;
19052044
19062045 struct wmi_tlv_bcn_tmpl_cmd {
....@@ -1931,7 +2070,7 @@
19312070 __le16 len;
19322071 __le32 timestamp;
19332072 __le32 code;
1934
- u8 payload[0];
2073
+ u8 payload[];
19352074 } __packed;
19362075
19372076 struct wmi_tlv_diag_data_ev {
....@@ -1952,7 +2091,99 @@
19522091 __le32 num_peer_stats;
19532092 __le32 num_bcnflt_stats;
19542093 __le32 num_chan_stats;
2094
+ __le32 num_mib_stats;
2095
+ __le32 pdev_id;
2096
+ __le32 num_bcn_stats;
2097
+ __le32 num_peer_stats_extd;
19552098 } __packed;
2099
+
2100
+struct wmi_tlv_peer_stats_info_ev {
2101
+ __le32 vdev_id;
2102
+ __le32 num_peers;
2103
+ __le32 more_data;
2104
+} __packed;
2105
+
2106
+#define WMI_TLV_MAX_CHAINS 8
2107
+
2108
+struct wmi_tlv_peer_stats_info {
2109
+ struct wmi_mac_addr peer_macaddr;
2110
+ struct {
2111
+ /* lower 32 bits of the tx_bytes value */
2112
+ __le32 low_32;
2113
+ /* upper 32 bits of the tx_bytes value */
2114
+ __le32 high_32;
2115
+ } __packed tx_bytes;
2116
+ struct {
2117
+ /* lower 32 bits of the tx_packets value */
2118
+ __le32 low_32;
2119
+ /* upper 32 bits of the tx_packets value */
2120
+ __le32 high_32;
2121
+ } __packed tx_packets;
2122
+ struct {
2123
+ /* lower 32 bits of the rx_bytes value */
2124
+ __le32 low_32;
2125
+ /* upper 32 bits of the rx_bytes value */
2126
+ __le32 high_32;
2127
+ } __packed rx_bytes;
2128
+ struct {
2129
+ /* lower 32 bits of the rx_packets value */
2130
+ __le32 low_32;
2131
+ /* upper 32 bits of the rx_packets value */
2132
+ __le32 high_32;
2133
+ } __packed rx_packets;
2134
+ __le32 tx_retries;
2135
+ __le32 tx_failed;
2136
+
2137
+ /* rate information, it is output of WMI_ASSEMBLE_RATECODE_V1
2138
+ * (in format of 0x1000RRRR)
2139
+ * The rate-code is a 4-bytes field in which,
2140
+ * for given rate, nss and preamble
2141
+ *
2142
+ * b'31-b'29 unused / reserved
2143
+ * b'28 indicate the version of rate-code (1 = RATECODE_V1)
2144
+ * b'27-b'11 unused / reserved
2145
+ * b'10-b'8 indicate the preamble (0 OFDM, 1 CCK, 2 HT, 3 VHT)
2146
+ * b'7-b'5 indicate the NSS (0 - 1x1, 1 - 2x2, 2 - 3x3, 3 - 4x4)
2147
+ * b'4-b'0 indicate the rate, which is indicated as follows:
2148
+ * OFDM : 0: OFDM 48 Mbps
2149
+ * 1: OFDM 24 Mbps
2150
+ * 2: OFDM 12 Mbps
2151
+ * 3: OFDM 6 Mbps
2152
+ * 4: OFDM 54 Mbps
2153
+ * 5: OFDM 36 Mbps
2154
+ * 6: OFDM 18 Mbps
2155
+ * 7: OFDM 9 Mbps
2156
+ * CCK (pream == 1)
2157
+ * 0: CCK 11 Mbps Long
2158
+ * 1: CCK 5.5 Mbps Long
2159
+ * 2: CCK 2 Mbps Long
2160
+ * 3: CCK 1 Mbps Long
2161
+ * 4: CCK 11 Mbps Short
2162
+ * 5: CCK 5.5 Mbps Short
2163
+ * 6: CCK 2 Mbps Short
2164
+ * HT/VHT (pream == 2/3)
2165
+ * 0..7: MCS0..MCS7 (HT)
2166
+ * 0..9: MCS0..MCS9 (11AC VHT)
2167
+ * 0..11: MCS0..MCS11 (11AX VHT)
2168
+ * rate-code of the last transmission
2169
+ */
2170
+ __le32 last_tx_rate_code;
2171
+ __le32 last_rx_rate_code;
2172
+ __le32 last_tx_bitrate_kbps;
2173
+ __le32 last_rx_bitrate_kbps;
2174
+ __le32 peer_rssi;
2175
+ __le32 tx_succeed;
2176
+ __le32 peer_rssi_per_chain[WMI_TLV_MAX_CHAINS];
2177
+} __packed;
2178
+
2179
+#define HW_RATECODE_PREAM_V1_MASK GENMASK(10, 8)
2180
+#define WMI_TLV_GET_HW_RC_PREAM_V1(rc) FIELD_GET(HW_RATECODE_PREAM_V1_MASK, rc)
2181
+
2182
+#define HW_RATECODE_NSS_V1_MASK GENMASK(7, 5)
2183
+#define WMI_TLV_GET_HW_RC_NSS_V1(rc) FIELD_GET(HW_RATECODE_NSS_V1_MASK, rc)
2184
+
2185
+#define HW_RATECODE_RATE_V1_MASK GENMASK(4, 0)
2186
+#define WMI_TLV_GET_HW_RC_RATE_V1(rc) FIELD_GET(HW_RATECODE_RATE_V1_MASK, rc)
19562187
19572188 struct wmi_tlv_p2p_noa_ev {
19582189 __le32 vdev_id;
....@@ -1970,6 +2201,14 @@
19702201 __le32 event_bitmap;
19712202 } __packed;
19722203
2204
+struct wmi_tlv_request_peer_stats_info {
2205
+ __le32 request_type;
2206
+ __le32 vdev_id;
2207
+ /* peer MAC address */
2208
+ struct wmi_mac_addr peer_macaddr;
2209
+ __le32 reset_after_request;
2210
+} __packed;
2211
+
19732212 /* Command to set/unset chip in quiet mode */
19742213 struct wmi_tlv_set_quiet_cmd {
19752214 __le32 vdev_id;
....@@ -1985,8 +2224,15 @@
19852224 __le32 enabled;
19862225 } __packed;
19872226
2227
+enum wmi_tlv_wow_interface_cfg {
2228
+ WOW_IFACE_PAUSE_ENABLED,
2229
+ WOW_IFACE_PAUSE_DISABLED
2230
+};
2231
+
19882232 struct wmi_tlv_wow_enable_cmd {
19892233 __le32 enable;
2234
+ __le32 pause_iface_config;
2235
+ __le32 flags;
19902236 } __packed;
19912237
19922238 struct wmi_tlv_wow_host_wakeup_ind {
....@@ -2144,8 +2390,287 @@
21442390 __le32 vdev_id;
21452391 } __packed;
21462392
2393
+enum wmi_tlv_sys_cap_info_flags {
2394
+ WMI_TLV_SYS_CAP_INFO_RXTX_LED = BIT(0),
2395
+ WMI_TLV_SYS_CAP_INFO_RFKILL = BIT(1),
2396
+};
2397
+
2398
+#define WMI_TLV_RFKILL_CFG_GPIO_PIN_NUM GENMASK(5, 0)
2399
+#define WMI_TLV_RFKILL_CFG_RADIO_LEVEL BIT(6)
2400
+#define WMI_TLV_RFKILL_CFG_PIN_AS_GPIO GENMASK(10, 7)
2401
+
2402
+enum wmi_tlv_rfkill_enable_radio {
2403
+ WMI_TLV_RFKILL_ENABLE_RADIO_ON = 0,
2404
+ WMI_TLV_RFKILL_ENABLE_RADIO_OFF = 1,
2405
+};
2406
+
2407
+enum wmi_tlv_rfkill_radio_state {
2408
+ WMI_TLV_RFKILL_RADIO_STATE_OFF = 1,
2409
+ WMI_TLV_RFKILL_RADIO_STATE_ON = 2,
2410
+};
2411
+
2412
+struct wmi_tlv_rfkill_state_change_ev {
2413
+ __le32 gpio_pin_num;
2414
+ __le32 int_type;
2415
+ __le32 radio_state;
2416
+};
2417
+
21472418 void ath10k_wmi_tlv_attach(struct ath10k *ar);
21482419
2420
+enum wmi_nlo_auth_algorithm {
2421
+ WMI_NLO_AUTH_ALGO_80211_OPEN = 1,
2422
+ WMI_NLO_AUTH_ALGO_80211_SHARED_KEY = 2,
2423
+ WMI_NLO_AUTH_ALGO_WPA = 3,
2424
+ WMI_NLO_AUTH_ALGO_WPA_PSK = 4,
2425
+ WMI_NLO_AUTH_ALGO_WPA_NONE = 5,
2426
+ WMI_NLO_AUTH_ALGO_RSNA = 6,
2427
+ WMI_NLO_AUTH_ALGO_RSNA_PSK = 7,
2428
+};
2429
+
2430
+enum wmi_nlo_cipher_algorithm {
2431
+ WMI_NLO_CIPHER_ALGO_NONE = 0x00,
2432
+ WMI_NLO_CIPHER_ALGO_WEP40 = 0x01,
2433
+ WMI_NLO_CIPHER_ALGO_TKIP = 0x02,
2434
+ WMI_NLO_CIPHER_ALGO_CCMP = 0x04,
2435
+ WMI_NLO_CIPHER_ALGO_WEP104 = 0x05,
2436
+ WMI_NLO_CIPHER_ALGO_BIP = 0x06,
2437
+ WMI_NLO_CIPHER_ALGO_RSN_USE_GROUP = 0x100,
2438
+ WMI_NLO_CIPHER_ALGO_WEP = 0x101,
2439
+};
2440
+
2441
+/* SSID broadcast type passed in NLO params */
2442
+enum wmi_nlo_ssid_bcastnwtype {
2443
+ WMI_NLO_BCAST_UNKNOWN = 0,
2444
+ WMI_NLO_BCAST_NORMAL = 1,
2445
+ WMI_NLO_BCAST_HIDDEN = 2,
2446
+};
2447
+
2448
+#define WMI_NLO_MAX_SSIDS 16
2449
+#define WMI_NLO_MAX_CHAN 48
2450
+
2451
+#define WMI_NLO_CONFIG_STOP (0x1 << 0)
2452
+#define WMI_NLO_CONFIG_START (0x1 << 1)
2453
+#define WMI_NLO_CONFIG_RESET (0x1 << 2)
2454
+#define WMI_NLO_CONFIG_SLOW_SCAN (0x1 << 4)
2455
+#define WMI_NLO_CONFIG_FAST_SCAN (0x1 << 5)
2456
+#define WMI_NLO_CONFIG_SSID_HIDE_EN (0x1 << 6)
2457
+
2458
+/* This bit is used to indicate if EPNO or supplicant PNO is enabled.
2459
+ * Only one of them can be enabled at a given time
2460
+ */
2461
+#define WMI_NLO_CONFIG_ENLO (0x1 << 7)
2462
+#define WMI_NLO_CONFIG_SCAN_PASSIVE (0x1 << 8)
2463
+#define WMI_NLO_CONFIG_ENLO_RESET (0x1 << 9)
2464
+#define WMI_NLO_CONFIG_SPOOFED_MAC_IN_PROBE_REQ (0x1 << 10)
2465
+#define WMI_NLO_CONFIG_RANDOM_SEQ_NO_IN_PROBE_REQ (0x1 << 11)
2466
+#define WMI_NLO_CONFIG_ENABLE_IE_WHITELIST_IN_PROBE_REQ (0x1 << 12)
2467
+#define WMI_NLO_CONFIG_ENABLE_CNLO_RSSI_CONFIG (0x1 << 13)
2468
+
2469
+/* Whether directed scan needs to be performed (for hidden SSIDs) */
2470
+#define WMI_ENLO_FLAG_DIRECTED_SCAN 1
2471
+
2472
+/* Whether PNO event shall be triggered if the network is found on A band */
2473
+#define WMI_ENLO_FLAG_A_BAND 2
2474
+
2475
+/* Whether PNO event shall be triggered if the network is found on G band */
2476
+#define WMI_ENLO_FLAG_G_BAND 4
2477
+
2478
+/* Whether strict matching is required (i.e. firmware shall not
2479
+ * match on the entire SSID)
2480
+ */
2481
+#define WMI_ENLO_FLAG_STRICT_MATCH 8
2482
+
2483
+/* Code for matching the beacon AUTH IE - additional codes TBD */
2484
+/* open */
2485
+#define WMI_ENLO_AUTH_CODE_OPEN 1
2486
+
2487
+/* WPA_PSK or WPA2PSK */
2488
+#define WMI_ENLO_AUTH_CODE_PSK 2
2489
+
2490
+/* any EAPOL */
2491
+#define WMI_ENLO_AUTH_CODE_EAPOL 4
2492
+
2493
+struct wmi_nlo_ssid_param {
2494
+ __le32 valid;
2495
+ struct wmi_ssid ssid;
2496
+} __packed;
2497
+
2498
+struct wmi_nlo_enc_param {
2499
+ __le32 valid;
2500
+ __le32 enc_type;
2501
+} __packed;
2502
+
2503
+struct wmi_nlo_auth_param {
2504
+ __le32 valid;
2505
+ __le32 auth_type;
2506
+} __packed;
2507
+
2508
+struct wmi_nlo_bcast_nw_param {
2509
+ __le32 valid;
2510
+
2511
+ /* If WMI_NLO_CONFIG_EPNO is not set. Supplicant PNO is enabled.
2512
+ * The value should be true/false. Otherwise EPNO is enabled.
2513
+ * bcast_nw_type would be used as a bit flag contains WMI_ENLO_FLAG_XXX
2514
+ */
2515
+ __le32 bcast_nw_type;
2516
+} __packed;
2517
+
2518
+struct wmi_nlo_rssi_param {
2519
+ __le32 valid;
2520
+ __le32 rssi;
2521
+} __packed;
2522
+
2523
+struct nlo_configured_parameters {
2524
+ /* TLV tag and len;*/
2525
+ __le32 tlv_header;
2526
+ struct wmi_nlo_ssid_param ssid;
2527
+ struct wmi_nlo_enc_param enc_type;
2528
+ struct wmi_nlo_auth_param auth_type;
2529
+ struct wmi_nlo_rssi_param rssi_cond;
2530
+
2531
+ /* indicates if the SSID is hidden or not */
2532
+ struct wmi_nlo_bcast_nw_param bcast_nw_type;
2533
+} __packed;
2534
+
2535
+/* Support channel prediction for PNO scan after scanning top_k_num channels
2536
+ * if stationary_threshold is met.
2537
+ */
2538
+struct nlo_channel_prediction_cfg {
2539
+ __le32 tlv_header;
2540
+
2541
+ /* Enable or disable this feature. */
2542
+ __le32 enable;
2543
+
2544
+ /* Top K channels will be scanned before deciding whether to further scan
2545
+ * or stop. Minimum value is 3 and maximum is 5.
2546
+ */
2547
+ __le32 top_k_num;
2548
+
2549
+ /* Preconfigured stationary threshold.
2550
+ * Lesser value means more conservative. Bigger value means more aggressive.
2551
+ * Maximum is 100 and mininum is 0.
2552
+ */
2553
+ __le32 stationary_threshold;
2554
+
2555
+ /* Periodic full channel scan in milliseconds unit.
2556
+ * After full_scan_period_ms since last full scan, channel prediction
2557
+ * scan is suppressed and will do full scan.
2558
+ * This is to help detecting sudden AP power-on or -off. Value 0 means no
2559
+ * full scan at all (not recommended).
2560
+ */
2561
+ __le32 full_scan_period_ms;
2562
+} __packed;
2563
+
2564
+struct enlo_candidate_score_params_t {
2565
+ __le32 tlv_header; /* TLV tag and len; */
2566
+
2567
+ /* minimum 5GHz RSSI for a BSSID to be considered (units = dBm) */
2568
+ __le32 min_5ghz_rssi;
2569
+
2570
+ /* minimum 2.4GHz RSSI for a BSSID to be considered (units = dBm) */
2571
+ __le32 min_24ghz_rssi;
2572
+
2573
+ /* the maximum score that a network can have before bonuses */
2574
+ __le32 initial_score_max;
2575
+
2576
+ /* current_connection_bonus:
2577
+ * only report when there is a network's score this much higher
2578
+ * than the current connection
2579
+ */
2580
+ __le32 current_connection_bonus;
2581
+
2582
+ /* score bonus for all networks with the same network flag */
2583
+ __le32 same_network_bonus;
2584
+
2585
+ /* score bonus for networks that are not open */
2586
+ __le32 secure_bonus;
2587
+
2588
+ /* 5GHz RSSI score bonus (applied to all 5GHz networks) */
2589
+ __le32 band_5ghz_bonus;
2590
+} __packed;
2591
+
2592
+struct connected_nlo_bss_band_rssi_pref_t {
2593
+ __le32 tlv_header; /* TLV tag and len;*/
2594
+
2595
+ /* band which needs to get preference over other band
2596
+ * - see wmi_set_vdev_ie_band enum
2597
+ */
2598
+ __le32 band;
2599
+
2600
+ /* Amount of RSSI preference (in dB) that can be given to a band */
2601
+ __le32 rssi_pref;
2602
+} __packed;
2603
+
2604
+struct connected_nlo_rssi_params_t {
2605
+ __le32 tlv_header; /* TLV tag and len;*/
2606
+
2607
+ /* Relative rssi threshold (in dB) by which new BSS should have
2608
+ * better rssi than the current connected BSS.
2609
+ */
2610
+ __le32 relative_rssi;
2611
+
2612
+ /* The amount of rssi preference (in dB) that can be given
2613
+ * to a 5G BSS over 2.4G BSS.
2614
+ */
2615
+ __le32 relative_rssi_5g_pref;
2616
+} __packed;
2617
+
2618
+struct wmi_tlv_wow_nlo_config_cmd {
2619
+ __le32 flags;
2620
+ __le32 vdev_id;
2621
+ __le32 fast_scan_max_cycles;
2622
+ __le32 active_dwell_time;
2623
+ __le32 passive_dwell_time; /* PDT in msecs */
2624
+ __le32 probe_bundle_size;
2625
+
2626
+ /* ART = IRT */
2627
+ __le32 rest_time;
2628
+
2629
+ /* Max value that can be reached after SBM */
2630
+ __le32 max_rest_time;
2631
+
2632
+ /* SBM */
2633
+ __le32 scan_backoff_multiplier;
2634
+
2635
+ /* SCBM */
2636
+ __le32 fast_scan_period;
2637
+
2638
+ /* specific to windows */
2639
+ __le32 slow_scan_period;
2640
+
2641
+ __le32 no_of_ssids;
2642
+
2643
+ __le32 num_of_channels;
2644
+
2645
+ /* NLO scan start delay time in milliseconds */
2646
+ __le32 delay_start_time;
2647
+
2648
+ /** MAC Address to use in Probe Req as SA **/
2649
+ struct wmi_mac_addr mac_addr;
2650
+
2651
+ /** Mask on which MAC has to be randomized **/
2652
+ struct wmi_mac_addr mac_mask;
2653
+
2654
+ /** IE bitmap to use in Probe Req **/
2655
+ __le32 ie_bitmap[8];
2656
+
2657
+ /** Number of vendor OUIs. In the TLV vendor_oui[] **/
2658
+ __le32 num_vendor_oui;
2659
+
2660
+ /** Number of connected NLO band preferences **/
2661
+ __le32 num_cnlo_band_pref;
2662
+
2663
+ /* The TLVs will follow.
2664
+ * nlo_configured_parameters nlo_list[];
2665
+ * A_UINT32 channel_list[num_of_channels];
2666
+ * nlo_channel_prediction_cfg ch_prediction_cfg;
2667
+ * enlo_candidate_score_params candidate_score_params;
2668
+ * wmi_vendor_oui vendor_oui[num_vendor_oui];
2669
+ * connected_nlo_rssi_params cnlo_rssi_params;
2670
+ * connected_nlo_bss_band_rssi_pref cnlo_bss_band_rssi_pref[num_cnlo_band_pref];
2671
+ */
2672
+} __packed;
2673
+
21492674 struct wmi_tlv_mgmt_tx_cmd {
21502675 __le32 vdev_id;
21512676 __le32 desc_id;