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

wifi: mac80211: fix driver debugfs for vif type change

If a driver implements the change_interface() method, we switch
interface type without taking the interface down, but still will
recreate the debugfs for it since it's a new type. As such, we
should use the ieee80211_debugfs_recreate_netdev() function here
to also recreate the driver's files, if it is indeed from a type
change while up.

Link: https://msgid.link/20240129155402.7311a36ffeeb.I18df02bbeb685d4250911de5ffbaf090f60c3803@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+3 -8
+2 -2
net/mac80211/debugfs_netdev.c
··· 997 997 } 998 998 } 999 999 1000 - void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata, 1001 - bool mld_vif) 1000 + static void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata, 1001 + bool mld_vif) 1002 1002 { 1003 1003 char buf[10+IFNAMSIZ]; 1004 1004
-5
net/mac80211/debugfs_netdev.h
··· 11 11 #include "ieee80211_i.h" 12 12 13 13 #ifdef CONFIG_MAC80211_DEBUGFS 14 - void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata, 15 - bool mld_vif); 16 14 void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata); 17 15 void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata); 18 16 void ieee80211_debugfs_recreate_netdev(struct ieee80211_sub_if_data *sdata, ··· 22 24 void ieee80211_link_debugfs_drv_add(struct ieee80211_link_data *link); 23 25 void ieee80211_link_debugfs_drv_remove(struct ieee80211_link_data *link); 24 26 #else 25 - static inline void ieee80211_debugfs_add_netdev( 26 - struct ieee80211_sub_if_data *sdata, bool mld_vif) 27 - {} 28 27 static inline void ieee80211_debugfs_remove_netdev( 29 28 struct ieee80211_sub_if_data *sdata) 30 29 {}
+1 -1
net/mac80211/iface.c
··· 1783 1783 /* need to do this after the switch so vif.type is correct */ 1784 1784 ieee80211_link_setup(&sdata->deflink); 1785 1785 1786 - ieee80211_debugfs_add_netdev(sdata, false); 1786 + ieee80211_debugfs_recreate_netdev(sdata, false); 1787 1787 } 1788 1788 1789 1789 static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata,