Linux wireless drivers development
 help / color / mirror / Atom feed
From: Alexander Wilhelm <alexander.wilhelm@westermo.com>
To: Alex Gavin <a_gavin@icloud.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: wifi: mac80211: question about 20/40 coex support
Date: Fri, 13 Feb 2026 10:46:27 +0100	[thread overview]
Message-ID: <aY7y84VZW465W_zr@FUE-ALEWI-WINX> (raw)
In-Reply-To: <a3fd0a27-f09f-4950-919d-1b4ba2dcb16a@icloud.com>

On Fri, Feb 13, 2026 at 12:14:16AM -0800, Alex Gavin wrote:
> On 2/12/26 23:05, Alexander Wilhelm wrote:
> > 
> > Hello wireless devs,
> > 
> > I am analyzing a wireless management frame taken from the beacon of an
> > access point, and in this frame the `20/40 Coexistence Management Support`
> > bit is set to 0, indicating that the feature is not supported. See frame
> > below:
> > 
> >     Frame 2: 217 bytes on wire (1736 bits), 217 bytes captured (1736 bits)
> >     Radiotap Header v0, Length 26
> >     802.11 radio information
> >     IEEE 802.11 Beacon frame, Flags: ........
> >     IEEE 802.11 Wireless Management
> >         Fixed parameters (12 bytes)
> >         Tagged parameters (155 bytes)
> >             Tag: SSID parameter set: "SSID"
> >             Tag: Supported Rates 6(B), 9, 12(B), 18, 24(B), 36, 48, 54, [Mbit/sec]
> >             Tag: DS Parameter set: Current Channel: 6
> >             Tag: Traffic Indication Map (TIM): DTIM 0 of 2 bitmap
> >             Tag: Country Information: Country Code DE, Environment All
> >             Tag: ERP Information
> >             Tag: QBSS Load Element 802.11e CCA Version
> >             Tag: Supported Operating Classes
> >             Tag: HT Capabilities (802.11n D1.10)
> >             Tag: HT Information (802.11n D1.10)
> >             Tag: Extended Capabilities (10 octets)
> >                 Tag Number: Extended Capabilities (127)
> >                 Tag length: 10
> >                 Extended Capabilities: 0x04 (octet 1)
> >                     .... ...0 = 20/40 BSS Coexistence Management Support: Not supported
> >                     .... ..0. = General Link (GLK): 0x0
> >                     .... .1.. = Extended Channel Switching: Supported
> >                     .... 0... = GLK-GCR: 0x0
> >                     ...0 .... = PSMP Capability: Not supported
> >                     ..0. .... = Reserved: 0x0
> >                     .0.. .... = S-PSMP Support: Not supported
> >                     0... .... = Event: Not supported
> >                 Extended Capabilities: 0x00 (octet 2)
> >                 Extended Capabilities: 0x00 (octet 3)
> >                 Extended Capabilities: 0x02 (octet 4)
> >                 Extended Capabilities: 0x00 (octet 5)
> >                 Extended Capabilities: 0x00 (octet 6)
> >                 Extended Capabilities: 0x01 (octet 7)
> >                 Extended Capabilities: 0x0040 (octets 8 & 9)
> >                 Extended Capabilities: 0x40 (octet 10)
> >             Tag: Vendor Specific: Microsoft Corp.: WMM/WME: Parameter Element
> > 
> > I reviewed several driver implementations, and none of them seem to
> > advertise this capability. I also could not find any definition for this
> > bit in `include/linux/ieee80211.h`, unlike many other capability bits that
> > are defined (e.g. `WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING` or
> > `WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT`). From what I can see, none of the
> > `mac80211`‑based drivers appear to support this feature, is that correct?
> > 
> > Additionally, I want to confirm whether my understanding of the feature is
> > accurate: the 20/40 Coexistence mechanism implements the “good neighbor”
> > policy, meaning that an AP using a 40 MHz channel in the 2.4 GHz band must
> > fall back to 20 MHz when it detects an overlapping BSS (OBSS). Is that
> > right?
> > 
> > Any clarification would be greatly appreciated.
> > 
> > 
> > Best regards
> > Alexander Wilhelm
> > 
> 
> From my understanding, this is implemented in userspace (i.e. hostapd), at least in upstream code.

I've alredy seen the code in `hostapd` that implements a fallback to 20
MHz. But that implementation is based only on scan results, not on 20/40
coexistence feautre. Here the snippet from `ieee80211n_check_scan`
function:

    [...]
    if (iface->current_mode->mode == HOSTAPD_MODE_IEEE80211A)
            oper40 = ieee80211n_check_40mhz_5g(iface, scan_res);
    else
            oper40 = ieee80211n_check_40mhz_2g4(iface, scan_res);
    wpa_scan_results_free(scan_res);

    iface->secondary_ch = iface->conf->secondary_channel;
    if (!oper40) {
            wpa_printf(MSG_INFO, "20/40 MHz operation not permitted on "
                       "channel pri=%d sec=%d based on overlapping BSSes",
                       iface->conf->channel,
                       iface->conf->channel +
                       iface->conf->secondary_channel * 4);
            iface->conf->secondary_channel = 0;
            if (iface->drv_flags & WPA_DRIVER_FLAGS_HT_2040_COEX) {
                    /*
                     * TODO: Could consider scheduling another scan to check
                     * if channel width can be changed if no coex reports
                     * are received from associating stations.
                     */
            }
    }
    [...]

> In hostapd, the '20/40 BSS Coexistence Management Support' bit you reference is set in the
> 'hostapd_ext_capab_byte()' function in 'src/ap/ieee802_11_shared.c' when 'obss_interval' is set in
> the AP config file.
> 
> For more information on the 'obss_interval' config item see the following from the hostapd config
> reference here [1]:
> 
> # If set non-zero, require stations to perform scans of overlapping
> # channels to test for stations which would be affected by 40 MHz traffic.
> # This parameter sets the interval in seconds between these scans. Setting this
> # to non-zero allows 2.4 GHz band AP to move dynamically to a 40 MHz channel if
> # no co-existence issues with neighboring devices are found.
> #obss_interval=0

Great, I found the the configuration in my `hostapd` version and the code
that implements the handling of this kind of management frames. I'll give
the configuration option a try.

> The following sections from the 802.11 standard may be helpful to understand this topic in more
> depth, although I'm sure there's information online that may be easier to digest:
> 
> - 9.4.2.58 20/40 BSS Coexistence element
> - 9.4.2.54.2 HT Capability Information field
> - 11.15.12 Switching between 40 MHz and 20 MHz
> 
> From 11.15.12:
> 
> TE-B: On any of the channels of the channel set defined in Clause 18, reception of a 20/40 BSS
> Coexistence Management, Beacon, Probe Request, or Probe Response frame that contains a value of 1 in
> a Forty MHz Intolerant field and that has the Address 1 field equal to the receiving STA’s address
> or to a group address, with no further addressing qualifications.

Thank you for the support, Alex. The information helps me a lot.


Best regards
Alexander Wilhelm

  reply	other threads:[~2026-02-13  9:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-13  7:05 wifi: mac80211: question about 20/40 coex support Alexander Wilhelm
2026-02-13  8:14 ` Alex Gavin
2026-02-13  9:46   ` Alexander Wilhelm [this message]
2026-02-13 21:44     ` Alex Gavin
2026-02-13 22:01       ` Alex Gavin
2026-02-16  9:50         ` Alexander Wilhelm

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=aY7y84VZW465W_zr@FUE-ALEWI-WINX \
    --to=alexander.wilhelm@westermo.com \
    --cc=a_gavin@icloud.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.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