linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@googlemail.com>
To: "Luis R. Rodriguez" <mcgrof@gmail.com>
Cc: MingAnn Ng <devil_eddie01@hotmail.com>,
	nbd@openwrt.org,
	wireless testing <linux-wireless@vger.kernel.org>
Subject: Re: problem on ACS
Date: Sat, 30 Jul 2011 13:17:14 +0200	[thread overview]
Message-ID: <201107301317.14486.chunkeey@googlemail.com> (raw)
In-Reply-To: <CAB=NE6Xc_9DcCz2KfFwR8x2wK5uUt61cH-rP5rNA+-B8XK2gYQ@mail.gmail.com>

On Friday 29 July 2011 22:50:54 Luis R. Rodriguez wrote:
> On Fri, Jul 29, 2011 at 12:39 AM, MingAnn Ng <devil_eddie01@hotmail.com> wrote:
> > Survey 2 from wlan0:
> >  noise:    -84 dBm
> >  channel active time:  12 ms
> >  channel busy time:  0 ms
> >  channel receive time:  0 ms
> >  channel transmit time:  0 ms
> >  interference factor:  9223372036854775815.000000
> 
> This is caused by log2(0), this if fixed as follows:

> diff --git a/src/ap/acs.c b/src/ap/acs.c
> index aa5498e..04b1e31 100644
> --- a/src/ap/acs.c
> +++ b/src/ap/acs.c
> @@ -125,7 +125,7 @@ static u64 min(u64 a, u64 b)
>   */
>  static u64 log2_sane(u64 val)
>  {
> -	return log2(min(1073741824, val));
> +	return return (!val) ? 0 : log2(min(1073741824, val));
>  }
> 
> 
> I'll send a new version of the last patch with this fix, thanks for
> reporting this.
Wait a sec... I guess you misunderstood my post about the cut-off.
I meant that you can cut of at the bottom by using log2(max(1, val)).
This ensures that the log2 will always be >= 0 anyway. In fact log2(1) = 0.

Regards,
	Chr

  reply	other threads:[~2011-07-30 11:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <COL114-W9CEFD4E7F3803005186F98A4F0@phx.gbl>
     [not found] ` <COL114-W59BDCD7915EEDAF4BEE71A8A4E0@phx.gbl>
2011-07-25 20:32   ` problem on ACS Luis R. Rodriguez
2011-07-25 23:35     ` Luis R. Rodriguez
2011-07-26  0:13       ` Christian Lamparter
2011-07-26  2:21         ` Luis R. Rodriguez
2011-07-26  2:42           ` Luis R. Rodriguez
     [not found]           ` <COL114-W76260EA23039CA8000DB88A320@phx.gbl>
2011-07-26 18:21             ` Luis R. Rodriguez
2011-07-26 18:31               ` Christian Lamparter
2011-07-26 20:19                 ` Luis R. Rodriguez
     [not found]                   ` <COL114-W2204F3FA55EF4C0D20D0C58A350@phx.gbl>
2011-07-27 20:18                     ` Luis R. Rodriguez
2011-07-27 20:55                       ` Swaminathan Vasanth
2011-07-27 21:00                         ` Luis R. Rodriguez
     [not found]                       ` <COL114-W50D316103F96D9ED1310098A340@phx.gbl>
     [not found]                         ` <COL114-W54CACDD9B23D044E0916368A370@phx.gbl>
2011-07-29 20:50                           ` Luis R. Rodriguez
2011-07-30 11:17                             ` Christian Lamparter [this message]
2011-07-30 11:29                               ` Luis R. Rodriguez
2011-07-30 15:54                                 ` Christian Lamparter
2011-07-30 18:24                                   ` Luis R. Rodriguez
     [not found]                                     ` <COL114-W51F297F32C58B7D93C26828A380@phx.gbl>
2011-08-01 18:00                                       ` Luis R. Rodriguez

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=201107301317.14486.chunkeey@googlemail.com \
    --to=chunkeey@googlemail.com \
    --cc=devil_eddie01@hotmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@gmail.com \
    --cc=nbd@openwrt.org \
    /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;
as well as URLs for NNTP newsgroup(s).