Linux wireless drivers development
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Tomas Winkler <tomasw@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linville@tuxdriver.com, yi.zhu@intel.com,
	linux-wireless@vger.kernel.org,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: Re: [PATCH 3/4 V2] mac80211: add last beacon time in scan list
Date: Wed, 25 Jun 2008 22:28:53 -0400	[thread overview]
Message-ID: <1214447333.18897.13.camel@dv> (raw)
In-Reply-To: <1ba2fa240806251526k773e8e2bj2c198defd0d8ef@mail.gmail.com>

On Thu, 2008-06-26 at 01:26 +0300, Tomas Winkler wrote:
> On Wed, Jun 25, 2008 at 7:12 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Wed, 2008-06-25 at 11:58 -0400, Pavel Roskin wrote:
> >
> >> > +                   unsigned long mid_range = (-1) / 2 + 1;
> >>
> >> What is that?  I guess that's where Riemann's zeta function has its
> >> non-trivial roots :-)
> 
> >
> > The Pavel hypothesis: "The Riemann hypothesis is correct when calculated
> > in 32-bit integers" is obviously wrong ;)
> >
> Welcome to the Desert of the Real

Welcome to C.  mid_range is 1, as you can easily check.

> >> > +                   time_diff = jiffies - bss->last_update > mid_range ?
> >> > +                           jiffies - bss->last_update :
> >> > +                           bss->last_update - jiffies;
> >>
> >> That's pretty hairy.  Do we really lack a function to calculate time
> >> difference?
> 
> This is simplest as you can get under assumption that times are not
> apart more then 1/2 of UL.
>  It would be overkill to translate it to timeval or anything we have
> diff function for.

Why would jiffies ever lag behind bss->last_update?  When would
(bss->last_update - jiffies) make sense?  If it makes sense, how about
indicating it somehow?  It would be a value that decreases over time.  

> > Actually, come to think of it, isn't just doing the difference as in teh
> > original patch correct in 32-bit unsigned integers? It'll wrap around a
> > bit but that's ok, no?
> 
> It would make a very recent beacon to be like half an hour old on
> wraps, wouldn't it?

No.  Why would it?  Can you give an example?  If you are not increasing
precision, wraparounds should make no difference.

-- 
Regards,
Pavel Roskin

  reply	other threads:[~2008-06-26  2:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-25 12:17 [PATCH 3/4 V2] mac80211: add last beacon time in scan list Tomas Winkler
2008-06-25 15:58 ` Pavel Roskin
2008-06-25 16:07   ` drago01
2008-06-25 16:12   ` Johannes Berg
2008-06-25 22:26     ` Tomas Winkler
2008-06-26  2:28       ` Pavel Roskin [this message]
2008-06-26 13:26         ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1214447333.18897.13.camel@dv \
    --to=proski@gnu.org \
    --cc=emmanuel.grumbach@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=tomasw@gmail.com \
    --cc=yi.zhu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox