2010-11-21 19:06:05

by Klaas De Craemer

[permalink] [raw]
Subject: RTL8187L: Can only "enable" hw radio switch after Windows boot

Hello all,

I'm using an Alfa AWUS036H adapter for a long range outdoor wireless
link (+5km) connected to an Intel Atom board running kernel
2.6.32-5-amd64. Since a few weeks, the system cannot connect to the
remote AP anymore after booting: trying to bring up the interface
wlan0 gives an SCIO error and rfkill reports a hw block is present on
the device... Repeatedly inserting and removing the device does not
change this.

The only way to make the card work is to plug it into a Windows
computer in which it then connects immediately to the AP. Then I can
plug it back into the linux box and the connection works (hw block
gone, yes, magic...). The connection is then stable (it is usually up
for about 8 hours). In the evening the hardware is turned off so in
the morning the same problem arises again.

Below is some dmesg output. If I can add some more specific debug
output, please let me know.

Klaas De Craemer

----------------
dmesg output after initially plugging the device in is:

[ 617.720045] usb 1-8: new high speed USB device using ehci_hcd and address 4
[ 617.852402] usb 1-8: New USB device found, idVendor=0409, idProduct=005a
[ 617.852511] usb 1-8: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 617.853147] usb 1-8: configuration #1 chosen from 1 choice
[ 617.853730] hub 1-8:1.0: USB hub found
[ 617.854023] hub 1-8:1.0: 4 ports detected
[ 618.140174] usb 1-8.1: new high speed USB device using ehci_hcd and address 5
[ 618.254772] usb 1-8.1: New USB device found, idVendor=0bda, idProduct=8187
[ 618.254882] usb 1-8.1: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 618.255016] usb 1-8.1: Product: RTL8187_Wireless
[ 618.255105] usb 1-8.1: Manufacturer: Manufacturer_Realtek_RTL8187_
[ 618.255202] usb 1-8.1: SerialNumber: 00C0CA3F9517
[ 618.257166] usb 1-8.1: configuration #1 chosen from 1 choice
[ 618.505617] phy6: Selected rate control algorithm 'minstrel'
[ 618.508755] phy6: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
+ rtl8225z2, rfkill mask 2
[ 618.525401] rtl8187: Customer ID is 0xFF
[ 618.526749] Registered led device: rtl8187-phy6::tx
[ 618.528126] Registered led device: rtl8187-phy6::rx
[ 618.529030] rtl8187: wireless switch is on
[ 618.529364] usbcore: registered new interface driver rtl8187
[ 623.780644] rtl8187: wireless radio switch turned off

After having it connected in Windows this will be added:

[ 762.904044] usb 1-8: new high speed USB device using ehci_hcd and address 6
[ 763.036384] usb 1-8: New USB device found, idVendor=0409, idProduct=005a
[ 763.036491] usb 1-8: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 763.037793] usb 1-8: configuration #1 chosen from 1 choice
[ 763.038501] hub 1-8:1.0: USB hub found
[ 763.038759] hub 1-8:1.0: 4 ports detected
[ 763.324155] usb 1-8.1: new high speed USB device using ehci_hcd and address 7
[ 763.438628] usb 1-8.1: New USB device found, idVendor=0bda, idProduct=8187
[ 763.438737] usb 1-8.1: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 763.438872] usb 1-8.1: Product: RTL8187_Wireless
[ 763.438961] usb 1-8.1: Manufacturer: Manufacturer_Realtek_RTL8187_
[ 763.439057] usb 1-8.1: SerialNumber: 00C0CA3F9517
[ 763.439707] usb 1-8.1: configuration #1 chosen from 1 choice
[ 763.672336] phy7: Selected rate control algorithm 'minstrel'
[ 763.675556] phy7: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
+ rtl8225z2, rfkill mask 2
[ 763.692505] rtl8187: Customer ID is 0xFF
[ 763.692885] Registered led device: rtl8187-phy7::tx
[ 763.693125] Registered led device: rtl8187-phy7::rx
[ 763.693752] rtl8187: wireless switch is on


2010-11-24 00:34:02

by Larry Finger

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On 11/23/2010 03:06 PM, Klaas De Craemer wrote:
>
> Don't worry, I live in Belgium and temperatures in winter rarely get
> below -10 °C. I might just jam an USB cup heater in the enclosure...
>
> If you think there is anything I can help you with, please let me
> know. For now I'll try some more test variations to see if I can find
> more clues.

I got drivers for XP and Linux from the Alfa site. I selected the high-power
version, which should match your device.

I don't know what version is in the Windows version, but the Linux version has
rtl8187_linux_26.1025.0328.2007, which is pretty old. I have
rtl8187L_linux_26.1038.0626.2009, rtl8187L_linux_26.1039.0104.2010, and
rtl8187L_linux_26.1040.0820.2010 on my disk. At this point, I'm not sure which
version was used to generate the in-kernel Linux driver. Perhaps Herton
remembers, but it had to be something about the 2007 time frame.

I had to build a new Windows XP system in a virtual machine. The one I already
had won't run on the machine I have now and the original is in the shop. Access
to the new host is restricted to mornings.

Larry

2010-11-24 03:04:42

by Dan Williams

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On Tue, 2010-11-23 at 14:22 -0600, Larry Finger wrote:
> On 11/23/2010 01:26 PM, Klaas De Craemer wrote:
> >
> > This morning I put the transceiver inside. I just connected it to the
> > Atom box without antenna and it reported no wireless block:
> >
> > [ 382.312044] usb 1-3: new high speed USB device using ehci_hcd and address 2
> > [ 382.450722] usb 1-3: New USB device found, idVendor=0bda, idProduct=8187
> > [ 382.450835] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> > [ 382.450939] usb 1-3: Product: RTL8187_Wireless
> > [ 382.451027] usb 1-3: Manufacturer: Manufacturer_Realtek_RTL8187_
> > [ 382.451122] usb 1-3: SerialNumber: 00C0CA3F9517
> > [ 382.451822] usb 1-3: configuration #1 chosen from 1 choice
> > [ 382.743060] phy1: Selected rate control algorithm 'minstrel'
> > [ 382.746490] phy1: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
> > + rtl8225z2, rfkill mask 2
> > [ 382.764106] rtl8187: Customer ID is 0xFF
> > [ 382.764344] Registered led device: rtl8187-phy1::tx
> > [ 382.764554] Registered led device: rtl8187-phy1::rx
> > [ 382.765254] rtl8187: wireless switch is on
> > [ 382.765594] usbcore: registered new interface driver rtl8187
> >
> > Then I put it back onto the antenna outside and it connected just fine.
> >
> > I'm really confused now. Does this mean that it might be both a hard-
> > & software problem? I guess I should also check if it works fine
> > "warm" + immediately connecting it to the antenna. If temperature is
> > such a problem I might put a heating resistor inside the transceiver
> > housing...
>
> I think we do have both a hardware problem in that your device is getting a
> false hardware block reading when cold, and that the Linux driver is missing
> some operation that compensates for this hardware error.
>
> > The Windows driver is 6.1316.1209.2009 for Windows 7 64bit. It comes
> > with a GUI from Alfa Networks that says version 700.1604.108.201.
>
> The only Windows 7 system here belongs to my wife, and any requests to use it
> for testing are not well received. In addition, the USB capture code I have only
> works on XP. I will try to get that driver, or as close as I can.

Snoopy Pro perhaps? I do wish there was a free sniffer that worked on
Vista and Win7, would help sniffing 3G dongles. The best one I can find
is USBlyzer (non-free) which is a 30 day free trial but otherwise works
pretty well.

Dan


Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

Em Tue, 23 Nov 2010 18:33:47 -0600
Larry Finger <[email protected]> escreveu:

> On 11/23/2010 03:06 PM, Klaas De Craemer wrote:
> >
> > Don't worry, I live in Belgium and temperatures in winter rarely get
> > below -10 °C. I might just jam an USB cup heater in the enclosure...
> >
> > If you think there is anything I can help you with, please let me
> > know. For now I'll try some more test variations to see if I can
> > find more clues.
>
> I got drivers for XP and Linux from the Alfa site. I selected the
> high-power version, which should match your device.
>
> I don't know what version is in the Windows version, but the Linux
> version has rtl8187_linux_26.1025.0328.2007, which is pretty old. I
> have rtl8187L_linux_26.1038.0626.2009,
> rtl8187L_linux_26.1039.0104.2010, and
> rtl8187L_linux_26.1040.0820.2010 on my disk. At this point, I'm not
> sure which version was used to generate the in-kernel Linux driver.
> Perhaps Herton remembers, but it had to be something about the 2007
> time frame.

For rfkill, if I remember correctly I based on
rtl8187B_linux_26.1036.0708.2008 release (the one which only used
rfkill_mask == 0x2), and verified on one of the more recent rtl8187L
releases to see if was the same.

But the initial driver was based on a release previous to
rtl8187B_linux_26.1033.0611.2008, that was available for a quanta il1
machine on the web (tarball show release date == 2007-09-19)

The old release rtl8187_linux_26.1025.0328.2007 doesn't have code to
check RF switch state, so may be the windows driver doesn't have it
too, and may be that's why it doesn't have the problem.

>
> I had to build a new Windows XP system in a virtual machine. The one
> I already had won't run on the machine I have now and the original is
> in the shop. Access to the new host is restricted to mornings.
>
> Larry

--
[]'s
Herton

2010-11-23 21:06:43

by Klaas De Craemer

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On Tue, Nov 23, 2010 at 21:22, Larry Finger <[email protected]> wrote:
> On 11/23/2010 01:26 PM, Klaas De Craemer wrote:
>>
>> This morning I put the transceiver inside. I just connected it to the
>> Atom box without antenna and it reported no wireless block:
>>
>> [  382.312044] usb 1-3: new high speed USB device using ehci_hcd and address 2
>> [  382.450722] usb 1-3: New USB device found, idVendor=0bda, idProduct=8187
>> [  382.450835] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
>> [  382.450939] usb 1-3: Product: RTL8187_Wireless
>> [  382.451027] usb 1-3: Manufacturer: Manufacturer_Realtek_RTL8187_
>> [  382.451122] usb 1-3: SerialNumber: 00C0CA3F9517
>> [  382.451822] usb 1-3: configuration #1 chosen from 1 choice
>> [  382.743060] phy1: Selected rate control algorithm 'minstrel'
>> [  382.746490] phy1: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
>> + rtl8225z2, rfkill mask 2
>> [  382.764106] rtl8187: Customer ID is 0xFF
>> [  382.764344] Registered led device: rtl8187-phy1::tx
>> [  382.764554] Registered led device: rtl8187-phy1::rx
>> [  382.765254] rtl8187: wireless switch is on
>> [  382.765594] usbcore: registered new interface driver rtl8187
>>
>> Then I put it back onto the antenna outside and it connected just fine.
>>
>> I'm really confused now. Does this mean that it might be both a hard-
>> & software problem? I guess I should also check if it works fine
>> "warm" + immediately connecting it to the antenna. If temperature is
>> such a problem I might put a heating resistor inside the transceiver
>> housing...
>
> I think we do have both a hardware problem in that your device is getting a
> false hardware block reading when cold, and that the Linux driver is missing
> some operation that compensates for this hardware error.
>
>> The Windows driver is 6.1316.1209.2009 for Windows 7 64bit. It comes
>> with a GUI from Alfa Networks that says version 700.1604.108.201.
>
> The only Windows 7 system here belongs to my wife, and any requests to use it
> for testing are not well received. In addition, the USB capture code I have only
> works on XP. I will try to get that driver, or as close as I can.
>
> A heating element of some sort might be the best bet. As winter comes, the
> device might not generate enough heat to keep working. I don't know how cold it
> gets where you are located, but if it is 4-5 now, I would expect at least -20 later.
>
> Larry
>

Don't worry, I live in Belgium and temperatures in winter rarely get
below -10 °C. I might just jam an USB cup heater in the enclosure...

If you think there is anything I can help you with, please let me
know. For now I'll try some more test variations to see if I can find
more clues.

Klaas

2010-11-21 22:06:39

by Larry Finger

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On 11/21/2010 01:05 PM, Klaas De Craemer wrote:
> Hello all,
>
> I'm using an Alfa AWUS036H adapter for a long range outdoor wireless
> link (+5km) connected to an Intel Atom board running kernel
> 2.6.32-5-amd64. Since a few weeks, the system cannot connect to the
> remote AP anymore after booting: trying to bring up the interface
> wlan0 gives an SCIO error and rfkill reports a hw block is present on
> the device... Repeatedly inserting and removing the device does not
> change this.
>
> The only way to make the card work is to plug it into a Windows
> computer in which it then connects immediately to the AP. Then I can
> plug it back into the linux box and the connection works (hw block
> gone, yes, magic...). The connection is then stable (it is usually up
> for about 8 hours). In the evening the hardware is turned off so in
> the morning the same problem arises again.
>
> Below is some dmesg output. If I can add some more specific debug
> output, please let me know.
>
> Klaas De Craemer
>
> ----------------
> dmesg output after initially plugging the device in is:
>
> [ 617.720045] usb 1-8: new high speed USB device using ehci_hcd and address 4
> [ 617.852402] usb 1-8: New USB device found, idVendor=0409, idProduct=005a
> [ 617.852511] usb 1-8: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> [ 617.853147] usb 1-8: configuration #1 chosen from 1 choice
> [ 617.853730] hub 1-8:1.0: USB hub found
> [ 617.854023] hub 1-8:1.0: 4 ports detected
> [ 618.140174] usb 1-8.1: new high speed USB device using ehci_hcd and address 5
> [ 618.254772] usb 1-8.1: New USB device found, idVendor=0bda, idProduct=8187
> [ 618.254882] usb 1-8.1: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 618.255016] usb 1-8.1: Product: RTL8187_Wireless
> [ 618.255105] usb 1-8.1: Manufacturer: Manufacturer_Realtek_RTL8187_
> [ 618.255202] usb 1-8.1: SerialNumber: 00C0CA3F9517
> [ 618.257166] usb 1-8.1: configuration #1 chosen from 1 choice
> [ 618.505617] phy6: Selected rate control algorithm 'minstrel'
> [ 618.508755] phy6: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
> + rtl8225z2, rfkill mask 2
> [ 618.525401] rtl8187: Customer ID is 0xFF
> [ 618.526749] Registered led device: rtl8187-phy6::tx
> [ 618.528126] Registered led device: rtl8187-phy6::rx
> [ 618.529030] rtl8187: wireless switch is on
> [ 618.529364] usbcore: registered new interface driver rtl8187
> [ 623.780644] rtl8187: wireless radio switch turned off

Interesting. I do not have a data sheet for the RTL8187L, but I do for the
RTL8187B, which is very similar. On the chip, there is a GPIO0 line that has the
state of the radio. For an external device like yours, I would not expect a
switch connected to this line, thus it should be wired high.

Note that when the device is not yet brought up at 618 seconds, the radio enable
bit is high, yet at 623 seconds, it is low. One thing that happened is that the
radio was actually turned on, and the device is now drawing a lot more power.
Either that power is low, or the read of GPIO0 is failing and returning 0.

> After having it connected in Windows this will be added:
>
> [ 762.904044] usb 1-8: new high speed USB device using ehci_hcd and address 6
> [ 763.036384] usb 1-8: New USB device found, idVendor=0409, idProduct=005a
> [ 763.036491] usb 1-8: New USB device strings: Mfr=0, Product=0, SerialNumber=0
> [ 763.037793] usb 1-8: configuration #1 chosen from 1 choice
> [ 763.038501] hub 1-8:1.0: USB hub found
> [ 763.038759] hub 1-8:1.0: 4 ports detected
> [ 763.324155] usb 1-8.1: new high speed USB device using ehci_hcd and address 7
> [ 763.438628] usb 1-8.1: New USB device found, idVendor=0bda, idProduct=8187
> [ 763.438737] usb 1-8.1: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 763.438872] usb 1-8.1: Product: RTL8187_Wireless
> [ 763.438961] usb 1-8.1: Manufacturer: Manufacturer_Realtek_RTL8187_
> [ 763.439057] usb 1-8.1: SerialNumber: 00C0CA3F9517
> [ 763.439707] usb 1-8.1: configuration #1 chosen from 1 choice
> [ 763.672336] phy7: Selected rate control algorithm 'minstrel'
> [ 763.675556] phy7: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
> + rtl8225z2, rfkill mask 2
> [ 763.692505] rtl8187: Customer ID is 0xFF
> [ 763.692885] Registered led device: rtl8187-phy7::tx
> [ 763.693125] Registered led device: rtl8187-phy7::rx
> [ 763.693752] rtl8187: wireless switch is on

Any idea what is inside your box besides the RTL8187L chip and the radio
transceiver? Does lsusb show a hub? Run the command with the device unplugged
and again with it plugged in.

What does the acronym SCIO mean? I'm not familiar with that one? Where does the
SCIO read failure message get logged?

Larry

2010-11-22 16:23:47

by Larry Finger

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On 11/22/2010 02:59 AM, Klaas De Craemer wrote:
>
> Sorry, I meant I get a few errors in the form of "SIOCSIFFLAGS:
> Unknown error 132" on the stdout when trying to bring up the blocked
> interface.

Do those errors also occur when it works, or just when it is blocked?

Is it possible to keep the box in a warm place to see if it is temperature
related? The problem of it working with Windows is still puzzling. As your Atom
is 32 bit, there is the possibility of trying ndiswrapper with the Windows XP
driver. Oh it hurts to write that, but that would isolate the problem to rtl8187.

Larry

2010-11-22 17:10:00

by Sven-Haegar Koch

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On Mon, 22 Nov 2010, Larry Finger wrote:

> On 11/22/2010 02:59 AM, Klaas De Craemer wrote:
> >
> > Sorry, I meant I get a few errors in the form of "SIOCSIFFLAGS:
> > Unknown error 132" on the stdout when trying to bring up the blocked
> > interface.
>
> Do those errors also occur when it works, or just when it is blocked?

Just a small side note:
I receive the same error message for "ifconfig wlan0 up" whenever rfkill
is active for a wlan device - using iwl3945 and iwlagn here.

So I would not look too deep into this message in case rfkill is on.

(Not that we could not use a better error message in this case, or
perhaps just also a printk - took me quite a while to figure it out at
first)

c'ya
sven-haegar

--
Three may keep a secret, if two of them are dead.
- Ben F.

2010-11-23 19:27:07

by Klaas De Craemer

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On Mon, Nov 22, 2010 at 20:45, Larry Finger <[email protected]> wrote:
> On 11/22/2010 01:13 PM, Klaas De Craemer wrote:
>> Not sure if you meant this, but the box itself is inside (warm), only
>> the transceiver is outside.
>> Just to be sure, I skipped trying it in Linux first today and
>> immediately plugged it in my Windows laptop: instant connection. Next
>> I plugged it in Linux and it works fine. This way the device had no
>> time to "warm up" because of first being powered in Linux.
>>
>> I cannot easily take it inside without unscrewing the antenna (a dish
>> with biquad feeder). So I'll try it without antenna tomorrow.
>
> If it is not too much trouble, please try it with the transceiver box warm. In
> the meantime, I will do a USB dump of rtl8187 and the Windows driver using an XP
> system that I have as a VM. Please check in the device manager on your Windows
> box and get the driver version.
>
> Thanks,
>
> Larry
>

This morning I put the transceiver inside. I just connected it to the
Atom box without antenna and it reported no wireless block:

[ 382.312044] usb 1-3: new high speed USB device using ehci_hcd and address 2
[ 382.450722] usb 1-3: New USB device found, idVendor=0bda, idProduct=8187
[ 382.450835] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 382.450939] usb 1-3: Product: RTL8187_Wireless
[ 382.451027] usb 1-3: Manufacturer: Manufacturer_Realtek_RTL8187_
[ 382.451122] usb 1-3: SerialNumber: 00C0CA3F9517
[ 382.451822] usb 1-3: configuration #1 chosen from 1 choice
[ 382.743060] phy1: Selected rate control algorithm 'minstrel'
[ 382.746490] phy1: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
+ rtl8225z2, rfkill mask 2
[ 382.764106] rtl8187: Customer ID is 0xFF
[ 382.764344] Registered led device: rtl8187-phy1::tx
[ 382.764554] Registered led device: rtl8187-phy1::rx
[ 382.765254] rtl8187: wireless switch is on
[ 382.765594] usbcore: registered new interface driver rtl8187

Then I put it back onto the antenna outside and it connected just fine.

I'm really confused now. Does this mean that it might be both a hard-
& software problem? I guess I should also check if it works fine
"warm" + immediately connecting it to the antenna. If temperature is
such a problem I might put a heating resistor inside the transceiver
housing...

The Windows driver is 6.1316.1209.2009 for Windows 7 64bit. It comes
with a GUI from Alfa Networks that says version 700.1604.108.201.

Klaas

2010-11-22 16:40:30

by Hin-Tak Leung

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

--- On Mon, 22/11/10, Larry Finger <[email protected]> wrote:

> Date: Monday, 22 November, 2010, 16:23
> On 11/22/2010 02:59 AM, Klaas De
> Craemer wrote:
> >
> > Sorry, I meant I get a few errors in the form of
> "SIOCSIFFLAGS:
> > Unknown error 132" on the stdout when trying to bring
> up the blocked
> > interface.
>
> Do those errors also occur when it works, or just when it
> is blocked?
>
> Is it possible to keep the box in a warm place to see if it
> is temperature
> related? The problem of it working with Windows is still
> puzzling. As your Atom
> is 32 bit, there is the possibility of trying ndiswrapper
> with the Windows XP
> driver. Oh it hurts to write that, but that would isolate
> the problem to rtl8187.

I was going to comment if the problem is warm-reboot/cool-reboot related. I had an impression at some point in the past that the windows driver messes with the internal state of the 8187B device, such that it does not work under linux after a warm-boot from windows (i.e. you need to do "shutdown" in windows and presses the power-switch to go into linux, rather than "reboot", and select "linux" at the boot-loader prompt). Although I don't think this is the current situation - I don't often warm-reboot, and in any case, seldomly use wireless under windows - I think the in-kernel driver these days reset the device's state on start-up better or something, so my impression may not be valid; but if you are using a slightly older in-kernel driver, in combination with rebooting to windows, etc, that might be the case.





2010-11-22 19:46:13

by Larry Finger

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On 11/22/2010 01:13 PM, Klaas De Craemer wrote:
> Not sure if you meant this, but the box itself is inside (warm), only
> the transceiver is outside.
> Just to be sure, I skipped trying it in Linux first today and
> immediately plugged it in my Windows laptop: instant connection. Next
> I plugged it in Linux and it works fine. This way the device had no
> time to "warm up" because of first being powered in Linux.
>
> I cannot easily take it inside without unscrewing the antenna (a dish
> with biquad feeder). So I'll try it without antenna tomorrow.

If it is not too much trouble, please try it with the transceiver box warm. In
the meantime, I will do a USB dump of rtl8187 and the Windows driver using an XP
system that I have as a VM. Please check in the device manager on your Windows
box and get the driver version.

Thanks,

Larry

2010-11-22 09:05:21

by Klaas De Craemer

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On Sun, Nov 21, 2010 at 23:06, Larry Finger <[email protected]> wrote:
> On 11/21/2010 01:05 PM, Klaas De Craemer wrote:
>> Hello all,
>>
>> I'm using an Alfa AWUS036H adapter for a long range outdoor wireless
>> link (+5km) connected to an Intel Atom board running kernel
>> 2.6.32-5-amd64. Since a few weeks, the system cannot connect to the
>> remote AP anymore after booting: trying to bring up the interface
>> wlan0 gives an SCIO error and rfkill reports a hw block is present on
>> the device... Repeatedly inserting and removing the device does not
>> change this.
>>
>> The only way to make the card work is to plug it into a Windows
>> computer in which it then connects immediately to the AP. Then I can
>> plug it back into the linux box and the connection works (hw block
>> gone, yes, magic...). The connection is then stable (it is usually up
>> for about 8 hours). In the evening the hardware is turned off so in
>> the morning the same problem arises again.
>>
>> Below is some dmesg output. If I can add some more specific debug
>> output, please let me know.
>>
>> Klaas De Craemer
>>
>> ----------------
>> dmesg output after initially plugging the device in is:
>>
>> [  617.720045] usb 1-8: new high speed USB device using ehci_hcd and address 4
>> [  617.852402] usb 1-8: New USB device found, idVendor=0409, idProduct=005a
>> [  617.852511] usb 1-8: New USB device strings: Mfr=0, Product=0, SerialNumber=0
>> [  617.853147] usb 1-8: configuration #1 chosen from 1 choice
>> [  617.853730] hub 1-8:1.0: USB hub found
>> [  617.854023] hub 1-8:1.0: 4 ports detected
>> [  618.140174] usb 1-8.1: new high speed USB device using ehci_hcd and address 5
>> [  618.254772] usb 1-8.1: New USB device found, idVendor=0bda, idProduct=8187
>> [  618.254882] usb 1-8.1: New USB device strings: Mfr=1, Product=2,
>> SerialNumber=3
>> [  618.255016] usb 1-8.1: Product: RTL8187_Wireless
>> [  618.255105] usb 1-8.1: Manufacturer: Manufacturer_Realtek_RTL8187_
>> [  618.255202] usb 1-8.1: SerialNumber: 00C0CA3F9517
>> [  618.257166] usb 1-8.1: configuration #1 chosen from 1 choice
>> [  618.505617] phy6: Selected rate control algorithm 'minstrel'
>> [  618.508755] phy6: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
>> + rtl8225z2, rfkill mask 2
>> [  618.525401] rtl8187: Customer ID is 0xFF
>> [  618.526749] Registered led device: rtl8187-phy6::tx
>> [  618.528126] Registered led device: rtl8187-phy6::rx
>> [  618.529030] rtl8187: wireless switch is on
>> [  618.529364] usbcore: registered new interface driver rtl8187
>> [  623.780644] rtl8187: wireless radio switch turned off
>
> Interesting. I do not have a data sheet for the RTL8187L, but I do for the
> RTL8187B, which is very similar. On the chip, there is a GPIO0 line that has the
> state of the radio. For an external device like yours, I would not expect a
> switch connected to this line, thus it should be wired high.
>
> Note that when the device is not yet brought up at 618 seconds, the radio enable
> bit is high, yet at 623 seconds, it is low. One thing that happened is that the
> radio was actually turned on, and the device is now drawing a lot more power.
> Either that power is low, or the read of GPIO0 is failing and returning 0.
>
>> After having it connected in Windows this will be added:
>>
>> [  762.904044] usb 1-8: new high speed USB device using ehci_hcd and address 6
>> [  763.036384] usb 1-8: New USB device found, idVendor=0409, idProduct=005a
>> [  763.036491] usb 1-8: New USB device strings: Mfr=0, Product=0, SerialNumber=0
>> [  763.037793] usb 1-8: configuration #1 chosen from 1 choice
>> [  763.038501] hub 1-8:1.0: USB hub found
>> [  763.038759] hub 1-8:1.0: 4 ports detected
>> [  763.324155] usb 1-8.1: new high speed USB device using ehci_hcd and address 7
>> [  763.438628] usb 1-8.1: New USB device found, idVendor=0bda, idProduct=8187
>> [  763.438737] usb 1-8.1: New USB device strings: Mfr=1, Product=2,
>> SerialNumber=3
>> [  763.438872] usb 1-8.1: Product: RTL8187_Wireless
>> [  763.438961] usb 1-8.1: Manufacturer: Manufacturer_Realtek_RTL8187_
>> [  763.439057] usb 1-8.1: SerialNumber: 00C0CA3F9517
>> [  763.439707] usb 1-8.1: configuration #1 chosen from 1 choice
>> [  763.672336] phy7: Selected rate control algorithm 'minstrel'
>> [  763.675556] phy7: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
>> + rtl8225z2, rfkill mask 2
>> [  763.692505] rtl8187: Customer ID is 0xFF
>> [  763.692885] Registered led device: rtl8187-phy7::tx
>> [  763.693125] Registered led device: rtl8187-phy7::rx
>> [  763.693752] rtl8187: wireless switch is on
>
> Any idea what is inside your box besides the RTL8187L chip and the radio
> transceiver? Does lsusb show a hub? Run the command with the device unplugged
> and again with it plugged in.

The box consists of a Gigabyte GA-D510UD motherboard with an Intel
Atom D510. The antenna and usb-transceiver equipment is a few meters
away and connected using an active USB extender cable. I believe this
is where the "usb hub found" messages come from.
I'll run the lsusb command this evening when I'm back.

Not sure if it's useful, but the AWUS036H transceiver is the 1W
version (I run it at much lower power though). The pcb is shown on the
right in http://4.bp.blogspot.com/_yKAih5N2U8Y/S1MSczALYRI/AAAAAAAAACg/IhiVakqDhWE/s400/pcbalfa.jpg

Also, I believe the problem has come up since the outside temperature
has dropped to about 4-5 °C, so I don't exclude a hardware problem.
Even so, the fact that it then would still work in Windows is strange.

> What does the acronym SCIO mean? I'm not familiar with that one? Where does the
> SCIO read failure message get logged?

Sorry, I meant I get a few errors in the form of "SIOCSIFFLAGS:
Unknown error 132" on the stdout when trying to bring up the blocked
interface.

Klaas

> Larry
>

2010-11-24 20:25:00

by Hin-Tak Leung

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot


--- On Wed, 24/11/10, Dan Williams <[email protected]> wrote:

<snipped>
> > The only Windows 7 system here belongs to my wife, and
> any requests to use it
> > for testing are not well received. In addition, the
> USB capture code I have only
> > works on XP. I will try to get that driver, or as
> close as I can.
>
> Snoopy Pro perhaps?? I do wish there was a free
> sniffer that worked on
> Vista and Win7, would help sniffing 3G dongles.? The
> best one I can find
> is USBlyzer (non-free) which is a 30 day free trial but
> otherwise works
> pretty well.

Yes, somebody ported snoopy Pro to XP, and for a while it says also support Vista but apparently not - my experience is that it locks up Vista. (for an USB scanner rather than Realtek wireless). It was quite useful under win98, but my last win98 box died :-(.




2010-11-23 20:22:59

by Larry Finger

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On 11/23/2010 01:26 PM, Klaas De Craemer wrote:
>
> This morning I put the transceiver inside. I just connected it to the
> Atom box without antenna and it reported no wireless block:
>
> [ 382.312044] usb 1-3: new high speed USB device using ehci_hcd and address 2
> [ 382.450722] usb 1-3: New USB device found, idVendor=0bda, idProduct=8187
> [ 382.450835] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [ 382.450939] usb 1-3: Product: RTL8187_Wireless
> [ 382.451027] usb 1-3: Manufacturer: Manufacturer_Realtek_RTL8187_
> [ 382.451122] usb 1-3: SerialNumber: 00C0CA3F9517
> [ 382.451822] usb 1-3: configuration #1 chosen from 1 choice
> [ 382.743060] phy1: Selected rate control algorithm 'minstrel'
> [ 382.746490] phy1: hwaddr 00:c0:ca:3f:95:17, RTL8187vB (default) V1
> + rtl8225z2, rfkill mask 2
> [ 382.764106] rtl8187: Customer ID is 0xFF
> [ 382.764344] Registered led device: rtl8187-phy1::tx
> [ 382.764554] Registered led device: rtl8187-phy1::rx
> [ 382.765254] rtl8187: wireless switch is on
> [ 382.765594] usbcore: registered new interface driver rtl8187
>
> Then I put it back onto the antenna outside and it connected just fine.
>
> I'm really confused now. Does this mean that it might be both a hard-
> & software problem? I guess I should also check if it works fine
> "warm" + immediately connecting it to the antenna. If temperature is
> such a problem I might put a heating resistor inside the transceiver
> housing...

I think we do have both a hardware problem in that your device is getting a
false hardware block reading when cold, and that the Linux driver is missing
some operation that compensates for this hardware error.

> The Windows driver is 6.1316.1209.2009 for Windows 7 64bit. It comes
> with a GUI from Alfa Networks that says version 700.1604.108.201.

The only Windows 7 system here belongs to my wife, and any requests to use it
for testing are not well received. In addition, the USB capture code I have only
works on XP. I will try to get that driver, or as close as I can.

A heating element of some sort might be the best bet. As winter comes, the
device might not generate enough heat to keep working. I don't know how cold it
gets where you are located, but if it is 4-5 now, I would expect at least -20 later.

Larry


Larry

2010-11-22 19:13:48

by Klaas De Craemer

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On Mon, Nov 22, 2010 at 17:40, Hin-Tak Leung
<[email protected]> wrote:
> --- On Mon, 22/11/10, Larry Finger <[email protected]> wrote:
>
>> Date: Monday, 22 November, 2010, 16:23
>> On 11/22/2010 02:59 AM, Klaas De
>> Craemer wrote:
>> >
>> > Sorry, I meant I get a few errors in the form of
>> "SIOCSIFFLAGS:
>> > Unknown error 132" on the stdout when trying to bring
>> up the blocked
>> > interface.
>>
>> Do those errors also occur when it works, or just when it
>> is blocked?

The errors only occur when blocked. As Sven-Haegar Koch remarked, this
behaviour is similar to the iwlagn driver for example with the switch
turned off.

>>
>> Is it possible to keep the box in a warm place to see if it
>> is temperature
>> related? The problem of it working with Windows is still
>> puzzling. As your Atom

Not sure if you meant this, but the box itself is inside (warm), only
the transceiver is outside.
Just to be sure, I skipped trying it in Linux first today and
immediately plugged it in my Windows laptop: instant connection. Next
I plugged it in Linux and it works fine. This way the device had no
time to "warm up" because of first being powered in Linux.

I cannot easily take it inside without unscrewing the antenna (a dish
with biquad feeder). So I'll try it without antenna tomorrow.

>> is 32 bit, there is the possibility of trying ndiswrapper
>> with the Windows XP
>> driver. Oh it hurts to write that, but that would isolate
>> the problem to rtl8187.

That is going to be a bit difficult as the box is currently headless,
runs from a 4GB SSD and has no CD drive. But I'll see what I can do.
Would the results also be meaningful if I just ran plain/native
Windows XP on it to test the drivers?

>
> I was going to comment if the problem is warm-reboot/cool-reboot related. I had an impression at some point in the past that the windows driver messes with the internal state of the 8187B device, such that it does not work under linux after a warm-boot from windows (i.e. you need to do "shutdown" in windows and presses the power-switch to go into linux, rather than "reboot", and select "linux" at the boot-loader prompt). Although I don't think this is the current situation - I don't often warm-reboot, and in any case, seldomly use wireless under windows - I think the in-kernel driver these days reset the device's state on start-up better or something, so my impression may not be valid; but if you are using a slightly older in-kernel driver, in combination with rebooting to windows, etc, that might be the case.
>

I'm not rebooting the Atom machine to Windows, just unplugging and
plugging the usb cable into a Windows laptop. I guess that counts as a
cold-boot.


Thanks for your input so far!
Klaas

>
>
>
>

2011-01-10 19:10:10

by Hin-Tak Leung

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

--- On Mon, 10/1/11, Klaas De Craemer <[email protected]> wrote:

> Hello all,
>
> I can add to this that the rtl8187 driver seems to perform
> worse then
> its Windows counterpart (for this device anyway). Today,
> the Linux
> driver could not even connect anymore to the AP. Issuing
> "iwconfig
> wlan0 apname" just doesn't do anything. I could connect to
> another,
> more closer AP in Linux however.
> I'm very annoyed to announce that, despite the loss in
> flexibility, we
> will be moving this box to Windows because the wireless
> connection
> then "just works".
> I'll still check the list and I will remain available to
> test anything
> that could help the Linux driver though.

I would suggest you having a go at studying the windows driver under ndiswrapper, and using the kernel debugfs to study how the windows driver communicate with the device via USB and compared that with what the native driver is doing. That was how I got to be associated with the native driver - spotting what it was doing wrong/different from how the vendor linux driver was doing; the same should work with ndiswrapper+windows driver. (it did for a little bit, from personal experience).

There is no magic to it - if you want the driver to work for you, you can spend some time on it. You know the windows driver works "better" (for you), and there is a way to study the windows driver via ndiswrapper and compared that with the native driver, so it is do-able, just time and patience.

AFAIK, none of us have any special secret knowledge about the RTL8187L, much beyond what's publicly avaialable - i.e. the Realtek "official" driver code and a few spec sheets, and studying the windows driver via ndiswrapper; and AFAIK none of us are paid to work on the Realtek driver - Herton probably are paid to work on linux-things (given the e-mail address) but presumably not specifically on any one driver; I just happened to own a laptop with such a device built-in and Larry seems to be more or less of the same situation.

P.S. I am annoyed by the "I am very annoyed..." part of your e-mail message.





2011-01-06 18:07:26

by Klaas De Craemer

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

Would there be any progress on this? I'm still having the same issue
on humid days.

Klaas

On Wed, Nov 24, 2010 at 01:33, Larry Finger <[email protected]> wrote:
> On 11/23/2010 03:06 PM, Klaas De Craemer wrote:
>>
>> Don't worry, I live in Belgium and temperatures in winter rarely get
>> below -10 °C. I might just jam an USB cup heater in the enclosure...
>>
>> If you think there is anything I can help you with, please let me
>> know. For now I'll try some more test variations to see if I can find
>> more clues.
>
> I got drivers for XP and Linux from the Alfa site. I selected the high-power
> version, which should match your device.
>
> I don't know what version is in the Windows version, but the Linux version has
> rtl8187_linux_26.1025.0328.2007, which is pretty old. I have
> rtl8187L_linux_26.1038.0626.2009, rtl8187L_linux_26.1039.0104.2010, and
> rtl8187L_linux_26.1040.0820.2010 on my disk. At this point, I'm not sure which
> version was used to generate the in-kernel Linux driver. Perhaps Herton
> remembers, but it had to be something about the 2007 time frame.
>
> I had to build a new Windows XP system in a virtual machine. The one I already
> had won't run on the machine I have now and the original is in the shop. Access
> to the new host is restricted to mornings.
>
> Larry
>

2011-01-10 18:24:51

by Klaas De Craemer

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

Hello all,

I can add to this that the rtl8187 driver seems to perform worse then
its Windows counterpart (for this device anyway). Today, the Linux
driver could not even connect anymore to the AP. Issuing "iwconfig
wlan0 apname" just doesn't do anything. I could connect to another,
more closer AP in Linux however.
I'm very annoyed to announce that, despite the loss in flexibility, we
will be moving this box to Windows because the wireless connection
then "just works".
I'll still check the list and I will remain available to test anything
that could help the Linux driver though.

Regards,
Klaas

On Thu, Jan 6, 2011 at 19:07, Klaas De Craemer <[email protected]> wrote:
> Would there be any progress on this? I'm still having the same issue
> on humid days.
>
> Klaas
>
> On Wed, Nov 24, 2010 at 01:33, Larry Finger <[email protected]> wrote:
>> On 11/23/2010 03:06 PM, Klaas De Craemer wrote:
>>>
>>> Don't worry, I live in Belgium and temperatures in winter rarely get
>>> below -10 °C. I might just jam an USB cup heater in the enclosure...
>>>
>>> If you think there is anything I can help you with, please let me
>>> know. For now I'll try some more test variations to see if I can find
>>> more clues.
>>
>> I got drivers for XP and Linux from the Alfa site. I selected the high-power
>> version, which should match your device.
>>
>> I don't know what version is in the Windows version, but the Linux version has
>> rtl8187_linux_26.1025.0328.2007, which is pretty old. I have
>> rtl8187L_linux_26.1038.0626.2009, rtl8187L_linux_26.1039.0104.2010, and
>> rtl8187L_linux_26.1040.0820.2010 on my disk. At this point, I'm not sure which
>> version was used to generate the in-kernel Linux driver. Perhaps Herton
>> remembers, but it had to be something about the 2007 time frame.
>>
>> I had to build a new Windows XP system in a virtual machine. The one I already
>> had won't run on the machine I have now and the original is in the shop. Access
>> to the new host is restricted to mornings.
>>
>> Larry
>>
>

2011-01-10 21:53:26

by Klaas De Craemer

[permalink] [raw]
Subject: Re: RTL8187L: Can only "enable" hw radio switch after Windows boot

On Mon, Jan 10, 2011 at 20:10, Hin-Tak Leung
<[email protected]> wrote:
> --- On Mon, 10/1/11, Klaas De Craemer <[email protected]> wrote:
>
>> Hello all,
>>
>> I can add to this that the rtl8187 driver seems to perform
>> worse then
>> its Windows counterpart (for this device anyway). Today,
>> the Linux
>> driver could not even connect anymore to the AP. Issuing
>> "iwconfig
>> wlan0 apname" just doesn't do anything. I could connect to
>> another,
>> more closer AP in Linux however.
>> I'm very annoyed to announce that, despite the loss in
>> flexibility, we
>> will be moving this box to Windows because the wireless
>> connection
>> then "just works".
>> I'll still check the list and I will remain available to
>> test anything
>> that could help the Linux driver though.
>
> I would suggest you having a go at studying the windows driver under ndiswrapper, and using the kernel debugfs to study how the windows driver communicate with the device via USB and compared that with what the native driver is doing. That was how I got to be associated with the native driver - spotting what it was doing wrong/different from how the vendor linux driver was doing; the same should work with ndiswrapper+windows driver. (it did for a little bit, from personal experience).
>
> There is no magic to it - if you want the driver to work for you, you can spend some time on it. You know the windows driver works "better" (for you), and there is a way to study the windows driver via ndiswrapper and compared that with the native driver, so it is do-able, just time and patience.
>
> AFAIK, none of us have any special secret knowledge about the RTL8187L, much beyond what's publicly avaialable - i.e. the Realtek "official" driver code and a few spec sheets, and studying the windows driver via ndiswrapper; and AFAIK none of us are paid to work on the Realtek driver - Herton probably are paid to work on linux-things (given the e-mail address) but presumably not specifically on any one driver; I just happened to own a laptop with such a device built-in and Larry seems to be more or less of the same situation.
>
> P.S. I am annoyed by the "I am very annoyed..." part of your e-mail message.
>

My apologies if it sounded that negative. What I meant was that I
enjoy using Linux and that it now bothers me to have to put windows on
something like this. I'm still glad that people like you, Larry and
Herton are willing to put so much effort in developing drivers.

Klaas

>
>
>