[Debian-eeepc-devel] madwifi or ath5k in function.sh

Santi Béjar santi at agolina.net
Sat Oct 18 22:57:30 UTC 2008


On Mon, Oct 13, 2008 at 5:36 PM, Jean-Christophe <jc.sid at free.fr> wrote:
> Damyan Ivanov a écrit :
>> -=| Jean-Christophe, Mon, Oct 13, 2008 at 11:07:36AM +0200 |=-
>>
>>> Please somebody update functions.sh while eeepc-acpi-scripts is at
>>> present uncompatible with ath5k.
>>> I am sorry I do not know the way to do it. Below is the suggestion I
>>> made and which works perfectly on my 701 with last compat-wireless-old.
>>> It just detects if madwifi is installed on the machine and select the
>>> right if device and module.
>>>
>>> Thanks, kind regards
>>> Jean-Christophe
>>>
>>>> --- Desktop/eeepc-acpi-scripts-1.0.8/functions.sh    2008-09-21
>>>> 11:49:53.000000000 +0200
>>>> +++ /usr/share/eeepc-acpi-scripts/functions.sh    2008-10-10
>>>> 20:38:42.000000000 +0200
>>>> @@ -7,8 +7,13 @@
>>>>          WLAN_IF=ra0
>>>>          WLAN_MOD=rt2860sta
>>>>      elif lspci|grep -i 'atheros'|grep -q -i 'wireless'; then
>>>> -        WLAN_IF=ath0
>>>> -        WLAN_MOD=ath_pci
>>>> +    if pcimodules|grep 'ath_pci'; then
>>>> +            WLAN_IF=ath0
>>>> +            WLAN_MOD=ath_pci
>>>> +    else
>>>> +        WLAN_IF=wlan0
>>>> +        WLAN_MOD=ath5k
>>>> +    fi
>>>>      fi
>>>>
>>>>      echo "Detected WLAN module $WLAN_MOD on $WLAN_IF" >&
>>>>
>>
>> Please someone with the madwifi driver, confirm that this works for
>> you too
> Sorry I forgot: I tried while reinstalling madwifi and removing ath5k.
> It worked, but it should be more secure to have other user's confirmation.
> Thanks for testing

I've test it with madwifi in 2.6.26 and ath5 in 2.6.27 (just one
driver with each kernel) and the patch does what is expected. But if
you change from madwifi (ath0 by default) to ath5k (wlan0 by default)
you get the wrong $WLAN_IF because the persistent rule in udev:

$ cat /etc/udev/rules.d/70-persistent-net.rules
...

# PCI device 0x168c:0x001c (ath_pci)
SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="00:15:af:b7:0a:02",
ATTR{type}=="1", NAME="ath0"

Maybe you can extract it somehow from /sys:

ls /sys/bus/pci/devices/0000\:01\:00.0/net*
/sys/bus/pci/devices/0000:01:00.0/net:ath0
/sys/bus/pci/devices/0000:01:00.0/net:wmaster0

(but the drivers needs to be loaded). Althouth I think wireless.sh
should not know the interface, because all the drivers
settings/configs/workaround should be done in udev rules or in
/etc/modprobe.d.

To know what driver is configured to be loaded (via hotplug) you can use:

$ lspci -k -s 0000:01:00.0
Ethernet controller: Atheros Communications Inc. AR242x 802.11abg
Wireless PCI Express Adapter (rev 01)
	Kernel driver in use: ath5k_pci
	Kernel modules: ath5k

HTH,

Santi



More information about the Debian-eeepc-devel mailing list