ath10k: debugfs support to get final TPC stats for 10.4 variants
PATCH v2 1/1 ath10k: debugfs support to get final TPC stats for 10.4 variants
From: Maharaja Kennadyrajan <[email protected]>
Export the final Transmit Power Control (TPC) value, which is the minimum of control power and existing TPC value to user space via a new debugfs file "tpc_stats_final" to help with debugging. It works with the new wmi cmd and event introduced in 10.4 firmware branch.
WMI command ID: WMI_PDEV_GET_TPC_TABLE_CMDID
WMI event ID: WMI_PDEV_TPC_TABLE_EVENTID
cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final
$ cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final
TPC config for channel 5180 mode 10
CTL = 0x 0 Reg. Domain = 58 Antenna Gain = 0 Reg. Max Antenna Gain = 0 Power Limit = 60 Reg. Max Power = 60 Num tx chains = 2 Num supported rates = 109
******************* CDD POWER TABLE ****************
No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3 0 CCK 0x40 0 0 1 CCK 0x41 0 0 [...] 107 HTCUP 0x 0 46 46 108 HTCUP 0x 0 46 46
******************* STBC POWER TABLE ****************
No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3 0 CCK 0x40 0 0 1 CCK 0x41 0 0 [...] 107 HTCUP 0x 0 46 46 108 HTCUP 0x 0 46 46
***********************************
TXBF not supported
**********************************
The existing tpc_stats debugfs file provides the dump which is minimum of target power and regulatory domain.
cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats
Hardware_used: QCA4019
Firmware version: firmware-5.bin_10.4-3.0-00209
---
v2: Addressed sparse warnings: (new ones prefixed by >>)
drivers/net/wireless/ath/ath10k/core.h | 23 +++ drivers/net/wireless/ath/ath10k/debug.c | 107 +++++++++++ drivers/net/wireless/ath/ath10k/debug.h | 11 ++ drivers/net/wireless/ath/ath10k/wmi-ops.h | 21 ++ drivers/net/wireless/ath/ath10k/wmi.c | 308 ++++++++++++++++++++++++++++-- drivers/net/wireless/ath/ath10k/wmi.h | 66 +++++++ 6 files changed, 521 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath10k/core.h +23 -0
@@ -1,6 +1,7 @@/* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. +* Copyright (c) 2018, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above
@@ -324,6 +325,27 @@ struct ath10k_tpc_stats {struct ath10k_tpc_table tpc_table[WMI_TPC_FLAG ]; }; +struct ath10k_tpc_table_final { +u32 pream_idx[WMI_TPC_FINAL_RATE_MAX ]; +u8 rate_code[WMI_TPC_FINAL_RATE_MAX ]; +char tpc_value[WMI_TPC_FINAL_RATE_MAX ][WMI_TPC_TX_N_CHAIN *WMI_TPC_BUF_SIZE ]; +}; + +struct ath10k_tpc_stats_final { +u32 reg_domain; +u32 chan_freq; +u32 phy_mode; +u32 twice_antenna_reduction; +u32 twice_max_rd_power; +s32 twice_antenna_gain; +u32 power_limit; +u32 num_tx_chain; +u32 ctl; +u32 rate_max; +u8 flag[WMI_TPC_FLAG ]; +struct ath10k_tpc_table_final tpc_table_final[WMI_TPC_FLAG ]; +}; +struct ath10k_dfs_stats {u32 phy_errors;u32 pulses_total;
@@ -487,6 +509,7 @@ struct ath10k_debug {/* used for tpc-dump storage, protected by data-lock */ struct ath10k_tpc_stats *tpc_stats; +struct ath10k_tpc_stats_final *tpc_stats_final;struct completion tpc_complete;
drivers/net/wireless/ath/ath10k/debug.c +107 -0
125 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/debug.h +11 -0
@@ -1,6 +1,7 @@/* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. +* Copyright (c) 2018, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above
@@ -101,6 +102,9 @@ struct ath10k_pktlog_hdr {void ath10k_debug_fw_stats_process (struct ath10k *ar,struct sk_buff *skb);void ath10k_debug_tpc_stats_process (struct ath10k *ar,struct ath10k_tpc_stats *tpc_stats); +void +ath10k_debug_tpc_stats_final_process (struct ath10k *ar, +struct ath10k_tpc_stats_final *tpc_stats);void ath10k_debug_dbglog_add (struct ath10k *ar,u8 *buffer,int len);#define ATH10K_DFS_STAT_INC (ar, c) (ar->debug.dfs_stats.c++)
@@ -164,6 +168,13 @@ static inline void ath10k_debug_tpc_stats_process(struct ath10k *ar,kfree (tpc_stats); } +static inline void +ath10k_debug_tpc_stats_final_process (struct ath10k *ar, +struct ath10k_tpc_stats_final *tpc_stats) +{ +kfree (tpc_stats); +} +static inline void ath10k_debug_dbglog_add (struct ath10k *ar,u8 *buffer,int len) {
drivers/net/wireless/ath/ath10k/wmi-ops.h +21 -0
@@ -1,6 +1,7 @@/* * Copyright (c) 2005-2011 Atheros Communications Inc. * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. +* Copyright (c) 2018, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above
@@ -197,6 +198,9 @@ struct wmi_ops { (struct ath10k *ar, enum wmi_bss_survey_req_type type);struct sk_buff *(*gen_echo)(struct ath10k *ar,u32 value); +struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar, +u32 param); + };int ath10k_wmi_cmd_send (struct ath10k *ar,struct sk_buff *skb,u32 cmd_id);
@@ -1425,4 +1429,21 @@ struct wmi_ops { return ath10k_wmi_cmd_send(ar, skb, wmi->cmd->echo_cmdid); } +static inline int +ath10k_wmi_pdev_get_tpc_table_cmdid (struct ath10k *ar,u32 param) +{ +struct sk_buff *skb; + +if (!ar->wmi.ops->gen_pdev_get_tpc_table_cmdid) +return -EOPNOTSUPP ; + + skb = ar->wmi.ops->gen_pdev_get_tpc_table_cmdid (ar, param); + +if (IS_ERR (skb)) +return PTR_ERR (skb); + +return ath10k_wmi_cmd_send (ar, skb, + ar->wmi.cmd->pdev_get_tpc_table_cmdid); +} +#endif
drivers/net/wireless/ath/ath10k/wmi.c +293 -15
387 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/wmi.h +66 -0
117 lines not on this page · raw message
Signature · 1 line
1.9.1
as you said:
The existing tpc_stats debugfs file provides the dump which is
minimum of target power and regulatory domain.
cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_sta=
ts
I=E2=80=99m curious what=E2=80=99s exact difference w/ this new addition:
Export the final Transmit Power Control (TPC) value, which is
the minimum of control power and existing TPC value to user space via a new debugfs file "tpc_stats_final" to help with debugging.
Can you clarify or give examples on the difference?
Thanks!
Quoted 6 lines · Joshua Zhao
as you said:
The existingtpc_statsdebugfs file provides the dump which is
minimum of target power and regulatory domain.
cat/sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats
Quoted 8 lines
I’m curious what’s exact difference w/ this new addition:
Export the final Transmit Power Control (TPC) value, which is
the minimum of control power and existing TPC value to user space via a new debugfs file "tpc_stats_final" to help with debugging.Can you clarify or give examples on the difference?
Thanks!
The existing tpc_stats is the minimum of "target power and regulatory domain".
The new addition is the minimum of "existing tpc_stats and control power" which means minimum of "control power, target power and regulatory domain".
Signature · 2 lines
Regards, Maha
What exactly "control power" means? Can you illustrate or give examples? Thanks!
Quoted 9 lines · Maharaja Kennadyrajan
Quoted 8 lines · Joshua Zhao
as you said:
The existingtpc_statsdebugfs file provides the dump which is
minimum of target power and regulatory domain.
cat/sys/kernel/debug/ieee80211/phyX/ath10k/tpc_statsI=E2=80=99m curious what=E2=80=99s exact difference w/ this new addition=
:
Quoted 6 lines
Quoted 6 lines
Export the final Transmit Power Control (TPC) value, which is
the minimum of control power and existing TPC value to user space via a new debugfs file "tpc_stats_final" to help with debugging.Can you clarify or give examples on the difference?
Quoted 7 lines
Quoted 1 line
Thanks!
The existing
tpc_statsis the minimum of "target power and regulatory domain".
The new addition is the minimum of "existingtpc_statsand control power" which means minimum of "control power, target power and regulatory domain=
".
Quoted 4 lines
--
Regards,
Maha
Quoted 45 lines · [email protected] wrote:
Export the final Transmit Power Control (TPC) value, which is the minimum of control power and existing TPC value to user space via a new debugfs file "
tpc_stats_final" to help with debugging. It works with the new wmi cmd and event introduced in 10.4 firmware branch.WMI command ID:
WMI_PDEV_GET_TPC_TABLE_CMDID
WMI event ID:WMI_PDEV_TPC_TABLE_EVENTIDcat
/sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final$ cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_finalTPC config for channel 5180 mode 10
CTL = 0x 0 Reg. Domain = 58 Antenna Gain = 0 Reg. Max Antenna Gain = 0 Power Limit = 60 Reg. Max Power = 60 Num tx chains = 2 Num supported rates = 109******************* CDD POWER TABLE ****************
No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3 0 CCK 0x40 0 0 1 CCK 0x41 0 0 [...] 107 HTCUP 0x 0 46 46 108 HTCUP 0x 0 46 46******************* STBC POWER TABLE ****************
No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3 0 CCK 0x40 0 0 1 CCK 0x41 0 0 [...] 107 HTCUP 0x 0 46 46 108 HTCUP 0x 0 46 46***********************************
TXBF not supported
**********************************The existing
tpc_statsdebugfs file provides the dump which is minimum of target power and regulatory domain.
Quoted 7 lines
cat
/sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats
Hardware_used: QCA4019
Firmware version: firmware-5.bin_10.4-3.0-00209Signed-off-by Maharaja Kennadyrajan <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
bc64d05220f3 ath10k: debugfs support to get final TPC stats for 10.4 variants
Signature · 3 lines
https://patchwork.kernel.org/patch/10241601/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 45 lines · [email protected] wrote:
Export the final Transmit Power Control (TPC) value, which is the minimum of control power and existing TPC value to user space via a new debugfs file "
tpc_stats_final" to help with debugging. It works with the new wmi cmd and event introduced in 10.4 firmware branch.WMI command ID:
WMI_PDEV_GET_TPC_TABLE_CMDID
WMI event ID:WMI_PDEV_TPC_TABLE_EVENTIDcat
/sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_final$ cat /sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats_finalTPC config for channel 5180 mode 10
CTL = 0x 0 Reg. Domain = 58 Antenna Gain = 0 Reg. Max Antenna Gain = 0 Power Limit = 60 Reg. Max Power = 60 Num tx chains = 2 Num supported rates = 109******************* CDD POWER TABLE ****************
No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3 0 CCK 0x40 0 0 1 CCK 0x41 0 0 [...] 107 HTCUP 0x 0 46 46 108 HTCUP 0x 0 46 46******************* STBC POWER TABLE ****************
No. Preamble Rate_code tpc_value1 tpc_value2 tpc_value3 0 CCK 0x40 0 0 1 CCK 0x41 0 0 [...] 107 HTCUP 0x 0 46 46 108 HTCUP 0x 0 46 46***********************************
TXBF not supported
**********************************The existing
tpc_statsdebugfs file provides the dump which is minimum of target power and regulatory domain.
Quoted 7 lines
cat
/sys/kernel/debug/ieee80211/phyX/ath10k/tpc_stats
Hardware_used: QCA4019
Firmware version: firmware-5.bin_10.4-3.0-00209Signed-off-by Maharaja Kennadyrajan <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
bc64d05220f3 ath10k: debugfs support to get final TPC stats for 10.4 variants
Signature · 9 lines
https://patchwork.kernel.org/patch/10241601/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k