mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
mac80211: allow to get wireless_dev structure from ieee80211_vif
This will allow mac80211 drivers to call cfg80211 APIs with the right handle. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
45ceeee81e
commit
dc5a1ad7bd
@ -1281,6 +1281,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
|
||||
*/
|
||||
struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
|
||||
|
||||
/**
|
||||
* ieee80211_vif_to_wdev - return a wdev struct from a vif
|
||||
* @vif: the vif to get the wdev for
|
||||
*
|
||||
* This can be used by mac80211 drivers with direct cfg80211 APIs
|
||||
* (like the vendor commands) that needs to get the wdev for a vif.
|
||||
*
|
||||
* Note that this function may return %NULL if the given wdev isn't
|
||||
* associated with a vif that the driver knows about (e.g. monitor
|
||||
* or AP_VLAN interfaces.)
|
||||
*/
|
||||
struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif);
|
||||
|
||||
/**
|
||||
* enum ieee80211_key_flags - key flags
|
||||
*
|
||||
|
@ -745,6 +745,18 @@ struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(wdev_to_ieee80211_vif);
|
||||
|
||||
struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
|
||||
|
||||
if (!ieee80211_sdata_running(sdata) ||
|
||||
!(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
|
||||
return NULL;
|
||||
|
||||
return &sdata->wdev;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev);
|
||||
|
||||
/*
|
||||
* Nothing should have been stuffed into the workqueue during
|
||||
* the suspend->resume cycle. Since we can't check each caller
|
||||
|
Loading…
Reference in New Issue
Block a user