mirror of
https://github.com/torvalds/linux
synced 2026-07-21 17:50:43 +09:00
wifi: cfg80211: remove 5/10 MHz channel support
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 |
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
#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 (NARROW_OR_S1G(c1->width) || NARROW_OR_S1G(c2->width))
|
||||
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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user