Search Linux Wireless

[PATCH 11/12] mac80211: allow mac80211 drivers to get to driver priv from wiphy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If a driver is given a wiphy and it wants to get to its private
mac80211 driver area it can use mac80211_wiphy_driver_priv(). The
wiphy_priv() is already being used internally by mac80211 and drivers
should not use this. This can be helpful a drivers reg_notifier().

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 include/net/mac80211.h |   11 +++++++++++
 net/mac80211/util.c    |    9 +++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 00f7ec0..b73c379 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -966,6 +966,17 @@ struct ieee80211_hw {
 };
 
 /**
+ * mac80211_wiphy_driver_priv - return a mac80211 driver's priv from a wiphy
+ *
+ * @wiphy: the &struct wiphy which we want to query
+ *
+ * mac80211 drivers can use this instead of wiphy_priv() to get to their
+ * driver's private area. wiphy_priv() is used internally by mac80211 for
+ * its own private area and should not be used by mac80211 drivers.
+ */
+void *mac80211_wiphy_driver_priv(struct wiphy *wiphy);
+
+/**
  * SET_IEEE80211_DEV - set device for 802.11 hardware
  *
  * @hw: the &struct ieee80211_hw to set the device for
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 963e047..81d2cbb 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -41,6 +41,15 @@ const unsigned char rfc1042_header[] __aligned(2) =
 const unsigned char bridge_tunnel_header[] __aligned(2) =
 	{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
 
+void *mac80211_wiphy_driver_priv(struct wiphy *wiphy)
+{
+	struct ieee80211_local *local;
+	BUG_ON(!wiphy);
+
+	local = wiphy_priv(wiphy);
+	return local->hw.priv;
+}
+EXPORT_SYMBOL(mac80211_wiphy_driver_priv);
 
 u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len,
 			enum nl80211_iftype type)
-- 
1.6.1.rc3.51.g5832d

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux