From: Holger Schurig <hs4233@mail.mn-solutions.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: John W Linville <linville@tuxdriver.com>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] cfg80211: allow scanning on specified frequencies when using wext-compatibility
Date: Fri, 11 Sep 2009 09:52:14 +0200 [thread overview]
Message-ID: <200909110952.14644.hs4233@mail.mn-solutions.de> (raw)
In-Reply-To: <1252629664.23427.4.camel@johannes.local>
> This is a bit weird -- this way you don't report errors if the
> user specified frequencies that don't exist.
The old code did this:
Loop over all bands
Loop over all channels
Stick channel to scan request
I simply added this:
Loop over all bands
Loop over all channels
If scan-request hasn't this channel freq: continue
Stick channel to scan request
Now, if I want to report an -EINVAL for every possibly invalid
scan-request channel, I'd have to do this:
If scan-request has freqs:
Loop over all scan-request freqs
Loop over all bands
Loop over all channels
search for freq
if found:
Stick channel to scan request
else:
err = -EINVAL
else:
Loop over all bands
Loop over all channels
Stick channel to scan request
This is considerable code-bloat for such a seldom-used function.
I'd rather do it like this:
Loop over all bands
Loop over all channels
If scan-request hasn't this channel freq: continue
Stick channel to scan request
if no channels:
err = -EINVAL
That's a compromise :-)
--
http://www.holgerschurig.de
next prev parent reply other threads:[~2009-09-11 7:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-09 11:09 [PATCH] cfg80211: allow scanning on specified frequencies when using wext-compatibility Holger Schurig
2009-09-11 0:41 ` Johannes Berg
2009-09-11 7:35 ` Holger Schurig
2009-09-11 7:52 ` Holger Schurig [this message]
2009-09-12 14:56 ` 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=200909110952.14644.hs4233@mail.mn-solutions.de \
--to=hs4233@mail.mn-solutions.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox