All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Andrew Lunn <andrew@lunn.ch>,
	flamingice@sourmilk.net, linux-wireless@vger.kernel.org,
	linville@tuxdriver.com
Subject: Re: [PATCH] try 2: mac80211: Fix swapped parameters to ieee80211_set_channel()
Date: Thu, 13 Dec 2007 13:09:04 +0100	[thread overview]
Message-ID: <20071213120904.GB501@lunn.ch> (raw)
In-Reply-To: <1197504975.6558.199.camel@johannes.berg>

On Thu, Dec 13, 2007 at 01:16:14AM +0100, Johannes Berg wrote:
> > Acked-by: Johannes Berg <johannes@sipsolutions.net>
> 
> Actually, I take that back.
> 
> The code is correct, as per the comment above it. Stupid wext :/
> 
>         /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */
>         if (freq->e == 0) {
>                 if (freq->m < 0) {
>                         if (sdata->type == IEEE80211_IF_TYPE_STA)
>                                 sdata->u.sta.flags |=
>                                         IEEE80211_STA_AUTO_CHANNEL_SEL;
>                         return 0;
>                 } else  
>                         return ieee80211_set_channel(local, freq->m, -1);
> 

Probably a stupid question, but are you sure the comment is correct?

I added a printk for freq->e and freq->m. When i do

iwconfig wlan0 freq 5240

i see that e = 0, m = 5240 and that with my patch in place everything
is happy. Without the patch, it passes 5240 as a channel, not a
frequency and i get an EINVAL. 

So either the comment is wrong, or the comment is correct but
something is filling in freq wrongly. 

Any ideas?

    Thanks
        Andrew


  reply	other threads:[~2007-12-13 12:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-12 15:31 [PATCH] mac80211: Fix swapped parameters to ieee80211_set_channel() Andrew Lunn
2007-12-12 17:43 ` Johannes Berg
2007-12-12 18:02   ` [PATCH] try 2: " Andrew Lunn
2007-12-12 18:09     ` Johannes Berg
2007-12-13  0:16       ` Johannes Berg
2007-12-13 12:09         ` Andrew Lunn [this message]
2007-12-13 12:30           ` Johannes Berg
2007-12-13 12:50             ` Andrew Lunn
2007-12-13 12:53               ` Johannes Berg
2007-12-13 13:07                 ` [PATCH] wirelesstools: More user space validation of channel/frequency Andrew Lunn
2007-12-13 12:37           ` [PATCH] try 2: mac80211: Fix swapped parameters to ieee80211_set_channel() Andrew Lunn

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=20071213120904.GB501@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=flamingice@sourmilk.net \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.