Skip to content

Commit be23b2d

Browse files
committed
wifi: cfg80211: add a flag to disable wireless extensions
Wireless extensions are already disabled if MLO is enabled, given that we cannot support MLO there with all the hard- coded assumptions about BSSID etc. However, the WiFi7 ecosystem is still stabilizing, and some devices may need MLO disabled while that happens. In that case, we might end up with a device that supports wext (but not MLO) in one kernel, and then breaks wext in the future (by enabling MLO), which is not desirable. Add a flag to let such drivers/devices disable wext even if MLO isn't yet enabled. Cc: stable@vger.kernel.org Link: https://msgid.link/20240314110951.b50f1dc4ec21.I656ddd8178eedb49dc5c6c0e70f8ce5807afb54f@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 774f884 commit be23b2d

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

include/net/cfg80211.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4991,6 +4991,7 @@ struct cfg80211_ops {
49914991
* set this flag to update channels on beacon hints.
49924992
* @WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY: support connection to non-primary link
49934993
* of an NSTR mobile AP MLD.
4994+
* @WIPHY_FLAG_DISABLE_WEXT: disable wireless extensions for this device
49944995
*/
49954996
enum wiphy_flags {
49964997
WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0),
@@ -5002,6 +5003,7 @@ enum wiphy_flags {
50025003
WIPHY_FLAG_4ADDR_STATION = BIT(6),
50035004
WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
50045005
WIPHY_FLAG_IBSS_RSN = BIT(8),
5006+
WIPHY_FLAG_DISABLE_WEXT = BIT(9),
50055007
WIPHY_FLAG_MESH_AUTH = BIT(10),
50065008
WIPHY_FLAG_SUPPORTS_EXT_KCK_32 = BIT(11),
50075009
WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY = BIT(12),

net/wireless/wext-core.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
55
* Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
66
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
7+
* Copyright (C) 2024 Intel Corporation
78
*
89
* (As all part of the Linux kernel, this file is GPL)
910
*/
@@ -662,7 +663,8 @@ struct iw_statistics *get_wireless_stats(struct net_device *dev)
662663
dev->ieee80211_ptr->wiphy->wext &&
663664
dev->ieee80211_ptr->wiphy->wext->get_wireless_stats) {
664665
wireless_warn_cfg80211_wext();
665-
if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO)
666+
if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO |
667+
WIPHY_FLAG_DISABLE_WEXT))
666668
return NULL;
667669
return dev->ieee80211_ptr->wiphy->wext->get_wireless_stats(dev);
668670
}
@@ -704,7 +706,8 @@ static iw_handler get_handler(struct net_device *dev, unsigned int cmd)
704706
#ifdef CONFIG_CFG80211_WEXT
705707
if (dev->ieee80211_ptr && dev->ieee80211_ptr->wiphy) {
706708
wireless_warn_cfg80211_wext();
707-
if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO)
709+
if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO |
710+
WIPHY_FLAG_DISABLE_WEXT))
708711
return NULL;
709712
handlers = dev->ieee80211_ptr->wiphy->wext;
710713
}

0 commit comments

Comments
 (0)