Bug 12298 - ath5k: rf_kill problem with Atheros AR2425 and Samsung e152
ath5k: rf_kill problem with Atheros AR2425 and Samsung e152
Status: RESOLVED OBSOLETE
Product: Drivers
Classification: Unclassified
Component: network-wireless
All Linux
: P1 normal
Assigned To: Bob Copeland
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-25 18:16 UTC by Mario Kicherer
Modified: 2012-10-30 15:40 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.28
Tree: Mainline
Regression: No


Attachments
rfkill gpio support (1.69 KB, patch)
2009-01-22 07:45 UTC, Bob Copeland
Details | Diff
Patch for led.c (1.25 KB, patch)
2009-12-29 19:21 UTC, Mario Kicherer
Details | Diff
patch for rfkill.c (668 bytes, patch)
2009-12-29 19:32 UTC, Mario Kicherer
Details | Diff

Description Mario Kicherer 2008-12-25 18:16:36 UTC
Distribution: Gentoo
-------------
Hardware Environment:
---------------------

lspci:
00:00.0 Host bridge [0600]: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub [8086:2a40] (rev 07)
00:01.0 PCI bridge [0604]: Intel Corporation Mobile 4 Series Chipset PCI Express Graphics Port [8086:2a41] (rev 07)
00:1a.0 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 [8/proc/sys/dev/wifi0/softled086:2937] (rev 03)
00:1a.1 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 [8086:2938] (rev 03)
00:1a.2 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 [8086:2939] (rev 03)
00:1a.7 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 [8086:293c] (rev 03)
00:1b.0 Audio device [0403]: Intel Corporation 82801I (ICH9 Family) HD Audio Controller [8086:293e] (rev 03)
00:1c.0 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 [8086:2940] (rev 03)
00:1c.2 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 [8086:2944] (rev 03)
00:1c.3 PCI bridge [0604]: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 [8086:2946] (rev 03)
00:1d.0 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 [8086:2934] (rev 03)
00:1d.1 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 [8086:2935] (rev 03)
00:1d.2 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 [8086:2936] (rev 03)
00:1d.7 USB Controller [0c03]: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 [8086:293a] (rev 03)
00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev 93)
00:1f.0 ISA bridge [0601]: Intel Corporation ICH9M LPC Interface Controller [8086:2919] (rev 03)
00:1f.2 SATA controller [0106]: Intel Corporation ICH9M/M-E SATA AHCI Controller [8086:2929] (rev 03)
00:1f.3 SMBus [0c05]: Intel Corporation 82801I (ICH9 Family) SMBus Controller [8086:2930] (rev 03)
01:00.0 VGA compatible controller [0300]: nVidia Corporation GeForce 9200M GS [10de:06e8] (rev a1)
02:00.0 Ethernet controller [0200]: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter [168c:001c] (rev 01)
06:00.0 Ethernet controller [0200]: Marvell Technology Group Ltd. 88E8055 PCI-E Gigabit Ethernet Controller [11ab:4363] (rev 13)

The laptop is a Samsung e152, dmidecode calls it a r510/p510.

Software Environment: up-to-date Gentoo
---------------------
Problem Description:
--------------------
With ath5k, the AR2425 card is detected correctly and the usual iwconfig/ifconfig commands work properly. The problem is, that i can't find any network. If i unload ath5k and try the madwifi-hal-0.10.5.6 driver from http://snapshots.madwifi-project.org/madwifi-hal-0.10.5.6/ , i can activate the WLan-LED with writing "1" to /proc/sys/dev/wifi0/softled and then the networks become visible. After this, it is possible to unload the Madwifi-hal driver and continue with the official ath5k driver. So i guess it's a rf_kill-related problem.
Actually i can't deactivate the card with either the official or the madwifi-hal driver, but this is a minor problem for me.

The same is true for the 2.6.27 kernel.

I completely removed the proprietary NVIDIA and madwifi-hal drivers, but the problem remains.

Steps to reproduce:
rmmod ath5k
modprobe ath_pci
echo "1" > /proc/sys/dev/wifi0/softled
madwifi-unload
modprobe ath5k

Thank you!
Comment 1 Bob Copeland 2008-12-31 07:36:31 UTC
Can you post lspci -vnn?
Comment 2 Mario Kicherer 2009-01-01 11:20:53 UTC
Output for my card:

02:00.0 Ethernet controller [0200]: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter [168c:001c] (rev 01)
        Subsystem: Askey Computer Corp. Device [144f:7131]
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at f3000000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: [40] Power Management version 2
        Capabilities: [50] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable-
        Capabilities: [60] Express Legacy Endpoint, MSI 00
        Capabilities: [90] MSI-X: Enable- Mask- TabSize=1
        Capabilities: [100] Advanced Error Reporting <?>
        Capabilities: [140] Virtual Channel <?>
        Kernel driver in use: ath5k_pci
        Kernel modules: ath_pci, ath5k


Or do you need the whole output?
Comment 3 Bob Copeland 2009-01-01 15:12:11 UTC
That's enough, I just wanted to see if we mis-identified it as some other chip and wrote to the rfkill gpio when we meant to write the led gpio.  Not the case, though.  Does your laptop have an rfkill switch, and does it do anything?  I suspect we'll have to write some basic support for rfkill sooner rather than later to fix your device.
Comment 4 Mario Kicherer 2009-01-02 15:46:10 UTC
It has a function key, that, as far as i remember, generates a unknown key-down event, but no key-up event (another issue i'll have to investigate :). I can test it again on sunday, if it is important. The laptop is currently not here.

Is there anything else I could help with?
Comment 5 Bob Copeland 2009-01-22 07:45:58 UTC
Created attachment 19937 [details]
rfkill gpio support

Here's a patch for you to try, against linux-2.6.git.  If it doesn't work, try changing the value of sc->rfkill_on to 0.  (Actually, for completeness, testing both values will be useful to verify that some value does invoke rfkill.)
Comment 6 Bob Copeland 2009-01-22 07:48:40 UTC
Err, I'm dumb, before you apply it, please change the line:

+	ath5k_hw_set_gpio(sc->ah, sc->led_pin, !sc->rfkill_on);
to 
+	ath5k_hw_set_gpio(sc->ah, sc->rfkill_pin, !sc->rfkill_on);
Comment 7 Mario Kicherer 2009-01-24 10:33:06 UTC
The patch works with 2.6.28 and sc->rfkill_on = 0.
Shall i test it with the latest git too?

Is there also a way to deactivate the antenna?
It's not important but it would be nice. :)

Thank you very much!
Comment 8 Bob Copeland 2009-07-19 20:13:03 UTC
Can you retest with 2.6.31-rcX?  It should (finally) include rfkill support.

Right now there's no way to deactivate antennas, I suppose that could be some feature of antenna diversity controls which don't exist yet.  Perhaps you can explain what you want it for?  Also if you just don't want to transmit you can use the txpower setting.
Comment 9 Mario Kicherer 2009-08-06 19:51:40 UTC
Tested with vanilla 2.6.31-rc5.

After simply loading ath5k:

# rfkill list
0: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no

But the WLAN-Led doesn't glow. Blocking&Unblocking changes nothing.

# rfkill event
RFKILL event: idx 0 type 1 op 0 soft 0 hard 0

After "ifconfig wlan0 up", "iwlist wlan0 scan" shows nothing.

Actually it's the laptop of my sister. From the technical side it is sufficient at the moment to turn of the txpower. A optical feedback would be nice, but not necessary.
Comment 10 Mario Kicherer 2009-12-03 20:54:08 UTC
Hi,

is there a way to get the patch into main tree?
It doesn't work anymore with 2.6.31. :/

Thank you very much!
Comment 11 Mario Kicherer 2009-12-25 18:36:11 UTC
So, i've managed to get the LED flashing by adding the following line in the led.c:

{ PCI_VDEVICE(ATHEROS,0x001c), ATH_LED(0, 0) },

When i load the module, the LED flashes, the wlan0 interface is down and rfkill says no blocks. I bring it up using "ifconfig wlan0 up" and the LED stops flashing and rfkill says hard block. If i issue the ifconfig command again it prints a "SIOCSIFFLAGS: unknown error 132" error. If i unload the module, the LED starts flashing again, but the device is gone.

If i change the macro to ATH_LED(0,1) the LED never flashes.

Any recommendations what else i could try?
Comment 12 Mario Kicherer 2009-12-29 19:21:32 UTC
Created attachment 24354 [details]
Patch for led.c
Comment 13 Mario Kicherer 2009-12-29 19:32:14 UTC
Created attachment 24355 [details]
patch for rfkill.c


I've managed to get the rfkill part of the device fully working through patching of the rfkill.c and led.c.

The problem is, that the device has no hardware rfkill switch. It is (de-)activated through PIN 0, that also controls the LED. So, with the patches, i deactivated the separate LED handling and solely use the rfkill functions. There i have to deactivate a few lines, as they activate the rfkill again while bringing the interface up. I guess the ath5k_hw_set_gpio_input function is causing this, as it is mentioned in another comment that this function can cause a change of the PIN.

If you could tell me please how it is safe to distinguish between my type of laptop and others, i will improve the patch and it can hopefully be included into main tree.
Comment 14 Alan 2012-10-30 15:40:54 UTC
If this is still seen on modern kernels then please re-open/update

Note You need to log in before you can comment on or make changes to this bug.