Hi Johannes, On Fri, Jan 4, 2013 at 5:05 AM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > On Wed, 2013-01-02 at 14:55 -0800, Thomas Pedersen wrote: > >> @@ -359,6 +359,8 @@ struct mac80211_hwsim_data { >> /* difference between this hw's clock and the real clock, in usecs */ >> s64 tsf_offset; >> s64 bcn_delta; >> + /* absolute beacon transmission time. Used to cover up "tx" delay. */ >> + u64 abs_bcn_tstamp; > > This can't work if you have multiple interfaces, as far as I can tell. In practice, I think it'll be fine. abs_bcn_tstamp is only relevant from the beacon timestamp to the rx mactime code, of which you have a single (non-preemptible) path per hwsim hw. Per-vif beaconing (was) is already not supported. >> + /* >> + * Account for delay from filling in the timestamp to mactime. >> + */ >> + now = mac80211_hwsim_get_tsf_raw(); >> + if (ieee80211_is_beacon(hdr->frame_control) || >> + ieee80211_is_probe_resp(hdr->frame_control)) >> + now -= now - data->abs_bcn_tstamp; > > Uhh. > now -= now - data->abs_bcn_tstamp; > <=> now = now - now + data->abs_bcn_tstamp; > <=> now = dat->abs_bcn_tstamp; Oops. I guess that factors down to what I was really trying to do. No wonder the test passed :P > No? But it seems to me that you're trying to timestamp based on theT > transmitter? This is weird anyway? The global hwsim tsf is just ktime, so all interfaces have the same reference. This might cause the beacon mactime to show as earlier than just-received non-beacons, but it's only on the order of ~10 us, and I'd rather have that uncertainty there than Toffset. Will you take this patch after a little refactoring? Thomas -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html