aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/main.c
diff options
context:
space:
mode:
authorAlina Friedrichsen <x-alina@gmx.net>2009-01-25 09:28:28 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:46 -0500
commit08e87a833f5e77ff33b64c9ac27cb7fb9ecd4a48 (patch)
tree838a60f6de3c6b058ba7ab0caeee5edfda012a6d /drivers/net/wireless/b43/main.c
parent3b5d665b51cda73ef1a774b515afd879a38e3674 (diff)
b43: Accessing the TSF via mac80211
This allows the mac80211 high level code to access the TSF. This is e.g. needed for BSSID merges in the IBSS mode. The second version adds locking and removes the now unnecessary debugfs entries. Thanks to Michael Buesch! :) Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
-rw-r--r--drivers/net/wireless/b43/main.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index cbb3d45f6fc9..e41c10fd31d3 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3245,6 +3245,43 @@ static int b43_op_get_stats(struct ieee80211_hw *hw,
3245 return 0; 3245 return 0;
3246} 3246}
3247 3247
3248static u64 b43_op_get_tsf(struct ieee80211_hw *hw)
3249{
3250 struct b43_wl *wl = hw_to_b43_wl(hw);
3251 struct b43_wldev *dev;
3252 u64 tsf;
3253
3254 mutex_lock(&wl->mutex);
3255 spin_lock_irq(&wl->irq_lock);
3256 dev = wl->current_dev;
3257
3258 if (dev && (b43_status(dev) >= B43_STAT_INITIALIZED))
3259 b43_tsf_read(dev, &tsf);
3260 else
3261 tsf = 0;
3262
3263 spin_unlock_irq(&wl->irq_lock);
3264 mutex_unlock(&wl->mutex);
3265
3266 return tsf;
3267}
3268
3269static void b43_op_set_tsf(struct ieee80211_hw *hw, u64 tsf)
3270{
3271 struct b43_wl *wl = hw_to_b43_wl(hw);
3272 struct b43_wldev *dev;
3273
3274 mutex_lock(&wl->mutex);
3275 spin_lock_irq(&wl->irq_lock);
3276 dev = wl->current_dev;
3277
3278 if (dev && (b43_status(dev) >= B43_STAT_INITIALIZED))
3279 b43_tsf_write(dev, tsf);
3280
3281 spin_unlock_irq(&wl->irq_lock);
3282 mutex_unlock(&wl->mutex);
3283}
3284
3248static void b43_put_phy_into_reset(struct b43_wldev *dev) 3285static void b43_put_phy_into_reset(struct b43_wldev *dev)
3249{ 3286{
3250 struct ssb_device *sdev = dev->dev; 3287 struct ssb_device *sdev = dev->dev;
@@ -4364,6 +4401,8 @@ static const struct ieee80211_ops b43_hw_ops = {
4364 .set_key = b43_op_set_key, 4401 .set_key = b43_op_set_key,
4365 .get_stats = b43_op_get_stats, 4402 .get_stats = b43_op_get_stats,
4366 .get_tx_stats = b43_op_get_tx_stats, 4403 .get_tx_stats = b43_op_get_tx_stats,
4404 .get_tsf = b43_op_get_tsf,
4405 .set_tsf = b43_op_set_tsf,
4367 .start = b43_op_start, 4406 .start = b43_op_start,
4368 .stop = b43_op_stop, 4407 .stop = b43_op_stop,
4369 .set_tim = b43_op_beacon_set_tim, 4408 .set_tim = b43_op_beacon_set_tim,