From: Ali Bahar <ali@internetdog.org>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: r8712u driver for the rtl8192su chip.
Date: Mon, 27 Jun 2011 15:23:51 +0800 [thread overview]
Message-ID: <20110627072351.GA4251@internetdog.org> (raw)
In-Reply-To: <4E015CE8.3000304@lwfinger.net>
Hi Larry,
On Tue, Jun 21, 2011 at 10:09:28PM -0500, Larry Finger wrote:
> On 06/21/2011 09:56 PM, Ali Bahar wrote:
> >
> >>>>>this is more of a quick FYI, regarding Staging's r8712u driver.
> >>>
> >>>>>root@hashbang Tue Jun 21 18:30:06 ~$ iwconfig wlan2 essid "h55m"
> >>>>>Error for wireless request "Set ESSID" (8B1A) :
> >>>>> SET failed on device wlan2 ; Operation not permitted.
> I am not rewriting this driver in the immediate future, thus you
> need to find out what is wrong.
The cause is that the driver's handler for the Set expects that the
interface is Up. In my case, it was not, and so it returns a -1. This
pops back up the call-chain until it gets misinterpreted as an EPERM.
I'll use this Set as an example, though the same pattern is seen
elsewhere.
Upon entry into r8711_wx_set_scan(), this check is done:
1090 if (padapter->bup == false)
1091 return -1;
The adapter structure has no comments as to what bup is (nor for
bDriverStopped). Current usage suggests that bup indicates that the
interface is Up (and bDriverStopped indicates that the driver has been
cleanly stopped)
The Fix:
~~~~~~~
1. the -1 return-values must be changed, or translated, so as to not
conflict with EPERM/errno.
2. The 802.11 cfg SETs ought not check bup, or the definition of bup
has to be made distinct from the interface's Up status.
I tried to dig into the history of this code, but found none before
2010. The source which came on the product's cdrom (ASUS WL-167G V3)
is very old, and too different. Realtek's website provides recent
code, but is significantly newer than that which you seem to have
based your code on. And, unfortunately, it contains the same usage of
bup!
So, if the above analysis is correct, should the patch be based on the
Staging code?
Additional Info:
~~~~~~~~~~~~~~~
The question did arise as to whether the driver's expectation (of the
interface being Up) is legitimate. But this was dismissed because:
- I did not expect it to be so. There really is no reason why it'd be
obligatory!
- Other drivers handle Sets of their 802.11 configuration while the
interface is Down;
- the frequent case is for such Sets to take place before an IP number
is obtained via DHCP! So the interface will not be Up;
- the 802.11 Standard ought not take a stance with respect to this.
Indeed, to the extent that I dug into this, it does not seem to
have.
regards,
ali
next prev parent reply other threads:[~2011-06-27 7:25 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-03 14:47 [PATCH 00/12] rtlwifi: rtl8192se: Merge new driver Larry Finger
2011-05-03 15:01 ` Borislav Petkov
2011-05-03 20:03 ` Larry Finger
2011-05-04 17:01 ` Borislav Petkov
2011-05-04 17:20 ` Larry Finger
2011-05-04 18:06 ` Borislav Petkov
2011-05-04 19:15 ` Larry Finger
2011-05-03 15:59 ` Walter Goldens
2011-05-03 16:45 ` Larry Finger
2011-05-03 20:19 ` Gábor Stefanik
2011-05-03 20:33 ` Larry Finger
2011-05-03 20:38 ` Gábor Stefanik
2011-05-03 20:56 ` Larry Finger
2011-05-03 21:09 ` Gábor Stefanik
2011-05-03 21:35 ` Larry Finger
2011-06-21 12:49 ` r8712u driver for the rtl8192su chip Ali Bahar
2011-06-21 22:08 ` Larry Finger
2011-06-22 1:00 ` Ali Bahar
2011-06-22 2:03 ` Julian Calaby
2011-06-22 2:12 ` Gábor Stefanik
2011-06-22 2:46 ` Ali Bahar
2011-06-22 2:39 ` Ali Bahar
2011-06-22 2:34 ` Larry Finger
2011-06-22 2:56 ` Ali Bahar
2011-06-22 3:09 ` Larry Finger
2011-06-22 3:17 ` Ali Bahar
2011-06-27 7:23 ` Ali Bahar [this message]
2011-07-02 17:09 ` Larry Finger
2011-07-03 1:06 ` Ali Bahar
2011-07-03 1:24 ` Larry Finger
2011-07-03 1:47 ` Ali Bahar
2011-07-15 17:11 ` [PATCH 0/2] staging: r8712u: Most return-values changed from -1 to Ali Bahar
2011-07-15 17:11 ` [PATCH 1/2] staging: r8712u: Most return-values changed from -1 to proper errno macros Ali Bahar
2011-07-15 21:00 ` Larry Finger
2011-07-16 3:21 ` Ali Bahar
2011-07-16 9:23 ` Kalle Valo
2011-07-16 10:50 ` Ali Bahar
2011-07-16 11:44 ` Kalle Valo
2011-07-16 11:55 ` Ali Bahar
2011-07-15 17:11 ` [PATCH 2/2] staging: r8712u: checkpatch errors: trailing whitespace on 2 lines Ali Bahar
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=20110627072351.GA4251@internetdog.org \
--to=ali@internetdog.org \
--cc=Larry.Finger@lwfinger.net \
--cc=linux-wireless@vger.kernel.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).