aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_main.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-07-08 10:49:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-08 16:35:50 -0400
commitbbbb538e337a3eb2166d5a20307b93822bdacc4f (patch)
tree1a263c7062785b539867751dd018780df2f77a8e /drivers/net/wireless/wl12xx/wl1271_main.c
parentab2807efcfd2dd646a2ca8d71585e26cda3fc0c1 (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.c27
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 7a14da506d78..5970fde49d40 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -1966,6 +1966,32 @@ out:
1966 return ret; 1966 return ret;
1967} 1967}
1968 1968
1969static u64 wl1271_op_get_tsf(struct ieee80211_hw *hw)
1970{
1971
1972 struct wl1271 *wl = hw->priv;
1973 u64 mactime = ULLONG_MAX;
1974 int ret;
1975
1976 wl1271_debug(DEBUG_MAC80211, "mac80211 get tsf");
1977
1978 mutex_lock(&wl->mutex);
1979
1980 ret = wl1271_ps_elp_wakeup(wl, false);
1981 if (ret < 0)
1982 goto out;
1983
1984 ret = wl1271_acx_tsf_info(wl, &mactime);
1985 if (ret < 0)
1986 goto out_sleep;
1987
1988out_sleep:
1989 wl1271_ps_elp_sleep(wl);
1990
1991out:
1992 mutex_unlock(&wl->mutex);
1993 return mactime;
1994}
1969 1995
1970/* can't be const, mac80211 writes to this */ 1996/* can't be const, mac80211 writes to this */
1971static struct ieee80211_rate wl1271_rates[] = { 1997static struct ieee80211_rate wl1271_rates[] = {
@@ -2195,6 +2221,7 @@ static const struct ieee80211_ops wl1271_ops = {
2195 .bss_info_changed = wl1271_op_bss_info_changed, 2221 .bss_info_changed = wl1271_op_bss_info_changed,
2196 .set_rts_threshold = wl1271_op_set_rts_threshold, 2222 .set_rts_threshold = wl1271_op_set_rts_threshold,
2197 .conf_tx = wl1271_op_conf_tx, 2223 .conf_tx = wl1271_op_conf_tx,
2224 .get_tsf = wl1271_op_get_tsf,
2198 CFG80211_TESTMODE_CMD(wl1271_tm_cmd) 2225 CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
2199}; 2226};
2200 2227