diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-07-08 18:49:57 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-09 00:35:50 +0400 |
commit | bbbb538e337a3eb2166d5a20307b93822bdacc4f (patch) | |
tree | 1a263c7062785b539867751dd018780df2f77a8e /drivers/net/wireless/wl12xx/wl1271_acx.c | |
parent | ab2807efcfd2dd646a2ca8d71585e26cda3fc0c1 (diff) | |
download | linux-bbbb538e337a3eb2166d5a20307b93822bdacc4f.tar.xz |
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_acx.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_acx.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c index e19e2f8f1e52..5cadb9d06c76 100644 --- a/drivers/net/wireless/wl12xx/wl1271_acx.c +++ b/drivers/net/wireless/wl12xx/wl1271_acx.c @@ -1266,3 +1266,29 @@ out: kfree(acx); return ret; } + +int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime) +{ + struct wl1271_acx_fw_tsf_information *tsf_info; + int ret; + + tsf_info = kzalloc(sizeof(*tsf_info), GFP_KERNEL); + if (!tsf_info) { + ret = -ENOMEM; + goto out; + } + + ret = wl1271_cmd_interrogate(wl, ACX_TSF_INFO, + tsf_info, sizeof(*tsf_info)); + if (ret < 0) { + wl1271_warning("acx tsf info interrogate failed"); + goto out; + } + + *mactime = le32_to_cpu(tsf_info->current_tsf_low) | + ((u64) le32_to_cpu(tsf_info->current_tsf_high) << 32); + +out: + kfree(tsf_info); + return ret; +} |