linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] mac80211: allow to get wireless_dev structure from ieee80211_vif
@ 2015-03-12  6:53 Emmanuel Grumbach
  2015-03-12  6:53 ` [PATCH 2/7] mac80211: refactor drop connection/unlock in CSA processing Emmanuel Grumbach
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Emmanuel Grumbach @ 2015-03-12  6:53 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach

This will allow mac80211 drivers to call cfg80211 APIs with
the right handle.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 include/net/mac80211.h | 13 +++++++++++++
 net/mac80211/util.c    | 12 ++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index a7756e4..157c0f1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1282,6 +1282,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
  *
  * These flags are used for communication about keys between the driver
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 37d85d3..e664b28 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-05-07 12:25 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12  6:53 [PATCH 1/7] mac80211: allow to get wireless_dev structure from ieee80211_vif Emmanuel Grumbach
2015-03-12  6:53 ` [PATCH 2/7] mac80211: refactor drop connection/unlock in CSA processing Emmanuel Grumbach
2015-03-12  6:53 ` [PATCH 3/7] mac80211: ignore CSA to same channel Emmanuel Grumbach
2015-03-12  6:53 ` [PATCH 4/7] nl80211: ignore HT/VHT capabilities without QoS/WMM Emmanuel Grumbach
2015-03-12  6:53 ` [PATCH 5/7] mac80211: Adjust chan_ctx when assigning reserved vif Emmanuel Grumbach
2015-03-16  8:33   ` Johannes Berg
2015-04-21  8:53   ` [PATCH v2 " andrei.otc
2015-04-24 10:41     ` Johannes Berg
2015-04-26  8:13       ` Andrei Otcheretianski
2015-05-06 12:50         ` Johannes Berg
2015-05-06 15:30           ` [PATCH v3 5/7] mac80211: Adjust reserved chan_ctx when assigned to vif andrei.otc
2015-05-07 12:25             ` Johannes Berg
2015-03-12  6:53 ` [PATCH 6/7] mac80211: ask for ECSA IE to be considered for beacon parse CRC Emmanuel Grumbach
2015-03-12  6:53 ` [PATCH 7/7] mac80211: Count correctly interface types Emmanuel Grumbach
2015-04-01  6:06   ` Janusz Dziedzic
2015-04-01  7:12     ` Johannes Berg
2015-04-01  8:36       ` Arend van Spriel
2015-04-01  8:44         ` Johannes Berg
2015-04-01  9:15           ` Arend van Spriel
2015-04-01  9:50             ` Peer, Ilan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).