mac80211: add offset_tsf driver op and use it for mesh

This allows the mesh sync (and debugfs) code to make incremental
TSF adjustments, avoiding any uncertainty introduced by delay in
programming absolute TSF.

Signed-off-by: Thomas Pedersen <twp@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Pedersen, Thomas 2016-09-28 16:56:28 -07:00 committed by Johannes Berg
parent 3ff23cd565
commit 354d381baf
6 changed files with 68 additions and 6 deletions

View file

@ -70,9 +70,13 @@ void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata)
}
spin_unlock_bh(&ifmsh->sync_offset_lock);
tsf = drv_get_tsf(local, sdata);
if (tsf != -1ULL)
drv_set_tsf(local, sdata, tsf + tsfdelta);
if (local->ops->offset_tsf) {
drv_offset_tsf(local, sdata, tsfdelta);
} else {
tsf = drv_get_tsf(local, sdata);
if (tsf != -1ULL)
drv_set_tsf(local, sdata, tsf + tsfdelta);
}
}
static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,