diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-23 12:52:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:37 -0400 |
commit | 2448798133d747ad339e57099e32a1d1e68aca1c (patch) | |
tree | ee09385f5dca9e243c38f5f888baa02605423bd7 /net/mac80211/ibss.c | |
parent | 2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (diff) |
mac80211: add driver ops wrappers
In order to later add tracing or verifications to the driver
calls mac80211 makes, this patch adds static inline wrappers
for all operations.
All calls are now written as
drv_<op>(local, ...);
instead of
local->ops-><op>(&local->hw, ...);
Where necessary, the wrappers also do existence checking and
return default values as appropriate.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r-- | net/mac80211/ibss.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index c87caad383f0..a8e23232267e 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/unaligned.h> | 22 | #include <asm/unaligned.h> |
23 | 23 | ||
24 | #include "ieee80211_i.h" | 24 | #include "ieee80211_i.h" |
25 | #include "driver-ops.h" | ||
25 | #include "rate.h" | 26 | #include "rate.h" |
26 | 27 | ||
27 | #define IEEE80211_SCAN_INTERVAL (2 * HZ) | 28 | #define IEEE80211_SCAN_INTERVAL (2 * HZ) |
@@ -75,10 +76,9 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
75 | struct ieee80211_supported_band *sband; | 76 | struct ieee80211_supported_band *sband; |
76 | u32 bss_change; | 77 | u32 bss_change; |
77 | 78 | ||
78 | if (local->ops->reset_tsf) { | 79 | |
79 | /* Reset own TSF to allow time synchronization work. */ | 80 | /* Reset own TSF to allow time synchronization work. */ |
80 | local->ops->reset_tsf(local_to_hw(local)); | 81 | drv_reset_tsf(local); |
81 | } | ||
82 | 82 | ||
83 | skb = ifibss->skb; | 83 | skb = ifibss->skb; |
84 | rcu_assign_pointer(ifibss->presp, NULL); | 84 | rcu_assign_pointer(ifibss->presp, NULL); |
@@ -315,12 +315,13 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
315 | bitrates[rx_status->rate_idx].bitrate; | 315 | bitrates[rx_status->rate_idx].bitrate; |
316 | 316 | ||
317 | rx_timestamp = rx_status->mactime + (24 * 8 * 10 / rate); | 317 | rx_timestamp = rx_status->mactime + (24 * 8 * 10 / rate); |
318 | } else if (local && local->ops && local->ops->get_tsf) | 318 | } else { |
319 | /* second best option: get current TSF */ | 319 | /* |
320 | rx_timestamp = local->ops->get_tsf(local_to_hw(local)); | 320 | * second best option: get current TSF |
321 | else | 321 | * (will return -1 if not supported) |
322 | /* can't merge without knowing the TSF */ | 322 | */ |
323 | rx_timestamp = -1LLU; | 323 | rx_timestamp = drv_get_tsf(local); |
324 | } | ||
324 | 325 | ||
325 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 326 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
326 | printk(KERN_DEBUG "RX beacon SA=%pM BSSID=" | 327 | printk(KERN_DEBUG "RX beacon SA=%pM BSSID=" |
@@ -591,10 +592,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata, | |||
591 | len < 24 + 2 || !ifibss->presp) | 592 | len < 24 + 2 || !ifibss->presp) |
592 | return; | 593 | return; |
593 | 594 | ||
594 | if (local->ops->tx_last_beacon) | 595 | tx_last_beacon = drv_tx_last_beacon(local); |
595 | tx_last_beacon = local->ops->tx_last_beacon(local_to_hw(local)); | ||
596 | else | ||
597 | tx_last_beacon = 1; | ||
598 | 596 | ||
599 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 597 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
600 | printk(KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM" | 598 | printk(KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM" |