On Fri, Jun 1, 2012 at 9:41 AM, Helmut Schaa <helmut.schaa@xxxxxxxxxxxxxx> wrote: > On Fri, Jun 1, 2012 at 9:37 AM, Ivo Van Doorn <ivdoorn@xxxxxxxxx> wrote: >> Hi, >> >>> On Wed, May 9, 2012 at 11:08 AM, Johannes Berg >>> <johannes@xxxxxxxxxxxxxxxx> wrote: >>>> From: Johannes Berg <johannes.berg@xxxxxxxxx> >>>> >>>> Some drivers (iwlegacy, iwlwifi and rt2x00) today use the >>>> bss_conf.last_tsf value. By itself though that value is >>>> completely worthless since it may be ancient. What really >>>> is needed is synchronisation between some device time and >>>> the TSF. >>>> >>>> To clarify this, rename bss_conf.last_tsf to sync_tsf and >>>> add sync_device_ts which is obtained from rx_status which >>>> gets a new field device_timestamp for this purpose. This >>>> is intentionally not using the mactime field since that >>>> is used for other things and in IBSS is expected to sync >>>> with the IBSS's TSF which isn't necessarily true for the >>>> device timestamp. >>>> >>>> Also, since we have the information and it's useful even >>>> before the connection has been established, give all the >>>> timing details to the driver before authenticating. >>>> >>>> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx> >>>> --- >>>> I note that rt2x00 is completely broken since it mixes last_tsf (now >>>> sync_tsf) with jiffies ... what?? >>> >>> Thanks for coming up with this Johannes, that looks indeed strange. >>> >>> Ivo, that was introduced with your "rt2x00: Add autowake support for >>> USB hardware" patch as far as I can tell. >>> >>> Since the last_beacon value is updated within rt2x00 already we should >>> be able to just remove the assignment in rt2x00lib_config_erp. Ivo, could >>> you please recheck? >>> >>> This would also remove rt2x00's dependency on the last_tsf >>> field as provided by mac80211. >>> >>> Thanks, >>> Helmut >>> >>> diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c >>> b/drivers/net/wireless/rt2x00/rt2x00config.c >>> index 96db933..b2d2ad3 100644 >>> --- a/drivers/net/wireless/rt2x00/rt2x00config.c >>> +++ b/drivers/net/wireless/rt2x00/rt2x00config.c >>> @@ -102,7 +102,6 @@ void rt2x00lib_config_erp(struct rt2x00_dev *rt2x00dev, >>> >>> /* Update the AID, this is needed for dynamic PS support */ >>> rt2x00dev->aid = bss_conf->assoc ? bss_conf->aid : 0; >>> - rt2x00dev->last_beacon = bss_conf->last_tsf; >> >> Can't access the code right now, is the last_beacon initialized somewhere else? >> because I do assume we need the value somewhere? > > Yup, it's set in two code paths. One is within rt2x00 where last_beacon is > set to jiffies. The other one is here where it is set to last_tsf which is not > derived from jiffies at all :D Hmm ok, well then removing this line should be safe :) -- 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