linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Aloka Dixit <alokad@codeaurora.org>
Cc: linux-wireless@vger.kernel.org, John Crispin <john@phrozen.org>,
	ath11k@lists.infradead.org
Subject: Re: [PATCH V4 2/2] ath11k: add debugfs for TWT debug calls
Date: Tue, 09 Feb 2021 11:30:28 +0200	[thread overview]
Message-ID: <87sg65io5n.fsf@tynnyri.adurom.net> (raw)
In-Reply-To: <20210120023048.5016-3-alokad@codeaurora.org> (Aloka Dixit's message of "Tue, 19 Jan 2021 18:30:48 -0800")

+ ath11k

Aloka Dixit <alokad@codeaurora.org> writes:

> From: John Crispin <john@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@phrozen.org>
> Signed-off-by: Aloka Dixit <alokad@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

      reply	other threads:[~2021-02-09  9:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  2:30 [PATCH V4 0/2] WMI and debugfs calls for TWT dialogs Aloka Dixit
2021-01-20  2:30 ` [PATCH V4 1/2] ath11k: add WMI calls to manually add/del/pause/resume " Aloka Dixit
2021-01-20  2:30 ` [PATCH V4 2/2] ath11k: add debugfs for TWT debug calls Aloka Dixit
2021-02-09  9:30   ` Kalle Valo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sg65io5n.fsf@tynnyri.adurom.net \
    --to=kvalo@codeaurora.org \
    --cc=alokad@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=john@phrozen.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).