diff mbox series

[RFC] wifi: cfg80211: allow two wext calls

Message ID 20230227101326.d991669b20b9.Iaee03cafd239aab1cc635c008c5882ccc6c2aeae@changeid
State New
Headers show
Series [RFC] wifi: cfg80211: allow two wext calls | expand

Commit Message

Johannes Berg Feb. 27, 2023, 9:13 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

The wext call SIOCGIWMODE appears to be frequently used by
the QT libraries to determine whether or not a netdev is
wireless and here multi-link makes no difference. Also,
SIOCGIWNAME is completely static.

Allow these calls without a warning since these won't be
going away if we allow them here now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
Really not sure this is the right thing to do. On the one
hand it's easy, but on the other hand we've been disabling
WEXT completely for drivers Intel ships, and nobody has
complained about that in years.
---
 net/wireless/wext-core.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c
index a125fd1fa134..ae4bcda1a369 100644
--- a/net/wireless/wext-core.c
+++ b/net/wireless/wext-core.c
@@ -703,9 +703,16 @@  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)
-			return NULL;
+		switch (cmd) {
+		case SIOCGIWNAME:
+		case SIOCGIWMODE:
+			break;
+		default:
+			wireless_warn_cfg80211_wext();
+			if (dev->ieee80211_ptr->wiphy->flags &
+					WIPHY_FLAG_SUPPORTS_MLO)
+				return NULL;
+		}
 		handlers = dev->ieee80211_ptr->wiphy->wext;
 	}
 #endif