Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+7 -2
+2
include/net/cfg80211.h
··· 4991 4991 * set this flag to update channels on beacon hints. 4992 4992 * @WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY: support connection to non-primary link 4993 4993 * of an NSTR mobile AP MLD. 4994 + * @WIPHY_FLAG_DISABLE_WEXT: disable wireless extensions for this device 4994 4995 */ 4995 4996 enum wiphy_flags { 4996 4997 WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0), ··· 5003 5002 WIPHY_FLAG_4ADDR_STATION = BIT(6), 5004 5003 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), 5005 5004 WIPHY_FLAG_IBSS_RSN = BIT(8), 5005 + WIPHY_FLAG_DISABLE_WEXT = BIT(9), 5006 5006 WIPHY_FLAG_MESH_AUTH = BIT(10), 5007 5007 WIPHY_FLAG_SUPPORTS_EXT_KCK_32 = BIT(11), 5008 5008 WIPHY_FLAG_SUPPORTS_NSTR_NONPRIMARY = BIT(12),
+5 -2
net/wireless/wext-core.c
··· 4 4 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> 5 5 * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. 6 6 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> 7 + * Copyright (C) 2024 Intel Corporation 7 8 * 8 9 * (As all part of the Linux kernel, this file is GPL) 9 10 */ ··· 663 662 dev->ieee80211_ptr->wiphy->wext && 664 663 dev->ieee80211_ptr->wiphy->wext->get_wireless_stats) { 665 664 wireless_warn_cfg80211_wext(); 666 - if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO) 665 + if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO | 666 + WIPHY_FLAG_DISABLE_WEXT)) 667 667 return NULL; 668 668 return dev->ieee80211_ptr->wiphy->wext->get_wireless_stats(dev); 669 669 } ··· 706 704 #ifdef CONFIG_CFG80211_WEXT 707 705 if (dev->ieee80211_ptr && dev->ieee80211_ptr->wiphy) { 708 706 wireless_warn_cfg80211_wext(); 709 - if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO) 707 + if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO | 708 + WIPHY_FLAG_DISABLE_WEXT)) 710 709 return NULL; 711 710 handlers = dev->ieee80211_ptr->wiphy->wext; 712 711 }