site  contact  subhomenews

Wireless mystery with 2.6.31 kernel

February 03, 2010 — BarryK
My Acer 3681WXMi laptop has inbuilt wireless that uses the ath5k kernel module. It used to work, however with Quirky and the 2.6.31.5 kernel it doesn't.

In the Network Wizard, when I choose to scan for neworks, an error message comes up that 'ifconfig wlan0 up' failed, with this error:

ifconfig: SIOCSIFFLAGS: Unknown error 132

I googled around, and there are many wireless problems with recent kernels. My particular problem seems to have something to do with the 'rfkill.ko' kernel module, which is now a dependency of the wireless kernel modules.

There is a utility called 'rfkill' that queries the state of a wireless interface. I ran it:

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


However, after I had done the scan with the Network Wizard, it returns this:

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


"Hard blocked" means that there is a hardware switch on my laptop that has turned off the wireless interface. That is just plain incorrect.

I found a "fix" posted in a forum thread discussing the same problem with the 'ath9k' driver. I applied it to my ath5k:

# rmmod ath5k
# rfkill block wifi
# rfkill unblock wifi
# modprobe ath5k
# ifconfig wlan0 up


Somehow, the above clears the problem. But then, running Network Wizard and the problem comes back. So, I had a little play with /usr/sbin/wag-profiles.sh (part of Network Wizard) and modified the cleanUpInterface function:

cleanUpInterface(){

# put interface down
#ifconfig "$1" down
killDhcpcd "$1"
# kill wpa_supplicant
killWpaSupplicant "$1"
# clean up some wireless stuff (taken from wifi-radar)
if [ "$IS_WIRELESS" = "yes" ] ; then
iwconfig "$1" essid off
iwconfig "$1" key off
iwconfig "$1" mode managed # auto doesn't exist anymore??
iwconfig "$1" channel auto
fi
# put interface down
ifconfig "$1" down
# reset ip address (set a false one)
ifconfig "$1" 0.0.0.0
# stop dhcpcd
#killall dhcpcd 2>/dev/null
# flush routing table
#ip route flush dev "$1"
# bring interface up again
#ifconfig "$1" up

#100202
ERROR="`ifconfig "$1" up 2>&1`"
if [ "$ERROR" ];then
case $1 in
wlan*)
if [ "`echo "$ERROR" | grep 'ifconfig: SIOCSIFFLAGS: Unknown error 132'`" != "" ];then
rmmod $INTMODULE
rfkill block wifi
rfkill unblock wifi
modprobe $INTMODULE
ERROR="`ifconfig "$1" up 2>&1`"
fi
;;
esac
fi
if [ "$ERROR" ];then
giveErrorDialog "${L_MESSAGE_Failed_To_Raise_p1}${1}${L_MESSAGE_Failed_To_Raise_p2} ifconfig $1 up
$L_MESSAGE_Failed_To_Raise_p3
$ERROR
"
return 1
fi

return $?
} # end cleanUpInterface


Hmmm, now there is no error message, but it reports no networks found (there is one, about 1 foot away from my laptop!).

I'm far from an expert on networking, and I have left development of these wizards to others. I have messed around a bit, but that's enough.

Now plugging in my USB wireless, which does work with the Wizard.

The Arch Linux guys have been discussing this problem, ath5k/ath9k and 2.6.31.x:

http://bbs.archlinux.org/viewtopic.php?id=81930

...seem to be quite a mess.

Hmmm, I wonder if the 2.6.33 kernel has improved this situation? I wonder if I can/should disable 'rfkill' in the kernel pre-compile configuration?

Rfkill utility links
http://linuxwireless.org/en/users/Documentation/rfkill
http://wireless.kernel.org/download/rfkill/


Comments

maybe try updating the BIOS
Username: Jemimah
I had this problem on my Eee 1005HA (ath9k), but only with a specific BIOS version. I had upgraded because they claimed a fix for suspend issues, but the fix was a lot worse than the problem. :( Luckily, I've now grabbed the very latest BIOS, and the rfkill switch now works correctly.


Tags: quirky