All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wireless: Allow disabling TWT
Date: Thu, 8 Apr 2021 16:00:32 -0700	[thread overview]
Message-ID: <3ce23e62-a9f7-013f-9eb7-578f5ca5c9dd@candelatech.com> (raw)
In-Reply-To: <0b89f56b37073b633b343a71a098247a53ec89f9.camel@sipsolutions.net>

On 4/8/21 6:25 AM, Johannes Berg wrote:
> 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.

So we don't even need HE overrides in this case?

>>
>> -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.

Evidently, like maybe the spec was planning to add TWT to VHT or
something like that?

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

Maybe this can be done, but since TWT is in several different places, it
is going to be a pain to code up that way.

The way I see it, if we do go with overrides, the API is going to be pretty
tricky, basically passing a bunch of u8 around to represent different sets of IE
contents and their mask.  So I think it is cleaner to pass in specific flags such as 'disable-twt'.
Now, maybe those types of flags can be passed in as part of a nested netlink attribute
or a 'override-flags-1' u32 so that each time we add a new one it doesn't need to grow
the main netlink enum...

And, I'd still like to see a way to set station config
while it is still admin down, so that we have all of the desired local config overrides set
before we ever even start scanning...  That would be a better way to do overrides in
general in my opinion.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

      reply	other threads:[~2021-04-08 23:00 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
2021-04-08 23:00   ` Ben Greear [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=3ce23e62-a9f7-013f-9eb7-578f5ca5c9dd@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=johannes@sipsolutions.net \
    --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.