Skip to contentSkip to conversation

WMI and debugfs calls for TWT dialogs

PATCH Superseded Aloka Dixit 2 participants 4 messages Apr 8, 2021 – Dec 8, 2021 Qualcomm Atheros ATH11K wireless driver

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v6 cover WMI and debugfs calls for TWT dialogs

This patchset adds support for TWT dialogs using debugfs. Patch files show changes in V6 compared to V5.

John Crispin (2):
ath11k: add WMI calls to manually add/del/pause/resume TWT dialogs
ath11k: add debugfs for TWT debug calls

 drivers/net/wireless/ath/ath11k/core.h    |   4 +
 drivers/net/wireless/ath/ath11k/debugfs.c | 222 +++++++++++++++++++
 drivers/net/wireless/ath/ath11k/debugfs.h |  14 +-
 drivers/net/wireless/ath/ath11k/mac.c     |   6 +
 drivers/net/wireless/ath/ath11k/wmi.c     | 247 +++++++++++++++++++++-
 drivers/net/wireless/ath/ath11k/wmi.h     | 114 ++++++++++
 6 files changed, 602 insertions(+), 5 deletions(-)

base-commit: 1924a31a1d7c49a87dad0c6df7a3bff3d68cc462

Signature · 1 line
2.25.0
#1 lore raw

PATCH v6 1/2 ath11k: add WMI calls to manually add/del/pause/resume TWT dialogs

From: John Crispin <[email protected]>

These calls are used for debugging and will be required for WFA certification tests.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00680-QCAHKSWPL_SILICONZ-1

---
Changes in V6
* new function ath11k_wmi_twt_add_dialog_event_status()
* re-added WMI_TAG_TWT_ADD_DIALOG_COMPLETE_EVENT in wmi_tlv_policies which was missed in V5.

Changes in V5
* Setting and resetting of twt_enabled in WMI functions
* ath11k_dbg() instead of ath11k_info() in ath11k_wmi_twt_add_dialog_event()
* Made WMI error messages more readable

 drivers/net/wireless/ath/ath11k/core.h |   1 +
 drivers/net/wireless/ath/ath11k/wmi.c  | 247 ++++++++++++++++++++++++-
 drivers/net/wireless/ath/ath11k/wmi.h  | 114 ++++++++++++
 3 files changed, 358 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +1 -0
index 55af982deca7..b59bf2c28193 100644
@@ -566,6 +566,7 @@ struct ath11k {
 #endif
 	bool dfs_block_radar_events;
 	struct ath11k_thermal thermal;
+	u8 twt_enabled;
 };
 
 struct ath11k_band_cap {
drivers/net/wireless/ath/ath11k/wmi.c +243 -4

288 lines not on this page · raw message

drivers/net/wireless/ath/ath11k/wmi.h +114 -0

126 lines not on this page · raw message

base-commit: 1924a31a1d7c49a87dad0c6df7a3bff3d68cc462

Signature · 1 line
2.25.0
#2 lore raw

Re: [PATCH V6 1/2] ath11k: add WMI calls to manually add/del/pause/resume TWT dialogs

Quoted 8 lines · Aloka Dixit

From: John Crispin <[email protected]>

These calls are used for debugging and will be required for WFA certification tests.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00680-QCAHKSWPL_SILICONZ-1

Doesn't apply anymore, please rebase.

error: patch failed: drivers/net/wireless/ath/ath11k/core.h:566
error: drivers/net/wireless/ath/ath11k/core.h: patch does not apply
error: patch failed: drivers/net/wireless/ath/ath11k/wmi.c:128
error: drivers/net/wireless/ath/ath11k/wmi.c: patch does not apply stg import: Diff does not apply cleanly

2 patches set to Changes Requested.

12189609 [V6,1/2] ath11k: add WMI calls to manually add/del/pause/resume TWT dialogs 12189611 [V6,2/2] ath11k: add debugfs for TWT debug calls

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw

PATCH v6 2/2 ath11k: add debugfs for TWT debug calls

In reply to Aloka Dixit

From: John Crispin <[email protected]>

New debugfs files to manually add/delete/pause/resume TWT dialogs for test/debug purposes.

The debugfs files expect the following parameters
(1) Add dialog
echo '<Peer_MAC> <Dialog_ID> <Wake_Interval_Usec> <Wake_Interval_Mantis> <Wake_Duration_Usec> <First_SP_Offset> <TWT_Command> <1:Broadcast / 0:Individual> <1:Triggered / 0:Untriggered> <1:Unannounced / 0:Announced> <1:Protected / 0:Unprotected>' > /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' > /sys/kernel/debug/ieee80211/phy0/netdev:wlan0/twt/add_dialog

(2) Delete dialog
echo '<Peer_MAC> <Dialog_ID>' > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/twt/del_dialog

(3) Pause dialog
echo '<Peer_MAC> <Dialog_ID>' > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/twt/pause_dialog

(4) Resume dialog
echo '<Peer_MAC> <Dialog_ID> <SP_Offset_Usec> <Next_TWT_Size>' > /sys/kernel/debug/ieee80211/phyX/netdev:wlanX/twt/resume_dialog

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

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00680-QCAHKSWPL_SILICONZ-1

---
Changes in V6
* Moved all functions from debug.c to debugfs.c
* ath11k_debugfs_add_interface() returns int instead of void

Changes in V5
* TWT directory created during ath11k_mac_op_add_interface() instead
* of during TWT enable command.
* File write operation check for twt_enabled.
* Used CONFIG_ATH11K_DEBUGFS instead of CONFIG_MAC80211_DEBUGFS.
* Example commands in commit description.

 drivers/net/wireless/ath/ath11k/core.h    |   3 +
 drivers/net/wireless/ath/ath11k/debugfs.c | 222 ++++++++++++++++++++++
 drivers/net/wireless/ath/ath11k/debugfs.h |  14 +-
 drivers/net/wireless/ath/ath11k/mac.c     |   6 +
 4 files changed, 244 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/core.h +3 -0
index b59bf2c28193..bb79662b1630 100644
@@ -243,6 +243,9 @@ struct ath11k_vif {
 	bool rsnie_present;
 	bool wpaie_present;
 	struct ieee80211_chanctx_conf chanctx;
+#ifdef CONFIG_ATH11K_DEBUGFS
+	struct dentry *debugfs_twt;
+#endif /* CONFIG_ATH11K_DEBUGFS */
 };
 
 struct ath11k_vif_iter {
drivers/net/wireless/ath/ath11k/debugfs.c +222 -0

225 lines not on this page · raw message

drivers/net/wireless/ath/ath11k/debugfs.h +13 -1
index e5346af71f24..290520fbe05b 100644
@@ -145,6 +145,9 @@ static inline int ath11k_debugfs_rx_filter(struct ath11k *ar)
 	return ar->debug.rx_filter;
 }
 
+int ath11k_debugfs_add_interface(struct ath11k_vif *arvif);
+void ath11k_debugfs_remove_interface(struct ath11k_vif *arvif);
+
 #else
 static inline int ath11k_debugfs_soc_create(struct ath11k_base *ab)
 {
@@ -212,6 +215,15 @@ static inline int ath11k_debugfs_rx_filter(struct ath11k *ar)
 	return 0;
 }
 
-#endif /* CONFIG_MAC80211_DEBUGFS*/
+static inline int ath11k_debugfs_add_interface(struct ath11k_vif *arvif)
+{
+	return 0;
+}
+
+static inline void ath11k_debugfs_remove_interface(struct ath11k_vif *arvif)
+{
+}
+
+#endif /* CONFIG_ATH11K_DEBUGFS*/
 
 #endif /* _ATH11K_DEBUGFS_H_ */
drivers/net/wireless/ath/ath11k/mac.c +6 -0
index 8719e8550a40..332e7353f12f 100644
@@ -4833,6 +4833,9 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
 	}
 
 	ath11k_dp_vdev_tx_attach(ar, arvif);
+	ret = ath11k_debugfs_add_interface(arvif);
+	if (ret)
+		goto err_peer_del;
 
 	mutex_unlock(&ar->conf_mutex);
 
@@ -4868,6 +4871,7 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
 	spin_unlock_bh(&ar->data_lock);
 
 err:
+	ath11k_debugfs_remove_interface(arvif);
 	mutex_unlock(&ar->conf_mutex);
 
 	return ret;
@@ -4952,6 +4956,8 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw,
 	ath11k_mac_txpower_recalc(ar);
 	clear_bit(ATH11K_FLAG_MONITOR_ENABLED, &ar->monitor_flags);
 
+	ath11k_debugfs_remove_interface(arvif);
+
 	/* TODO: recal traffic pause state based on the available vdevs */
 
 	mutex_unlock(&ar->conf_mutex);
Signature · 1 line
2.25.0