]> www.infradead.org Git - users/hch/misc.git/commitdiff
wifi: mac80211: Fix 6 GHz Band capabilities element advertisement in lower bands
authorRamya Gnanasekar <ramya.gnanasekar@oss.qualcomm.com>
Fri, 6 Jun 2025 10:44:36 +0000 (16:14 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 4 Sep 2025 09:47:03 +0000 (11:47 +0200)
Currently, when adding the 6 GHz Band Capabilities element, the channel
list of the wiphy is checked to determine if 6 GHz is supported for a given
virtual interface. However, in a multi-radio wiphy (e.g., one that has
both lower bands and 6 GHz combined), the wiphy advertises support for
all bands. As a result, the 6 GHz Band Capabilities element is incorrectly
included in mesh beacon and station's association request frames of
interfaces operating in lower bands, without verifying whether the
interface is actually operating in a 6 GHz channel.

Fix this by verifying if the interface operates on 6 GHz channel
before adding the element. Note that this check cannot be placed
directly in ieee80211_put_he_6ghz_cap() as the same function is used to
add probe request elements while initiating scan in which case the
interface may not be operating in any band's channel.

Signed-off-by: Ramya Gnanasekar <ramya.gnanasekar@oss.qualcomm.com>
Signed-off-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20250606104436.326654-1-rameshkumar.sundaram@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mesh.c
net/mac80211/mlme.c

index a4a715f6f1c32fd49f47e1b2da0d61b6b5abe294..f37068a533f4e3d7a899fd7cb32b303417b07999 100644 (file)
@@ -624,6 +624,9 @@ int mesh_add_he_6ghz_cap_ie(struct ieee80211_sub_if_data *sdata,
        if (!sband)
                return -EINVAL;
 
+       if (sband->band != NL80211_BAND_6GHZ)
+               return 0;
+
        iftd = ieee80211_get_sband_iftype_data(sband,
                                               NL80211_IFTYPE_MESH_POINT);
        /* The device doesn't support HE in mesh mode or at all */
index 9568cc95a7ff2632bb87342fe19ab9337f2ffaf9..83a9986dd1c4a1976516160bf40e935fa3b8caf6 100644 (file)
@@ -1842,7 +1842,8 @@ ieee80211_add_link_elems(struct ieee80211_sub_if_data *sdata,
                ieee80211_put_he_cap(skb, sdata, sband,
                                     &assoc_data->link[link_id].conn);
                ADD_PRESENT_EXT_ELEM(WLAN_EID_EXT_HE_CAPABILITY);
-               ieee80211_put_he_6ghz_cap(skb, sdata, smps_mode);
+               if (sband->band == NL80211_BAND_6GHZ)
+                       ieee80211_put_he_6ghz_cap(skb, sdata, smps_mode);
        }
 
        /*