2012-03-05 18:07:43

by alupu

[permalink] [raw]
Subject: r8712u staging in kernel 3.2.9

Hello Larry,

System: (B)LFS i686-pc-linux-gnu, 3.2.9
Rosewill Wireless Adapter: RNX-N180UBE

I compiled (as part of kernel 3.2.9) the r8712u module.
Comes up OK but cannot take an essid nor a key.


Example:
iwconfig wlan0 essid <ESSID> key restricted <Encryption key>


Fails quietly:
iwconfig wlan0

wlan0 unassociated Nickname:"rtl_wifi"
Mode:Managed Access Point: Not-Associated Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
...

FWIW, it does take a mode ("managed", as shown above - default was Auto)

I'd appreciate your help.


Thanks,
-- Alex


2012-03-12 01:46:29

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

>> On 03/11/12 8.19 PM, Larry Finger wrote:
> On 03/11/2012 05:36 PM, Alex wrote:

[ Previous Larry email:
After you boot it, use the NetworkManager system tray
applet to connect to your system.
Does that work? ]

> Alex (in answer to [Previous Larry email]):
> Yes. How? Very smoothly.

Unfortunately, here we lose the sync (so to speak):

>> I know that the openSUSE Live CD works on my computer with the Rosewill device
>> and WEP encryption. That tells me that the driver is working correctly, and that
>> the user-space stuff is OK. Let's see if we can find what is wrong for you.
>> After the Live CD boots, do you see the NM applet in the lower-right hand corner
of the screen?
>> When you click on it, do you see a list of APs that are in range?
>> If you click on yours, do you get a screen that wants to know the WEP key? You
>> will need to enter the hexadecimal key, not any passphrase. You will also get a
>> popup asking if you want to use kwallet. Say yes and give it a blank password.
>> Did you get a connection? Note, NM uses wpa_supplicant even for WEP. That is normal.

I'm repeating myself:
> Yes. How? Very smoothly.

That means that I _must_ have done and succeeded in all of your above
instructions and descriptions. But that's beside the point.

The real point that somehow I haven't been able to convey since my OP
is that I expect the commands,
iwconfig wlan0 essid ...

and

iwconfig wlan0 key restricted ...
(or these two combined)

to work from the _command line_ (init 3) for an adapter/driver.
(how one actually connects to an AP, is _another_ story completely
and I can handle that by myself).

What you have to do to replicate what I (and all the other
users who prefer to sit at the command line) do is to
use Linux at command line (init 3) and test the two commands.

As an aside, in the meantime I tested Knoppix wireless in graphics mode.
Works smoothly as well (as I feared)!
Fails, as I said, if you try to connect from the command line, like
'knoppix 2' on the boot (BIOS) prompt.

I suppose openSUSE has a similar command to go directly to command line
(to "simulate" the _real_ Linux - not the graphics thrown on top of it).
A "workaround" I suppose is to start up openSUSE "normally" (to graphics
mode) _without_ the Rosewill plugged in (so the driver module doesn't
load automatically). Then go into a terminal, then plug in Rosewill
then test these two commands.

Reasons (pretty obvious):
1. Wired connections _can_ be made from the command line at any time
simply, conveniently and securely.
2. I worked with wireless adapters (Lynksys - Atheros? comes to mind)
which do indeed that (i.e. succeed on the above two commands).
Whether I use the wpa_supplicant (again, from command line) is based on
what the AP expects from me as level of security and that's my business.

Thanks,
-- Alex

2012-03-07 03:22:53

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

Here are the details for my system, which is 64-bit. I'm running kernel 3.3-rc5
with wireless-tools version 30. Apparently my kernel has V22 - that seems
surprising.

If I use 'iwconfig wlanX essid blah-blah' followed by 'iwconfig wlanX key
restricted xxxxxxxxxxxxxx', then it does not work, but it does when I combine
the essid and key on a single line.

What would be the ifconfig command to start the interface with DHCP? In my
distro, we have an ifup command that reads a configuration file. That script is
too complicated to see what it does.

Larry




Attachments:
r8712u_config (3.98 kB)

2012-03-07 05:31:48

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

> On 03/06/12 10:22 PM, Larry Finger wrote:> Here are the details for my system, which is 64-bit.
> I'm running kernel 3.3-rc5 with wireless-tools version 30.

The root of the divergence between our results might be
found in the differences between my version 29 and your "30".

According to Jean Tourrilhes (the founding father of the tools):
"The latest stable version of Wireless Tools is version 29"
He also mentions (and offers) a version "30-pre9(beta)".
See
<http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html>

As an aside, this situation where distributions (as opposed to the
(B)LFS approach) tweak packages so as to offer an overall workable
release is getting worse and worse, especially lately where
software package dependencies are getting way out of hand.
In this particular instance, we'll never know if openSuse "30"
is the same as "30-pre9(beta)" (whatever that would mean) or
a lower "-pre" or even an in-house version 29/30 software
massaged to play nice with other package instances within
a particular distribution release.

That said, this doesn't mean that my problem might not lie elsewhere.
A great help would be if you could install the latest
_stable_ release (29) and quickly test my complaints.
Don't be afraid of the version police. You cannot be arrested
for using the _official_, genuine, latest stable version 29.
You _might_ get in trouble if they catch you using a most
likely counterfeit version 30 :)

> What would be the ifconfig command to start the interface with DHCP?
> In my distro, we have an ifup command that reads a configuration file.
> That script is too complicated to see what it does.

I've used DHCP only for "wire" connections, in a wrapper of my
own which finally ends up doing something like,
dhcpcd eth0 -L
For wireless stuff I use 'pppoe-start/stop/status' with an
appropriate /etc/ppp/xxxxx.conf file.

For a solid, more legible (IMHO) approach (DHCP, etc.),
you can take a look at LFS-Bootscripts:
<http://www.linuxfromscratch.org/lfs/view/development/chapter03/packages.html>
and BLFS-Bootscripts:
<http://www.linuxfromscratch.org/blfs/view/svn/introduction/bootscripts.html>

Thanks,
-- Alex

2012-03-10 02:17:09

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

On 03/09/2012 01:06 PM, [email protected] wrote:
>
> Hi Larry,
>
> I applied the "debug" patch you sent and I followed your test instructions.
> Still, the same problem.
> Moreover I didn't see any debug output; maybe I'm missing something.
> The log of my test is attached.

Most of the messages were set to output only when the setting of the ESSID
failed. Yours did not, and the ESSID was set. I was surprised to see you using
my ESSID of "radius", and my WEP key (at least the obscured version I sent).

I have no idea what is going wrong on your system. All the proper routines are
entered, and the data seem to be set correctly. I'm stumped.

Larry


2012-03-10 18:10:52

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

Hi Larry,

I ran a few more tests around the subject thread.
Brought up my machine on the Knoppix-6.7.1 DVD, (his latest):

uname -a
Linux Microknoppix 3.0.4 #12 SMP PREEMPT Thu Sep 8 05:27:05 CEST 2011
i686 GNU/Linux

iwconfig --version
iwconfig Wireless-Tools version 30
Compatible with Wireless Extension v11 to v22.

Kernel Currently compiled with Wireless Extension v22.

Please note the same weird version, 30.
There must be a thriving black market for wireless-tools in Germany :)

Whatever driver Knoppix uses, it is in the kernel
(i.e., not as a module) and BTW, 'iwconfig wlan0 essid ...'
doesn't work either.

lsusb --version
lsusb (usbutils) 0.87

Two odd things:
1. Bus 002 Device 003:
ID 0bda:8172 Realtek Semiconductor Corp. RTL8191S WLAN Adapter

Please note "RTL8191S" above.

2. ls -og /lib/firmware/rtlwifi
-rw-r--r-- 1 122328 Jan 4 2011 rtl8712u.bin

As opposed to things on my subject machine (3.2.9):
lsusb --version
lsusb (usbutils) 0.73

1. Bus 002 Device 003: ID 0bda:8172 Realtek Semiconductor Corp.
Note: the missing "RTL8191S" could very well be caused by
my using a lower lsusb version.

2. ls -og /lib/firmware/rtlwifi
-rw-r--r-- 1 129304 2012-03-04 15:42 rtl8712u.bin
------

The 'menuconfig' on my version, 3.2.9, has only these choices for
RTL staging devices:
8187SE
8192U
8192E
8712 (8192SU)

No trace of an RTL8191S possibility.

Maybe you can make more heads (or even tails) of it.

Regards,
-- Alex

PS. Just to prevent any uncalled-for suspicions, this Rosewill device
works smoothly and perfectly on Win XP (very same machine, different
partition) and Win 7. Surprise, surprise.

2012-03-11 22:36:21

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

Hi Larry,

A few _quick_ notes ("impressions") so you can get me more/detailed
instructions while I'm getting the hang of openSUSE :)

> Could you please download a Live KDE CD from
> software.opensuse.org/121/en
> It should not matter whether you use the 32- or 64-bit version.
> After you boot it, use the NetworkManager system tray
> applet to connect to your system.
> Does that work?

Yes. How? Very smoothly.

> Next, use 'ps ax' to get the PID for NetworkManager and kill it.
> Then try your iwconfig/ifconfig command sequence.
> Does that work?

No. Same old story.
Actually, I tried the "iwconfig/ifconfig" (from the KDE terminal) first.
It didn't work so then, quite discouraged, I went to the NM above.
As I said, worked AOK, I then killed the guy, so I can try
the "iwconfig/ifconfig" again. No cigar, as I explained above.

Note: in retrospect, I'm wondering if in Knoppix what would've
happened if I had tried his graphics mode (some sort of KDE clone).
An even bigger wonder. I'll be looking into that:
When doing 'ps ...' I noticed there was a wpa_supplicant(?) running.
If that was a requirement for NM, it should've helped when I went "down"
in command (KDE terminal) mode as well. ???
I don't remember if the supplicant process was killed (as a side effect).

Thanks,
-- Alex

2012-03-09 20:06:18

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

> On 03/07/12 11:16 AM, Larry Finger wrote:

> To help debug the problem, the attached patch will log the setting of
> the ESSID in the driver.
> For some reason, there is one garbage printout and the correct
> one for every call, but that should not cause a problem.

Hi Larry,

I applied the "debug" patch you sent and I followed your test instructions.
Still, the same problem.
Moreover I didn't see any debug output; maybe I'm missing something.
The log of my test is attached.

Regards,
-- Alex


Attachments:
temp3.txt (5.15 kB)

2012-03-11 04:23:46

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

Alex,

I was not doing any finger pointing. Your system is everything - hardware,
kernel, and user-space routines. Obviously something is not working.

I have a Rosewill RNX-N180UBE. The chip is a RTL8191RU, but appears to be
programmed the same as the RTL8191SU. Mine works with the standard r8712u driver.

The two possible firmware files have the following md5sum:

200fd952db3cc9259b1fd05e3e51966f /lib/firmware/rtlwifi/rtl8712u.bin_122328
8e6396b5844a3e279ae8679555dec3f0 /lib/firmware/rtlwifi/rtl8712u.bin_129304

Could you please download a Live KDE CD from
http://software.opensuse.org/121/en? It should not matter whether you use the
32- or 64-bit version. After you boot it, use the NetworkManager system tray
applet to connect to your system. Does that work?

Next, use 'ps ax' to get the PID for NetworkManager and kill it. Then try your
iwconfig/ifconfig command sequence. Does that work?

Both sets of connection methods work here. I used the 64-bit system with my
Rosewill device.

Larry

2012-03-07 01:44:19

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9




> On 03/06/12, Larry Finger wrote:



>> On 03/05/2012 08:22 PM, Alex wrote:


>>> On 03/05/2012, Larry Finger wrote:


>>>> On 03/05/2012 11:07 AM, Alex wrote:
>>>> System: (B)LFS i686-pc-linux-gnu, 3.2.9
>>>> Rosewill Wireless Adapter: RNX-N180UBE
>>>> I compiled (as part of kernel 3.2.9) the r8712u module.
>>>> Comes up OK but cannot take an essid nor a key.


>>> There are a couple of bugs in 3.2.6+.
>>> I don't think they have been fixed by 3.2.9.
>>> Check dmesg for a "Badfw size" message.
>>> If you see that, the two attached patches will fix that.


>> Hi Larry,
>> Thank you for the patches.
>> Unfortunately, no cigar: <same problem>


> I tested your iwconfig statement using kernel 3.3-rc5. It worked.
> Then I downloaded a fresh copy of 3.2.9 and built it. It also worked.
> I have no idea what is wrong on your system, but it appears not to be
> the kernel, but something in your user-space tools.
> My tests were done with openSUSE 12.1.
Hi Larry,


I re-installed "wireless-tools.29" (just in case).
Same problems as before (doesn't take essid, nor key), i.e.,
the module doesn't work here.
FWIW, I'll be attaching highlights of the latest tests.


I don't know why on your system (openSUSE) the module/tools work
while on mine (BLFS) they don't.


As opposed to "distributions", a BLFS is a system not installed but
built "by hand", so the owner feels they have more control and know
what's under the hood better.
See: <http://www.linuxfromscratch.org>
My subject system has been working just fine for years now:
ASUS P5E-VM HDMI, Intel E8400, 3.0 GHz, 4 GB, G35/ICH9R, SATA


REFERENCES - so we can compare notes:
[~]$ uname -a
Linux AlexLFS 3.2.9 #1 SMP Mon Mar 5 20:16:46 EST 2012 i686 i686 i386
GNU/Linux


wireless_tools.29.tar.gz
md5sum: e06c222e186f7cc013fd272d023710cb
Unprivileged: make
Privileged: make PREFIX=/usr INSTALL_MAN=/usr/share/man install


[~]$ iwconfig --version
iwconfig Wireless-Tools version 29
Compatible with Wireless Extension v11 to v22.


Kernel Currently compiled with Wireless Extension v22.


wlan0 Recommend Wireless Extension v16 or later,
Currently compiled with Wireless Extension v22.


[~]$ ls -ogtr /usr/sbin
...
-rwxr-xr-x 1 12386 2012-03-06 17:26 iwspy
-rwxr-xr-x 1 13122 2012-03-06 17:26 iwpriv
-rwxr-xr-x 1 29122 2012-03-06 17:26 iwlist
-rwxr-xr-x 1 11863 2012-03-06 17:26 iwgetid
-rwxr-xr-x 1 16105 2012-03-06 17:26 iwevent
-rwxr-xr-x 1 23263 2012-03-06 17:26 iwconfig
-rwxr-xr-x 1 26473 2012-03-06 17:26 ifrename


[~]$ ls -ogtr /usr/lib
...
-rwxr-xr-x 1 27702 2012-03-06 17:26 libiw.so.29
lrwxrwxrwx 1 11 2012-03-06 17:26 libiw.so -> libiw.so.29


[~]$ modinfo r8712u
filename: /lib/modules/3.2.9/kernel/drivers/staging/rtl8712/r8712u.ko
firmware: rtlwifi/rtl8712u.bin
author: Larry Finger
description: rtl871x wireless lan driver
license: GPL
alias: ...
depends: usbcore
staging: Y
intree: Y
vermagic: 3.2.9 SMP mod_unload CORE2
parm: ...


[~]$ ls -l /lib/firmware/rtlwifi
-rw-r--r-- 1 alex users 129304 2012-03-04 15:42 rtl8712u.bin


Thank you for your help. We'll make it work sooner or later.
-- Alex




Attachments:
rtl8712_3.1.txt (4.18 kB)

2012-03-10 04:53:47

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

> On 03/09/12, 09:17 PM, Larry Finger wrote:
> I was surprised to see you using my
> ESSID of "radius", and my WEP key ...

Hi Larry,

You don't need to be. It has always been our intention to
come as close as possible to comparing apples to apples.
You were gracious enough to install wireless tools _v29_
to accommodate me. I tried to reciprocate by using _exactly_ the
values for essis and key you did. Just for argument's sake,
any other values I could've used (practically an infinite array
- the complimentary set) would've raised the suspicion that
that "unfortunate" choice might be responsible for the problem.
And we'd hate that, wouldn't we?

> I have no idea what is going wrong on your system ...

In general, I wouldn't be so hasty in blaming my system.
It's _very_ possible, but not proven yet. There's nothing
to gain in finger pointing. The object of the game is
to see what and where the problem is. We'll both come
out heads up high if we deal with the situation
professionally, as we are.

Speaking of this, I've been wondering if there's a possibility
that the firmware is somewhat bad (corrupted, wrong, etc)
I did "describe" it in my Mar 6 07:15 PM post,
for convenience, I repeat it here:

[~]$ ls -l /lib/firmware/rtlwifi
-rw-r--r-- 1 alex users 129304 2012-03-04 15:42 rtl8712u.bin

I assumed, your original acceptance of this file (size, etc.)
was an implicit assuaging of my above concern, but one never knows,
do one?

There's another possibility that the Rosewill Wireless Adapter,
RNX-N180UBE, uses a non-"standard" chip, design, etc..
Have you tested your driver with this particular device?
What other devices and/or systems have you validated your
driver with?
Etc., etc.
Anyway, the point is to troubleshoot the problem and not to
speculate about it. Any suggestions, help are welcome as always.

Regards,
-- Alex

2012-03-06 20:21:52

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

On 03/05/2012 08:22 PM, [email protected] wrote:
>> On 03/05/12, Larry Finger wrote:
>
>>> On 03/05/2012 11:07 AM, [email protected] wrote:
>>> System: (B)LFS i686-pc-linux-gnu, 3.2.9
>>> Rosewill Wireless Adapter: RNX-N180UBE
>>> I compiled (as part of kernel 3.2.9) the r8712u module.
>>> Comes up OK but cannot take an essid nor a key.
>>> ...
>
>> There are a couple of bugs in 3.2.6+.
>> I don't think they have been fixed by 3.2.9.
>> Check dmesg for a "Badfw size" message.
>> If you see that, the two attached patches will fix that.
>
> Hi Larry,
> Thank you for the patches.
> Unfortunately, no cigar:
>
> <After kernel re-compile>
> usb 8-1: new high-speed USB device number 2 using ehci_hcd
> r8712u: module is from the staging directory, the quality is unknown,
> you have been warned.
> r8712u: DriverVersion: v7_0.20100831
> r8712u: register rtl8712_netdev_ops to netdev_ops
> r8712u: USB_SPEED_HIGH with 4 endpoints
> r8712u: Boot from EFUSE: Autoload OK
> r8712u: CustomerID = 0x0000
> r8712u: MAC Address from efuse = 00:1a:ef:25:2d:f9
> r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
> usbcore: registered new interface driver r8712u
> r8712u: r8711_wx_set_enc: IW_ENCODE_RESTRICTED
> usb 8-1: USB disconnect, device number 2

I tested your iwconfig statement using kernel 3.3-rc5. It worked. Then I
downloaded a fresh copy of 3.2.9 and built it. It also worked. I have no idea
what is wrong on your system, but it appears not to be the kernel, but something
in your user-space tools. My tests were done with openSUSE 12.1.

Larry

2012-03-13 05:13:48

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

> On 03/12/12, 8:54 PM Larry Finger wrote:

> You need to use YOUR essid and WEP key.
> Once you enter the 'iwconfig wlan0 essid xxxxxx', that triggers
> the association step, and it will never be able to see MY AP from your location.
> After association, then entering the WEP key will start the authentication.
> Similarly, I think it will not report back the essid unless
> that AP has been seen in a scan, but that is hard to test.
> Please try again using your values.

I did try that numerous times. To paraphrase you, I'm not stupid!
I replaced _your_ values in my report because you decided to out them
for public consumption anyway and also to be able to compare our
logs line by line more easily.

Please trust me,
IT DOES NOT WORK.
I can plug in my trusted values (validated to work with other computers
and my AP) in any combination,
iwconfig wlan0 essid ...
iwconfig wlan0 key restricted ...
iwconfig wlan0 essid ... key restricted ...

IT JUST DOES NOT WORK.
Try to absorb this info like a man.

Regards,
-- Alex

2012-03-06 02:22:53

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

> On 03/05/12, Larry Finger wrote:

>> On 03/05/2012 11:07 AM, [email protected] wrote:
>> System: (B)LFS i686-pc-linux-gnu, 3.2.9
>> Rosewill Wireless Adapter: RNX-N180UBE
>> I compiled (as part of kernel 3.2.9) the r8712u module.
>> Comes up OK but cannot take an essid nor a key.
>> ...

> There are a couple of bugs in 3.2.6+.
> I don't think they have been fixed by 3.2.9.
> Check dmesg for a "Badfw size" message.
> If you see that, the two attached patches will fix that.

Hi Larry,
Thank you for the patches.
Unfortunately, no cigar:

<After kernel re-compile>
usb 8-1: new high-speed USB device number 2 using ehci_hcd
r8712u: module is from the staging directory, the quality is unknown,
you have been warned.
r8712u: DriverVersion: v7_0.20100831
r8712u: register rtl8712_netdev_ops to netdev_ops
r8712u: USB_SPEED_HIGH with 4 endpoints
r8712u: Boot from EFUSE: Autoload OK
r8712u: CustomerID = 0x0000
r8712u: MAC Address from efuse = 00:1a:ef:25:2d:f9
r8712u: Loading firmware from "rtlwifi/rtl8712u.bin"
usbcore: registered new interface driver r8712u
r8712u: r8711_wx_set_enc: IW_ENCODE_RESTRICTED
usb 8-1: USB disconnect, device number 2


NOTE: I haven't seen any "Badfw size" message.
I applied the patches, hope against hope.
(maybe, as a side effect, it can fix my problem)
------
iwconfig
lo no wireless extensions.

wlan0 unassociated Nickname:"rtl_wifi"
Mode:Auto Access Point: Not-Associated Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0



eth0 no wireless extensions.
------
iwconfig wlan0 essid <ESSIS> key restricted <Encryption Key>

r8712u: r8711_wx_set_enc: IW_ENCODE_RESTRICTED


iwconfig wlan0
wlan0 unassociated Nickname:"rtl_wifi"
Mode:Auto Access Point: Not-Associated Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
NOTE: 'iwconfig wlan0 essid ' and 'iwconfig wlan0 key restricted '
can be tried separately, with or without double quotes
(for the particular ESSID or KEY), with the same failed result.
------
iwconfig wlan0 Mode managed
iwconfig wlan0
wlan0 unassociated Nickname:"rtl_wifi"
Mode:Managed Access Point: Not-Associated Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
------
Any idea what's happening?
Thanks,
-- Alex
---------------------------------------------------
For reference:
[/linux-3.2.9/drivers/staging/rtl8712]$ ls -og os_intfs.c* usb_intf.c*
-rw-rw-r-- 1 15584 2012-03-05 19:25 os_intfs.c
-rw-rw-r-- 1 15781 2012-02-29 19:32 os_intfs.c-orig
-rw-rw-r-- 1 18798 2012-03-05 19:25 usb_intf.c
-rw-rw-r-- 1 18609 2012-02-29 19:32 usb_intf.c-orig
------
[/linux-3.2.9/drivers/staging/rtl8712]$ diff os_intfs.c os_intfs.c.orig
478a479,483
> /* The interface is no longer Up: */
> padapter->bup = false;
> release_firmware(padapter->fw);
> /* never exit with a firmware callback pending */
> wait_for_completion(&padapter->rtl8712_fw_ready);
------
[/linux-3.2.9/drivers/staging/rtl8712]$ diff usb_intf.c usb_intf.c.orig
33d32
< #include

625,628d623
< if (padapter->fw_found)
< release_firmware(padapter->fw);
< /* never exit with a firmware callback pending */
< wait_for_completion(&padapter->rtl8712_fw_ready);

2012-03-12 02:54:58

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

On 03/11/2012 08:46 PM, [email protected] wrote:
> That means that I _must_ have done and succeeded in all of your above
> instructions and descriptions. But that's beside the point.

I did not understand that point. Sorry.

> The real point that somehow I haven't been able to convey since my OP
> is that I expect the commands,
> iwconfig wlan0 essid ...
>
> and
>
> iwconfig wlan0 key restricted ...
> (or these two combined)
>
> to work from the _command line_ (init 3) for an adapter/driver.
> (how one actually connects to an AP, is _another_ story completely
> and I can handle that by myself).

I have understood that. I'm not stupid! The problem is that they work for me,
but not for you. Why?

> What you have to do to replicate what I (and all the other
> users who prefer to sit at the command line) do is to
> use Linux at command line (init 3) and test the two commands.

Why? I did that and it worked.

> As an aside, in the meantime I tested Knoppix wireless in graphics mode.
> Works smoothly as well (as I feared)!
> Fails, as I said, if you try to connect from the command line, like
> 'knoppix 2' on the boot (BIOS) prompt.
>
> I suppose openSUSE has a similar command to go directly to command line
> (to "simulate" the _real_ Linux - not the graphics thrown on top of it).
> A "workaround" I suppose is to start up openSUSE "normally" (to graphics
> mode) _without_ the Rosewill plugged in (so the driver module doesn't
> load automatically). Then go into a terminal, then plug in Rosewill
> then test these two commands.

Watch what you say. I think that openSUSE is a "real" Linux, and I have a number
of systems that connect to networks, including wireless, without even having a
GUI loaded - no X. Yes, they boot in the equivalent of init 3. What openSUSE has
are scripts called ifup and ifdown that read a control file and do the settings.
That control file is owned by root and can only be read by root. It is as secure
as anything else on the box, AND they do the stuff in the right order.

> Reasons (pretty obvious):
> 1. Wired connections _can_ be made from the command line at any time
> simply, conveniently and securely.
> 2. I worked with wireless adapters (Lynksys - Atheros? comes to mind)
> which do indeed that (i.e. succeed on the above two commands).
> Whether I use the wpa_supplicant (again, from command line) is based on
> what the AP expects from me as level of security and that's my business.

Here are the commands that I used and the results from the Live CD:

linux@linux:~> su - # switch to root
linux:~ # ps ax | grep Network
2007 ? Ssl 0:00 /usr/sbin/NetworkManager --no-daemon
3596 ? S 0:00 /sbin/dhclient -d -4 -sf
/usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/dhclient-wlan0.pid
-lf /var/lib/dhcp/dhclient-415c92e4-fabb-45ff-ae4e-350d9e4a607d-wlan0.lease -cf
/var/run/nm-dhclient-wlan0.conf wlan0
3828 pts/1 S+ 0:00 grep --color=auto Network
linux:~ # kill -9 2007 # kill NetworkManager
linux:~ # modprobe -rv r8712u # unload the driver to clear the
connection
rmmod /lib/modules/3.1.0-1.2-desktop/kernel/drivers/staging/rtl8712/r8712u.ko
linux:~ # modprobe -v r8712u # reload driver
insmod /lib/modules/3.1.0-1.2-desktop/kernel/drivers/staging/rtl8712/r8712u.ko
linux:~ # iwconfig wlan0 # connection clear
wlan0 unassociated Nickname:"rtl_wifi"
Mode:Auto Access Point: Not-Associated Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0


linux:~ # ifconfig wlan0 up # get iface UP - did you do this?
linux:~ # iwconfig wlan0 essid radius
linux:~ # iwconfig wlan0
wlan0 IEEE 802.11bg ESSID:"radius" Nickname:"rtl_wifi"
Mode:Managed Frequency:2.412 GHz Access Point: 00:14:BF:85:49:FA
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=0/100 Signal level=96/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

linux:~ # iwconfig wlan0 key restricted 1234f0033edaebf3f7dab4ceca
linux:~ # iwconfig wlan0
wlan0 IEEE 802.11bg ESSID:"radius" Nickname:"rtl_wifi"
Mode:Managed Frequency:2.412 GHz Access Point: 00:14:BF:85:49:FA
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:1234-F003-3EDA-EBF3-F7DA-B4CE-CA Security
mode:restricted
Power Management:off
Link Quality=0/100 Signal level=100/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

linux:~ # dhcpcd wlan0 -L
linux:~ # ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:1A:EF:1A:C2:17
inet addr:192.168.3.109 Bcast:192.168.3.255 Mask:255.255.255.0
inet6 addr: fe80::21a:efff:fe1a:c217/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:768 (768.0 b) TX bytes:6570 (6.4 Kb)

The only thing that may be unusual about r8712u is that the interface MUST be up
before it will accept the essid and key. Is that the step you have been missing?

Larry

2012-03-07 16:15:55

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

On 03/06/2012 11:31 PM, [email protected] wrote:
>> On 03/06/12 10:22 PM, Larry Finger wrote:> Here are the details for my system, which is 64-bit.
>> I'm running kernel 3.3-rc5 with wireless-tools version 30.
>
> The root of the divergence between our results might be
> found in the differences between my version 29 and your "30".
>
> According to Jean Tourrilhes (the founding father of the tools):
> "The latest stable version of Wireless Tools is version 29"
> He also mentions (and offers) a version "30-pre9(beta)".
> See
> <http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html>
>
> As an aside, this situation where distributions (as opposed to the
> (B)LFS approach) tweak packages so as to offer an overall workable
> release is getting worse and worse, especially lately where
> software package dependencies are getting way out of hand.
> In this particular instance, we'll never know if openSuse "30"
> is the same as "30-pre9(beta)" (whatever that would mean) or
> a lower "-pre" or even an in-house version 29/30 software
> massaged to play nice with other package instances within
> a particular distribution release.
>
> That said, this doesn't mean that my problem might not lie elsewhere.
> A great help would be if you could install the latest
> _stable_ release (29) and quickly test my complaints.
> Don't be afraid of the version police. You cannot be arrested
> for using the _official_, genuine, latest stable version 29.
> You _might_ get in trouble if they catch you using a most
> likely counterfeit version 30 :)
>
>> What would be the ifconfig command to start the interface with DHCP?
>> In my distro, we have an ifup command that reads a configuration file.
>> That script is too complicated to see what it does.
>
> I've used DHCP only for "wire" connections, in a wrapper of my
> own which finally ends up doing something like,
> dhcpcd eth0 -L

Well, despite your complaints about my "illicit and counterfeit" version of
wireless extensions, that is not where the problem lies, as shown in the
attached log. In it, I used kernel 3.3-rc6 to configure the r8712u device, get
an IP using the dhcpcd command, and pinged the Internet. I was even able to
split the setting of the essid and the key.

To help debug the problem, the attached patch will log the setting of the ESSID
in the driver. For some reason, there is one garbage printout and the correct
one for every call, but that should not cause a problem.

Larry


Attachments:
wlan4_log (3.15 kB)
r8712u_debug_SIOC (1.32 kB)
Download all attachments

2012-03-11 22:18:21

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

On 03/10/12 11:23 PM, Larry Finger wrote:

> I have a Rosewill RNX-N180UBE. The chip is a RTL8191RU, but appears to be
> programmed the same as the RTL8191SU. Mine works with the standard r8712u driver.

In WinXP, the driver is identified as 'RTL8192su.sys', so
for the heck of it, I enabled two additional modules,
RTL8192U and RTL8192E.
Not surprisingly, Rosewill wants to work with r8712u only.

> The two possible firmware files have the following md5sum:
> 200fd952db3cc9259b1fd05e3e51966f /lib/firmware/rtlwifi/rtl8712u.bin_122328
> 8e6396b5844a3e279ae8679555dec3f0 /lib/firmware/rtlwifi/rtl8712u.bin_129304

Both check out OK.

> Could you please download a Live KDE CD from ...

Working on that.

Thanks,
-- Alex

2012-03-13 00:54:57

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

On 03/12/2012 06:02 PM, [email protected] wrote:

I tried again with the i686 Live CD.

You need to use YOUR essid and WEP key. Once you enter the 'iwconfig wlan0 essid
xxxxxx', that triggers the association step, and it will never be able to see MY
AP from your location. After association, then entering the WEP key will start
the authentication. Similarly, I think it will not report back the essid unless
that AP has been seen in a scan, but that is hard to test. Please try again
using your values.

Larry


2012-03-12 00:19:28

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

On 03/11/2012 05:36 PM, [email protected] wrote:
> Hi Larry,
>
> A few _quick_ notes ("impressions") so you can get me more/detailed
> instructions while I'm getting the hang of openSUSE :)
>
>> Could you please download a Live KDE CD from
>> software.opensuse.org/121/en
>> It should not matter whether you use the 32- or 64-bit version.
>> After you boot it, use the NetworkManager system tray
>> applet to connect to your system.
>> Does that work?
>
> Yes. How? Very smoothly.
>
>> Next, use 'ps ax' to get the PID for NetworkManager and kill it.
>> Then try your iwconfig/ifconfig command sequence.
>> Does that work?
>
> No. Same old story.
> Actually, I tried the "iwconfig/ifconfig" (from the KDE terminal) first.
> It didn't work so then, quite discouraged, I went to the NM above.
> As I said, worked AOK, I then killed the guy, so I can try
> the "iwconfig/ifconfig" again. No cigar, as I explained above.
>
> Note: in retrospect, I'm wondering if in Knoppix what would've
> happened if I had tried his graphics mode (some sort of KDE clone).
> An even bigger wonder. I'll be looking into that:
> When doing 'ps ...' I noticed there was a wpa_supplicant(?) running.
> If that was a requirement for NM, it should've helped when I went "down"
> in command (KDE terminal) mode as well. ???
> I don't remember if the supplicant process was killed (as a side effect).

I know that the openSUSE Live CD works on my computer with the Rosewill device
and WEP encryption. That tells me that the driver is working correctly, and that
the user-space stuff is OK. Let's see if we can find what is wrong for you.

After the Live CD boots, do you see the NM applet in the lower-right hand corner
of the screen?

When you click on it, do you see a list of APs that are in range?

If you click on yours, do you get a screen that wants to know the WEP key? You
will need to enter the hexadecimal key, not any passphrase. You will also get a
popup asking if you want to use kwallet. Say yes and give it a blank password.

Did you get a connection? Note, NM uses wpa_supplicant even for WEP. That is normal.

Larry


2012-03-05 19:10:44

by Larry Finger

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

On 03/05/2012 11:07 AM, [email protected] wrote:
> Hello Larry,
>
> System: (B)LFS i686-pc-linux-gnu, 3.2.9
> Rosewill Wireless Adapter: RNX-N180UBE
>
> I compiled (as part of kernel 3.2.9) the r8712u module.
> Comes up OK but cannot take an essid nor a key.
>
>
> Example:
> iwconfig wlan0 essid<ESSID> key restricted<Encryption key>
>
>
> Fails quietly:
> iwconfig wlan0
>
> wlan0 unassociated Nickname:"rtl_wifi"
> Mode:Managed Access Point: Not-Associated Sensitivity:0/0
> Retry:off RTS thr:off Fragment thr:off
> Encryption key:off
> ...
>
> FWIW, it does take a mode ("managed", as shown above - default was Auto)

There are a couple of bugs in 3.2.6+. I don't think they have been fixed by
3.2.9. Check dmesg for a "Badfw size" message. If you see that, the two attached
patches will fix that.

Larry


Attachments:
r8712u_patch1 (2.18 kB)
r8712u_patch2 (2.17 kB)
Download all attachments

2012-03-12 23:03:03

by alupu

[permalink] [raw]
Subject: Re: r8712u staging in kernel 3.2.9

> On 03/11/12 10:54 PM, Larry Finger wrote:
>> On 03/11/2012 08:46 PM, [email protected] wrote:

Hi Larry,

I tested the Rosewill wireless adapter as per your instructions.
Still FAILURE.
The gory details are in the attached file.

Just so you have a better idea of the "tool" I used:
694157312 openSUSE-12.1-KDE-LiveCD-i686.iso
md5sum: 29fa37038400b9894fc62b6aeaa7932c

When the LiveCD is up I get a screen "openSUSE installer",
The screen contains five choices,
openSUSE Live KDE (the default - the one I've chosen anyway)
Installation
Check Installation Media
Boot form Hard Disk
Memory Test

and three defaults (all taken)
English (US), 1280x1024 and Default Kernel

Once fully up (in "openSUSE Live KDE") I select
Kickoff Application Launcher > Terminal > su

-----------------------------------------------------------------
Loose ends (you can disregard - the important words are above)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> [ I excpect the iwconfig coomands ]
>> to work from the _command line_ (init 3) for an adapter/driver.
>> (how one actually connects to an AP, is _another_ story completely
>> and I can handle that by myself).

> I have understood that. I'm not stupid! The problem is that they work for me,
> but not for you. Why?

>> What you have to do to replicate what I (and all the other
>> users who prefer to sit at the command line) do is to
>> use Linux at command line (init 3) and test the two commands.

> Why? I did that and it worked.

>> As an aside, in the meantime I tested Knoppix wireless in graphics mode.
>> Works smoothly as well (as I feared)!
>> Fails, as I said, if you try to connect from the command line, like
>> 'knoppix 2' on the boot (BIOS) prompt.
>>
>> I suppose openSUSE has a similar command to go directly to command line
>> (to "simulate" the _real_ Linux - not the graphics thrown on top of it).

> Watch what you say. I think that openSUSE is a "real" Linux, and I have a
> number of systems that connect to networks, including wireless, without even
> having a GUI loaded - no X.
>
> Here are the commands that I used and the results from the Live CD:
...

The commands in your log appear to have been run in a Terminal opened from the
graphics mode (i.e. "GUI loaded"). I assume that was so we compare our notes
directly (I only have the Live CD). That's perfectly OK.

> The only thing that may be unusual about r8712u is that the interface MUST
> be up before it will accept the essid and key.
> Is that the step you have been missing?

I never missed this step, now or on the previous tests.

Regards,
-- Alex


Attachments:
temp2.txt (7.21 kB)