Hi,

we're trying to measure the synchronization error between 2 stations in adhoc mode.
For this, we log the difference between a received beacon's TSF and the local TSF.
(ath/if_ath.c:ath_recv_mgmt() at the bottom).
What we expected was to see some fluctuation in this difference, since it is in
microseconds and both clocks are not locked. However, the difference between
the local and beacon TSF were constant. In our case it was -228 micro-secs.
So this means that the TSF is not adjusted, since the beacon TSF is lower.

Right now we cannot explain why those clocks do not get out of sync with each other.
We cannot find the code where this is done in MadWifi, except for the flag:
     #define HAL_BEACON_RESET_TSF (from hal/ah.h)
So the only reason for this we could think of is the HAL layer does some TSF corrections.

Can anyone explain if the HAL layer does some corrections on the TSF when
it receives a beacon frame? or how the TSF value is corrected in general.

Regards,
Andre