Skip to content

Conversation

@SwedishOutlaw123
Copy link

This commit introduces a new debugfs interface for the Timing Synchronization Function (TSF) specifically for the RTL8821CU chipset.

The following changes were made:

  • Added rtw_debugfs_get_tsf to read the 64-bit TSF value from the correct hardware registers (0x0560 and 0x0564).
  • Added rtw_debugfs_set_tsf to allow writing a new TSF value or resetting TSF using the "reset" command. Writes update registers 0x0560 (lower 32 bits) and 0x0564 (upper 32 bits).
  • Updated the rtw_debugfs_priv structure to include TSF support.
  • Ensures proper locking via the device mutex to prevent race conditions when accessing TSF registers.
  • Provides debug logging via rtw_info for TSF read/write operations.
  • Creates the TSF debugfs file at /sys/kernel/debug/ieee80211/phy*/rtw88/tsf.

This feature allows developers and testers to monitor and manipulate the TSF for debugging and performance evaluation purposes.

This commit introduces a new debugfs interface for the Timing Synchronization Function (TSF) specifically for the RTL8821CU chipset.

The following changes were made:

- Added `rtw_debugfs_get_tsf` to read the 64-bit TSF value from the correct hardware registers (0x0560 and 0x0564).
- Added `rtw_debugfs_set_tsf` to allow writing a new TSF value or resetting TSF using the "reset" command. Writes update registers 0x0560 (lower 32 bits) and 0x0564 (upper 32 bits).
- Updated the `rtw_debugfs_priv` structure to include TSF support.
- Ensures proper locking via the device mutex to prevent race conditions when accessing TSF registers.
- Provides debug logging via `rtw_info` for TSF read/write operations.
- Creates the TSF debugfs file at `/sys/kernel/debug/ieee80211/phy*/rtw88/tsf`.

This feature allows developers and testers to monitor and manipulate the TSF for debugging and performance evaluation purposes.
@dubhater
Copy link
Collaborator

dubhater commented Oct 7, 2025

Please email your patch to linux-wireless at vger.kernel.org and pkshih at realtek.com.

@SwedishOutlaw123
Copy link
Author

Ok, I'll do that! I want to clarify that the TSF debugfs functionality has only been tested and verified on the RTL8821CU chipset. Other rtw88 devices may work, but I haven’t verified them yet, so testing is needed.

Based on my research of the hardware registers, similar TSF register addresses appear on the following chipsets:

USB Wi-Fi Chips:

RTL8822CU
RTL8822BU
RTL8812BU
RTL8814AU

PCIe Wi-Fi Chips Supported:

RTL8822BE/BU
RTL8822CE/CU
RTL8821CE/AE
RTL8723DE/DU
RTL8814AE

Testing on these devices would help confirm whether the TSF debugfs functionality works across the wider rtw88 family.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants