From: Johannes Berg Date: Wed, 20 Feb 2013 21:00:18 +0100 Subject: [ath9k-devel] [PATCHv2 1/3] mac80211: move mesh sync beacon handler into neighbour_update In-Reply-To: (sfid-20130220_192632_697375_96735330) References: <1361203709-16669-1-git-send-email-marco@cozybit.com> <1361371850.8629.24.camel@jlt4.sipsolutions.net> (sfid-20130220_192632_697375_96735330) Message-ID: <1361390418.8579.6.camel@jlt4.sipsolutions.net> 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, 2013-02-20 at 10:26 -0800, Thomas Pedersen wrote: > On Wed, Feb 20, 2013 at 6:50 AM, Johannes Berg > wrote: > > On Mon, 2013-02-18 at 17:08 +0100, Marco Porsch wrote: > > > >> + /* > >> + * If available, calculate the time the beacon timestamp field was > >> + * received from the rx_status->mactime field. Otherwise get the > >> + * current TSF as approximation before entering rcu-read section. > >> + */ > >> + if (ieee80211_have_rx_timestamp(rx_status)) > >> + t_r = ieee80211_calculate_rx_timestamp(local, rx_status, > >> + 24 + 12 + > >> + elems->total_len + > >> + FCS_LEN, > >> + 24); > > > > That doesn't seem right -- it's calculating the timestamp at the end of > > the frame, but you said you wanted the timestamp at the "timestamp > > field" time, which is just 24 bytes into the frame. > > [...] > > >> - if (ieee80211_have_rx_timestamp(rx_status)) > >> - /* time when timestamp field was received */ > >> - t_r = ieee80211_calculate_rx_timestamp(local, rx_status, > >> - 24 + 12 + > >> - elems->total_len + > >> - FCS_LEN, > >> - 24); > > > > I see this was already wrong ... > > No it's OK. The API is actually > ieee80211_calculate_rx_timestamp(local, status, len, offset). Oops, indeed, my mistake. johannes