iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Re: 40MHz Bandwidth in AP mode
       [not found] <CAH4auOnuK_dDemZRF4BMq3LPL6A5cmLfSgJKeFVKAYZUNGAk2w@mail.gmail.com>
@ 2023-03-13 10:07 ` Alagu Sankar
  2023-03-13 15:29   ` Denis Kenzior
  0 siblings, 1 reply; 5+ messages in thread
From: Alagu Sankar @ 2023-03-13 10:07 UTC (permalink / raw)
  To: iwd

Hi,

We are testing the iwd-2.3 version in AP mode for one of our
requirements.  When trying to configure the AP mode in Channel 36, it
was always selecting 20MHz.  The band_freq_to_ht_chandef() function is
supposed to select the best bandwidth. As we see, channel 36 is
configured as 40Mhz capable (operating_class 116).  Debugging this
further, we see that 40MHz spacing is rejected due to the following
condition
if (info->flags & PRIMARY_CHANNEL_UPPER && attr->no_ht40_plus)
    continue;
if (info->flags & PRIMARY_CHANNEL_LOWER && attr->no_ht40_minus)
    continue;
Channel 36 is configured as PRIMARY_CHANNEL_LOWER and the NL80211
attribute is indicating no_ht40_minus for this, but as per the
condition above, this is skipped. The check above seems incorrect.
Can you please let me know if 40MHz bandwidth is tested on AP mode?

Best Regards,
Alagu Sankar

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 40MHz Bandwidth in AP mode
  2023-03-13 10:07 ` 40MHz Bandwidth in AP mode Alagu Sankar
@ 2023-03-13 15:29   ` Denis Kenzior
  2023-03-13 16:56     ` James Prestwood
  2023-03-14  6:14     ` Alagu Sankar
  0 siblings, 2 replies; 5+ messages in thread
From: Denis Kenzior @ 2023-03-13 15:29 UTC (permalink / raw)
  To: Alagu Sankar, iwd

Hi Alagu,

On 3/13/23 05:07, Alagu Sankar wrote:
> Hi,
> 
> We are testing the iwd-2.3 version in AP mode for one of our
> requirements.  When trying to configure the AP mode in Channel 36, it
> was always selecting 20MHz.  The band_freq_to_ht_chandef() function is
> supposed to select the best bandwidth. As we see, channel 36 is
> configured as 40Mhz capable (operating_class 116).  Debugging this
> further, we see that 40MHz spacing is rejected due to the following
> condition
> if (info->flags & PRIMARY_CHANNEL_UPPER && attr->no_ht40_plus)
>      continue;
> if (info->flags & PRIMARY_CHANNEL_LOWER && attr->no_ht40_minus)
>      continue;
> Channel 36 is configured as PRIMARY_CHANNEL_LOWER and the NL80211
> attribute is indicating no_ht40_minus for this, but as per the

So if NL80211 reports no_ht40_minus, we can't use this channel for 40HT:

* @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
  *      channel as the control channel

> condition above, this is skipped. The check above seems incorrect.

Why do you say that?

Is the currently set regdom somehow restricting HT40 operation?  Does setting 
the regdom country help?  Perhaps via [General].Country?  See man 5 iwd.config.

> Can you please let me know if 40MHz bandwidth is tested on AP mode?
> 

Yes, but things can always be tested better.  Our AP support is still quite 
experimental.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 40MHz Bandwidth in AP mode
  2023-03-13 15:29   ` Denis Kenzior
@ 2023-03-13 16:56     ` James Prestwood
  2023-03-14  6:14     ` Alagu Sankar
  1 sibling, 0 replies; 5+ messages in thread
From: James Prestwood @ 2023-03-13 16:56 UTC (permalink / raw)
  To: Denis Kenzior, Alagu Sankar, iwd

On Mon, 2023-03-13 at 10:29 -0500, Denis Kenzior wrote:
> Hi Alagu,
> 
> On 3/13/23 05:07, Alagu Sankar wrote:
> > Hi,
> > 
> > We are testing the iwd-2.3 version in AP mode for one of our
> > requirements.  When trying to configure the AP mode in Channel 36, it
> > was always selecting 20MHz.  The band_freq_to_ht_chandef() function
> > is
> > supposed to select the best bandwidth. As we see, channel 36 is
> > configured as 40Mhz capable (operating_class 116).  Debugging this
> > further, we see that 40MHz spacing is rejected due to the following
> > condition
> > if (info->flags & PRIMARY_CHANNEL_UPPER && attr->no_ht40_plus)
> >      continue;
> > if (info->flags & PRIMARY_CHANNEL_LOWER && attr->no_ht40_minus)
> >      continue;
> > Channel 36 is configured as PRIMARY_CHANNEL_LOWER and the NL80211
> > attribute is indicating no_ht40_minus for this, but as per the
> 
> So if NL80211 reports no_ht40_minus, we can't use this channel for
> 40HT:
> 
> * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
>   *      channel as the control channel
> 
> > condition above, this is skipped. The check above seems incorrect.
> 
> Why do you say that?
> 
> Is the currently set regdom somehow restricting HT40 operation?  Does
> setting 
> the regdom country help?  Perhaps via [General].Country?  See man 5
> iwd.config.
> 
> > Can you please let me know if 40MHz bandwidth is tested on AP mode?
> > 
> 
> Yes, but things can always be tested better.  Our AP support is still
> quite 
> experimental.

Yes, AP mode certainly could use more testing but the adapters I have
tested on have worked with 40MHz. 

As Denis said just because the operating class allows 40Mhz doesn't
mean your wifi hardware or country allow that operation.

To tell 100% in your case you'd need to get an iwmon log of IWD
starting up. This will get a full log of any channel restrictions, more
info here: https://iwd.wiki.kernel.org/debugging

Thanks,
James

> 
> Regards,
> -Denis
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 40MHz Bandwidth in AP mode
  2023-03-13 15:29   ` Denis Kenzior
  2023-03-13 16:56     ` James Prestwood
@ 2023-03-14  6:14     ` Alagu Sankar
  2023-03-14 15:24       ` James Prestwood
  1 sibling, 1 reply; 5+ messages in thread
From: Alagu Sankar @ 2023-03-14  6:14 UTC (permalink / raw)
  To: Denis Kenzior; +Cc: iwd

Hi Denis,

On Mon, Mar 13, 2023 at 8:59 PM Denis Kenzior <denkenz@gmail.com> wrote:
>
> Hi Alagu,
>
> On 3/13/23 05:07, Alagu Sankar wrote:
> > Hi,
> >
> > We are testing the iwd-2.3 version in AP mode for one of our
> > requirements.  When trying to configure the AP mode in Channel 36, it
> > was always selecting 20MHz.  The band_freq_to_ht_chandef() function is
> > supposed to select the best bandwidth. As we see, channel 36 is
> > configured as 40Mhz capable (operating_class 116).  Debugging this
> > further, we see that 40MHz spacing is rejected due to the following
> > condition
> > if (info->flags & PRIMARY_CHANNEL_UPPER && attr->no_ht40_plus)
> >      continue;
> > if (info->flags & PRIMARY_CHANNEL_LOWER && attr->no_ht40_minus)
> >      continue;
> > Channel 36 is configured as PRIMARY_CHANNEL_LOWER and the NL80211
> > attribute is indicating no_ht40_minus for this, but as per the
>
> So if NL80211 reports no_ht40_minus, we can't use this channel for 40HT:
>
> * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
>   *      channel as the control channel
>
> > condition above, this is skipped. The check above seems incorrect.
>
> Why do you say that?
For a Channel with PRIMARY_CHANNEL_LOWER flag, if it supports HT40+,
then we are allowed to use 40MHz bandwidth. (Ex. Channel 36 and
HT40+). In other words for PRIMARY_CHANNEL_LOWER, if no_ht40_plus flag
is set, then we skip the channel for 40Mhz. When we used IWD with a
Qualcomm 11AX driver, for Channel 36, no_ht40_minus is set to 1 and
no_ht40_plus is set to 0. So the check shall be
if (info->flags & PRIMARY_CHANNEL_UPPER && attr->no_ht40_minus)
    continue;
if (info->flags & PRIMARY_CHANNEL_LOWER && attr->no_ht40_plus)
    continue;
> Is the currently set regdom somehow restricting HT40 operation?  Does setting
> the regdom country help?  Perhaps via [General].Country?  See man 5 iwd.config.
>
Regulatory is managed by the driver and set to US in our test.  Could
verify the channel and bandwidth availability through iw list command.
> > Can you please let me know if 40MHz bandwidth is tested on AP mode?
> >
>
> Yes, but things can always be tested better.  Our AP support is still quite
> experimental.
>
> Regards,
> -Denis

Best Regards,
Alagu Sankar

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 40MHz Bandwidth in AP mode
  2023-03-14  6:14     ` Alagu Sankar
@ 2023-03-14 15:24       ` James Prestwood
  0 siblings, 0 replies; 5+ messages in thread
From: James Prestwood @ 2023-03-14 15:24 UTC (permalink / raw)
  To: Alagu Sankar, Denis Kenzior; +Cc: iwd

Hi Alagu,

On Tue, 2023-03-14 at 11:44 +0530, Alagu Sankar wrote:
> Hi Denis,
> 
> On Mon, Mar 13, 2023 at 8:59 PM Denis Kenzior <denkenz@gmail.com>
> wrote:
> > 
> > Hi Alagu,
> > 
> > On 3/13/23 05:07, Alagu Sankar wrote:
> > > Hi,
> > > 
> > > We are testing the iwd-2.3 version in AP mode for one of our
> > > requirements.  When trying to configure the AP mode in Channel 36,
> > > it
> > > was always selecting 20MHz.  The band_freq_to_ht_chandef() function
> > > is
> > > supposed to select the best bandwidth. As we see, channel 36 is
> > > configured as 40Mhz capable (operating_class 116).  Debugging this
> > > further, we see that 40MHz spacing is rejected due to the following
> > > condition
> > > if (info->flags & PRIMARY_CHANNEL_UPPER && attr->no_ht40_plus)
> > >      continue;
> > > if (info->flags & PRIMARY_CHANNEL_LOWER && attr->no_ht40_minus)
> > >      continue;
> > > Channel 36 is configured as PRIMARY_CHANNEL_LOWER and the NL80211
> > > attribute is indicating no_ht40_minus for this, but as per the
> > 
> > So if NL80211 reports no_ht40_minus, we can't use this channel for
> > 40HT:
> > 
> > * @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with
> > this
> >   *      channel as the control channel
> > 
> > > condition above, this is skipped. The check above seems incorrect.
> > 
> > Why do you say that?
> For a Channel with PRIMARY_CHANNEL_LOWER flag, if it supports HT40+,
> then we are allowed to use 40MHz bandwidth. (Ex. Channel 36 and
> HT40+). In other words for PRIMARY_CHANNEL_LOWER, if no_ht40_plus flag
> is set, then we skip the channel for 40Mhz. When we used IWD with a
> Qualcomm 11AX driver, for Channel 36, no_ht40_minus is set to 1 and
> no_ht40_plus is set to 0. So the check shall be
> if (info->flags & PRIMARY_CHANNEL_UPPER && attr->no_ht40_minus)
>     continue;
> if (info->flags & PRIMARY_CHANNEL_LOWER && attr->no_ht40_plus)
>     continue;

I think you may be on to something actually. I apparently misunderstood
the terminology of HT40+/HT40-. The spec doesn't use these terms, but
nl80211 does:

 * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
 *	below the control channel
 * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
 *	above the control channel

Specifically for operating class 116 we have the PRIMARY_CHANNEL_LOWER
behavior limit, which indeed means this is HT40+. Good catch!

So far all the hardware I tested never set any of these flags. For
HT/40MHz channel widths you are implicitly limited anyways since the
operating classes define the upper/lower behavior.

Since you found the bug and already have a fix you could send that to
the list? If not I'm happy to do it as well.

Thanks,
James



> > Is the currently set regdom somehow restricting HT40 operation?  Does
> > setting
> > the regdom country help?  Perhaps via [General].Country?  See man 5
> > iwd.config.
> > 
> Regulatory is managed by the driver and set to US in our test.  Could
> verify the channel and bandwidth availability through iw list command.
> > > Can you please let me know if 40MHz bandwidth is tested on AP mode?
> > > 
> > 
> > Yes, but things can always be tested better.  Our AP support is still
> > quite
> > experimental.
> > 
> > Regards,
> > -Denis
> 
> Best Regards,
> Alagu Sankar
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-14 15:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAH4auOnuK_dDemZRF4BMq3LPL6A5cmLfSgJKeFVKAYZUNGAk2w@mail.gmail.com>
2023-03-13 10:07 ` 40MHz Bandwidth in AP mode Alagu Sankar
2023-03-13 15:29   ` Denis Kenzior
2023-03-13 16:56     ` James Prestwood
2023-03-14  6:14     ` Alagu Sankar
2023-03-14 15:24       ` James Prestwood

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