18 #define TOFFSET_MINIMUM_ADJUSTMENT 10
24 #define TOFFSET_SET_MARGIN 20
31 #define TOFFSET_MAXIMUM_ADJUSTMENT 30000
54 u64 beacon_int_fraction = sdata->
vif.bss_conf.beacon_int * 1024 / 2500;
60 msync_dbg(sdata,
"TBTT : max clockdrift=%lld; adjusting\n",
65 msync_dbg(sdata,
"TBTT : max clockdrift=%lld; adjusting by %llu\n",
67 (
unsigned long long) beacon_int_fraction);
68 tsfdelta = -beacon_int_fraction;
73 tsf = drv_get_tsf(local, sdata);
75 drv_set_tsf(local, sdata, tsf + tsfdelta);
100 t_r = drv_get_tsf(local, sdata);
113 if (elems->
mesh_config && mesh_peer_tbtt_adjusting(elems)) {
115 msync_dbg(sdata,
"STA %pM : is adjusting TBTT\n", sta->
sta.addr);
149 rate = local->
hw.wiphy->bands[rx_status->
band]->
150 bitrates[rx_status->
rate_idx].bitrate;
159 sta->t_offset = t_t -
t_r;
162 s64 t_clockdrift = sta->t_offset_setpoint
165 "STA %pM : sta->t_offset=%lld, sta->t_offset_setpoint=%lld, t_clockdrift=%lld\n",
167 (
long long) sta->t_offset,
169 sta->t_offset_setpoint,
170 (
long long) t_clockdrift);
175 "STA %pM : t_clockdrift=%lld too large, setpoint reset\n",
177 (
long long) t_clockdrift);
195 "STA %pM : offset was invalid, sta->t_offset=%lld\n",
197 (
long long) sta->t_offset);
212 BUG_ON(!rcu_read_lock_held());
224 "TBTT : kicking off TBTT adjustment with clockdrift_max=%lld\n",
230 "TBTT : max clockdrift=%lld; too small to adjust\n",
251 return ifmsh->
ie + offset + 2;
263 msync_dbg(sdata,
"called mesh_sync_vendor_rx_bcn_presp\n");
264 oui = mesh_get_vendor_oui(sdata);
273 msync_dbg(sdata,
"called mesh_sync_vendor_adjust_tbtt\n");
274 oui = mesh_get_vendor_oui(sdata);
283 .rx_bcn_presp = &mesh_sync_offset_rx_bcn_presp,
284 .adjust_tbtt = &mesh_sync_offset_adjust_tbtt,
290 .rx_bcn_presp = &mesh_sync_vendor_rx_bcn_presp,
291 .adjust_tbtt = &mesh_sync_vendor_adjust_tbtt,
302 if (sync_methods[i].method == method) {
303 ops = &sync_methods[
i].
ops;