[PATCH V4 2/2] ath11k: add debugfs for TWT debug calls
Kalle Valo
kvalo at codeaurora.org
Tue Feb 9 04:30:28 EST 2021
+ ath11k
Aloka Dixit <alokad at codeaurora.org> writes:
> From: John Crispin <john at phrozen.org>
>
> These new debugfs files allow us to manually add/del/pause/resume TWT
> dialogs for test/debug purposes.
>
> The debugfs files expect the following parameters
> add_dialog - mac dialog_id wake_intvl_us wake_intvl_mantis
> wake_dura_us sp_offset_us twt_cmd flag_bcast
> flag_trigger flag_flow_type flag_protection
> del_dialog - mac dialog_id
> pause_dialog - mac dialog_id
> resume_dialog - mac dialog_id sp_offset_us next_twt_size
>
> Signed-off-by: John Crispin <john at phrozen.org>
> Signed-off-by: Aloka Dixit <alokad at codeaurora.org>
[...]
> --- a/drivers/net/wireless/ath/ath11k/debug.h
> +++ b/drivers/net/wireless/ath/ath11k/debug.h
> @@ -64,4 +64,12 @@ do { \
> __ath11k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
> } while (0)
>
> +#ifdef CONFIG_MAC80211_DEBUGFS
> +void ath11k_debugfs_twt(struct ath11k_vif *arvif, bool enable);
> +#else
> +static inline void ath11k_debugfs_twt(struct ath11k_vif *arvif, bool enable)
> +{
> +}
> +#endif
> +
> #endif /* _ATH11K_DEBUG_H_ */
> diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
> index c1608f64ea95..564cdf7a5331 100644
> --- a/drivers/net/wireless/ath/ath11k/mac.c
> +++ b/drivers/net/wireless/ath/ath11k/mac.c
> @@ -2111,6 +2111,8 @@ static void ath11k_mac_op_bss_info_changed(struct ieee80211_hw *hw,
> ath11k_wmi_send_twt_enable_cmd(ar, ar->pdev->pdev_id);
> else
> ath11k_wmi_send_twt_disable_cmd(ar, ar->pdev->pdev_id);
> + if (vif->type == NL80211_IFTYPE_AP)
> + ath11k_debugfs_twt(arvif, info->twt_requester);
> }
These hunks gave my deja vu and indeed I have provided comments before:
http://lists.infradead.org/pipermail/ath11k/2020-July/000039.html
I'll copy my comments here:
To make this more generic can you call this
ath11k_debugs_add_interface() or something like that? Ah, but this is in
ath11k_mac_op_bss_info_changed(). Shouldn't it be in
ath11k_mac_op_add_interface()?
Hmm, I think I get now. You create the debugfs directory and files only
when twt is actually enabled, not when the interface is added. I have
concerns about files coming and going like that dynamically. Wouldn't it
be cleaner to create the directory and the files when the interface is
added? And just return a good error code if someone tries to use the
debugfs files when twt is disabled?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
More information about the ath11k
mailing list