diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-07-08 17:49:57 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-08 16:35:50 -0400 |
commit | bbbb538e337a3eb2166d5a20307b93822bdacc4f (patch) | |
tree | 1a263c7062785b539867751dd018780df2f77a8e /drivers/net/wireless/wl12xx/wl1271_main.c | |
parent | ab2807efcfd2dd646a2ca8d71585e26cda3fc0c1 (diff) |
wl1271: Add TSF handling
Add functionality to pass the current TSF (mac time) to the mac80211. This is
needed for ad-hoc merging.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index 7a14da506d7..5970fde49d4 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c @@ -1966,6 +1966,32 @@ out: return ret; } +static u64 wl1271_op_get_tsf(struct ieee80211_hw *hw) +{ + + struct wl1271 *wl = hw->priv; + u64 mactime = ULLONG_MAX; + int ret; + + wl1271_debug(DEBUG_MAC80211, "mac80211 get tsf"); + + mutex_lock(&wl->mutex); + + ret = wl1271_ps_elp_wakeup(wl, false); + if (ret < 0) + goto out; + + ret = wl1271_acx_tsf_info(wl, &mactime); + if (ret < 0) + goto out_sleep; + +out_sleep: + wl1271_ps_elp_sleep(wl); + +out: + mutex_unlock(&wl->mutex); + return mactime; +} /* can't be const, mac80211 writes to this */ static struct ieee80211_rate wl1271_rates[] = { @@ -2195,6 +2221,7 @@ static const struct ieee80211_ops wl1271_ops = { .bss_info_changed = wl1271_op_bss_info_changed, .set_rts_threshold = wl1271_op_set_rts_threshold, .conf_tx = wl1271_op_conf_tx, + .get_tsf = wl1271_op_get_tsf, CFG80211_TESTMODE_CMD(wl1271_tm_cmd) }; |