@@ -1603,6 +1603,8 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
*/
struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif);
+struct net_device *ieee80211_vif_to_netdev(struct ieee80211_vif *vif);
+
/**
* enum ieee80211_key_flags - key flags
*
@@ -827,6 +827,18 @@ struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
}
EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev);
+struct net_device *ieee80211_vif_to_netdev(struct ieee80211_vif *vif)
+{
+ struct ieee80211_sub_if_data *sdata;
+
+ if (!vif)
+ return NULL;
+
+ sdata = vif_to_sdata(vif);
+ return sdata->dev;
+}
+EXPORT_SYMBOL_GPL(ieee80211_vif_to_netdev);
+
/*
* Nothing should have been stuffed into the workqueue during
* the suspend->resume cycle. Since we can't check each caller
Add ieee80211_vif_to_netdev utility routine to get the netdevice pointer related to ieee80211_vif one even if the sdata has not been inserted in the driver or running yet. ieee80211_vif_to_netdev will be used by mt76 to properly configure xdp_rxq_info data structure adding vif to the driver Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> --- include/net/mac80211.h | 2 ++ net/mac80211/util.c | 12 ++++++++++++ 2 files changed, 14 insertions(+)