aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
authorJavier Cardona <javier@cozybit.com>2012-03-05 17:20:38 -0800
committerJohn W. Linville <linville@tuxdriver.com>2012-03-06 15:16:17 -0500
commit12ce8ba3eb09bb83509a459835917a3100ad8db1 (patch)
treec93d67241456469078092fd6127ec5649ed7c4cd /drivers/net/wireless/mac80211_hwsim.c
parent2f40b9404903dba89d70d706ee71263f9babd109 (diff)
downloadlinux-stericsson-12ce8ba3eb09bb83509a459835917a3100ad8db1.tar.gz
mac80211: Modify tsf via debugfs in mesh interfaces
Signed-off-by: Javier Cardona <javier@cozybit.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 14a3cac19a30..b4f6cb3298a4 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -379,6 +379,22 @@ static __le64 __mac80211_hwsim_get_tsf(struct mac80211_hwsim_data *data)
return cpu_to_le64(now + data->tsf_offset);
}
+static u64 mac80211_hwsim_get_tsf(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+{
+ struct mac80211_hwsim_data *data = hw->priv;
+ return le64_to_cpu(__mac80211_hwsim_get_tsf(data));
+}
+
+static void mac80211_hwsim_set_tsf(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif, u64 tsf)
+{
+ struct mac80211_hwsim_data *data = hw->priv;
+ struct timeval tv = ktime_to_timeval(ktime_get_real());
+ u64 now = tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
+ data->tsf_offset = tsf - now;
+}
+
static void mac80211_hwsim_monitor_rx(struct ieee80211_hw *hw,
struct sk_buff *tx_skb)
{
@@ -1224,6 +1240,8 @@ static struct ieee80211_ops mac80211_hwsim_ops =
.sw_scan_start = mac80211_hwsim_sw_scan,
.sw_scan_complete = mac80211_hwsim_sw_scan_complete,
.flush = mac80211_hwsim_flush,
+ .get_tsf = mac80211_hwsim_get_tsf,
+ .set_tsf = mac80211_hwsim_set_tsf,
};