Saturday, 23 February 2008

ACPI and WiFi card Intel PROWireless on Asus M5200ae M5A

In this post tweaking wireless card Intel PROWireless 2200 is described. It is a little bit tricky to get such card to work on Asus M5200AE notebook. But using latest extras from acpi4asus project, my wifi card works perfectly.

Intel PRO/Wireless 2200
Because this adapter is made by Intel, no problems should appear during installation of the drivers. It is required to download the firmware from here, unpack it and copy to /usr/share/firmware

Also you must install the packages for wireless networking:

aptitude install wireless-tools, kwifimanager, kwirelessmonitor-net kwirelessmonitor kwrapper
And also install packages for ACPI:
aptitude install acpi-support acpid laptop-mode-tools
If all steps were performed correctly then during boot process should be such strings:
ieee80211_crypt: registered algorithm 'NULL'
ieee80211: 802.11 data/management/control stack, 1.1.14
ieee80211: Copyright (C) 2004-2005 Intel Corporation
ipw2200: Intel(R) PRO/Wireless 2200/2915 Network Driver, 1.1.3dmprq
ipw2200: Copyright(c) 2003-2006 Intel Corporation
ACPI: PCI Interrupt 0000:01:05.0[A] -> GSI 18 (level, low) -> IRQ 17
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection
ipw2200: Radio Frequency Kill Switch is On:
Kill switch must be turned off for wireless networking to work.
ipw2200: Detected geography ZZM (11 802.11bg channels, 0 802.11a channels)
It seems to work, but there are suspicious string emphasized by red bold font. What is a "Kill Switch" and why you can not connect to wireless networks when it activated?

Radio frequency killer
There is a combination of keys that turns on and off a radio transmitter of the WIFI chip. Such combination is often mentioned as "Kill Switch", thus is you did not deactivated such kill switch then yours WiFi ciph is turned off and nothing can help you.

To test Kill Switch is on or off, you can type such command:
# cat /sys/bus/pci/drivers/ipw2200/0000\:01\:05.0/rf_kill
According to the documentation we have:
read -
0 = RF kill not enabled (radio on)
1 = SW based RF kill active (radio off)
2 = HW based RF kill active (radio off)
3 = Both HW and SW RF kill active (radio off)

End of story: Kill Switch is on, Wifi's radio transmitter is turned off. It also can be checked by iwconfig:

eth3 radio off ESSID:"virens"
Mode:Ad-Hoc Frequency:2.412 GHz Cell: Not-Associated
Bit Rate:0 kb/s Tx-Power=off Sensitivity=8/0
Retry limit:7 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

As usual, Kill Switch key combination on notebooks is Fn+F2 but on your notebook it may be different.

For the key combination to turn on you need to activate ACPI extras for your notebook. For Asus laptops it is Asus Extras. You need to obtain latest version of the asus_extras driver from SVN of the Acpi4Asus project.
For those who compiled the kernel by themselves, here are some guidelines:

Power management options (ACPI, APM) --->
[*] Power Management support ---->
[*] ACPI Support:
<М> AC Adapter
<М> Battery
<М> Button
<М> Video
<М> Fan
<М>Thermal Zone
< > ASUS/Medion Laptop Extras
Next, turning on the support of a Radio Frequency Kill Switch

Networking --->
[*] Networking support -->
Improved wireless configuration API
--- Wireless extensions
<М> Generic IEEE 802.11 Networking Stack (mac80211)
[ ] Enable debugging output
<М>Generic IEEE 802.11 Networking Stack
[ ] Enable full debugging output
--- IEEE 802.11 WEP encryption (802.1x)
<М> IEEE 802.11i CCMP support
<М> IEEE 802.11i TKIP encryption
<М> Software MAC add-on to the IEEE 802.11 networking stack
[ ] Enable full debugging output

In the Networking section turn on:
<*> RF switch subsystem support --->
<*> Input layer to RF switch connector
It is certainly that you need the NAT for providing Internet connections from you laptop, thus you need to activate NAT and Masquerading:

Networking --->
[*] Networking support -->
Networking options --->
[*] Network packet filtering framework (Netfilter) --->
Core Netfilter Configuration --->

<*> Netfilter netlink interface
<*> Netfilter connection tracking support

IP: Netfilter Configuration --->
<*> IPv4 connection tracking support (required for NAT)
[*] proc/sysctl compatibility with old connection tracking
<*> IP tables support (required for filtering/masq/NAT)
<*> IP range match support
<*> TOS match support
<*> recent match support
<*> ECN match support
<*> AH match support
<*> TTL match support
<*> Owner match support
<*> address type match support
<*> Packet filtering
<*> REJECT target support
<*> LOG target support
<*> ULOG target support
<*> Full NAT
<*> MASQUERADE target support
<*> REDIRECT target support
<*> NETMAP target support
<*> SAME target support
<*> Packet mangling
<*> TOS target support
<*> ECN target support
<*> TTL target support

Next thing to do is activation of the wireless card.

Device Drivers ---->
Network device support --->
[*] Network device support
Wireless LAN --->

[*] Wireless LAN (IEEE 802.11)
<М> Intel PRO/Wireless 2200BG and 2915ABG Network Connection
<------- this is our driver, let's compile it as a module
[*] Enable promiscuous mode
--- Enable radiotap format 802.11 raw packet support
[*] Enable creation of a RF radiotap promiscuous interface
[*] Enable QoS support
[*] Enable full debugging output in IPW2200 module.

Enabling firmware load:
Device Drivers ---->
Generic Driver Options ---->
Hotplug firmware loading support

For the connection to be encrypted you need to turn on encryption support:

Cryptographic options ->
<*>ARC4 cipher algorithm
<*>Michael MIC keyed digest algorithm
<*>AES cipher algorithms (i586)

And also this one:
Library routines ->
<*>CRC32 functions

After all you need to turn on the LED's support for indication of a wireless status. In the Device Drivers section:

Device Drivers ---->
LED devices --->
[*] LED Support
<*> LED Class Support
--- LED drivers
--- LED Triggers

That's all; compile the kernel and reboot with it.

Let's fire up!
It is practically all that needed for your wireless happiness. During the boot process our kernel must detect the wireless card and turn it on. Now press Fn+F2 and the WiFi LED must turn on. If it works then all is done correctly and WiFi now can be used. Let's check the state of Kill Switch:
# cat /sys/bus/pci/drivers/ipw2200/0000\:01\:05.0/rf_kill
That's it, the radio is turned ON. Now type:
# iwconfig
lo no wireless extensions.

eth1 no wireless extensions.

Warning: Driver for device eth3 has been compiled with version 22
of Wireless Extension, while this program supports up to version 20.
Some things may be broken...

eth3 unassociated ESSID:"virens"
Mode:Ad-Hoc Frequency=2.412 GHz Cell: Not-Associated
Bit Rate:0 kb/s Tx-Power=20 dBm Sensitivity=8/0
Retry limit:7 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
It works! The rest of the job is simple: just configure an ad-hoc network. For the network to be configured you need to edit /etc/network/interfaces like this:

auto eth3
iface eth3 inet static
wireless-mode ad-hoc
wireless-channel 1
wireless-rate auto
wireless-essid virens

Now let's tweak network card:
iwconfig eth3 mode Ad-Hoc channel 1 essid virens
That's all and you got simple ad-hoc network with identifier virens .


va1e said...

if someone have same "2 problem" on IBM ThinkPad notebook, just put downloaded ipw2200 firmware in /lib/firmware ;)