diff options
-rw-r--r-- | include/net/mac80211.h | 13 | ||||
-rw-r--r-- | net/mac80211/util.c | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 35643c55827a..c1e8261e899e 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -990,6 +990,19 @@ struct ieee80211_hw { | |||
990 | }; | 990 | }; |
991 | 991 | ||
992 | /** | 992 | /** |
993 | * wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy | ||
994 | * | ||
995 | * @wiphy: the &struct wiphy which we want to query | ||
996 | * | ||
997 | * mac80211 drivers can use this to get to their respective | ||
998 | * &struct ieee80211_hw. Drivers wishing to get to their own private | ||
999 | * structure can then access it via hw->priv. Note that mac802111 drivers should | ||
1000 | * not use wiphy_priv() to try to get their private driver structure as this | ||
1001 | * is already used internally by mac80211. | ||
1002 | */ | ||
1003 | struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy); | ||
1004 | |||
1005 | /** | ||
993 | * SET_IEEE80211_DEV - set device for 802.11 hardware | 1006 | * SET_IEEE80211_DEV - set device for 802.11 hardware |
994 | * | 1007 | * |
995 | * @hw: the &struct ieee80211_hw to set the device for | 1008 | * @hw: the &struct ieee80211_hw to set the device for |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index ede96c4fea2e..fc30f2940e1e 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -41,6 +41,15 @@ const unsigned char rfc1042_header[] __aligned(2) = | |||
41 | const unsigned char bridge_tunnel_header[] __aligned(2) = | 41 | const unsigned char bridge_tunnel_header[] __aligned(2) = |
42 | { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; | 42 | { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 }; |
43 | 43 | ||
44 | struct ieee80211_hw *wiphy_to_ieee80211_hw(struct wiphy *wiphy) | ||
45 | { | ||
46 | struct ieee80211_local *local; | ||
47 | BUG_ON(!wiphy); | ||
48 | |||
49 | local = wiphy_priv(wiphy); | ||
50 | return &local->hw; | ||
51 | } | ||
52 | EXPORT_SYMBOL(wiphy_to_ieee80211_hw); | ||
44 | 53 | ||
45 | u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, | 54 | u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, |
46 | enum nl80211_iftype type) | 55 | enum nl80211_iftype type) |