diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-01-22 18:05:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 16:01:19 -0500 |
commit | 9a95371aa26e3cb9fb1340362912000088ff3c3e (patch) | |
tree | aaa8470b9304d344a2c15f30776b3dd1c044183a /net | |
parent | f976376de0d6a9697fb635369f12ae00251f4566 (diff) |
mac80211: allow mac80211 drivers to get to struct ieee80211_hw from wiphy
If a driver is given a wiphy and it wants to get to its private
mac80211 driver area it can use wiphy_to_ieee80211_hw() to get first
to its ieee80211_hw and then access the private structure via hw->priv. The
wiphy_priv() is already being used internally by mac80211 and drivers
should not use this. This can be helpful in a drivers reg_notifier().
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/util.c | 9 |
1 files changed, 9 insertions, 0 deletions
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) |