]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: cfg80211: remove 5/10 MHz channel support
authorJohannes Berg <johannes.berg@intel.com>
Fri, 29 May 2026 06:40:27 +0000 (08:40 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 3 Jun 2026 12:07:05 +0000 (14:07 +0200)
Remove WIPHY_FLAG_SUPPORTS_5_10_MHZ and 5/10 MHz channel
width support. We contemplated this back in early 2023
and didn't do it yet, but nobody stepped up to maintain
it.

It's already _mostly_ dead code since it can really only
be used for AP and maybe IBSS and monitor, but not on a
client since there's no way to scan (and hasn't been in
a very long time, if ever), so the only thing that ever
could really happen with it was run syzbot and trip over
assumptions in the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
Link: https://patch.msgid.link/20260529084502.080c5885f0b7.I77cc94485b523c3c006005b9233db13cd4e077b3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/virtual/mac80211_hwsim_main.c
include/net/cfg80211.h
net/wireless/chan.c
net/wireless/core.c
net/wireless/nl80211.c
net/wireless/util.c

index 6ca31d4ea437bd7058e14d35005a7ddc2cdf7c04..610a3321b4971613fb6c2ab54cce4070f2ac0b72 100644 (file)
@@ -2600,8 +2600,6 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
        /* SW support for IBSS_RSN is provided by mac80211 */
        hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
 
-       hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
-
        /* both antennas can be configured as RX or TX */
        hw->wiphy->available_antennas_tx = 0x3;
        hw->wiphy->available_antennas_rx = 0x3;
index e1a67e8ed09fe747738b80ca15df754e631f1ddd..2f0c4ef86b7e1fb8936dd5caeb3673808503e230 100644 (file)
@@ -957,7 +957,6 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
        hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
        hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS;
        hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
-       hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_5_10_MHZ;
        hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
        hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
 
index 6ea082157307b8b23ca376889d48a7fa3ff71d44..4926122d6648073db8c1615bb2922e4629b521c0 100644 (file)
@@ -5903,7 +5903,6 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
        hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
                            WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
                            WIPHY_FLAG_AP_UAPSD |
-                           WIPHY_FLAG_SUPPORTS_5_10_MHZ |
                            WIPHY_FLAG_HAS_CHANNEL_SWITCH;
        hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
        hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR |
index 69dc9a978861a8ac8a9b472760d69a08707de38c..f91a71c7f4db6d0543257f6c99530c868b9d4578 100644 (file)
@@ -5676,7 +5676,6 @@ struct cfg80211_ops {
  *     responds to probe-requests in hardware.
  * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
  * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
- * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
  * @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in
  *     beaconing mode (AP, IBSS, Mesh, ...).
  * @WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK: The device supports bigger kek and kck keys
@@ -5716,7 +5715,6 @@ enum wiphy_flags {
        WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD        = BIT(19),
        WIPHY_FLAG_OFFCHAN_TX                   = BIT(20),
        WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL        = BIT(21),
-       WIPHY_FLAG_SUPPORTS_5_10_MHZ            = BIT(22),
        WIPHY_FLAG_HAS_CHANNEL_SWITCH           = BIT(23),
        WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER      = BIT(24),
        WIPHY_FLAG_CHANNEL_CHANGE_ON_BEACON     = BIT(25),
index f0811efb5d0fba2a46743a3dbffaa10ebab70df7..7f6af1790736cd803b526fc45615595ecf6bd76a 100644 (file)
@@ -280,12 +280,6 @@ int nl80211_chan_width_to_mhz(enum nl80211_chan_width chan_width)
        case NL80211_CHAN_WIDTH_16:
                mhz = 16;
                break;
-       case NL80211_CHAN_WIDTH_5:
-               mhz = 5;
-               break;
-       case NL80211_CHAN_WIDTH_10:
-               mhz = 10;
-               break;
        case NL80211_CHAN_WIDTH_20:
        case NL80211_CHAN_WIDTH_20_NOHT:
                mhz = 20;
@@ -347,8 +341,6 @@ cfg80211_chandef_valid_control_freq(const struct cfg80211_chan_def *chandef,
                                    u32 control_freq)
 {
        switch (chandef->width) {
-       case NL80211_CHAN_WIDTH_5:
-       case NL80211_CHAN_WIDTH_10:
        case NL80211_CHAN_WIDTH_20:
        case NL80211_CHAN_WIDTH_20_NOHT:
        case NL80211_CHAN_WIDTH_1:
@@ -415,8 +407,6 @@ bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef)
                return false;
 
        switch (chandef->width) {
-       case NL80211_CHAN_WIDTH_5:
-       case NL80211_CHAN_WIDTH_10:
        case NL80211_CHAN_WIDTH_20:
        case NL80211_CHAN_WIDTH_20_NOHT:
                if (ieee80211_chandef_to_khz(chandef) !=
@@ -803,18 +793,16 @@ _cfg80211_chandef_compatible(const struct cfg80211_chan_def *c1,
                return NULL;
 
        /*
-        * can't be compatible if one of them is 5/10 MHz or S1G
+        * can't be compatible if one of them is S1G
         * but they don't have the same width.
         */
-#define NARROW_OR_S1G(width)   ((width) == NL80211_CHAN_WIDTH_5 || \
-                                (width) == NL80211_CHAN_WIDTH_10 || \
-                                (width) == NL80211_CHAN_WIDTH_1 || \
-                                (width) == NL80211_CHAN_WIDTH_2 || \
-                                (width) == NL80211_CHAN_WIDTH_4 || \
-                                (width) == NL80211_CHAN_WIDTH_8 || \
-                                (width) == NL80211_CHAN_WIDTH_16)
-
-       if (NARROW_OR_S1G(c1->width) || NARROW_OR_S1G(c2->width))
+#define IS_S1G(width)  ((width) == NL80211_CHAN_WIDTH_1 || \
+                        (width) == NL80211_CHAN_WIDTH_2 || \
+                        (width) == NL80211_CHAN_WIDTH_4 || \
+                        (width) == NL80211_CHAN_WIDTH_8 || \
+                        (width) == NL80211_CHAN_WIDTH_16)
+
+       if (IS_S1G(c1->width) || IS_S1G(c2->width))
                return NULL;
 
        /*
@@ -1506,13 +1494,6 @@ bool _cfg80211_chandef_usable(struct wiphy *wiphy,
        control_freq = chandef->chan->center_freq;
 
        switch (chandef->width) {
-       case NL80211_CHAN_WIDTH_5:
-               width = 5;
-               break;
-       case NL80211_CHAN_WIDTH_10:
-               prohibited_flags |= IEEE80211_CHAN_NO_10MHZ;
-               width = 10;
-               break;
        case NL80211_CHAN_WIDTH_20:
                if (!ht_cap->ht_supported &&
                    chandef->chan->band != NL80211_BAND_6GHZ)
index 62ab5e4639be1b18a99ff0723336ae1bfbadb5c1..3dcf63b04c41db43a6e626f4ee8f9ceb1fee220e 100644 (file)
@@ -917,9 +917,7 @@ int wiphy_register(struct wiphy *wiphy)
                                  BIT(NL80211_CHAN_WIDTH_80) |
                                  BIT(NL80211_CHAN_WIDTH_80P80) |
                                  BIT(NL80211_CHAN_WIDTH_160) |
-                                 BIT(NL80211_CHAN_WIDTH_320) |
-                                 BIT(NL80211_CHAN_WIDTH_5) |
-                                 BIT(NL80211_CHAN_WIDTH_10))))
+                                 BIT(NL80211_CHAN_WIDTH_320))))
                        return -EINVAL;
        }
 
index cdb5e9b77143d7a0e9a7631632040b6750699137..19244708f5c3219bbef8c367b2d7c03d94db3590 100644 (file)
@@ -3450,11 +3450,6 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
                if (nl80211_send_coalesce(msg, rdev))
                        goto nla_put_failure;
 
-               if ((rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ) &&
-                   (nla_put_flag(msg, NL80211_ATTR_SUPPORT_5_MHZ) ||
-                    nla_put_flag(msg, NL80211_ATTR_SUPPORT_10_MHZ)))
-                       goto nla_put_failure;
-
                if (rdev->wiphy.max_ap_assoc_sta &&
                    nla_put_u32(msg, NL80211_ATTR_MAX_AP_ASSOC_STA,
                                rdev->wiphy.max_ap_assoc_sta))
@@ -4085,10 +4080,9 @@ static int _nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
                return -EINVAL;
        }
 
-       if ((chandef->width == NL80211_CHAN_WIDTH_5 ||
-            chandef->width == NL80211_CHAN_WIDTH_10) &&
-           !(rdev->wiphy.flags & WIPHY_FLAG_SUPPORTS_5_10_MHZ)) {
-               NL_SET_ERR_MSG(extack, "5/10 MHz not supported");
+       if (chandef->width == NL80211_CHAN_WIDTH_5 ||
+           chandef->width == NL80211_CHAN_WIDTH_10) {
+               NL_SET_ERR_MSG(extack, "5/10 MHz not supported any more");
                return -EINVAL;
        }
 
@@ -13410,8 +13404,6 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
                return -EINVAL;
 
        switch (ibss.chandef.width) {
-       case NL80211_CHAN_WIDTH_5:
-       case NL80211_CHAN_WIDTH_10:
        case NL80211_CHAN_WIDTH_20_NOHT:
                break;
        case NL80211_CHAN_WIDTH_20:
index 8dd7545b909774026589db0352cb51ba93aaf7cf..24527bf321b2a1ff28192f1312c726281766f9ef 100644 (file)
@@ -2304,9 +2304,6 @@ bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef,
        case NL80211_CHAN_WIDTH_80P80:
                vht_opclass = 130;
                break;
-       case NL80211_CHAN_WIDTH_10:
-       case NL80211_CHAN_WIDTH_5:
-               return false; /* unsupported for now */
        default:
                vht_opclass = 0;
                break;