| From 1db1fb62393aab45621c5960a5d4281657151c8f Mon Sep 17 00:00:00 2001 |
| From: Shayne Chen <shayne.chen@mediatek.com> |
| Date: Mon, 22 Apr 2024 12:22:05 +0800 |
| Subject: [PATCH 108/193] mtk: mt76: add internal debug tool |
| |
| Add the following DebugFS knobs: |
| - reset_counter: reset TX/RX statistical counters in FW, WTBL, and MT76. |
| - per: show PER, which is calculated using MPDU-based statistics from CMDRPT-TX. |
| |
| Sources of statistics stored in Eagle mt76_sta_stats are summarized below. |
| <tx_bytes> source: CMDRPT-TX |
| <tx_packets> unit: MSDU. source: WTBL. |
| <tx_retries> unit: MPDU. source: TX-Free-Done Event |
| <tx_failed> unit: MPDU. source: TX-Free-Done Event |
| <tx_total_mpdu_cnt> unit: MPDU. source: CMDRPT-TX |
| <tx_failed_mpdu_cnt> unit: MPDU. source: CMDRPT-TX |
| <rx_bytes> source: RXRPT |
| <rx_packets> unit: MSDU. source: WTBL. |
| <rx_errors> Not used. |
| <rx_drops> Not used. |
| |
| Add token pending time |
| |
| Refactor DebugFS knob amsdu_info to read unambiguous CR addresses for HW-AMSDU information. |
| |
| Remove the duplicate function in mtk_debugfs.c & mtk_debug_i.c |
| Only enable mt7996_mcu_fw_log_2_host function in mcu.c |
| |
| mtk: wifi: mt76: mt7996: add more ids support for eagle and kite |
| |
| IDS is the internal debug commands for firmware debug usage. This |
| debugfs will be called only when we use chihuahua tool. Since MT7990 and |
| MT7992 use the same firmware branch. This commit change some ids idx and |
| support mode ids options as below: |
| |
| 1. set fw_dbg=2:62 for MUCOP |
| 2. set fw_dbg=1:85 for BSRP |
| 3. set fw_dbg=1:86 for Tput Monitor |
| 4. set fw_dbg=1:100 for MLO |
| 5. set fw_dbg=1:101 for ERROR Log |
| |
| mtk: wifi: mt76: mt7996: revise DebugFS command ple_info to show correct TXCMD queue information |
| |
| Each band has its own set of TXCMD queues in PLE module. |
| However, the original codebase only specifies one shared set of queues with wrong queue indices. |
| |
| mtk: wifi: mt76: mt7992: revise DebugFS command ple_info to accommodate Kite |
| |
| Because Kite only supports 512 STAs, the number of AC_QUEUE_EMPTY CRs is less than that of Eagle. |
| Consequently, some related macros have to be revised to prevent reading wrong CRs. |
| |
| Change-Id: I22331b413b0583c4209f733ad197369fa8939d97 |
| Change-Id: Ic01c288fda25886a9c384441704cb7a9f86f6209 |
| Change-Id: I3515144170aad82c23d38a6eedad8843f818058d |
| Change-Id: Iea052180b469e8ae8ba759ddb4bcf028fce3dace |
| Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> |
| Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com> |
| Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com> |
| Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| --- |
| mt7996/Makefile | 3 +- |
| mt7996/debugfs.c | 6 +- |
| mt7996/init.c | 4 + |
| mt7996/mac.c | 2 + |
| mt7996/mt7996.h | 12 + |
| mt7996/mtk_debug_i.h | 987 +++++++++++++++++++++++++++++++++++++++++ |
| mt7996/mtk_debugfs_i.c | 720 ++++++++++++++++++++++++++++++ |
| 7 files changed, 1732 insertions(+), 2 deletions(-) |
| create mode 100644 mt7996/mtk_debug_i.h |
| create mode 100644 mt7996/mtk_debugfs_i.c |
| |
| diff --git a/mt7996/Makefile b/mt7996/Makefile |
| index 6643c7a..49ec915 100644 |
| --- a/mt7996/Makefile |
| +++ b/mt7996/Makefile |
| @@ -1,4 +1,5 @@ |
| # SPDX-License-Identifier: ISC |
| +EXTRA_CFLAGS += -Werror |
| EXTRA_CFLAGS += -DCONFIG_MT76_LEDS |
| EXTRA_CFLAGS += -DCONFIG_MTK_DEBUG |
| EXTRA_CFLAGS += -DCONFIG_MTK_VENDOR |
| @@ -11,4 +12,4 @@ mt7996e-y := pci.o init.o dma.o eeprom.o main.o mcu.o mac.o \ |
| mt7996e-$(CONFIG_DEV_COREDUMP) += coredump.o |
| mt7996e-$(CONFIG_NL80211_TESTMODE) += testmode.o |
| |
| -mt7996e-y += mtk_debugfs.o mtk_mcu.o |
| +mt7996e-y += mtk_debugfs.o mtk_mcu.o mtk_debugfs_i.o |
| diff --git a/mt7996/debugfs.c b/mt7996/debugfs.c |
| index db41e37..7e545f6 100644 |
| --- a/mt7996/debugfs.c |
| +++ b/mt7996/debugfs.c |
| @@ -1118,8 +1118,12 @@ int mt7996_init_debugfs(struct mt7996_phy *phy) |
| debugfs_create_file("fw_debug_muru_disable", 0600, dir, dev, |
| &fops_fw_debug_muru_disable); |
| |
| - if (phy == &dev->phy) |
| + if (phy == &dev->phy) { |
| dev->debugfs_dir = dir; |
| +#ifdef CONFIG_MTK_DEBUG |
| + mt7996_mtk_init_debugfs_internal(phy, dir); |
| +#endif |
| + } |
| |
| #ifdef CONFIG_MTK_DEBUG |
| debugfs_create_u16("wlan_idx", 0600, dir, &dev->wlan_idx); |
| diff --git a/mt7996/init.c b/mt7996/init.c |
| index c501d19..3cd0c9e 100644 |
| --- a/mt7996/init.c |
| +++ b/mt7996/init.c |
| @@ -883,6 +883,10 @@ void mt7996_rro_hw_init(struct mt7996_dev *dev) |
| mt76_wr(dev, MT_RRO_ADDR_ARRAY_BASE0, |
| dev->wed_rro.addr_elem[0].phy_addr); |
| } else { |
| + INIT_LIST_HEAD(&dev->wed_rro.pg_addr_cache); |
| + for (i = 0; i < MT7996_RRO_MSDU_PG_HASH_SIZE; i++) |
| + INIT_LIST_HEAD(&dev->wed_rro.pg_hash_head[i]); |
| + |
| /* TODO: remove line after WM has set */ |
| mt76_clear(dev, WF_RRO_AXI_MST_CFG, WF_RRO_AXI_MST_CFG_DIDX_OK); |
| |
| diff --git a/mt7996/mac.c b/mt7996/mac.c |
| index cd13911..2e27e3b 100644 |
| --- a/mt7996/mac.c |
| +++ b/mt7996/mac.c |
| @@ -334,6 +334,7 @@ mt7996_mac_fill_rx(struct mt7996_dev *dev, enum mt76_rxq_id q, |
| #ifdef CONFIG_MTK_DEBUG |
| if (dev->dbg.dump_rx_raw) |
| mt7996_packet_log_to_host(dev, skb->data, skb->len, PKT_BIN_DEBUG_RX_RAW, 0); |
| + mt7996_dump_bmac_rxd_info(dev, rxd); |
| #endif |
| hw_aggr = status->aggr; |
| memset(status, 0, sizeof(*status)); |
| @@ -1007,6 +1008,7 @@ int mt7996_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, |
| mt7996_packet_log_to_host(dev, txwi, MT_TXD_SIZE, PKT_BIN_DEBUG_TXD, 0); |
| if (dev->dbg.dump_tx_pkt) |
| mt7996_packet_log_to_host(dev, t->skb->data, t->skb->len, PKT_BIN_DEBUG_TX, 0); |
| + mt7996_dump_bmac_txd_info(NULL, dev, (__le32 *)txwi, true, false); |
| #endif |
| |
| return 0; |
| diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
| index 00023a5..e23ed8e 100644 |
| --- a/mt7996/mt7996.h |
| +++ b/mt7996/mt7996.h |
| @@ -103,6 +103,7 @@ |
| |
| #define MT7996_BUILD_TIME_LEN 24 |
| |
| +#define MT7996_RRO_MSDU_PG_HASH_SIZE 127 |
| #define MT7996_RRO_MAX_SESSION 1024 |
| #define MT7996_RRO_WINDOW_MAX_LEN 1024 |
| #define MT7996_RRO_ADDR_ELEM_LEN 128 |
| @@ -689,6 +690,9 @@ struct mt7996_dev { |
| struct work_struct work; |
| struct list_head poll_list; |
| spinlock_t lock; |
| + |
| + struct list_head pg_addr_cache; |
| + struct list_head pg_hash_head[MT7996_RRO_MSDU_PG_HASH_SIZE]; |
| } wed_rro; |
| |
| bool testmode_enable; |
| @@ -749,7 +753,11 @@ struct mt7996_dev { |
| bool dump_tx_pkt:1; |
| bool dump_rx_pkt:1; |
| bool dump_rx_raw:1; |
| + u8 dump_ple_txd; |
| u32 token_idx; |
| + u32 rxd_read_cnt; |
| + u32 txd_read_cnt; |
| + u32 fid_idx; |
| } dbg; |
| const struct mt7996_dbg_reg_desc *dbg_reg; |
| #endif |
| @@ -1292,6 +1300,10 @@ enum { |
| }; |
| |
| void mt7996_packet_log_to_host(struct mt7996_dev *dev, const void *data, int len, int type, int des_len); |
| +void mt7996_dump_bmac_rxd_info(struct mt7996_dev *dev, __le32 *rxd); |
| +void mt7996_dump_bmac_txd_info(struct seq_file *s, struct mt7996_dev *dev, |
| + __le32 *txd, bool is_hif_txd, bool dump_txp); |
| +int mt7996_mtk_init_debugfs_internal(struct mt7996_phy *phy, struct dentry *dir); |
| #endif |
| |
| #ifdef CONFIG_NET_MEDIATEK_SOC_WED |
| diff --git a/mt7996/mtk_debug_i.h b/mt7996/mtk_debug_i.h |
| new file mode 100644 |
| index 0000000..d3756fa |
| --- /dev/null |
| +++ b/mt7996/mtk_debug_i.h |
| @@ -0,0 +1,987 @@ |
| +#ifndef __MTK_DEBUG_I_H |
| +#define __MTK_DEBUG_I_H |
| + |
| +#ifdef CONFIG_MTK_DEBUG |
| + |
| +// DW0 |
| +#define WF_RX_DESCRIPTOR_RX_BYTE_COUNT_DW 0 |
| +#define WF_RX_DESCRIPTOR_RX_BYTE_COUNT_ADDR 0 |
| +#define WF_RX_DESCRIPTOR_RX_BYTE_COUNT_MASK 0x0000ffff // 15- 0 |
| +#define WF_RX_DESCRIPTOR_RX_BYTE_COUNT_SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_PACKET_TYPE_DW 0 |
| +#define WF_RX_DESCRIPTOR_PACKET_TYPE_ADDR 0 |
| +#define WF_RX_DESCRIPTOR_PACKET_TYPE_MASK 0xf8000000 // 31-27 |
| +#define WF_RX_DESCRIPTOR_PACKET_TYPE_SHIFT 27 |
| +// DW1 |
| +#define WF_RX_DESCRIPTOR_MLD_ID_DW 1 |
| +#define WF_RX_DESCRIPTOR_MLD_ID_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_MLD_ID_MASK 0x00000fff // 11- 0 |
| +#define WF_RX_DESCRIPTOR_MLD_ID_SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_GROUP_VLD_DW 1 |
| +#define WF_RX_DESCRIPTOR_GROUP_VLD_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_GROUP_VLD_MASK 0x001f0000 // 20-16 |
| +#define WF_RX_DESCRIPTOR_GROUP_VLD_SHIFT 16 |
| +#define WF_RX_DESCRIPTOR_KID_DW 1 |
| +#define WF_RX_DESCRIPTOR_KID_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_KID_MASK 0x00600000 // 22-21 |
| +#define WF_RX_DESCRIPTOR_KID_SHIFT 21 |
| +#define WF_RX_DESCRIPTOR_CM_DW 1 |
| +#define WF_RX_DESCRIPTOR_CM_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_CM_MASK 0x00800000 // 23-23 |
| +#define WF_RX_DESCRIPTOR_CM_SHIFT 23 |
| +#define WF_RX_DESCRIPTOR_CLM_DW 1 |
| +#define WF_RX_DESCRIPTOR_CLM_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_CLM_MASK 0x01000000 // 24-24 |
| +#define WF_RX_DESCRIPTOR_CLM_SHIFT 24 |
| +#define WF_RX_DESCRIPTOR_I_DW 1 |
| +#define WF_RX_DESCRIPTOR_I_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_I_MASK 0x02000000 // 25-25 |
| +#define WF_RX_DESCRIPTOR_I_SHIFT 25 |
| +#define WF_RX_DESCRIPTOR_T_DW 1 |
| +#define WF_RX_DESCRIPTOR_T_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_T_MASK 0x04000000 // 26-26 |
| +#define WF_RX_DESCRIPTOR_T_SHIFT 26 |
| +#define WF_RX_DESCRIPTOR_BN_DW 1 |
| +#define WF_RX_DESCRIPTOR_BN_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_BN_MASK 0x18000000 // 28-27 |
| +#define WF_RX_DESCRIPTOR_BN_SHIFT 27 |
| +#define WF_RX_DESCRIPTOR_BIPN_FAIL_DW 1 |
| +#define WF_RX_DESCRIPTOR_BIPN_FAIL_ADDR 4 |
| +#define WF_RX_DESCRIPTOR_BIPN_FAIL_MASK 0x20000000 // 29-29 |
| +#define WF_RX_DESCRIPTOR_BIPN_FAIL_SHIFT 29 |
| +// DW2 |
| +#define WF_RX_DESCRIPTOR_BSSID_DW 2 |
| +#define WF_RX_DESCRIPTOR_BSSID_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_BSSID_MASK 0x0000003f // 5- 0 |
| +#define WF_RX_DESCRIPTOR_BSSID_SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_H_DW 2 |
| +#define WF_RX_DESCRIPTOR_H_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_H_MASK 0x00000080 // 7- 7 |
| +#define WF_RX_DESCRIPTOR_H_SHIFT 7 |
| +#define WF_RX_DESCRIPTOR_HEADER_LENGTH_DW 2 |
| +#define WF_RX_DESCRIPTOR_HEADER_LENGTH_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_HEADER_LENGTH_MASK 0x00001f00 // 12- 8 |
| +#define WF_RX_DESCRIPTOR_HEADER_LENGTH_SHIFT 8 |
| +#define WF_RX_DESCRIPTOR_HO_DW 2 |
| +#define WF_RX_DESCRIPTOR_HO_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_HO_MASK 0x0000e000 // 15-13 |
| +#define WF_RX_DESCRIPTOR_HO_SHIFT 13 |
| +#define WF_RX_DESCRIPTOR_SEC_MODE_DW 2 |
| +#define WF_RX_DESCRIPTOR_SEC_MODE_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_SEC_MODE_MASK 0x001f0000 // 20-16 |
| +#define WF_RX_DESCRIPTOR_SEC_MODE_SHIFT 16 |
| +#define WF_RX_DESCRIPTOR_MUBAR_DW 2 |
| +#define WF_RX_DESCRIPTOR_MUBAR_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_MUBAR_MASK 0x00200000 // 21-21 |
| +#define WF_RX_DESCRIPTOR_MUBAR_SHIFT 21 |
| +#define WF_RX_DESCRIPTOR_SWBIT_DW 2 |
| +#define WF_RX_DESCRIPTOR_SWBIT_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_SWBIT_MASK 0x00400000 // 22-22 |
| +#define WF_RX_DESCRIPTOR_SWBIT_SHIFT 22 |
| +#define WF_RX_DESCRIPTOR_DAF_DW 2 |
| +#define WF_RX_DESCRIPTOR_DAF_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_DAF_MASK 0x00800000 // 23-23 |
| +#define WF_RX_DESCRIPTOR_DAF_SHIFT 23 |
| +#define WF_RX_DESCRIPTOR_EL_DW 2 |
| +#define WF_RX_DESCRIPTOR_EL_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_EL_MASK 0x01000000 // 24-24 |
| +#define WF_RX_DESCRIPTOR_EL_SHIFT 24 |
| +#define WF_RX_DESCRIPTOR_HTF_DW 2 |
| +#define WF_RX_DESCRIPTOR_HTF_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_HTF_MASK 0x02000000 // 25-25 |
| +#define WF_RX_DESCRIPTOR_HTF_SHIFT 25 |
| +#define WF_RX_DESCRIPTOR_INTF_DW 2 |
| +#define WF_RX_DESCRIPTOR_INTF_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_INTF_MASK 0x04000000 // 26-26 |
| +#define WF_RX_DESCRIPTOR_INTF_SHIFT 26 |
| +#define WF_RX_DESCRIPTOR_FRAG_DW 2 |
| +#define WF_RX_DESCRIPTOR_FRAG_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_FRAG_MASK 0x08000000 // 27-27 |
| +#define WF_RX_DESCRIPTOR_FRAG_SHIFT 27 |
| +#define WF_RX_DESCRIPTOR_NUL_DW 2 |
| +#define WF_RX_DESCRIPTOR_NUL_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_NUL_MASK 0x10000000 // 28-28 |
| +#define WF_RX_DESCRIPTOR_NUL_SHIFT 28 |
| +#define WF_RX_DESCRIPTOR_NDATA_DW 2 |
| +#define WF_RX_DESCRIPTOR_NDATA_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_NDATA_MASK 0x20000000 // 29-29 |
| +#define WF_RX_DESCRIPTOR_NDATA_SHIFT 29 |
| +#define WF_RX_DESCRIPTOR_NAMP_DW 2 |
| +#define WF_RX_DESCRIPTOR_NAMP_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_NAMP_MASK 0x40000000 // 30-30 |
| +#define WF_RX_DESCRIPTOR_NAMP_SHIFT 30 |
| +#define WF_RX_DESCRIPTOR_BF_RPT_DW 2 |
| +#define WF_RX_DESCRIPTOR_BF_RPT_ADDR 8 |
| +#define WF_RX_DESCRIPTOR_BF_RPT_MASK 0x80000000 // 31-31 |
| +#define WF_RX_DESCRIPTOR_BF_RPT_SHIFT 31 |
| +// DW3 |
| +#define WF_RX_DESCRIPTOR_RXV_SN_DW 3 |
| +#define WF_RX_DESCRIPTOR_RXV_SN_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_RXV_SN_MASK 0x000000ff // 7- 0 |
| +#define WF_RX_DESCRIPTOR_RXV_SN_SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_CH_FREQUENCY_DW 3 |
| +#define WF_RX_DESCRIPTOR_CH_FREQUENCY_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_CH_FREQUENCY_MASK 0x0000ff00 // 15- 8 |
| +#define WF_RX_DESCRIPTOR_CH_FREQUENCY_SHIFT 8 |
| +#define WF_RX_DESCRIPTOR_A1_TYPE_DW 3 |
| +#define WF_RX_DESCRIPTOR_A1_TYPE_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_A1_TYPE_MASK 0x00030000 // 17-16 |
| +#define WF_RX_DESCRIPTOR_A1_TYPE_SHIFT 16 |
| +#define WF_RX_DESCRIPTOR_HTC_DW 3 |
| +#define WF_RX_DESCRIPTOR_HTC_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_HTC_MASK 0x00040000 // 18-18 |
| +#define WF_RX_DESCRIPTOR_HTC_SHIFT 18 |
| +#define WF_RX_DESCRIPTOR_TCL_DW 3 |
| +#define WF_RX_DESCRIPTOR_TCL_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_TCL_MASK 0x00080000 // 19-19 |
| +#define WF_RX_DESCRIPTOR_TCL_SHIFT 19 |
| +#define WF_RX_DESCRIPTOR_BBM_DW 3 |
| +#define WF_RX_DESCRIPTOR_BBM_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_BBM_MASK 0x00100000 // 20-20 |
| +#define WF_RX_DESCRIPTOR_BBM_SHIFT 20 |
| +#define WF_RX_DESCRIPTOR_BU_DW 3 |
| +#define WF_RX_DESCRIPTOR_BU_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_BU_MASK 0x00200000 // 21-21 |
| +#define WF_RX_DESCRIPTOR_BU_SHIFT 21 |
| +#define WF_RX_DESCRIPTOR_CO_ANT_DW 3 |
| +#define WF_RX_DESCRIPTOR_CO_ANT_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_CO_ANT_MASK 0x00400000 // 22-22 |
| +#define WF_RX_DESCRIPTOR_CO_ANT_SHIFT 22 |
| +#define WF_RX_DESCRIPTOR_BF_CQI_DW 3 |
| +#define WF_RX_DESCRIPTOR_BF_CQI_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_BF_CQI_MASK 0x00800000 // 23-23 |
| +#define WF_RX_DESCRIPTOR_BF_CQI_SHIFT 23 |
| +#define WF_RX_DESCRIPTOR_FC_DW 3 |
| +#define WF_RX_DESCRIPTOR_FC_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_FC_MASK 0x01000000 // 24-24 |
| +#define WF_RX_DESCRIPTOR_FC_SHIFT 24 |
| +#define WF_RX_DESCRIPTOR_VLAN_DW 3 |
| +#define WF_RX_DESCRIPTOR_VLAN_ADDR 12 |
| +#define WF_RX_DESCRIPTOR_VLAN_MASK 0x80000000 // 31-31 |
| +#define WF_RX_DESCRIPTOR_VLAN_SHIFT 31 |
| +// DW4 |
| +#define WF_RX_DESCRIPTOR_PF_DW 4 |
| +#define WF_RX_DESCRIPTOR_PF_ADDR 16 |
| +#define WF_RX_DESCRIPTOR_PF_MASK 0x00000003 // 1- 0 |
| +#define WF_RX_DESCRIPTOR_PF_SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_MAC_DW 4 |
| +#define WF_RX_DESCRIPTOR_MAC_ADDR 16 |
| +#define WF_RX_DESCRIPTOR_MAC_MASK 0x00000004 // 2- 2 |
| +#define WF_RX_DESCRIPTOR_MAC_SHIFT 2 |
| +#define WF_RX_DESCRIPTOR_TID_DW 4 |
| +#define WF_RX_DESCRIPTOR_TID_ADDR 16 |
| +#define WF_RX_DESCRIPTOR_TID_MASK 0x00000078 // 6- 3 |
| +#define WF_RX_DESCRIPTOR_TID_SHIFT 3 |
| +#define WF_RX_DESCRIPTOR_ETHER_TYPE_OFFSET_DW 4 |
| +#define WF_RX_DESCRIPTOR_ETHER_TYPE_OFFSET_ADDR 16 |
| +#define WF_RX_DESCRIPTOR_ETHER_TYPE_OFFSET_MASK 0x00003f80 // 13- 7 |
| +#define WF_RX_DESCRIPTOR_ETHER_TYPE_OFFSET_SHIFT 7 |
| +#define WF_RX_DESCRIPTOR_IP_DW 4 |
| +#define WF_RX_DESCRIPTOR_IP_ADDR 16 |
| +#define WF_RX_DESCRIPTOR_IP_MASK 0x00004000 // 14-14 |
| +#define WF_RX_DESCRIPTOR_IP_SHIFT 14 |
| +#define WF_RX_DESCRIPTOR_UT_DW 4 |
| +#define WF_RX_DESCRIPTOR_UT_ADDR 16 |
| +#define WF_RX_DESCRIPTOR_UT_MASK 0x00008000 // 15-15 |
| +#define WF_RX_DESCRIPTOR_UT_SHIFT 15 |
| +#define WF_RX_DESCRIPTOR_PSE_FID_DW 4 |
| +#define WF_RX_DESCRIPTOR_PSE_FID_ADDR 16 |
| +#define WF_RX_DESCRIPTOR_PSE_FID_MASK 0x0fff0000 // 27-16 |
| +#define WF_RX_DESCRIPTOR_PSE_FID_SHIFT 16 |
| +// DW5 |
| +// DW6 |
| +#define WF_RX_DESCRIPTOR_CLS_BITMAP_31_0__DW 6 |
| +#define WF_RX_DESCRIPTOR_CLS_BITMAP_31_0__ADDR 24 |
| +#define WF_RX_DESCRIPTOR_CLS_BITMAP_31_0__MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_CLS_BITMAP_31_0__SHIFT 0 |
| +// DW7 |
| +#define WF_RX_DESCRIPTOR_CLS_BITMAP_33_32__DW 7 |
| +#define WF_RX_DESCRIPTOR_CLS_BITMAP_33_32__ADDR 28 |
| +#define WF_RX_DESCRIPTOR_CLS_BITMAP_33_32__MASK 0x00000003 // 1- 0 |
| +#define WF_RX_DESCRIPTOR_CLS_BITMAP_33_32__SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_DP_DW 7 |
| +#define WF_RX_DESCRIPTOR_DP_ADDR 28 |
| +#define WF_RX_DESCRIPTOR_DP_MASK 0x00080000 // 19-19 |
| +#define WF_RX_DESCRIPTOR_DP_SHIFT 19 |
| +#define WF_RX_DESCRIPTOR_CLS_DW 7 |
| +#define WF_RX_DESCRIPTOR_CLS_ADDR 28 |
| +#define WF_RX_DESCRIPTOR_CLS_MASK 0x00100000 // 20-20 |
| +#define WF_RX_DESCRIPTOR_CLS_SHIFT 20 |
| +#define WF_RX_DESCRIPTOR_OFLD_DW 7 |
| +#define WF_RX_DESCRIPTOR_OFLD_ADDR 28 |
| +#define WF_RX_DESCRIPTOR_OFLD_MASK 0x00600000 // 22-21 |
| +#define WF_RX_DESCRIPTOR_OFLD_SHIFT 21 |
| +#define WF_RX_DESCRIPTOR_MGC_DW 7 |
| +#define WF_RX_DESCRIPTOR_MGC_ADDR 28 |
| +#define WF_RX_DESCRIPTOR_MGC_MASK 0x00800000 // 23-23 |
| +#define WF_RX_DESCRIPTOR_MGC_SHIFT 23 |
| +#define WF_RX_DESCRIPTOR_WOL_DW 7 |
| +#define WF_RX_DESCRIPTOR_WOL_ADDR 28 |
| +#define WF_RX_DESCRIPTOR_WOL_MASK 0x1f000000 // 28-24 |
| +#define WF_RX_DESCRIPTOR_WOL_SHIFT 24 |
| +#define WF_RX_DESCRIPTOR_PF_MODE_DW 7 |
| +#define WF_RX_DESCRIPTOR_PF_MODE_ADDR 28 |
| +#define WF_RX_DESCRIPTOR_PF_MODE_MASK 0x20000000 // 29-29 |
| +#define WF_RX_DESCRIPTOR_PF_MODE_SHIFT 29 |
| +#define WF_RX_DESCRIPTOR_PF_STS_DW 7 |
| +#define WF_RX_DESCRIPTOR_PF_STS_ADDR 28 |
| +#define WF_RX_DESCRIPTOR_PF_STS_MASK 0xc0000000 // 31-30 |
| +#define WF_RX_DESCRIPTOR_PF_STS_SHIFT 30 |
| +// DW8 |
| +#define WF_RX_DESCRIPTOR_FRAME_CONTROL_FIELD_DW 8 |
| +#define WF_RX_DESCRIPTOR_FRAME_CONTROL_FIELD_ADDR 32 |
| +#define WF_RX_DESCRIPTOR_FRAME_CONTROL_FIELD_MASK 0x0000ffff // 15- 0 |
| +#define WF_RX_DESCRIPTOR_FRAME_CONTROL_FIELD_SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_15_0__DW 8 |
| +#define WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_15_0__ADDR 32 |
| +#define WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_15_0__MASK 0xffff0000 // 31-16 |
| +#define WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_15_0__SHIFT 16 |
| +// DW9 |
| +#define WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_47_16__DW 9 |
| +#define WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_47_16__ADDR 36 |
| +#define WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_47_16__MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_47_16__SHIFT 0 |
| +// DW10 |
| +#define WF_RX_DESCRIPTOR_FRAGMENT_NUMBER_DW 10 |
| +#define WF_RX_DESCRIPTOR_FRAGMENT_NUMBER_ADDR 40 |
| +#define WF_RX_DESCRIPTOR_FRAGMENT_NUMBER_MASK 0x0000000f // 3- 0 |
| +#define WF_RX_DESCRIPTOR_FRAGMENT_NUMBER_SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_SEQUENCE_NUMBER_DW 10 |
| +#define WF_RX_DESCRIPTOR_SEQUENCE_NUMBER_ADDR 40 |
| +#define WF_RX_DESCRIPTOR_SEQUENCE_NUMBER_MASK 0x0000fff0 // 15- 4 |
| +#define WF_RX_DESCRIPTOR_SEQUENCE_NUMBER_SHIFT 4 |
| +#define WF_RX_DESCRIPTOR_QOS_CONTROL_FIELD_DW 10 |
| +#define WF_RX_DESCRIPTOR_QOS_CONTROL_FIELD_ADDR 40 |
| +#define WF_RX_DESCRIPTOR_QOS_CONTROL_FIELD_MASK 0xffff0000 // 31-16 |
| +#define WF_RX_DESCRIPTOR_QOS_CONTROL_FIELD_SHIFT 16 |
| +// DW11 |
| +#define WF_RX_DESCRIPTOR_HT_CONTROL_FIELD_DW 11 |
| +#define WF_RX_DESCRIPTOR_HT_CONTROL_FIELD_ADDR 44 |
| +#define WF_RX_DESCRIPTOR_HT_CONTROL_FIELD_MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_HT_CONTROL_FIELD_SHIFT 0 |
| +// DW12 |
| +#define WF_RX_DESCRIPTOR_PN_31_0__DW 12 |
| +#define WF_RX_DESCRIPTOR_PN_31_0__ADDR 48 |
| +#define WF_RX_DESCRIPTOR_PN_31_0__MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_PN_31_0__SHIFT 0 |
| +// DW13 |
| +#define WF_RX_DESCRIPTOR_PN_63_32__DW 13 |
| +#define WF_RX_DESCRIPTOR_PN_63_32__ADDR 52 |
| +#define WF_RX_DESCRIPTOR_PN_63_32__MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_PN_63_32__SHIFT 0 |
| +// DW14 |
| +#define WF_RX_DESCRIPTOR_PN_95_64__DW 14 |
| +#define WF_RX_DESCRIPTOR_PN_95_64__ADDR 56 |
| +#define WF_RX_DESCRIPTOR_PN_95_64__MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_PN_95_64__SHIFT 0 |
| +// DW15 |
| +#define WF_RX_DESCRIPTOR_PN_127_96__DW 15 |
| +#define WF_RX_DESCRIPTOR_PN_127_96__ADDR 60 |
| +#define WF_RX_DESCRIPTOR_PN_127_96__MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_PN_127_96__SHIFT 0 |
| +// DW16 |
| +#define WF_RX_DESCRIPTOR_TIMESTAMP_DW 16 |
| +#define WF_RX_DESCRIPTOR_TIMESTAMP_ADDR 64 |
| +#define WF_RX_DESCRIPTOR_TIMESTAMP_MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_TIMESTAMP_SHIFT 0 |
| +// DW17 |
| +#define WF_RX_DESCRIPTOR_CRC_DW 17 |
| +#define WF_RX_DESCRIPTOR_CRC_ADDR 68 |
| +#define WF_RX_DESCRIPTOR_CRC_MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_CRC_SHIFT 0 |
| +// DW18 |
| +// DW19 |
| +// DW20 |
| +#define WF_RX_DESCRIPTOR_P_RXV_DW 20 |
| +#define WF_RX_DESCRIPTOR_P_RXV_ADDR 80 |
| +#define WF_RX_DESCRIPTOR_P_RXV_MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_P_RXV_SHIFT 0 |
| +// DW21 |
| +// DO NOT process repeat field(p_rxv) |
| +// DW22 |
| +#define WF_RX_DESCRIPTOR_DBW_DW 22 |
| +#define WF_RX_DESCRIPTOR_DBW_ADDR 88 |
| +#define WF_RX_DESCRIPTOR_DBW_MASK 0x00000007 // 2- 0 |
| +#define WF_RX_DESCRIPTOR_DBW_SHIFT 0 |
| +#define WF_RX_DESCRIPTOR_GI_DW 22 |
| +#define WF_RX_DESCRIPTOR_GI_ADDR 88 |
| +#define WF_RX_DESCRIPTOR_GI_MASK 0x00000018 // 4- 3 |
| +#define WF_RX_DESCRIPTOR_GI_SHIFT 3 |
| +#define WF_RX_DESCRIPTOR_DCM_DW 22 |
| +#define WF_RX_DESCRIPTOR_DCM_ADDR 88 |
| +#define WF_RX_DESCRIPTOR_DCM_MASK 0x00000020 // 5- 5 |
| +#define WF_RX_DESCRIPTOR_DCM_SHIFT 5 |
| +#define WF_RX_DESCRIPTOR_NUM_RX_DW 22 |
| +#define WF_RX_DESCRIPTOR_NUM_RX_ADDR 88 |
| +#define WF_RX_DESCRIPTOR_NUM_RX_MASK 0x000001c0 // 8- 6 |
| +#define WF_RX_DESCRIPTOR_NUM_RX_SHIFT 6 |
| +#define WF_RX_DESCRIPTOR_STBC_DW 22 |
| +#define WF_RX_DESCRIPTOR_STBC_ADDR 88 |
| +#define WF_RX_DESCRIPTOR_STBC_MASK 0x00000600 // 10- 9 |
| +#define WF_RX_DESCRIPTOR_STBC_SHIFT 9 |
| +#define WF_RX_DESCRIPTOR_TX_MODE_DW 22 |
| +#define WF_RX_DESCRIPTOR_TX_MODE_ADDR 88 |
| +#define WF_RX_DESCRIPTOR_TX_MODE_MASK 0x00007800 // 14-11 |
| +#define WF_RX_DESCRIPTOR_TX_MODE_SHIFT 11 |
| +// DW23 |
| +#define WF_RX_DESCRIPTOR_RCPI_DW 23 |
| +#define WF_RX_DESCRIPTOR_RCPI_ADDR 92 |
| +#define WF_RX_DESCRIPTOR_RCPI_MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_RCPI_SHIFT 0 |
| +// DW24 |
| +#define WF_RX_DESCRIPTOR_C_RXV_DW 24 |
| +#define WF_RX_DESCRIPTOR_C_RXV_ADDR 96 |
| +#define WF_RX_DESCRIPTOR_C_RXV_MASK 0xffffffff // 31- 0 |
| +#define WF_RX_DESCRIPTOR_C_RXV_SHIFT 0 |
| +// DW25 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW26 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW27 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW28 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW29 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW30 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW31 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW32 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW33 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW34 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW35 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW36 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW37 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW38 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW39 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW40 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW41 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW42 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW43 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW44 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW45 |
| +// DO NOT process repeat field(c_rxv) |
| +// DW46 |
| +// DW47 |
| + |
| +/* TXD */ |
| +// DW0 |
| +#define WF_TX_DESCRIPTOR_TX_BYTE_COUNT_DW 0 |
| +#define WF_TX_DESCRIPTOR_TX_BYTE_COUNT_ADDR 0 |
| +#define WF_TX_DESCRIPTOR_TX_BYTE_COUNT_MASK 0x0000ffff // 15- 0 |
| +#define WF_TX_DESCRIPTOR_TX_BYTE_COUNT_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_ETHER_TYPE_OFFSET_DW 0 |
| +#define WF_TX_DESCRIPTOR_ETHER_TYPE_OFFSET_ADDR 0 |
| +#define WF_TX_DESCRIPTOR_ETHER_TYPE_OFFSET_MASK 0x007f0000 // 22-16 |
| +#define WF_TX_DESCRIPTOR_ETHER_TYPE_OFFSET_SHIFT 16 |
| +#define WF_TX_DESCRIPTOR_PKT_FT_DW 0 |
| +#define WF_TX_DESCRIPTOR_PKT_FT_ADDR 0 |
| +#define WF_TX_DESCRIPTOR_PKT_FT_MASK 0x01800000 // 24-23 |
| +#define WF_TX_DESCRIPTOR_PKT_FT_SHIFT 23 |
| +#define WF_TX_DESCRIPTOR_Q_IDX_DW 0 |
| +#define WF_TX_DESCRIPTOR_Q_IDX_ADDR 0 |
| +#define WF_TX_DESCRIPTOR_Q_IDX_MASK 0xfe000000 // 31-25 |
| +#define WF_TX_DESCRIPTOR_Q_IDX_SHIFT 25 |
| +// DW1 |
| +#define WF_TX_DESCRIPTOR_MLD_ID_DW 1 |
| +#define WF_TX_DESCRIPTOR_MLD_ID_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_MLD_ID_MASK 0x00000fff // 11- 0 |
| +#define WF_TX_DESCRIPTOR_MLD_ID_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_TGID_DW 1 |
| +#define WF_TX_DESCRIPTOR_TGID_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_TGID_MASK 0x00003000 // 13-12 |
| +#define WF_TX_DESCRIPTOR_TGID_SHIFT 12 |
| +#define WF_TX_DESCRIPTOR_HF_DW 1 |
| +#define WF_TX_DESCRIPTOR_HF_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_HF_MASK 0x0000c000 // 15-14 |
| +#define WF_TX_DESCRIPTOR_HF_SHIFT 14 |
| +#define WF_TX_DESCRIPTOR_HEADER_LENGTH_DW 1 |
| +#define WF_TX_DESCRIPTOR_HEADER_LENGTH_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_HEADER_LENGTH_MASK 0x001f0000 // 20-16 |
| +#define WF_TX_DESCRIPTOR_HEADER_LENGTH_SHIFT 16 |
| +#define WF_TX_DESCRIPTOR_MRD_DW 1 |
| +#define WF_TX_DESCRIPTOR_MRD_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_MRD_MASK 0x00010000 // 16-16 |
| +#define WF_TX_DESCRIPTOR_MRD_SHIFT 16 |
| +#define WF_TX_DESCRIPTOR_EOSP_DW 1 |
| +#define WF_TX_DESCRIPTOR_EOSP_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_EOSP_MASK 0x00020000 // 17-17 |
| +#define WF_TX_DESCRIPTOR_EOSP_SHIFT 17 |
| +#define WF_TX_DESCRIPTOR_EOSP_DW 1 |
| +#define WF_TX_DESCRIPTOR_EOSP_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_EOSP_MASK 0x00020000 // 17-17 |
| +#define WF_TX_DESCRIPTOR_EOSP_SHIFT 17 |
| +#define WF_TX_DESCRIPTOR_AMS_DW 1 |
| +#define WF_TX_DESCRIPTOR_AMS_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_AMS_MASK 0x00040000 // 18-18 |
| +#define WF_TX_DESCRIPTOR_AMS_SHIFT 18 |
| +#define WF_TX_DESCRIPTOR_RMVL_DW 1 |
| +#define WF_TX_DESCRIPTOR_RMVL_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_RMVL_MASK 0x00040000 // 18-18 |
| +#define WF_TX_DESCRIPTOR_RMVL_SHIFT 18 |
| +#define WF_TX_DESCRIPTOR_VLAN_DW 1 |
| +#define WF_TX_DESCRIPTOR_VLAN_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_VLAN_MASK 0x00080000 // 19-19 |
| +#define WF_TX_DESCRIPTOR_VLAN_SHIFT 19 |
| +#define WF_TX_DESCRIPTOR_ETYP_DW 1 |
| +#define WF_TX_DESCRIPTOR_ETYP_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_ETYP_MASK 0x00100000 // 20-20 |
| +#define WF_TX_DESCRIPTOR_ETYP_SHIFT 20 |
| +#define WF_TX_DESCRIPTOR_TID_MGMT_TYPE_DW 1 |
| +#define WF_TX_DESCRIPTOR_TID_MGMT_TYPE_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_TID_MGMT_TYPE_MASK 0x01e00000 // 24-21 |
| +#define WF_TX_DESCRIPTOR_TID_MGMT_TYPE_SHIFT 21 |
| +#define WF_TX_DESCRIPTOR_OM_DW 1 |
| +#define WF_TX_DESCRIPTOR_OM_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_OM_MASK 0x7e000000 // 30-25 |
| +#define WF_TX_DESCRIPTOR_OM_SHIFT 25 |
| +#define WF_TX_DESCRIPTOR_FR_DW 1 |
| +#define WF_TX_DESCRIPTOR_FR_ADDR 4 |
| +#define WF_TX_DESCRIPTOR_FR_MASK 0x80000000 // 31-31 |
| +#define WF_TX_DESCRIPTOR_FR_SHIFT 31 |
| +// DW2 |
| +#define WF_TX_DESCRIPTOR_SUBTYPE_DW 2 |
| +#define WF_TX_DESCRIPTOR_SUBTYPE_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_SUBTYPE_MASK 0x0000000f // 3- 0 |
| +#define WF_TX_DESCRIPTOR_SUBTYPE_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_FTYPE_DW 2 |
| +#define WF_TX_DESCRIPTOR_FTYPE_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_FTYPE_MASK 0x00000030 // 5- 4 |
| +#define WF_TX_DESCRIPTOR_FTYPE_SHIFT 4 |
| +#define WF_TX_DESCRIPTOR_BF_TYPE_DW 2 |
| +#define WF_TX_DESCRIPTOR_BF_TYPE_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_BF_TYPE_MASK 0x000000c0 // 7- 6 |
| +#define WF_TX_DESCRIPTOR_BF_TYPE_SHIFT 6 |
| +#define WF_TX_DESCRIPTOR_OM_MAP_DW 2 |
| +#define WF_TX_DESCRIPTOR_OM_MAP_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_OM_MAP_MASK 0x00000100 // 8- 8 |
| +#define WF_TX_DESCRIPTOR_OM_MAP_SHIFT 8 |
| +#define WF_TX_DESCRIPTOR_RTS_DW 2 |
| +#define WF_TX_DESCRIPTOR_RTS_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_RTS_MASK 0x00000200 // 9- 9 |
| +#define WF_TX_DESCRIPTOR_RTS_SHIFT 9 |
| +#define WF_TX_DESCRIPTOR_HEADER_PADDING_DW 2 |
| +#define WF_TX_DESCRIPTOR_HEADER_PADDING_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_HEADER_PADDING_MASK 0x00000c00 // 11-10 |
| +#define WF_TX_DESCRIPTOR_HEADER_PADDING_SHIFT 10 |
| +#define WF_TX_DESCRIPTOR_DU_DW 2 |
| +#define WF_TX_DESCRIPTOR_DU_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_DU_MASK 0x00001000 // 12-12 |
| +#define WF_TX_DESCRIPTOR_DU_SHIFT 12 |
| +#define WF_TX_DESCRIPTOR_HE_DW 2 |
| +#define WF_TX_DESCRIPTOR_HE_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_HE_MASK 0x00002000 // 13-13 |
| +#define WF_TX_DESCRIPTOR_HE_SHIFT 13 |
| +#define WF_TX_DESCRIPTOR_FRAG_DW 2 |
| +#define WF_TX_DESCRIPTOR_FRAG_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_FRAG_MASK 0x0000c000 // 15-14 |
| +#define WF_TX_DESCRIPTOR_FRAG_SHIFT 14 |
| +#define WF_TX_DESCRIPTOR_REMAINING_TX_TIME_DW 2 |
| +#define WF_TX_DESCRIPTOR_REMAINING_TX_TIME_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_REMAINING_TX_TIME_MASK 0x03ff0000 // 25-16 |
| +#define WF_TX_DESCRIPTOR_REMAINING_TX_TIME_SHIFT 16 |
| +#define WF_TX_DESCRIPTOR_POWER_OFFSET_DW 2 |
| +#define WF_TX_DESCRIPTOR_POWER_OFFSET_ADDR 8 |
| +#define WF_TX_DESCRIPTOR_POWER_OFFSET_MASK 0xfc000000 // 31-26 |
| +#define WF_TX_DESCRIPTOR_POWER_OFFSET_SHIFT 26 |
| +// DW3 |
| +#define WF_TX_DESCRIPTOR_NA_DW 3 |
| +#define WF_TX_DESCRIPTOR_NA_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_NA_MASK 0x00000001 // 0- 0 |
| +#define WF_TX_DESCRIPTOR_NA_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_PF_DW 3 |
| +#define WF_TX_DESCRIPTOR_PF_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_PF_MASK 0x00000002 // 1- 1 |
| +#define WF_TX_DESCRIPTOR_PF_SHIFT 1 |
| +#define WF_TX_DESCRIPTOR_EMRD_DW 3 |
| +#define WF_TX_DESCRIPTOR_EMRD_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_EMRD_MASK 0x00000004 // 2- 2 |
| +#define WF_TX_DESCRIPTOR_EMRD_SHIFT 2 |
| +#define WF_TX_DESCRIPTOR_EEOSP_DW 3 |
| +#define WF_TX_DESCRIPTOR_EEOSP_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_EEOSP_MASK 0x00000008 // 3- 3 |
| +#define WF_TX_DESCRIPTOR_EEOSP_SHIFT 3 |
| +#define WF_TX_DESCRIPTOR_BM_DW 3 |
| +#define WF_TX_DESCRIPTOR_BM_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_BM_MASK 0x00000010 // 4- 4 |
| +#define WF_TX_DESCRIPTOR_BM_SHIFT 4 |
| +#define WF_TX_DESCRIPTOR_HW_AMSDU_CAP_DW 3 |
| +#define WF_TX_DESCRIPTOR_HW_AMSDU_CAP_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_HW_AMSDU_CAP_MASK 0x00000020 // 5- 5 |
| +#define WF_TX_DESCRIPTOR_HW_AMSDU_CAP_SHIFT 5 |
| +#define WF_TX_DESCRIPTOR_TX_COUNT_DW 3 |
| +#define WF_TX_DESCRIPTOR_TX_COUNT_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_TX_COUNT_MASK 0x000007c0 // 10- 6 |
| +#define WF_TX_DESCRIPTOR_TX_COUNT_SHIFT 6 |
| +#define WF_TX_DESCRIPTOR_REMAINING_TX_COUNT_DW 3 |
| +#define WF_TX_DESCRIPTOR_REMAINING_TX_COUNT_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_REMAINING_TX_COUNT_MASK 0x0000f800 // 15-11 |
| +#define WF_TX_DESCRIPTOR_REMAINING_TX_COUNT_SHIFT 11 |
| +#define WF_TX_DESCRIPTOR_SN_DW 3 |
| +#define WF_TX_DESCRIPTOR_SN_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_SN_MASK 0x0fff0000 // 27-16 |
| +#define WF_TX_DESCRIPTOR_SN_SHIFT 16 |
| +#define WF_TX_DESCRIPTOR_BA_DIS_DW 3 |
| +#define WF_TX_DESCRIPTOR_BA_DIS_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_BA_DIS_MASK 0x10000000 // 28-28 |
| +#define WF_TX_DESCRIPTOR_BA_DIS_SHIFT 28 |
| +#define WF_TX_DESCRIPTOR_PM_DW 3 |
| +#define WF_TX_DESCRIPTOR_PM_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_PM_MASK 0x20000000 // 29-29 |
| +#define WF_TX_DESCRIPTOR_PM_SHIFT 29 |
| +#define WF_TX_DESCRIPTOR_PN_VLD_DW 3 |
| +#define WF_TX_DESCRIPTOR_PN_VLD_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_PN_VLD_MASK 0x40000000 // 30-30 |
| +#define WF_TX_DESCRIPTOR_PN_VLD_SHIFT 30 |
| +#define WF_TX_DESCRIPTOR_SN_VLD_DW 3 |
| +#define WF_TX_DESCRIPTOR_SN_VLD_ADDR 12 |
| +#define WF_TX_DESCRIPTOR_SN_VLD_MASK 0x80000000 // 31-31 |
| +#define WF_TX_DESCRIPTOR_SN_VLD_SHIFT 31 |
| +// DW4 |
| +#define WF_TX_DESCRIPTOR_PN_31_0__DW 4 |
| +#define WF_TX_DESCRIPTOR_PN_31_0__ADDR 16 |
| +#define WF_TX_DESCRIPTOR_PN_31_0__MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_PN_31_0__SHIFT 0 |
| +// DW5 |
| +#define WF_TX_DESCRIPTOR_PID_DW 5 |
| +#define WF_TX_DESCRIPTOR_PID_ADDR 20 |
| +#define WF_TX_DESCRIPTOR_PID_MASK 0x000000ff // 7- 0 |
| +#define WF_TX_DESCRIPTOR_PID_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_TXSFM_DW 5 |
| +#define WF_TX_DESCRIPTOR_TXSFM_ADDR 20 |
| +#define WF_TX_DESCRIPTOR_TXSFM_MASK 0x00000100 // 8- 8 |
| +#define WF_TX_DESCRIPTOR_TXSFM_SHIFT 8 |
| +#define WF_TX_DESCRIPTOR_TXS2M_DW 5 |
| +#define WF_TX_DESCRIPTOR_TXS2M_ADDR 20 |
| +#define WF_TX_DESCRIPTOR_TXS2M_MASK 0x00000200 // 9- 9 |
| +#define WF_TX_DESCRIPTOR_TXS2M_SHIFT 9 |
| +#define WF_TX_DESCRIPTOR_TXS2H_DW 5 |
| +#define WF_TX_DESCRIPTOR_TXS2H_ADDR 20 |
| +#define WF_TX_DESCRIPTOR_TXS2H_MASK 0x00000400 // 10-10 |
| +#define WF_TX_DESCRIPTOR_TXS2H_SHIFT 10 |
| +#define WF_TX_DESCRIPTOR_FBCZ_DW 5 |
| +#define WF_TX_DESCRIPTOR_FBCZ_ADDR 20 |
| +#define WF_TX_DESCRIPTOR_FBCZ_MASK 0x00001000 // 12-12 |
| +#define WF_TX_DESCRIPTOR_FBCZ_SHIFT 12 |
| +#define WF_TX_DESCRIPTOR_BYPASS_RBB_DW 5 |
| +#define WF_TX_DESCRIPTOR_BYPASS_RBB_ADDR 20 |
| +#define WF_TX_DESCRIPTOR_BYPASS_RBB_MASK 0x00002000 // 13-13 |
| +#define WF_TX_DESCRIPTOR_BYPASS_RBB_SHIFT 13 |
| +#define WF_TX_DESCRIPTOR_BYPASS_TBB_DW 5 |
| +#define WF_TX_DESCRIPTOR_BYPASS_TBB_ADDR 20 |
| +#define WF_TX_DESCRIPTOR_BYPASS_TBB_MASK 0x00004000 // 14-14 |
| +#define WF_TX_DESCRIPTOR_BYPASS_TBB_SHIFT 14 |
| +#define WF_TX_DESCRIPTOR_FL_DW 5 |
| +#define WF_TX_DESCRIPTOR_FL_ADDR 20 |
| +#define WF_TX_DESCRIPTOR_FL_MASK 0x00008000 // 15-15 |
| +#define WF_TX_DESCRIPTOR_FL_SHIFT 15 |
| +#define WF_TX_DESCRIPTOR_PN_47_32__DW 5 |
| +#define WF_TX_DESCRIPTOR_PN_47_32__ADDR 20 |
| +#define WF_TX_DESCRIPTOR_PN_47_32__MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_PN_47_32__SHIFT 16 |
| +// DW6 |
| +#define WF_TX_DESCRIPTOR_AMSDU_CAP_UTXB_DW 6 |
| +#define WF_TX_DESCRIPTOR_AMSDU_CAP_UTXB_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_AMSDU_CAP_UTXB_MASK 0x00000002 // 1- 1 |
| +#define WF_TX_DESCRIPTOR_AMSDU_CAP_UTXB_SHIFT 1 |
| +#define WF_TX_DESCRIPTOR_DAS_DW 6 |
| +#define WF_TX_DESCRIPTOR_DAS_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_DAS_MASK 0x00000004 // 2- 2 |
| +#define WF_TX_DESCRIPTOR_DAS_SHIFT 2 |
| +#define WF_TX_DESCRIPTOR_DIS_MAT_DW 6 |
| +#define WF_TX_DESCRIPTOR_DIS_MAT_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_DIS_MAT_MASK 0x00000008 // 3- 3 |
| +#define WF_TX_DESCRIPTOR_DIS_MAT_SHIFT 3 |
| +#define WF_TX_DESCRIPTOR_MSDU_COUNT_DW 6 |
| +#define WF_TX_DESCRIPTOR_MSDU_COUNT_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_MSDU_COUNT_MASK 0x000003f0 // 9- 4 |
| +#define WF_TX_DESCRIPTOR_MSDU_COUNT_SHIFT 4 |
| +#define WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_IDX_DW 6 |
| +#define WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_IDX_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_IDX_MASK 0x00007c00 // 14-10 |
| +#define WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_IDX_SHIFT 10 |
| +#define WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_EN_DW 6 |
| +#define WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_EN_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_EN_MASK 0x00008000 // 15-15 |
| +#define WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_EN_SHIFT 15 |
| +#define WF_TX_DESCRIPTOR_FIXED_RATE_IDX_DW 6 |
| +#define WF_TX_DESCRIPTOR_FIXED_RATE_IDX_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_FIXED_RATE_IDX_MASK 0x003f0000 // 21-16 |
| +#define WF_TX_DESCRIPTOR_FIXED_RATE_IDX_SHIFT 16 |
| +#define WF_TX_DESCRIPTOR_BW_DW 6 |
| +#define WF_TX_DESCRIPTOR_BW_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_BW_MASK 0x03c00000 // 25-22 |
| +#define WF_TX_DESCRIPTOR_BW_SHIFT 22 |
| +#define WF_TX_DESCRIPTOR_VTA_DW 6 |
| +#define WF_TX_DESCRIPTOR_VTA_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_VTA_MASK 0x10000000 // 28-28 |
| +#define WF_TX_DESCRIPTOR_VTA_SHIFT 28 |
| +#define WF_TX_DESCRIPTOR_SRC_DW 6 |
| +#define WF_TX_DESCRIPTOR_SRC_ADDR 24 |
| +#define WF_TX_DESCRIPTOR_SRC_MASK 0xc0000000 // 31-30 |
| +#define WF_TX_DESCRIPTOR_SRC_SHIFT 30 |
| +// DW7 |
| +#define WF_TX_DESCRIPTOR_SW_TX_TIME_DW 7 |
| +#define WF_TX_DESCRIPTOR_SW_TX_TIME_ADDR 28 |
| +#define WF_TX_DESCRIPTOR_SW_TX_TIME_MASK 0x000003ff // 9- 0 |
| +#define WF_TX_DESCRIPTOR_SW_TX_TIME_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_UT_DW 7 |
| +#define WF_TX_DESCRIPTOR_UT_ADDR 28 |
| +#define WF_TX_DESCRIPTOR_UT_MASK 0x00008000 // 15-15 |
| +#define WF_TX_DESCRIPTOR_UT_SHIFT 15 |
| +#define WF_TX_DESCRIPTOR_CTXD_CNT_DW 7 |
| +#define WF_TX_DESCRIPTOR_CTXD_CNT_ADDR 28 |
| +#define WF_TX_DESCRIPTOR_CTXD_CNT_MASK 0x03c00000 // 25-22 |
| +#define WF_TX_DESCRIPTOR_CTXD_CNT_SHIFT 22 |
| +#define WF_TX_DESCRIPTOR_CTXD_DW 7 |
| +#define WF_TX_DESCRIPTOR_CTXD_ADDR 28 |
| +#define WF_TX_DESCRIPTOR_CTXD_MASK 0x04000000 // 26-26 |
| +#define WF_TX_DESCRIPTOR_CTXD_SHIFT 26 |
| +#define WF_TX_DESCRIPTOR_HM_DW 7 |
| +#define WF_TX_DESCRIPTOR_HM_ADDR 28 |
| +#define WF_TX_DESCRIPTOR_HM_MASK 0x08000000 // 27-27 |
| +#define WF_TX_DESCRIPTOR_HM_SHIFT 27 |
| +#define WF_TX_DESCRIPTOR_DP_DW 7 |
| +#define WF_TX_DESCRIPTOR_DP_ADDR 28 |
| +#define WF_TX_DESCRIPTOR_DP_MASK 0x10000000 // 28-28 |
| +#define WF_TX_DESCRIPTOR_DP_SHIFT 28 |
| +#define WF_TX_DESCRIPTOR_IP_DW 7 |
| +#define WF_TX_DESCRIPTOR_IP_ADDR 28 |
| +#define WF_TX_DESCRIPTOR_IP_MASK 0x20000000 // 29-29 |
| +#define WF_TX_DESCRIPTOR_IP_SHIFT 29 |
| +#define WF_TX_DESCRIPTOR_TXD_LEN_DW 7 |
| +#define WF_TX_DESCRIPTOR_TXD_LEN_ADDR 28 |
| +#define WF_TX_DESCRIPTOR_TXD_LEN_MASK 0xc0000000 // 31-30 |
| +#define WF_TX_DESCRIPTOR_TXD_LEN_SHIFT 30 |
| +// DW8 |
| +#define WF_TX_DESCRIPTOR_MSDU0_DW 8 |
| +#define WF_TX_DESCRIPTOR_MSDU0_ADDR 32 |
| +#define WF_TX_DESCRIPTOR_MSDU0_MASK 0x0000ffff // 15- 0 |
| +#define WF_TX_DESCRIPTOR_MSDU0_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_MSDU1_DW 8 |
| +#define WF_TX_DESCRIPTOR_MSDU1_ADDR 32 |
| +#define WF_TX_DESCRIPTOR_MSDU1_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_MSDU1_SHIFT 16 |
| +// DW9 |
| +#define WF_TX_DESCRIPTOR_MSDU2_DW 9 |
| +#define WF_TX_DESCRIPTOR_MSDU2_ADDR 36 |
| +#define WF_TX_DESCRIPTOR_MSDU2_MASK 0x0000ffff // 15- 0 |
| +#define WF_TX_DESCRIPTOR_MSDU2_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_MSDU3_DW 9 |
| +#define WF_TX_DESCRIPTOR_MSDU3_ADDR 36 |
| +#define WF_TX_DESCRIPTOR_MSDU3_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_MSDU3_SHIFT 16 |
| +// DW10 |
| +#define WF_TX_DESCRIPTOR_TXP0_DW 10 |
| +#define WF_TX_DESCRIPTOR_TXP0_ADDR 40 |
| +#define WF_TX_DESCRIPTOR_TXP0_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP0_SHIFT 0 |
| +// DW11 |
| +// DO NOT process repeat field(txp[0]) |
| +#define WF_TX_DESCRIPTOR_TXP1_DW 11 |
| +#define WF_TX_DESCRIPTOR_TXP1_ADDR 44 |
| +#define WF_TX_DESCRIPTOR_TXP1_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP1_SHIFT 16 |
| +// DW12 |
| +// DO NOT process repeat field(txp[1]) |
| +// DW13 |
| +#define WF_TX_DESCRIPTOR_TXP2_DW 13 |
| +#define WF_TX_DESCRIPTOR_TXP2_ADDR 52 |
| +#define WF_TX_DESCRIPTOR_TXP2_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP2_SHIFT 0 |
| +// DW14 |
| +// DO NOT process repeat field(txp[2]) |
| +#define WF_TX_DESCRIPTOR_TXP3_DW 14 |
| +#define WF_TX_DESCRIPTOR_TXP3_ADDR 56 |
| +#define WF_TX_DESCRIPTOR_TXP3_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP3_SHIFT 16 |
| +// DW15 |
| +// DO NOT process repeat field(txp[3]) |
| +// DW16 |
| +#define WF_TX_DESCRIPTOR_MSDU4_DW 16 |
| +#define WF_TX_DESCRIPTOR_MSDU4_ADDR 64 |
| +#define WF_TX_DESCRIPTOR_MSDU4_MASK 0x0000ffff // 15- 0 |
| +#define WF_TX_DESCRIPTOR_MSDU4_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_MSDU5_DW 16 |
| +#define WF_TX_DESCRIPTOR_MSDU5_ADDR 64 |
| +#define WF_TX_DESCRIPTOR_MSDU5_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_MSDU5_SHIFT 16 |
| +// DW17 |
| +#define WF_TX_DESCRIPTOR_MSDU6_DW 17 |
| +#define WF_TX_DESCRIPTOR_MSDU6_ADDR 68 |
| +#define WF_TX_DESCRIPTOR_MSDU6_MASK 0x0000ffff // 15- 0 |
| +#define WF_TX_DESCRIPTOR_MSDU6_SHIFT 0 |
| +#define WF_TX_DESCRIPTOR_MSDU7_DW 17 |
| +#define WF_TX_DESCRIPTOR_MSDU7_ADDR 68 |
| +#define WF_TX_DESCRIPTOR_MSDU7_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_MSDU7_SHIFT 16 |
| +// DW18 |
| +#define WF_TX_DESCRIPTOR_TXP4_DW 18 |
| +#define WF_TX_DESCRIPTOR_TXP4_ADDR 72 |
| +#define WF_TX_DESCRIPTOR_TXP4_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP4_SHIFT 0 |
| +// DW19 |
| +// DO NOT process repeat field(txp[4]) |
| +#define WF_TX_DESCRIPTOR_TXP5_DW 19 |
| +#define WF_TX_DESCRIPTOR_TXP5_ADDR 76 |
| +#define WF_TX_DESCRIPTOR_TXP5_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP5_SHIFT 16 |
| +// DW20 |
| +// DO NOT process repeat field(txp[5]) |
| +// DW21 |
| +#define WF_TX_DESCRIPTOR_TXP6_DW 21 |
| +#define WF_TX_DESCRIPTOR_TXP6_ADDR 84 |
| +#define WF_TX_DESCRIPTOR_TXP6_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP6_SHIFT 0 |
| +// DW22 |
| +// DO NOT process repeat field(txp[6]) |
| +#define WF_TX_DESCRIPTOR_TXP7_DW 22 |
| +#define WF_TX_DESCRIPTOR_TXP7_ADDR 88 |
| +#define WF_TX_DESCRIPTOR_TXP7_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP7_SHIFT 16 |
| +// DW23 |
| +// DO NOT process repeat field(txp[7]) |
| +// DW24 |
| +#define WF_TX_DESCRIPTOR_TXP8_DW 24 |
| +#define WF_TX_DESCRIPTOR_TXP8_ADDR 96 |
| +#define WF_TX_DESCRIPTOR_TXP8_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP8_SHIFT 0 |
| +// DW25 |
| +// DO NOT process repeat field(txp[8]) |
| +#define WF_TX_DESCRIPTOR_TXP9_DW 25 |
| +#define WF_TX_DESCRIPTOR_TXP9_ADDR 100 |
| +#define WF_TX_DESCRIPTOR_TXP9_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP9_SHIFT 16 |
| +// DW26 |
| +// DO NOT process repeat field(txp[9]) |
| +// DW27 |
| +#define WF_TX_DESCRIPTOR_TXP10_DW 27 |
| +#define WF_TX_DESCRIPTOR_TXP10_ADDR 108 |
| +#define WF_TX_DESCRIPTOR_TXP10_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP10_SHIFT 0 |
| +// DW28 |
| +// DO NOT process repeat field(txp[10]) |
| +#define WF_TX_DESCRIPTOR_TXP11_DW 28 |
| +#define WF_TX_DESCRIPTOR_TXP11_ADDR 112 |
| +#define WF_TX_DESCRIPTOR_TXP11_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP11_SHIFT 16 |
| +// DW29 |
| +// DO NOT process repeat field(txp[11]) |
| +// DW30 |
| +#define WF_TX_DESCRIPTOR_TXP12_DW 30 |
| +#define WF_TX_DESCRIPTOR_TXP12_ADDR 120 |
| +#define WF_TX_DESCRIPTOR_TXP12_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP12_SHIFT 0 |
| +// DW31 |
| +// DO NOT process repeat field(txp[12]) |
| +#define WF_TX_DESCRIPTOR_TXP13_DW 31 |
| +#define WF_TX_DESCRIPTOR_TXP13_ADDR 124 |
| +#define WF_TX_DESCRIPTOR_TXP13_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP13_SHIFT 16 |
| +// DW32 |
| +// DO NOT process repeat field(txp[13]) |
| +// DW33 |
| +#define WF_TX_DESCRIPTOR_TXP14_DW 33 |
| +#define WF_TX_DESCRIPTOR_TXP14_ADDR 132 |
| +#define WF_TX_DESCRIPTOR_TXP14_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP14_SHIFT 0 |
| +// DW34 |
| +// DO NOT process repeat field(txp[14]) |
| +#define WF_TX_DESCRIPTOR_TXP15_DW 34 |
| +#define WF_TX_DESCRIPTOR_TXP15_ADDR 136 |
| +#define WF_TX_DESCRIPTOR_TXP15_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP15_SHIFT 16 |
| +// DW35 |
| +// DO NOT process repeat field(txp[15]) |
| +// DW36 |
| +#define WF_TX_DESCRIPTOR_TXP16_DW 36 |
| +#define WF_TX_DESCRIPTOR_TXP16_ADDR 144 |
| +#define WF_TX_DESCRIPTOR_TXP16_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP16_SHIFT 0 |
| +// DW37 |
| +// DO NOT process repeat field(txp[16]) |
| +#define WF_TX_DESCRIPTOR_TXP17_DW 37 |
| +#define WF_TX_DESCRIPTOR_TXP17_ADDR 148 |
| +#define WF_TX_DESCRIPTOR_TXP17_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP17_SHIFT 16 |
| +// DW38 |
| +// DO NOT process repeat field(txp[17]) |
| +// DW39 |
| +#define WF_TX_DESCRIPTOR_TXP18_DW 39 |
| +#define WF_TX_DESCRIPTOR_TXP18_ADDR 156 |
| +#define WF_TX_DESCRIPTOR_TXP18_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP18_SHIFT 0 |
| +// DW40 |
| +// DO NOT process repeat field(txp[18]) |
| +#define WF_TX_DESCRIPTOR_TXP19_DW 40 |
| +#define WF_TX_DESCRIPTOR_TXP19_ADDR 160 |
| +#define WF_TX_DESCRIPTOR_TXP19_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP19_SHIFT 16 |
| +// DW41 |
| +// DO NOT process repeat field(txp[19]) |
| +// DW42 |
| +#define WF_TX_DESCRIPTOR_TXP20_DW 42 |
| +#define WF_TX_DESCRIPTOR_TXP20_ADDR 168 |
| +#define WF_TX_DESCRIPTOR_TXP20_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP20_SHIFT 0 |
| +// DW43 |
| +// DO NOT process repeat field(txp[20]) |
| +#define WF_TX_DESCRIPTOR_TXP21_DW 43 |
| +#define WF_TX_DESCRIPTOR_TXP21_ADDR 172 |
| +#define WF_TX_DESCRIPTOR_TXP21_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP21_SHIFT 16 |
| +// DW44 |
| +// DO NOT process repeat field(txp[21]) |
| +// DW45 |
| +#define WF_TX_DESCRIPTOR_TXP22_DW 45 |
| +#define WF_TX_DESCRIPTOR_TXP22_ADDR 180 |
| +#define WF_TX_DESCRIPTOR_TXP22_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP22_SHIFT 0 |
| +// DW46 |
| +// DO NOT process repeat field(txp[22]) |
| +#define WF_TX_DESCRIPTOR_TXP23_DW 46 |
| +#define WF_TX_DESCRIPTOR_TXP23_ADDR 184 |
| +#define WF_TX_DESCRIPTOR_TXP23_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP23_SHIFT 16 |
| +// DW47 |
| +// DO NOT process repeat field(txp[23]) |
| +// DW48 |
| +#define WF_TX_DESCRIPTOR_TXP24_DW 48 |
| +#define WF_TX_DESCRIPTOR_TXP24_ADDR 192 |
| +#define WF_TX_DESCRIPTOR_TXP24_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP24_SHIFT 0 |
| +// DW49 |
| +// DO NOT process repeat field(txp[24]) |
| +#define WF_TX_DESCRIPTOR_TXP25_DW 49 |
| +#define WF_TX_DESCRIPTOR_TXP25_ADDR 196 |
| +#define WF_TX_DESCRIPTOR_TXP25_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP25_SHIFT 16 |
| +// DW50 |
| +// DO NOT process repeat field(txp[25]) |
| +// DW51 |
| +#define WF_TX_DESCRIPTOR_TXP26_DW 51 |
| +#define WF_TX_DESCRIPTOR_TXP26_ADDR 204 |
| +#define WF_TX_DESCRIPTOR_TXP26_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP26_SHIFT 0 |
| +// DW52 |
| +// DO NOT process repeat field(txp[26]) |
| +#define WF_TX_DESCRIPTOR_TXP27_DW 52 |
| +#define WF_TX_DESCRIPTOR_TXP27_ADDR 208 |
| +#define WF_TX_DESCRIPTOR_TXP27_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP27_SHIFT 16 |
| +// DW53 |
| +// DO NOT process repeat field(txp[27]) |
| +// DW54 |
| +#define WF_TX_DESCRIPTOR_TXP28_DW 54 |
| +#define WF_TX_DESCRIPTOR_TXP28_ADDR 216 |
| +#define WF_TX_DESCRIPTOR_TXP28_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP28_SHIFT 0 |
| +// DW55 |
| +// DO NOT process repeat field(txp[28]) |
| +#define WF_TX_DESCRIPTOR_TXP29_DW 55 |
| +#define WF_TX_DESCRIPTOR_TXP29_ADDR 220 |
| +#define WF_TX_DESCRIPTOR_TXP29_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP29_SHIFT 16 |
| +// DW56 |
| +// DO NOT process repeat field(txp[29]) |
| +// DW57 |
| +#define WF_TX_DESCRIPTOR_TXP30_DW 57 |
| +#define WF_TX_DESCRIPTOR_TXP30_ADDR 228 |
| +#define WF_TX_DESCRIPTOR_TXP30_MASK 0xffffffff // 31- 0 |
| +#define WF_TX_DESCRIPTOR_TXP30_SHIFT 0 |
| +// DW58 |
| +// DO NOT process repeat field(txp[30]) |
| +#define WF_TX_DESCRIPTOR_TXP31_DW 58 |
| +#define WF_TX_DESCRIPTOR_TXP31_ADDR 232 |
| +#define WF_TX_DESCRIPTOR_TXP31_MASK 0xffff0000 // 31-16 |
| +#define WF_TX_DESCRIPTOR_TXP31_SHIFT 16 |
| +// DW59 |
| +// DO NOT process repeat field(txp[31]) |
| + |
| +/* TXP PAO */ |
| +#define HIF_TXP_V2_SIZE (24 * 4) |
| +/* DW0 */ |
| +#define HIF_TXD_VERSION_SHIFT 19 |
| +#define HIF_TXD_VERSION_MASK 0x00780000 |
| + |
| +/* DW8 */ |
| +#define HIF_TXP_PRIORITY_SHIFT 0 |
| +#define HIF_TXP_PRIORITY_MASK 0x00000001 |
| +#define HIF_TXP_FIXED_RATE_SHIFT 1 |
| +#define HIF_TXP_FIXED_RATE_MASK 0x00000002 |
| +#define HIF_TXP_TCP_SHIFT 2 |
| +#define HIF_TXP_TCP_MASK 0x00000004 |
| +#define HIF_TXP_NON_CIPHER_SHIFT 3 |
| +#define HIF_TXP_NON_CIPHER_MASK 0x00000008 |
| +#define HIF_TXP_VLAN_SHIFT 4 |
| +#define HIF_TXP_VLAN_MASK 0x00000010 |
| +#define HIF_TXP_BC_MC_FLAG_SHIFT 5 |
| +#define HIF_TXP_BC_MC_FLAG_MASK 0x00000060 |
| +#define HIF_TXP_FR_HOST_SHIFT 7 |
| +#define HIF_TXP_FR_HOST_MASK 0x00000080 |
| +#define HIF_TXP_ETYPE_SHIFT 8 |
| +#define HIF_TXP_ETYPE_MASK 0x00000100 |
| +#define HIF_TXP_TXP_AMSDU_SHIFT 9 |
| +#define HIF_TXP_TXP_AMSDU_MASK 0x00000200 |
| +#define HIF_TXP_TXP_MC_CLONE_SHIFT 10 |
| +#define HIF_TXP_TXP_MC_CLONE_MASK 0x00000400 |
| +#define HIF_TXP_TOKEN_ID_SHIFT 16 |
| +#define HIF_TXP_TOKEN_ID_MASK 0xffff0000 |
| + |
| +/* DW9 */ |
| +#define HIF_TXP_BSS_IDX_SHIFT 0 |
| +#define HIF_TXP_BSS_IDX_MASK 0x000000ff |
| +#define HIF_TXP_USER_PRIORITY_SHIFT 8 |
| +#define HIF_TXP_USER_PRIORITY_MASK 0x0000ff00 |
| +#define HIF_TXP_BUF_NUM_SHIFT 16 |
| +#define HIF_TXP_BUF_NUM_MASK 0x001f0000 |
| +#define HIF_TXP_MSDU_CNT_SHIFT 21 |
| +#define HIF_TXP_MSDU_CNT_MASK 0x03e00000 |
| +#define HIF_TXP_SRC_SHIFT 26 |
| +#define HIF_TXP_SRC_MASK 0x0c000000 |
| + |
| +/* DW10 */ |
| +#define HIF_TXP_ETH_TYPE_SHIFT 0 |
| +#define HIF_TXP_ETH_TYPE_MASK 0x0000ffff |
| +#define HIF_TXP_WLAN_IDX_SHIFT 16 |
| +#define HIF_TXP_WLAN_IDX_MASK 0x0fff0000 |
| + |
| +/* DW11 */ |
| +#define HIF_TXP_PPE_INFO_SHIFT 0 |
| +#define HIF_TXP_PPE_INFO_MASK 0xffffffff |
| + |
| +/* DW12 - DW31 */ |
| +#define HIF_TXP_BUF_PTR0_L_SHIFT 0 |
| +#define HIF_TXP_BUF_PTR0_L_MASK 0xffffffff |
| +#define HIF_TXP_BUF_LEN0_SHIFT 0 |
| +#define HIF_TXP_BUF_LEN0_MASK 0x00000fff |
| +#define HIF_TXP_BUF_PTR0_H_SHIFT 12 |
| +#define HIF_TXP_BUF_PTR0_H_MASK 0x0000f000 |
| +#define HIF_TXP_BUF_LEN1_SHIFT 16 |
| +#define HIF_TXP_BUF_LEN1_MASK 0x0fff0000 |
| +#define HIF_TXP_BUF_PTR1_H_SHIFT 28 |
| +#define HIF_TXP_BUF_PTR1_H_MASK 0xf0000000 |
| +#define HIF_TXP_BUF_PTR1_L_SHIFT 0 |
| +#define HIF_TXP_BUF_PTR1_L_MASK 0xffffffff |
| + |
| +/* DW31 */ |
| +#define HIF_TXP_ML_SHIFT 16 |
| +#define HIF_TXP_ML_MASK 0xffff0000 |
| + |
| +#endif |
| + |
| +#endif |
| diff --git a/mt7996/mtk_debugfs_i.c b/mt7996/mtk_debugfs_i.c |
| new file mode 100644 |
| index 0000000..ea412cd |
| --- /dev/null |
| +++ b/mt7996/mtk_debugfs_i.c |
| @@ -0,0 +1,720 @@ |
| +#include <linux/inet.h> |
| +#include "mt7996.h" |
| +#include "../mt76.h" |
| +#include "mcu.h" |
| +#include "mac.h" |
| +#include "eeprom.h" |
| +#include "mtk_debug.h" |
| +#include "mtk_debug_i.h" |
| +#include "mtk_mcu.h" |
| + |
| +#ifdef CONFIG_MTK_DEBUG |
| + |
| +#define info_or_seq_printf(seq, fmt, ...) do { \ |
| + if (seq) \ |
| + seq_printf(seq, fmt, ##__VA_ARGS__); \ |
| + else \ |
| + pr_info(fmt, ##__VA_ARGS__); \ |
| +} while (0) |
| + |
| +static void info_or_seq_hex_dump(struct seq_file *seq, int prefix_type, |
| + int rowsize, int groupsize, const void *buf, |
| + size_t len, bool ascii) |
| +{ |
| + if (seq) |
| + seq_hex_dump(seq, "", prefix_type, rowsize, groupsize, |
| + buf, len, ascii); |
| + else |
| + print_hex_dump(KERN_INFO, "", prefix_type, |
| + rowsize, groupsize, buf, len, ascii); |
| +} |
| + |
| +//bmac dump mac txp |
| +static void mt7996_dump_bmac_mac_txp_info(struct seq_file *s, struct mt7996_dev *dev, |
| + __le32 *txp) |
| +{ |
| + struct mt7996_txp_token { |
| + __le16 msdu[4]; |
| + } *msdu; |
| + struct mt7996_txp_ptr { |
| + __le32 addr1; |
| + __le32 addr_info; |
| + __le32 addr2; |
| + } *ptr; |
| + int i = 0; |
| + |
| + for (i = 0; i < 12; i = i+2 ) { |
| + if (i == 0 || i == 4) { |
| + msdu = (struct mt7996_txp_token *) txp; |
| + info_or_seq_printf(s, "msdu token(%d-%d)=%ld %ld %ld %ld (0x%08x-0x%08x)\n", i, i+3, |
| + (msdu->msdu[0] & GENMASK(14, 0)), |
| + (msdu->msdu[1] & GENMASK(14, 0)), |
| + (msdu->msdu[2] & GENMASK(14, 0)), |
| + (msdu->msdu[3] & GENMASK(14, 0)), *txp, *(txp+1)); |
| + txp = txp + 2; |
| + } |
| + ptr = (struct mt7996_txp_ptr *) txp; |
| + info_or_seq_printf(s, "ptr%02d : addr(0x%08x) len(%ld) addr_h(%02lx) SRC(%d) ML(%d) \n", |
| + i, ptr->addr1, |
| + FIELD_GET(GENMASK(11, 0), ptr->addr_info), |
| + FIELD_GET(GENMASK(13, 12), ptr->addr_info), |
| + !!(ptr->addr_info & BIT(14)), |
| + !!(ptr->addr_info & BIT(15))); |
| + info_or_seq_printf(s, "ptr%02d : addr(0x%08x) len(%ld) addr_h(%02lx) SRC(%d) ML(%d) \n", |
| + i+1, ptr->addr2, |
| + FIELD_GET(GENMASK(27, 16), ptr->addr_info), |
| + FIELD_GET(GENMASK(29, 28), ptr->addr_info), |
| + !!(ptr->addr_info & BIT(30)), |
| + !!(ptr->addr_info & BIT(31))); |
| + txp = txp + 3; |
| + } |
| +} |
| + |
| +//bmac dump hif txp |
| +void mt7996_dump_bmac_hif_txp_info(struct seq_file *s, struct mt7996_dev *dev, |
| + __le32 *txp, u32 hif_txp_ver) |
| +{ |
| + int i, j = 0; |
| + u32 dw; |
| + |
| + info_or_seq_printf(s, "txp raw data: size=%d\n", HIF_TXP_V2_SIZE); |
| + info_or_seq_hex_dump(s, DUMP_PREFIX_OFFSET, 16, 1, (u8 *)txp, HIF_TXP_V2_SIZE, false); |
| + |
| + info_or_seq_printf(s, "BMAC_TXP Fields:\n"); |
| + |
| + /* dw0 */ |
| + if (hif_txp_ver == 2) { |
| + dw = le32_to_cpu(txp[0]); |
| + info_or_seq_printf(s, "HIF_TXP_PRIORITY = %d\n", |
| + GET_FIELD(HIF_TXP_PRIORITY, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_FIXED_RATE = %d\n", |
| + GET_FIELD(HIF_TXP_FIXED_RATE, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_TCP = %d\n", |
| + GET_FIELD(HIF_TXP_TCP, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_NON_CIPHER = %d\n", |
| + GET_FIELD(HIF_TXP_NON_CIPHER, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_VLAN = %d\n", |
| + GET_FIELD(HIF_TXP_VLAN, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_BC_MC_FLAG = %d\n", |
| + GET_FIELD(HIF_TXP_BC_MC_FLAG, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_FR_HOST = %d\n", |
| + GET_FIELD(HIF_TXP_FR_HOST, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_ETYPE = %d\n", |
| + GET_FIELD(HIF_TXP_ETYPE, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_TXP_AMSDU = %d\n", |
| + GET_FIELD(HIF_TXP_TXP_AMSDU, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_TXP_MC_CLONE = %d\n", |
| + GET_FIELD(HIF_TXP_TXP_MC_CLONE, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_TOKEN_ID = %d\n", |
| + GET_FIELD(HIF_TXP_TOKEN_ID, dw)); |
| + |
| + /* dw1 */ |
| + dw = le32_to_cpu(txp[1]); |
| + info_or_seq_printf(s, "HIF_TXP_BSS_IDX = %d\n", |
| + GET_FIELD(HIF_TXP_BSS_IDX, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_USER_PRIORITY = %d\n", |
| + GET_FIELD(HIF_TXP_USER_PRIORITY, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_BUF_NUM = %d\n", |
| + GET_FIELD(HIF_TXP_BUF_NUM, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_MSDU_CNT = %d\n", |
| + GET_FIELD(HIF_TXP_MSDU_CNT, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_SRC = %d\n", |
| + GET_FIELD(HIF_TXP_SRC, dw)); |
| + |
| + /* dw2 */ |
| + dw = le32_to_cpu(txp[2]); |
| + info_or_seq_printf(s, "HIF_TXP_ETH_TYPE(network-endian) = 0x%x\n", |
| + GET_FIELD(HIF_TXP_ETH_TYPE, dw)); |
| + info_or_seq_printf(s, "HIF_TXP_WLAN_IDX = %d\n", |
| + GET_FIELD(HIF_TXP_WLAN_IDX, dw)); |
| + |
| + /* dw3 */ |
| + dw = le32_to_cpu(txp[3]); |
| + info_or_seq_printf(s, "HIF_TXP_PPE_INFO = 0x%x\n", |
| + GET_FIELD(HIF_TXP_PPE_INFO, dw)); |
| + |
| + for (i = 0; i < 13; i++) { |
| + if (i % 2 == 0) { |
| + info_or_seq_printf(s, "HIF_TXP_BUF_PTR%d_L = 0x%x\n", |
| + i, GET_FIELD(HIF_TXP_BUF_PTR0_L, |
| + le32_to_cpu(txp[4 + j]))); |
| + j++; |
| + info_or_seq_printf(s, "HIF_TXP_BUF_LEN%d = %d\n", |
| + i, GET_FIELD(HIF_TXP_BUF_LEN0, le32_to_cpu(txp[4 + j]))); |
| + info_or_seq_printf(s, "HIF_TXP_BUF_PTR%d_H = 0x%x\n", |
| + i, GET_FIELD(HIF_TXP_BUF_PTR0_H, le32_to_cpu(txp[4 + j]))); |
| + if (i <= 10) { |
| + info_or_seq_printf(s, "HIF_TXP_BUF_LEN%d = %d\n", |
| + i + 1, GET_FIELD(HIF_TXP_BUF_LEN1, le32_to_cpu(txp[4 + j]))); |
| + info_or_seq_printf(s, "HIF_TXP_BUF_PTR%d_H = 0x%x\n", |
| + i + 1, GET_FIELD(HIF_TXP_BUF_PTR1_H, le32_to_cpu(txp[4 + j]))); |
| + } |
| + j++; |
| + } else { |
| + info_or_seq_printf(s, "HIF_TXP_BUF_PTR%d_L = 0x%x\n", |
| + i, GET_FIELD(HIF_TXP_BUF_PTR1_L, |
| + le32_to_cpu(txp[4 + j]))); |
| + j++; |
| + } |
| + } |
| + |
| + info_or_seq_printf(s, "ml = 0x%x\n", |
| + GET_FIELD(HIF_TXP_ML, le32_to_cpu(txp[23]))); |
| + } else { |
| + struct mt76_connac_txp_common *txp_v1 = (struct mt76_connac_txp_common *)txp; |
| + |
| + info_or_seq_printf(s, "FLAGS = (%04x)\n", txp_v1->fw.flags); |
| + |
| + info_or_seq_printf(s, "MSDU = %d\n", txp_v1->fw.token); |
| + |
| + info_or_seq_printf(s, "BSS_IDX = %d\n", txp_v1->fw.bss_idx); |
| + |
| + info_or_seq_printf(s, "WCID = %d\n",txp_v1->fw.rept_wds_wcid); |
| + |
| + info_or_seq_printf(s, "MSDU_CNT = %d\n", txp_v1->fw.nbuf); |
| + |
| + for (i = 0; i < MT_TXP_MAX_BUF_NUM; i++) |
| + info_or_seq_printf(s, "ptr%02d : addr(0x%08x) len(%d)\n", i, le32_to_cpu(txp_v1->fw.buf[i]), |
| + le16_to_cpu(txp_v1->fw.len[i])); |
| + } |
| +} |
| + |
| +/* bmac txd dump */ |
| +void mt7996_dump_bmac_txd_info(struct seq_file *s, struct mt7996_dev *dev, |
| + __le32 *txd, bool is_hif_txd, bool dump_txp) |
| +{ |
| + u32 hif_txp_ver = 0; |
| + |
| + /* dump stop */ |
| + if (!dev->dbg.txd_read_cnt) |
| + return; |
| + |
| + /* force dump */ |
| + if (dev->dbg.txd_read_cnt > 8) |
| + dev->dbg.txd_read_cnt = 8; |
| + |
| + /* dump txd_read_cnt times */ |
| + if (dev->dbg.txd_read_cnt != 8) |
| + dev->dbg.txd_read_cnt--; |
| + |
| + info_or_seq_printf(s, "txd raw data: size=%d\n", MT_TXD_SIZE); |
| + info_or_seq_hex_dump(s, DUMP_PREFIX_OFFSET, 16, 1, (u8 *)txd, MT_TXD_SIZE, false); |
| + |
| + info_or_seq_printf(s, "BMAC_TXD Fields:\n"); |
| + /* dw0 */ |
| + if (is_hif_txd) { |
| + hif_txp_ver = FIELD_GET(GENMASK(22, 19), txd[0]); |
| + info_or_seq_printf(s, "HIF TXD VER = %d\n", hif_txp_ver); |
| + } |
| + info_or_seq_printf(s, "TX_BYTE_COUNT = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TX_BYTE_COUNT, txd[0])); |
| + info_or_seq_printf(s, "ETHER_TYPE_OFFSET(word) = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_ETHER_TYPE_OFFSET, txd[0])); |
| + info_or_seq_printf(s, "PKT_FT = %d%s%s%s%s\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PKT_FT, txd[0]), |
| + GET_FIELD(WF_TX_DESCRIPTOR_PKT_FT, txd[0]) == 0 ? "(ct)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PKT_FT, txd[0]) == 1 ? "(s&f)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PKT_FT, txd[0]) == 2 ? "(cmd)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PKT_FT, txd[0]) == 3 ? "(redirect)" : ""); |
| + info_or_seq_printf(s, "Q_IDX = %d%s%s%s\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_Q_IDX, txd[0]), |
| + GET_FIELD(WF_TX_DESCRIPTOR_Q_IDX, txd[0]) == 0x10 ? "(ALTX)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_Q_IDX, txd[0]) == 0x11 ? "(BMC)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_Q_IDX, txd[0]) == 0x12 ? "(BCN)" : ""); |
| + |
| + /* dw1 */ |
| + info_or_seq_printf(s, "MLD_ID = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_MLD_ID, txd[1])); |
| + info_or_seq_printf(s, "TGID = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TGID, txd[1])); |
| + info_or_seq_printf(s, "HF = %d%s%s%s%s\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]), |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 0 ? "(eth/802.3)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 1 ? "(cmd)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 2 ? "(802.11)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 3 ? "(802.11 enhanced" : ""); |
| + info_or_seq_printf(s, "802.11 HEADER_LENGTH = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 2 ? |
| + GET_FIELD(WF_TX_DESCRIPTOR_HEADER_LENGTH, txd[1]) : 0); |
| + info_or_seq_printf(s, "MRD = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 0 ? |
| + GET_FIELD(WF_TX_DESCRIPTOR_MRD, txd[1]) : 0); |
| + info_or_seq_printf(s, "EOSP = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 0 ? |
| + GET_FIELD(WF_TX_DESCRIPTOR_EOSP, txd[1]) : 0); |
| + info_or_seq_printf(s, "AMS = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 3 ? |
| + GET_FIELD(WF_TX_DESCRIPTOR_AMS, txd[1]) : 0); |
| + info_or_seq_printf(s, "RMVL = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 0 ? |
| + GET_FIELD(WF_TX_DESCRIPTOR_RMVL, txd[1]): 0); |
| + info_or_seq_printf(s, "VLAN = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 0 ? |
| + GET_FIELD(WF_TX_DESCRIPTOR_VLAN, txd[1]) : 0); |
| + info_or_seq_printf(s, "ETYP = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HF, txd[1]) == 0 ? |
| + GET_FIELD(WF_TX_DESCRIPTOR_ETYP, txd[1]) : 0); |
| + info_or_seq_printf(s, "TID_MGMT_TYPE = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TID_MGMT_TYPE, txd[1])); |
| + info_or_seq_printf(s, "OM = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_OM, txd[1])); |
| + info_or_seq_printf(s, "FR = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_FR, txd[1])); |
| + |
| + /* dw2 */ |
| + info_or_seq_printf(s, "SUBTYPE = %d%s%s%s%s\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_SUBTYPE, txd[2]), |
| + (GET_FIELD(WF_TX_DESCRIPTOR_FTYPE, txd[2]) == 0) && |
| + (GET_FIELD(WF_TX_DESCRIPTOR_SUBTYPE, txd[2]) == 13) ? |
| + "(action)" : "", |
| + (GET_FIELD(WF_TX_DESCRIPTOR_FTYPE, txd[2]) == 1) && |
| + (GET_FIELD(WF_TX_DESCRIPTOR_SUBTYPE, txd[2]) == 8) ? |
| + "(bar)" : "", |
| + (GET_FIELD(WF_TX_DESCRIPTOR_FTYPE, txd[2]) == 2) && |
| + (GET_FIELD(WF_TX_DESCRIPTOR_SUBTYPE, txd[2]) == 4) ? |
| + "(null)" : "", |
| + (GET_FIELD(WF_TX_DESCRIPTOR_FTYPE, txd[2]) == 2) && |
| + (GET_FIELD(WF_TX_DESCRIPTOR_SUBTYPE, txd[2]) == 12) ? |
| + "(qos null)" : ""); |
| + |
| + info_or_seq_printf(s, "FTYPE = %d%s%s%s\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_FTYPE, txd[2]), |
| + GET_FIELD(WF_TX_DESCRIPTOR_FTYPE, txd[2]) == 0 ? "(mgmt)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_FTYPE, txd[2]) == 1 ? "(ctl)" : "", |
| + GET_FIELD(WF_TX_DESCRIPTOR_FTYPE, txd[2]) == 2 ? "(data)" : ""); |
| + info_or_seq_printf(s, "BF_TYPE = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_BF_TYPE, txd[2])); |
| + info_or_seq_printf(s, "OM_MAP = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_OM_MAP, txd[2])); |
| + info_or_seq_printf(s, "RTS = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_RTS, txd[2])); |
| + info_or_seq_printf(s, "HEADER_PADDING = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HEADER_PADDING, txd[2])); |
| + info_or_seq_printf(s, "DU = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_DU, txd[2])); |
| + info_or_seq_printf(s, "HE = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HE, txd[2])); |
| + info_or_seq_printf(s, "FRAG = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_FRAG, txd[2])); |
| + info_or_seq_printf(s, "REMAINING_TX_TIME = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_REMAINING_TX_TIME, txd[2])); |
| + info_or_seq_printf(s, "POWER_OFFSET = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_POWER_OFFSET, txd[2])); |
| + |
| + /* dw3 */ |
| + info_or_seq_printf(s, "NA = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_NA, txd[3])); |
| + info_or_seq_printf(s, "PF = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PF, txd[3])); |
| + info_or_seq_printf(s, "EMRD = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_EMRD, txd[3])); |
| + info_or_seq_printf(s, "EEOSP = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_EEOSP, txd[3])); |
| + info_or_seq_printf(s, "BM = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_BM, txd[3])); |
| + info_or_seq_printf(s, "HW_AMSDU_CAP = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HW_AMSDU_CAP, txd[3])); |
| + info_or_seq_printf(s, "TX_COUNT = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TX_COUNT, txd[3])); |
| + info_or_seq_printf(s, "REMAINING_TX_COUNT = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_REMAINING_TX_COUNT, txd[3])); |
| + info_or_seq_printf(s, "SN = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_SN, txd[3])); |
| + info_or_seq_printf(s, "BA_DIS = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_BA_DIS, txd[3])); |
| + info_or_seq_printf(s, "PM = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PM, txd[3])); |
| + info_or_seq_printf(s, "PN_VLD = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PN_VLD, txd[3])); |
| + info_or_seq_printf(s, "SN_VLD = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_SN_VLD, txd[3])); |
| + |
| + /* dw4 */ |
| + info_or_seq_printf(s, "PN_31_0 = 0x%x\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PN_31_0_, txd[4])); |
| + |
| + /* dw5 */ |
| + info_or_seq_printf(s, "PID = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PID, txd[5])); |
| + info_or_seq_printf(s, "TXSFM = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TXSFM, txd[5])); |
| + info_or_seq_printf(s, "TXS2M = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TXS2M, txd[5])); |
| + info_or_seq_printf(s, "TXS2H = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TXS2H, txd[5])); |
| + info_or_seq_printf(s, "FBCZ = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_FBCZ, txd[5])); |
| + info_or_seq_printf(s, "BYPASS_RBB = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_BYPASS_RBB, txd[5])); |
| + |
| + info_or_seq_printf(s, "FL = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_FL, txd[5])); |
| + info_or_seq_printf(s, "PN_47_32 = 0x%x\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_PN_47_32_, txd[5])); |
| + |
| + /* dw6 */ |
| + info_or_seq_printf(s, "AMSDU_CAP_UTXB = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_AMSDU_CAP_UTXB, txd[6])); |
| + info_or_seq_printf(s, "DAS = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_DAS, txd[6])); |
| + info_or_seq_printf(s, "DIS_MAT = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_DIS_MAT, txd[6])); |
| + info_or_seq_printf(s, "MSDU_COUNT = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_MSDU_COUNT, txd[6])); |
| + info_or_seq_printf(s, "TIMESTAMP_OFFSET = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TIMESTAMP_OFFSET_IDX, txd[6])); |
| + info_or_seq_printf(s, "FIXED_RATE_IDX = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_FIXED_RATE_IDX, txd[6])); |
| + info_or_seq_printf(s, "BW = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_BW, txd[6])); |
| + info_or_seq_printf(s, "VTA = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_VTA, txd[6])); |
| + info_or_seq_printf(s, "SRC = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_SRC, txd[6])); |
| + |
| + /* dw7 */ |
| + info_or_seq_printf(s, "SW_TX_TIME(unit:65536ns) = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_SW_TX_TIME , txd[7])); |
| + info_or_seq_printf(s, "UT = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_UT, txd[7])); |
| + info_or_seq_printf(s, "CTXD_CNT = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_CTXD_CNT, txd[7])); |
| + info_or_seq_printf(s, "HM = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_HM, txd[7])); |
| + info_or_seq_printf(s, "DP = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_DP, txd[7])); |
| + info_or_seq_printf(s, "IP = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_IP, txd[7])); |
| + info_or_seq_printf(s, "TXD_LEN = %d\n", |
| + GET_FIELD(WF_TX_DESCRIPTOR_TXD_LEN, txd[7])); |
| + |
| + if (dump_txp) { |
| + __le32 *txp = txd + 8; |
| + |
| + if (is_hif_txd) |
| + mt7996_dump_bmac_hif_txp_info(s, dev, txp, hif_txp_ver); |
| + else |
| + mt7996_dump_bmac_mac_txp_info(s, dev, txp); |
| + } |
| +} |
| + |
| +static void |
| +mt7996_dump_mac_fid(struct seq_file *s, struct mt7996_dev *dev, u32 fid, bool is_ple) |
| +{ |
| +#define PLE_MEM_SIZE 128 |
| +#define PSE_MEM_SIZE 256 |
| + u8 data[PSE_MEM_SIZE] = {0}; |
| + u32 addr = 0; |
| + int i = 0, cr_cnt = PSE_MEM_SIZE; |
| + u32 *ptr = (u32 *) data; |
| + |
| + if (is_ple) { |
| + cr_cnt = PLE_MEM_SIZE; |
| + seq_printf(s, "dump ple: fid = 0x%08x\n", fid); |
| + } else { |
| + seq_printf(s, "dump pse: fid = 0x%08x\n", fid); |
| + } |
| + |
| + for (i = 0; i < cr_cnt; i = i + 4) { |
| + if (is_ple) |
| + addr = (0xa << 28 | fid << 15) + i; |
| + else |
| + addr = (0xb << 28 | fid << 15) + i; |
| + *ptr = mt76_rr(dev, addr); |
| + ptr++; |
| + } |
| + |
| + seq_printf(s, "raw data: size=%d\n", cr_cnt); |
| + |
| + seq_hex_dump(s, "", DUMP_PREFIX_OFFSET, 16, 1, (u8 *)data, cr_cnt, false); |
| + /* dump one txd info */ |
| + if (is_ple) { |
| + dev->dbg.txd_read_cnt = 1; |
| + mt7996_dump_bmac_txd_info(s, dev, (__le32 *)&data[0], false, true); |
| + } |
| +} |
| + |
| +static int |
| +mt7996_ple_fid_read(struct seq_file *s, void *data) { |
| + struct mt7996_dev *dev = dev_get_drvdata(s->private); |
| + |
| + mt7996_dump_mac_fid(s, dev, dev->dbg.fid_idx, true); |
| + return 0; |
| +} |
| + |
| +static int |
| +mt7996_pse_fid_read(struct seq_file *s, void *data) { |
| + struct mt7996_dev *dev = dev_get_drvdata(s->private); |
| + |
| + mt7996_dump_mac_fid(s, dev, dev->dbg.fid_idx, false); |
| + return 0; |
| +} |
| + |
| +void mt7996_dump_bmac_rxd_info(struct mt7996_dev *dev, __le32 *rxd) |
| +{ |
| + /* dump stop */ |
| + if (!dev->dbg.rxd_read_cnt) |
| + return; |
| + |
| + /* force dump */ |
| + if (dev->dbg.rxd_read_cnt > 8) |
| + dev->dbg.rxd_read_cnt = 8; |
| + |
| + /* dump txd_read_cnt times */ |
| + if (dev->dbg.rxd_read_cnt != 8) |
| + dev->dbg.rxd_read_cnt--; |
| + |
| + printk("rxd raw data: size=%d\n", MT_TXD_SIZE); |
| + print_hex_dump(KERN_ERR , "", DUMP_PREFIX_OFFSET, 16, 1, (u8 *)rxd, 96, false); |
| + |
| + printk("BMAC_RXD Fields:\n"); |
| + |
| + /* group0 */ |
| + /* dw0 */ |
| + printk("RX_BYTE_COUNT = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_RX_BYTE_COUNT, le32_to_cpu(rxd[0]))); |
| + printk("PACKET_TYPE = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_PACKET_TYPE, le32_to_cpu(rxd[0]))); |
| + |
| + /* dw1 */ |
| + printk("MLD_ID = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_MLD_ID, le32_to_cpu(rxd[1]))); |
| + printk("GROUP_VLD = 0x%x%s%s%s%s%s\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])), |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_1 ? "[group1]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_2 ? "[group2]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_3 ? "[group3]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_4 ? "[group4]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_5 ? "[group5]" : ""); |
| + printk("KID = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_KID, le32_to_cpu(rxd[1]))); |
| + printk("CM = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_CM, le32_to_cpu(rxd[1]))); |
| + printk("CLM = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_CLM, le32_to_cpu(rxd[1]))); |
| + printk("I = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_I, le32_to_cpu(rxd[1]))); |
| + printk("T = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_T, le32_to_cpu(rxd[1]))); |
| + printk("BN = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_BN, le32_to_cpu(rxd[1]))); |
| + printk("BIPN_FAIL = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_BIPN_FAIL, le32_to_cpu(rxd[1]))); |
| + |
| + /* dw2 */ |
| + printk("BSSID = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_BSSID, le32_to_cpu(rxd[2]))); |
| + printk("H = %d%s\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_H, le32_to_cpu(rxd[2])), |
| + GET_FIELD(WF_RX_DESCRIPTOR_H, le32_to_cpu(rxd[2])) == 0 ? |
| + "802.11 frame" : "eth/802.3 frame"); |
| + printk("HEADER_LENGTH(word) = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_HEADER_LENGTH, le32_to_cpu(rxd[2]))); |
| + printk("HO(word) = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_HO, le32_to_cpu(rxd[2]))); |
| + printk("SEC_MODE = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_SEC_MODE, le32_to_cpu(rxd[2]))); |
| + printk("MUBAR = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_MUBAR, le32_to_cpu(rxd[2]))); |
| + printk("SWBIT = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_SWBIT, le32_to_cpu(rxd[2]))); |
| + printk("DAF = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_DAF, le32_to_cpu(rxd[2]))); |
| + printk("EL = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_EL, le32_to_cpu(rxd[2]))); |
| + printk("HTF = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_HTF, le32_to_cpu(rxd[2]))); |
| + printk("INTF = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_INTF, le32_to_cpu(rxd[2]))); |
| + printk("FRAG = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_FRAG, le32_to_cpu(rxd[2]))); |
| + printk("NUL = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_NUL, le32_to_cpu(rxd[2]))); |
| + printk("NDATA = %d%s\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_NDATA, le32_to_cpu(rxd[2])), |
| + GET_FIELD(WF_RX_DESCRIPTOR_NDATA, le32_to_cpu(rxd[2])) == 0 ? |
| + "[data frame]" : "[mgmt/ctl frame]"); |
| + printk("NAMP = %d%s\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_NAMP, le32_to_cpu(rxd[2])), |
| + GET_FIELD(WF_RX_DESCRIPTOR_NAMP, le32_to_cpu(rxd[2])) == 0 ? |
| + "[ampdu frame]" : "[mpdu frame]"); |
| + printk("BF_RPT = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_BF_RPT, le32_to_cpu(rxd[2]))); |
| + |
| + /* dw3 */ |
| + printk("RXV_SN = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_RXV_SN, le32_to_cpu(rxd[3]))); |
| + printk("CH_FREQUENCY = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_CH_FREQUENCY, le32_to_cpu(rxd[3]))); |
| + printk("A1_TYPE = %d%s%s%s%s\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_A1_TYPE, le32_to_cpu(rxd[3])), |
| + GET_FIELD(WF_RX_DESCRIPTOR_A1_TYPE, le32_to_cpu(rxd[3])) == 0 ? |
| + "[reserved]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_A1_TYPE, le32_to_cpu(rxd[3])) == 1 ? |
| + "[uc2me]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_A1_TYPE, le32_to_cpu(rxd[3])) == 2 ? |
| + "[mc]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_A1_TYPE, le32_to_cpu(rxd[3])) == 3 ? |
| + "[bc]" : ""); |
| + printk("HTC = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_HTC, le32_to_cpu(rxd[3]))); |
| + printk("TCL = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_TCL, le32_to_cpu(rxd[3]))); |
| + printk("BBM = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_BBM, le32_to_cpu(rxd[3]))); |
| + printk("BU = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_BU, le32_to_cpu(rxd[3]))); |
| + printk("CO_ANT = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_CO_ANT, le32_to_cpu(rxd[3]))); |
| + printk("BF_CQI = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_BF_CQI, le32_to_cpu(rxd[3]))); |
| + printk("FC = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_FC, le32_to_cpu(rxd[3]))); |
| + printk("VLAN = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_VLAN, le32_to_cpu(rxd[3]))); |
| + |
| + /* dw4 */ |
| + printk("PF = %d%s%s%s%s\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_PF, le32_to_cpu(rxd[4])), |
| + GET_FIELD(WF_RX_DESCRIPTOR_PF, le32_to_cpu(rxd[4])) == 0 ? |
| + "[msdu]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_PF, le32_to_cpu(rxd[4])) == 1 ? |
| + "[final amsdu]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_PF, le32_to_cpu(rxd[4])) == 2 ? |
| + "[middle amsdu]" : "", |
| + GET_FIELD(WF_RX_DESCRIPTOR_PF, le32_to_cpu(rxd[4])) == 3 ? |
| + "[first amsdu]" : ""); |
| + printk("MAC = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_MAC, le32_to_cpu(rxd[4]))); |
| + printk("TID = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_TID, le32_to_cpu(rxd[4]))); |
| + printk("ETHER_TYPE_OFFSET = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_ETHER_TYPE_OFFSET, le32_to_cpu(rxd[4]))); |
| + printk("IP = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_IP, le32_to_cpu(rxd[4]))); |
| + printk("UT = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_UT, le32_to_cpu(rxd[4]))); |
| + printk("PSE_FID = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_PSE_FID, le32_to_cpu(rxd[4]))); |
| + |
| + /* group4 */ |
| + /* dw0 */ |
| + printk("FRAME_CONTROL_FIELD = 0x%x\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_4 ? |
| + GET_FIELD(WF_RX_DESCRIPTOR_FRAME_CONTROL_FIELD, le32_to_cpu(rxd[8])) : 0); |
| + printk("PEER_MLD_ADDRESS_15_0 = 0x%x\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_4 ? |
| + GET_FIELD(WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_15_0_, |
| + le32_to_cpu(rxd[8])) : 0); |
| + |
| + /* dw1 */ |
| + printk("PEER_MLD_ADDRESS_47_16 = 0x%x\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_4 ? |
| + GET_FIELD(WF_RX_DESCRIPTOR_PEER_MLD_ADDRESS_47_16_, |
| + le32_to_cpu(rxd[9])) : 0); |
| + |
| + /* dw2 */ |
| + printk("FRAGMENT_NUMBER = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_4 ? |
| + GET_FIELD(WF_RX_DESCRIPTOR_FRAGMENT_NUMBER, |
| + le32_to_cpu(rxd[10])) : 0); |
| + printk("SEQUENCE_NUMBER = %d\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_4 ? |
| + GET_FIELD(WF_RX_DESCRIPTOR_SEQUENCE_NUMBER, |
| + le32_to_cpu(rxd[10])) : 0); |
| + printk("QOS_CONTROL_FIELD = 0x%x\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_4 ? |
| + GET_FIELD(WF_RX_DESCRIPTOR_QOS_CONTROL_FIELD, |
| + le32_to_cpu(rxd[10])) : 0); |
| + |
| + /* dw3 */ |
| + printk("HT_CONTROL_FIELD = 0x%x\n", |
| + GET_FIELD(WF_RX_DESCRIPTOR_GROUP_VLD, le32_to_cpu(rxd[1])) |
| + & BMAC_GROUP_VLD_4 ? |
| + GET_FIELD(WF_RX_DESCRIPTOR_HT_CONTROL_FIELD, |
| + le32_to_cpu(rxd[11])) : 0); |
| +} |
| + |
| +static int mt7996_token_txd_read(struct seq_file *s, void *data) |
| +{ |
| + struct mt7996_dev *dev = dev_get_drvdata(s->private); |
| + struct mt76_txwi_cache *t; |
| + u8* txwi; |
| + |
| + seq_printf(s, "\n"); |
| + spin_lock_bh(&dev->mt76.token_lock); |
| + |
| + t = idr_find(&dev->mt76.token, dev->dbg.token_idx); |
| + if (t != NULL) { |
| + struct mt76_dev *mdev = &dev->mt76; |
| + txwi = ((u8*)(t)) - (mdev->drv->txwi_size); |
| + /* dump one txd info */ |
| + dev->dbg.txd_read_cnt = 1; |
| + mt7996_dump_bmac_txd_info(s, dev, (__le32 *)txwi, true, true); |
| + seq_printf(s, "\n"); |
| + seq_printf(s, "[SKB]\n"); |
| + seq_hex_dump(s, "", DUMP_PREFIX_OFFSET, 16, 1, (u8 *)t->skb->data, t->skb->len, false); |
| + seq_printf(s, "\n"); |
| + } |
| + spin_unlock_bh(&dev->mt76.token_lock); |
| + return 0; |
| +} |
| + |
| +static int mt7996_rx_msdu_pg_read(struct seq_file *s, void *data) |
| +{ |
| + struct mt7996_dev *dev = dev_get_drvdata(s->private); |
| + struct list_head *p; |
| + int i, count = 0, total = 0; |
| + |
| + seq_printf(s, "Rx Msdu page:\n"); |
| + spin_lock(&dev->wed_rro.lock); |
| + for (i = 0; i < MT7996_RRO_MSDU_PG_HASH_SIZE; i++) { |
| + list_for_each(p, &dev->wed_rro.pg_hash_head[i]) { |
| + count++; |
| + } |
| + } |
| + |
| + total = count; |
| + list_for_each(p, &dev->wed_rro.pg_addr_cache) { |
| + total++; |
| + } |
| + seq_printf(s, "\ttotal:%8d used:%8d\n", total, count); |
| + spin_unlock(&dev->wed_rro.lock); |
| + |
| + return 0; |
| +} |
| + |
| +int mt7996_mtk_init_debugfs_internal(struct mt7996_phy *phy, struct dentry *dir) |
| +{ |
| + struct mt7996_dev *dev = phy->dev; |
| + |
| + debugfs_create_devm_seqfile(dev->mt76.dev, "token_txd", dir, |
| + mt7996_token_txd_read); |
| + debugfs_create_u32("txd_dump", 0600, dir, &dev->dbg.txd_read_cnt); |
| + debugfs_create_u32("rxd_dump", 0600, dir, &dev->dbg.rxd_read_cnt); |
| + debugfs_create_devm_seqfile(dev->mt76.dev, "rx_msdu_pg", dir, |
| + mt7996_rx_msdu_pg_read); |
| + |
| + /* ple/pse fid raw data dump */ |
| + debugfs_create_u32("fid_idx", 0600, dir, &dev->dbg.fid_idx); |
| + debugfs_create_devm_seqfile(dev->mt76.dev, "ple_fid", dir, |
| + mt7996_ple_fid_read); |
| + debugfs_create_devm_seqfile(dev->mt76.dev, "pse_fid", dir, |
| + mt7996_pse_fid_read); |
| + |
| + debugfs_create_u8("dump_ple_txd", 0600, dir, &dev->dbg.dump_ple_txd); |
| + return 0; |
| +} |
| + |
| +#endif |
| -- |
| 2.45.2 |
| |