]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/mac80211/util.c
Merge remote-tracking branch 'wireless-next/master' into mac80211-next
[karo-tx-linux.git] / net / mac80211 / util.c
index 875e172c001c697a72f85941fd0db8ef1b28b86a..adf81f02368195eb62ca1f2ccb2d9ef947f6189d 100644 (file)
@@ -642,6 +642,17 @@ void ieee80211_iterate_active_interfaces_rtnl(
 }
 EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_rtnl);
 
+struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev)
+{
+       struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+       if (!ieee80211_sdata_running(sdata) ||
+           !(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
+               return NULL;
+       return &sdata->vif;
+}
+EXPORT_SYMBOL_GPL(wdev_to_ieee80211_vif);
+
 /*
  * Nothing should have been stuffed into the workqueue during
  * the suspend->resume cycle. If this WARN is seen then there