wifi: cfg80211: add a flag to disable wireless extensions
[sfrench/cifs-2.6.git] / net / wireless / wext-core.c
index a161c64d1765e6cb2e2a4ae08e5534b22c8aa457..838ad6541a17d8acaa531aa62a8acceb39c959ad 100644 (file)
@@ -4,6 +4,7 @@
  * Authors :   Jean Tourrilhes - HPL - <jt@hpl.hp.com>
  * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved.
  * Copyright   2009 Johannes Berg <johannes@sipsolutions.net>
+ * Copyright (C) 2024 Intel Corporation
  *
  * (As all part of the Linux kernel, this file is GPL)
  */
@@ -662,7 +663,8 @@ struct iw_statistics *get_wireless_stats(struct net_device *dev)
            dev->ieee80211_ptr->wiphy->wext &&
            dev->ieee80211_ptr->wiphy->wext->get_wireless_stats) {
                wireless_warn_cfg80211_wext();
-               if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO)
+               if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO |
+                                                       WIPHY_FLAG_DISABLE_WEXT))
                        return NULL;
                return dev->ieee80211_ptr->wiphy->wext->get_wireless_stats(dev);
        }
@@ -704,7 +706,8 @@ static iw_handler get_handler(struct net_device *dev, unsigned int cmd)
 #ifdef CONFIG_CFG80211_WEXT
        if (dev->ieee80211_ptr && dev->ieee80211_ptr->wiphy) {
                wireless_warn_cfg80211_wext();
-               if (dev->ieee80211_ptr->wiphy->flags & WIPHY_FLAG_SUPPORTS_MLO)
+               if (dev->ieee80211_ptr->wiphy->flags & (WIPHY_FLAG_SUPPORTS_MLO |
+                                                       WIPHY_FLAG_DISABLE_WEXT))
                        return NULL;
                handlers = dev->ieee80211_ptr->wiphy->wext;
        }