From: Jouni Malinen Date: Wed, 16 Feb 2011 16:54:08 +0200 Subject: [ath9k-devel] radiotap.mactime appears to be wrong In-Reply-To: <201102161001.48326.Timothy.Smith@csr.com> References: <201102161001.48326.Timothy.Smith@csr.com> Message-ID: <1297868048.16073.42.camel@jm-desktop> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On Wed, 2011-02-16 at 02:01 -0800, Timothy Smith wrote: > I'm not sure if this specific to the ath9k drivers, or a general problem > across many, but I have seen it here so I'll report it here first. It's > actually been the case for quite a while and IIRC the ath5k does this too, but > I haven't checked it recently. I'm pretty sure it applies to other drivers, too. At least ath5k is affected since it uses similar mechanism. > radiotap.org defines the mactime field as > > "Value in microseconds of the MAC's 64-bit 802.11 Time Synchronization > Function timer when the first bit of the MPDU arrived at the MAC" I had not noticed this specification for the mactime, but yes, this is indeed different moment compared to the one returned by the ath9k (or ath5k) hardware. > This is consistent with radiotap.mactime being the value of the TSF when the > LAST bit of the MPDU arrived at the MAC, not the first as both radiotap.org > and wireshark's online help say should be the case. Yes, the current mactime is returned based on the value provided by the hardware which, for RX, happens to be at the end of the frame (at least for other frames than A-MPDU; I have not checked how exactly the aggregated frames would be handled). I would prefer to address this in mac80211, though, by allowing the drivers to indicate at which point of the frame the RX timestamp is taken. This would allow the extra calculations to be skipped unless there is need for them (i.e., only do that for IBSS Beacon frames or if there is a monitor interface in use). mac80211 could then adjust the mactime to meet the requirements for various uses (beginning of the timestamp field within Beacon frame for IBSS or beginning of the MPDU for radiotap header) based on the reporting style and transmission rate. - Jouni