<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/net/wireless/ath/ath11k/debugfs.c, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-03-10T08:29:08Z</updated>
<entry>
<title>wifi: ath11k: debugfs: fix to work with multiple PCI devices</title>
<updated>2023-03-10T08:29:08Z</updated>
<author>
<name>Kalle Valo</name>
<email>quic_kvalo@quicinc.com</email>
</author>
<published>2022-12-22T17:15:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8ec481e85e05665d133d679b7d36e4adcb4fb836'/>
<id>urn:sha1:8ec481e85e05665d133d679b7d36e4adcb4fb836</id>
<content type='text'>
[ Upstream commit 323d91d4684d238f6bc3693fed93caf795378fe0 ]

ath11k fails to load if there are multiple ath11k PCI devices with same name:

 ath11k_pci 0000:01:00.0: Hardware name qcn9074 hw1.0
 debugfs: Directory 'ath11k' with parent '/' already present!
 ath11k_pci 0000:01:00.0: failed to create ath11k debugfs
 ath11k_pci 0000:01:00.0: failed to create soc core: -17
 ath11k_pci 0000:01:00.0: failed to init core: -17
 ath11k_pci: probe of 0000:01:00.0 failed with error -17

Fix this by creating a directory for each ath11k device using schema
&lt;bus&gt;-&lt;devname&gt;, for example "pci-0000:06:00.0". This directory created under
the top-level ath11k directory, for example /sys/kernel/debug/ath11k.

The reference to the toplevel ath11k directory is not stored anymore within ath11k, instead
it's retrieved using debugfs_lookup(). If the directory does not exist it will
be created. After the last directory from the ath11k directory is removed, for
example when doing rmmod ath11k, the empty ath11k directory is left in place,
it's a minor cosmetic issue anyway.

Here's an example hierarchy with one WCN6855:

ath11k
`-- pci-0000:06:00.0
    |-- mac0
    |   |-- dfs_block_radar_events
    |   |-- dfs_simulate_radar
    |   |-- ext_rx_stats
    |   |-- ext_tx_stats
    |   |-- fw_dbglog_config
    |   |-- fw_stats
    |   |   |-- beacon_stats
    |   |   |-- pdev_stats
    |   |   `-- vdev_stats
    |   |-- htt_stats
    |   |-- htt_stats_reset
    |   |-- htt_stats_type
    |   `-- pktlog_filter
    |-- simulate_fw_crash
    `-- soc_dp_stats

I didn't have a test setup where I could connect multiple ath11k devices to the
same the host, so I have only tested this with one device.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.9
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1

Tested-by: Robert Marko &lt;robert.marko@sartura.hr&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20221220121231.20120-1-kvalo@kernel.org
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>wifi: ath11k: Add support to get power save duration for each client</title>
<updated>2022-09-26T09:34:38Z</updated>
<author>
<name>Venkateswara Naralasetty</name>
<email>quic_vnaralas@quicinc.com</email>
</author>
<published>2022-09-24T13:47:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=710a95f955863592acdc697d4c6967285c052670'/>
<id>urn:sha1:710a95f955863592acdc697d4c6967285c052670</id>
<content type='text'>
Add support to get the following power save information through debugfs interface,

 * Current ps state of the peer
 * Time duration since the peer is in power save
 * Total duration of the peer spent in power save

Above information is helpful in debugging the issues with power save clients.

This patch also add trace log support for PS timekeeper to track the PS state
change of the peers alongs with the peer MAC address and timestamp.

Use the below commands to get the above power save information,

To know the time_since_station_in_power_save:
cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/
XX:XX:XX:XX:XX:XX/current_ps_duration

To know power_save_duration:
cat /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/stations/
XX:XX:XX:XX:XX:XX/total_ps_duration

To reset the power_save_duration of all stations connected to AP:
echo 1 &gt; /sys/kernel/debug/ieee80211/phyX/ath11k/reset_ps_duration

To enable/disable the ps_timekeeper:
echo Y &gt; /sys/kernel/debug/ieee80211/phyX/ath11k/ps_timekeeper_enable
Y = 1 to enable and Y = 0 to disable.

To record PS timekeeer logs after enabling ps_timekeeper:
trace-cmd record -e ath11k_ps_timekeeper

Tested-on: Tested-on: IPQ8074 WLAN.HK.2.5.0.1-00991-QCAHKSWPL_SILICONZ-1

Signed-off-by: Venkateswara Naralasetty &lt;quic_vnaralas@quicinc.com&gt;
Signed-off-by: Tamizh Chelvam Raja &lt;quic_tamizhr@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220725054601.14719-1-quic_tamizhr@quicinc.com
</content>
</entry>
<entry>
<title>wifi: ath11k: move firmware stats out of debugfs</title>
<updated>2022-09-22T07:28:20Z</updated>
<author>
<name>Aditya Kumar Singh</name>
<email>quic_adisi@quicinc.com</email>
</author>
<published>2022-09-20T15:24:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ec8918f922b8a40a12cb86793245026f08b79812'/>
<id>urn:sha1:ec8918f922b8a40a12cb86793245026f08b79812</id>
<content type='text'>
Currently, firmware stats, comprising pdev, vdev and beacon stats are
part of debugfs. In firmware pdev stats, firmware reports the final
Tx power used to transmit each packet. If driver wants to know the
final Tx power being used at firmware level, it can leverage from
firmware pdev stats.

Move firmware stats out of debugfs context in order to leverage
the final Tx power reported in it even when debugfs is disabled.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Signed-off-by: Aditya Kumar Singh &lt;quic_adisi@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220603082814.31466-2-quic_adisi@quicinc.com
</content>
</entry>
<entry>
<title>wifi: ath11k: implement SRAM dump debugfs interface</title>
<updated>2022-09-10T06:26:18Z</updated>
<author>
<name>Baochen Qiang</name>
<email>quic_bqiang@quicinc.com</email>
</author>
<published>2022-09-07T08:31:13Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=876eb84882a8b2fc4036e735a2de52141aebb6a5'/>
<id>urn:sha1:876eb84882a8b2fc4036e735a2de52141aebb6a5</id>
<content type='text'>
On-board SRAM contains valuable information for firmware debugging so
add a new file named "sram" to debugfs with which we can dump SRAM
content using following the following:

cp /sys/kernel/debug/ath11k/wcn6855\ hw2.0/sram /tmp/sram

Currently this feature is enabled for QCA6390 and WCN6855.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1

Signed-off-by: Baochen Qiang &lt;quic_bqiang@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220802075533.1744-3-quic_bqiang@quicinc.com
</content>
</entry>
<entry>
<title>wifi: ath11k: Fix hardware restart failure due to twt debugfs failure</title>
<updated>2022-09-02T12:27:11Z</updated>
<author>
<name>Manikanta Pubbisetty</name>
<email>quic_mpubbise@quicinc.com</email>
</author>
<published>2022-09-01T16:21:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=607c467eac7d6da6be8127b9cc1893eae3ffb7f4'/>
<id>urn:sha1:607c467eac7d6da6be8127b9cc1893eae3ffb7f4</id>
<content type='text'>
Currently, creation of debugfs entries for TWT is failing during
hardware restart because of the residual TWT files which were
created during add_interface(). Since, struct arvif{} is memset
to zero upon add_interface() invocation, when the hardware restart
is triggered, arvif is memset to 0 and TWT files are attempted to
create again which will fail because of the residual TWT files
already in place, this leads to hardware restart failure.

Also, it is not a good idea to return error from add_interface()
because of debugfs file creation failures. Moreover, debugfs
framework can very well handle the errors in it's create file &amp;
remove file APIs and the errors returned by these APIs are not
checked in most usecases.

Fix the HW restart failure by ignoring the errors returned from
the debugfs APIs.

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1

Fixes: fe98a6137d03 ("ath11k: add debugfs for TWT debug calls")
Signed-off-by: Manikanta Pubbisetty &lt;quic_mpubbise@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220720135150.22193-3-quic_mpubbise@quicinc.com
</content>
</entry>
<entry>
<title>wifi: ath11k: Add TWT debugfs support for STA interface</title>
<updated>2022-09-02T12:27:11Z</updated>
<author>
<name>Manikanta Pubbisetty</name>
<email>quic_mpubbise@quicinc.com</email>
</author>
<published>2022-09-01T16:21:24Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9e2747c31e5a65e92173bc98a1b72f6a7c86d8e1'/>
<id>urn:sha1:9e2747c31e5a65e92173bc98a1b72f6a7c86d8e1</id>
<content type='text'>
Currently TWT debugfs files required for manually testing the
TWT feature are created only for the AP interfaces; these debugfs
hooks are also required for the station interfaces in order to
test the TWT feature manually, therefore create these debugfs
hooks for station iftype as well.

In the case of station interfaces, TWT is entirely handled in the
firmware based on input parameters passed to it during association
via TWT enable WMI command. In order to manually test this feature,
firmware expects to first disable the TWT feature and then send the
enable command with sta_cong_timer_ms parameter set to 0.
This is true for WCN6750, QCA6390 &amp; WCN6855 hardwares.

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1

Signed-off-by: Manikanta Pubbisetty &lt;quic_mpubbise@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220720135150.22193-2-quic_mpubbise@quicinc.com
</content>
</entry>
<entry>
<title>ath11k: Add hw-restart option to simulate_fw_crash</title>
<updated>2022-03-23T08:56:58Z</updated>
<author>
<name>Wen Gong</name>
<email>quic_wgong@quicinc.com</email>
</author>
<published>2022-03-21T11:17:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=78e3e6094220a71504e7136c42b49fc8ed3a72b4'/>
<id>urn:sha1:78e3e6094220a71504e7136c42b49fc8ed3a72b4</id>
<content type='text'>
Add hw-restart to directly restart wlan. Like UTF mode start it will
restart hardware and download firmware again.

Usage:
1. Run command:
   echo hw-restart &gt; /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash
   echo hw-restart &gt; /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash
2. wlan will be restart and do recovery process and success.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2

Signed-off-by: Wen Gong &lt;quic_wgong@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220228064606.8981-4-quic_wgong@quicinc.com
</content>
</entry>
<entry>
<title>ath11k: add dbring debug support</title>
<updated>2022-02-24T09:02:48Z</updated>
<author>
<name>Venkateswara Naralasetty</name>
<email>quic_vnaralas@quicinc.com</email>
</author>
<published>2022-02-20T14:07:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=691425b4a41fe5843ea424a93ee373f29b1040a5'/>
<id>urn:sha1:691425b4a41fe5843ea424a93ee373f29b1040a5</id>
<content type='text'>
Target copies spectral report and CFR report through dbring to
host for further processing. This mechanism involves ring and
buffer management in the Host, FW, and uCode, where improper
tail pointer update issues are seen.

This dbring debug support help to debug such issues by tracking
head and tail pointer movement along with the timestamp at which
each buffer is received and replenished.

Provide a debugfs interface to enalbe/disable dbring debug
support and dump the dbring debug entries.

Also introduced a new hardware param to add dbring debugfs support
for few hardwares which are using dbings.

Usage:

echo &lt;dbr_id&gt; &lt;val&gt; &gt; /sys/kernel/debug/ath11k/ipq8074_2/
mac0/enable_dbr_debug

dbr_id: 0 for spectral and 1 for CFR
val: 0 - disable, 1 - enable.

Tested-on: IPQ8074 WLAN.HK.2.4.0.1-01467-QCAHKSWPL_SILICONZ-1

Signed-off-by: Venkateswara Naralasetty &lt;quic_vnaralas@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/1645366059-11798-1-git-send-email-quic_vnaralas@quicinc.com
</content>
</entry>
<entry>
<title>ath11k: add debugfs for TWT debug calls</title>
<updated>2022-02-01T10:57:08Z</updated>
<author>
<name>John Crispin</name>
<email>john@phrozen.org</email>
</author>
<published>2022-01-31T14:16:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fe98a6137d03a9e51db2197674c355d64eb3b709'/>
<id>urn:sha1:fe98a6137d03a9e51db2197674c355d64eb3b709</id>
<content type='text'>
New debugfs files to manually add/delete/pause/resume TWT
dialogs for test/debug purposes.

The debugfs files expect the following parameters
- Add dialog
echo '&lt;Peer_MAC&gt; &lt;Dialog_ID&gt; &lt;Wake_Interval_Usec&gt; &lt;Wake_Interval_Mantis&gt;
 &lt;Wake_Duration_Usec&gt; &lt;First_SP_Offset&gt; &lt;TWT_Command&gt;
 &lt;1:Broadcast /0:Individual&gt; &lt;1:Triggered / 0:Untriggered&gt;
 &lt;1:Unannounced /0:Announced&gt; &lt;1:Protected / 0:Unprotected&gt;' &gt;
 /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/twt/add_dialog

Example (Non-triggered and un-announced):
echo '00:03:7F:20:13:52 1 102400 100 30720 20480 4 0 0 1 0' &gt;
 /sys/kernel/debug/ieee80211/phy0/netdev:wlan0/twt/add_dialog

- Delete dialog
echo '&lt;Peer_MAC&gt; &lt;Dialog_ID&gt;' &gt;
 /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/twt/del_dialog

- Pause dialog
echo '&lt;Peer_MAC&gt; &lt;Dialog_ID&gt;' &gt;
 /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/twt/pause_dialog

- Resume dialog
echo '&lt;Peer_MAC&gt; &lt;Dialog_ID&gt; &lt;SP_Offset_Usec&gt; &lt;Next_TWT_Size&gt;' &gt;
 /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/twt/resume_dialog

Example:
echo '00:03:7F:20:13:52 1 2000000 3' &gt;
 /sys/kernel/debug/ieee80211/phy0/netdev:wlan0/twt/resume_dialog

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01179-QCAHKSWPL_SILICONZ-1
Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
Signed-off-by: Aloka Dixit &lt;alokad@codeaurora.org&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/20220131031043.1295-2-alokad@codeaurora.org
</content>
</entry>
<entry>
<title>ath11k: Add debugfs interface to configure firmware debug log level</title>
<updated>2022-02-01T10:56:14Z</updated>
<author>
<name>Seevalamuthu Mariappan</name>
<email>quic_seevalam@quicinc.com</email>
</author>
<published>2022-01-31T14:16:44Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f295ad912910e08d9b887a0c952f82d9612459d4'/>
<id>urn:sha1:f295ad912910e08d9b887a0c952f82d9612459d4</id>
<content type='text'>
Add debugfs interface "fw_dbglog_config" to configure firmware log level.
Configuration is done via WMI command WMI_DBGLOG_CFG_CMDID.

Command to configure,
echo "&lt;dbglog_param&gt; &lt;values&gt;" &gt;
/sys/kernel/debug/ath11k/&lt;hw&gt;/macX/fw_dbglog_config

where dbglog_param can be,
  1) WMI_DEBUG_LOG_PARAM_LOG_LEVEL - configure log level for a given module
     here, &lt;values&gt; = &lt;0xaaaa00bb&gt;, 'aaaa' - module id and 'bb' - loglevel
  2) WMI_DEBUG_LOG_PARAM_VDEV_ENABLE - enable debug log for a given vdev
     here, &lt;values&gt; = vdev_id
  3) WMI_DEBUG_LOG_PARAM_VDEV_DISABLE - disable debug log for a given vdev
     except ERROR logs
     here, &lt;values&gt; = vdev_id
  4) WMI_DEBUG_LOG_PARAM_VDEV_ENABLE_BITMAP - set vdev enable bitmap
       here, &lt;values&gt; = vdev_enable_bitmap
  5) WMI_DEBUG_LOG_PARAM_MOD_ENABLE_BITMAP - set a given log level to all the
     modules specified in the module bitmap. Command to configure for this log param,

     $ echo "5 &lt;values&gt; &lt;module_id_index&gt; &lt;is_end&gt;" &gt;
         /sys/kernel/debug/ath11k/&lt;hw&gt;/macX/fw_dbglog_config
     here,
                &lt;values&gt; = &lt;0xaaaaaaaa000000bb&gt;, 'aaaaaaaa' - module bitmap and
                          'bb' - loglevel
                &lt;module_id_index&gt; = index of module bitmap. Max module id is 512.
                                    So, module_id_index is 0-15.
                &lt;is_end&gt; = to indicate if more configuration to follow.

  6) WMI_DEBUG_LOG_PARAM_WOW_MOD_ENABLE_BITMAP - Wow mode specific logging enable.
     Command to configure for this log param,

      $ echo "6 &lt;values&gt; &lt;module_id_index&gt; &lt;is_end&gt;" &gt;
          /sys/kernel/debug/ath11k/&lt;hw&gt;/macX/fw_dbglog_config
      here,
                 &lt;values&gt; = &lt;0xaaaaaaaa000000bb&gt;, 'aaaaaaaa' - module bitmap and
                              'bb' - loglevel
                 &lt;module_id_index&gt; = index of module bitmap. Max module id is 512.
                                     So, module_id_index is 0-15.
                 &lt;is_end&gt; = to indicate if more configuration to follow.

Sample command usage,

To enable module WLAN_MODULE_WMI and log level ATH11K_FW_DBGLOG_VERBOSE,
echo "1 0x10001" &gt; /sys/kernel/debug/ath11k/&lt;hw&gt;/macX/fw_dbglog_config

To enable module bit map from 32 to 63 and log level ATH11K_FW_DBGLOG_VERBOSE,
echo "5 0xffffffff00000001 1 1" &gt; /sys/kernel/debug/ath11k/&lt;hw&gt;/macX/fw_dbglog_config

Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1

Signed-off-by: Seevalamuthu Mariappan &lt;quic_seevalam@quicinc.com&gt;
Signed-off-by: Kalle Valo &lt;quic_kvalo@quicinc.com&gt;
Link: https://lore.kernel.org/r/1642405103-32302-1-git-send-email-quic_seevalam@quicinc.com
</content>
</entry>
</feed>
