Commit 6ed73182 authored by Seevalamuthu Mariappan's avatar Seevalamuthu Mariappan Committed by Kalle Valo

ath11k: Change masking and shifting in htt stats

In debugfs_htt_stats.c, masking and shifting is done to get
stats values. Instead use GENMASK and FIELD_GET to improve
code readability and maintenance.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01105-QCAHKSWPL_SILICONZ-1
Signed-off-by: default avatarSeevalamuthu Mariappan <seevalam@codeaurora.org>
Signed-off-by: default avatarJouni Malinen <jouni@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210913223148.208026-5-jouni@codeaurora.org
parent 74327bab
......@@ -137,6 +137,8 @@ struct htt_stats_string_tlv {
u32 data[0]; /* Can be variable length */
} __packed;
#define HTT_STATS_MAC_ID GENMASK(7, 0)
/* == TX PDEV STATS == */
struct htt_tx_pdev_stats_cmn_tlv {
u32 mac_id__word;
......@@ -290,6 +292,10 @@ struct htt_hw_stats_whal_tx_tlv {
};
/* ============ PEER STATS ============ */
#define HTT_MSDU_FLOW_STATS_TX_FLOW_NO GENMASK(15, 0)
#define HTT_MSDU_FLOW_STATS_TID_NUM GENMASK(19, 16)
#define HTT_MSDU_FLOW_STATS_DROP_RULE BIT(20)
struct htt_msdu_flow_stats_tlv {
u32 last_update_timestamp;
u32 last_add_timestamp;
......@@ -306,6 +312,11 @@ struct htt_msdu_flow_stats_tlv {
#define MAX_HTT_TID_NAME 8
#define HTT_TX_TID_STATS_SW_PEER_ID GENMASK(15, 0)
#define HTT_TX_TID_STATS_TID_NUM GENMASK(31, 16)
#define HTT_TX_TID_STATS_NUM_SCHED_PENDING GENMASK(7, 0)
#define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ GENMASK(15, 8)
/* Tidq stats */
struct htt_tx_tid_stats_tlv {
/* Stored as little endian */
......@@ -326,6 +337,11 @@ struct htt_tx_tid_stats_tlv {
u32 tid_tx_airtime;
};
#define HTT_TX_TID_STATS_V1_SW_PEER_ID GENMASK(15, 0)
#define HTT_TX_TID_STATS_V1_TID_NUM GENMASK(31, 16)
#define HTT_TX_TID_STATS_V1_NUM_SCHED_PENDING GENMASK(7, 0)
#define HTT_TX_TID_STATS_V1_NUM_PPDU_IN_HWQ GENMASK(15, 8)
/* Tidq stats */
struct htt_tx_tid_stats_v1_tlv {
/* Stored as little endian */
......@@ -348,6 +364,9 @@ struct htt_tx_tid_stats_v1_tlv {
u32 sendn_frms_allowed;
};
#define HTT_RX_TID_STATS_SW_PEER_ID GENMASK(15, 0)
#define HTT_RX_TID_STATS_TID_NUM GENMASK(31, 16)
struct htt_rx_tid_stats_tlv {
u32 sw_peer_id__tid_num;
u8 tid_name[MAX_HTT_TID_NAME];
......@@ -386,6 +405,10 @@ struct htt_peer_stats_cmn_tlv {
u32 inactive_time;
};
#define HTT_PEER_DETAILS_VDEV_ID GENMASK(7, 0)
#define HTT_PEER_DETAILS_PDEV_ID GENMASK(15, 8)
#define HTT_PEER_DETAILS_AST_IDX GENMASK(31, 16)
struct htt_peer_details_tlv {
u32 peer_type;
u32 sw_peer_id;
......@@ -510,6 +533,9 @@ struct htt_tx_hwq_mu_mimo_mpdu_stats_tlv {
u32 mu_mimo_ampdu_underrun_usr;
};
#define HTT_TX_HWQ_STATS_MAC_ID GENMASK(7, 0)
#define HTT_TX_HWQ_STATS_HWQ_ID GENMASK(15, 8)
struct htt_tx_hwq_mu_mimo_cmn_stats_tlv {
u32 mac_id__hwq_id__word;
};
......@@ -789,6 +815,9 @@ struct htt_sched_txq_sched_ineligibility_tlv_v {
u32 sched_ineligibility[0];
};
#define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID GENMASK(7, 0)
#define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_ID GENMASK(15, 8)
struct htt_tx_pdev_stats_sched_per_txq_tlv {
u32 mac_id__txq_id__word;
u32 sched_policy;
......@@ -910,6 +939,9 @@ struct htt_tx_tqm_error_stats_tlv {
};
/* == TQM CMDQ stats == */
#define HTT_TX_TQM_CMDQ_STATUS_MAC_ID GENMASK(7, 0)
#define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID GENMASK(15, 8)
struct htt_tx_tqm_cmdq_status_tlv {
u32 mac_id__cmdq_id__word;
u32 sync_cmd;
......@@ -1055,6 +1087,15 @@ struct htt_tx_de_cmn_stats_tlv {
#define HTT_STATS_LOW_WM_BINS 5
#define HTT_STATS_HIGH_WM_BINS 5
#define HTT_RING_IF_STATS_NUM_ELEMS GENMASK(15, 0)
#define HTT_RING_IF_STATS_PREFETCH_TAIL_INDEX GENMASK(31, 16)
#define HTT_RING_IF_STATS_HEAD_IDX GENMASK(15, 0)
#define HTT_RING_IF_STATS_TAIL_IDX GENMASK(31, 16)
#define HTT_RING_IF_STATS_SHADOW_HEAD_IDX GENMASK(15, 0)
#define HTT_RING_IF_STATS_SHADOW_TAIL_IDX GENMASK(31, 16)
#define HTT_RING_IF_STATS_LWM_THRESH GENMASK(15, 0)
#define HTT_RING_IF_STATS_HWM_THRESH GENMASK(31, 16)
struct htt_ring_if_stats_tlv {
u32 base_addr; /* DWORD aligned base memory address of the ring */
u32 elem_size;
......@@ -1117,6 +1158,19 @@ struct htt_sfm_cmn_tlv {
};
/* == SRNG STATS == */
#define HTT_SRING_STATS_MAC_ID GENMASK(7, 0)
#define HTT_SRING_STATS_RING_ID GENMASK(15, 8)
#define HTT_SRING_STATS_ARENA GENMASK(23, 16)
#define HTT_SRING_STATS_EP BIT(24)
#define HTT_SRING_STATS_NUM_AVAIL_WORDS GENMASK(15, 0)
#define HTT_SRING_STATS_NUM_VALID_WORDS GENMASK(31, 16)
#define HTT_SRING_STATS_HEAD_PTR GENMASK(15, 0)
#define HTT_SRING_STATS_TAIL_PTR GENMASK(31, 16)
#define HTT_SRING_STATS_CONSUMER_EMPTY GENMASK(15, 0)
#define HTT_SRING_STATS_PRODUCER_FULL GENMASK(31, 16)
#define HTT_SRING_STATS_PREFETCH_COUNT GENMASK(15, 0)
#define HTT_SRING_STATS_INTERNAL_TAIL_PTR GENMASK(31, 16)
struct htt_sring_stats_tlv {
u32 mac_id__ring_id__arena__ep;
u32 base_addr_lsb; /* DWORD aligned base memory address of the ring */
......
......@@ -1593,6 +1593,13 @@ struct ath11k_htt_extd_stats_msg {
u8 data[0];
} __packed;
#define HTT_MAC_ADDR_L32_0 GENMASK(7, 0)
#define HTT_MAC_ADDR_L32_1 GENMASK(15, 8)
#define HTT_MAC_ADDR_L32_2 GENMASK(23, 16)
#define HTT_MAC_ADDR_L32_3 GENMASK(31, 24)
#define HTT_MAC_ADDR_H16_0 GENMASK(7, 0)
#define HTT_MAC_ADDR_H16_1 GENMASK(15, 8)
struct htt_mac_addr {
u32 mac_addr_l32;
u32 mac_addr_h16;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment