All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@candelatech.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wireless:  Allow disabling TWT
Date: Thu, 08 Apr 2021 15:25:19 +0200	[thread overview]
Message-ID: <0b89f56b37073b633b343a71a098247a53ec89f9.camel@sipsolutions.net> (raw)
In-Reply-To: <20210306162010.16706-1-greearb@candelatech.com> (sfid-20210306_172115_779009_173A00D2)

On Sat, 2021-03-06 at 08:20 -0800, greearb@candelatech.com wrote:
> 
> +	/* Apply overrides as needed. */
> +	if (ifmgd->flags & IEEE80211_STA_DISABLE_TWT) {
> +		if (ext_capa) {
> +			if (ext_capa && ext_capa->datalen > 10) {
> +				ext_capa->data[9] &= ~(WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT);

So apart from the useless code (checking "ext_capa" twice, unnecessary
nested ifs, unnecessary parentheses), this can already be done entirely
by userspace, since it controls the ext capa we send.

> 
> -static bool ieee80211_twt_req_supported(const struct sta_info *sta,
> +static bool ieee80211_twt_req_supported(struct ieee80211_sub_if_data *sdata,
> +					const struct sta_info *sta,
>  					const struct ieee802_11_elems *elems)
> 

This code here seems possibly wrong anyway since it doesn't take local
capabilities into account, maybe it should, and then these changes
wouldn't be necessary?

> +	/* Apply overrides as needed. */
> +	if (ifmgd->flags & IEEE80211_STA_DISABLE_TWT) {
> +		struct ieee80211_he_cap_elem *hec;
> +		hec = (struct ieee80211_he_cap_elem *)(pos);
> +		hec->mac_cap_info[0] &= ~(IEEE80211_HE_MAC_CAP0_TWT_REQ);
> +		hec->mac_cap_info[0] &= ~(IEEE80211_HE_MAC_CAP0_TWT_RES);
> +	}

Wait, we actually have TWT capability *twice*, once in HE and once in
extended capabilities?! Fun.

But for this shouldn't we have the more general "HE capability override"
stuff that we have also for HT and VHT?



  reply	other threads:[~2021-04-08 13:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-06 16:20 [PATCH] wireless: Allow disabling TWT greearb
2021-04-08 13:25 ` Johannes Berg [this message]
2021-04-08 23:00   ` Ben Greear

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=0b89f56b37073b633b343a71a098247a53ec89f9.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.