Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tricks for ipw2100; iwl4965
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
alexdu
n00b
n00b


Joined: 25 Oct 2005
Posts: 38
Location: Moscow, Russia

PostPosted: Mon Sep 15, 2008 10:58 pm    Post subject: Tricks for ipw2100; iwl4965 Reply with quote

Hi.

The next workarounds work for me just fine.

The general idea is simple - use wpa_supplicant to reconnect a WiFi device after power-off timeout or/and after any reason occasional signal lost from an AP.

ipw2100 + WEP/WPA/WPA2

Machine: IBM ThinkPad R40 with
Quote:
02:02.0 Network controller: Intel Corporation PRO/Wireless LAN 2100 3B Mini PCI Adapter (rev 04)

System:
Quote:
Linux wax 2.6.24-tuxonice-r9 #3 PREEMPT Sun Sep 7 17:54:21 MSD 2008 i686 Intel(R) Pentium(R) M processor 1400MHz GenuineIntel GNU/Linux

Kernel modules:
Code:
Module                  Size  Used by
ipw2100                65840  0
ieee80211_crypt_tkip     9536  1
ieee80211_crypt_ccmp     5824  1
thinkpad_acpi          43832  0
ieee80211              29960  1 ipw2100
ieee80211_crypt         4480  3 ieee80211_crypt_tkip,ieee80211_crypt_ccmp,ieee80211

Firmware:
Quote:
Installed versions: net-wireless/ipw2100-firmware-1.3

N.B. I don't know if the firmware is really needed and used.

and some magic ;)
here example for WPA/WPA2

cat /etc/conf.d/net
Code:
postup() {
    sleep 1; /sinit/squid restart &
}


modules=( "wpa_supplicant" )
wpa_supplicant_eth1="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"
wpa_timeout_eth1="0"

associate_timeout_eth1="10"

N.B. If you need some system service(s) to restart after WiFi device power flip - postup() is a good place to do it. /sinit/ is my symlink to /etc/init.d/. 'Sleep' and non-default timeouts are mandatory for some cards!

cat /etc/wpa_supplicant/wpa_supplicant.conf
Code:
network={
   ssid="-- your AP name here --"
   psk="-- your pass here --"
   priority=5
}

# This is a network block that connects to any unsecured access point.
# We give it a low priority so any defined blocks are preferred.
network={
   key_mgmt=NONE
   priority=-9999999
}

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=users
update_config=1


/var/log/messages example
Code:
Sep 16 01:05:44 wax ipw2100: Intel(R) PRO/Wireless 2100 Network Driver, git-1.2.2
Sep 16 01:05:44 wax ipw2100: Copyright(c) 2003-2006 Intel Corporation
Sep 16 01:05:44 wax ACPI: PCI Interrupt 0000:02:02.0[A] -> Link [LNKC] -> GSI 11 (level, low) -> IRQ 11
Sep 16 01:05:44 wax ipw2100: Detected Intel PRO/Wireless 2100 Network Connection
Sep 16 01:05:51 wax wpa_cli: interface eth1 CONNECTED
Sep 16 01:36:40 wax wpa_cli: interface eth1 DISCONNECTED
Sep 16 01:36:43 wax wpa_cli: interface eth1 CONNECTED
Sep 16 01:40:01 wax cron[13871]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Sep 16 01:42:40 wax wpa_cli: interface eth1 DISCONNECTED
Sep 16 01:42:43 wax wpa_cli: interface eth1 CONNECTED
Sep 16 01:50:01 wax cron[15041]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )
Sep 16 01:51:40 wax wpa_cli: interface eth1 DISCONNECTED
Sep 16 01:51:43 wax wpa_cli: interface eth1 CONNECTED
Sep 16 01:57:40 wax wpa_cli: interface eth1 DISCONNECTED
Sep 16 01:57:43 wax wpa_cli: interface eth1 CONNECTED
and so on...

If something goes wrong... I made a "repair WiFi button" Fn+F5 (this one for ThinkPad's hotkeys):

cat /etc/acpi/events/wifi
Code:
event=ibm/hotkey HKEY 00000080 00001005
action=rmmod ipw2100 ; sleep 1; modprobe ipw2100

N.B. don't forget to run 'pkill -HUP acpid' after acpid rules update.

But it's unlucky case you will need it... I don't remember if I used this button after testing :)

Suspend/Hibernate.
...with such schema - OTB for tuxonice-source.


iwl4965 + WEP/WPA/WPA2
The same... like that, but there are little differences.

Machine: lenovo ThinkPad X300 with
Quote:
03:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN Network Connection (rev 61)

System:
Quote:
Linux x300 2.6.24-tuxonice-r9 #7 SMP PREEMPT Sun Sep 7 15:39:25 MSD 2008 i686 Intel(R) Core(TM)2 Duo CPU L7100 @ 1.20GHz GenuineIntel GNU/Linux

Kernel modules:
Code:
Module                  Size  Used by
iwl4965                99880  0
thinkpad_acpi          45760  0

Firmware:
Quote:
Installed versions: net-wireless/iwl4965-ucode-4.44.1.20

N.B. I don't know if the firmware is really needed and used.

and also some magic ;)
here example for WPA/WPA2

cat /etc/conf.d/net
Code:
postup() {
    sleep 3; /sinit/squid restart &
}

modules=( "wpa_supplicant" )
wpa_supplicant_wlan0="-w -Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"
wpa_timeout_wlan0="0"

associate_timeout_wlan0="10"

N.B. If you need some system service(s) to restart after WiFi device power flip - postup() is a good place to do it. /sinit/ is my symlink to /etc/init.d/. 'Sleep' and non-default timeouts are mandatory for some cards!
N.B.2. Here pay attention to "-w" wpa_supplicant option!

cat /etc/wpa_supplicant/wpa_supplicant.conf
just the same...
Code:
network={
   ssid="-- your AP name here --"
   psk="-- your pass here --"
   priority=5
}

# This is a network block that connects to any unsecured access point.
# We give it a low priority so any defined blocks are preferred.
network={
   key_mgmt=NONE
   priority=-9999999
}

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=users
update_config=1


/var/log/messages example
Code:
Sep 15 11:51:04 x300 iwl4965: Intel(R) Wireless WiFi Link 4965AGN driver for Linux, 1.1.17ks
Sep 15 11:51:04 x300 iwl4965: Copyright(c) 2003-2007 Intel Corporation
Sep 15 11:51:04 x300 ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 17 (level, low) -> IRQ 21
Sep 15 11:51:04 x300 PCI: Setting latency timer of device 0000:03:00.0 to 64
Sep 15 11:51:04 x300 iwl4965: Detected Intel Wireless WiFi Link 4965AGN
Sep 15 11:51:04 x300 iwl4965: Tunable channels: 13 802.11bg, 19 802.11a channels
Sep 15 11:51:04 x300 phy14: Selected rate control algorithm 'iwl-4965-rs'
Sep 15 11:51:07 x300 wlan0: Initial auth_alg=0
Sep 15 11:51:07 x300 wlan0: authenticate with AP 00:1b:11:67:99:dd
Sep 15 11:51:07 x300 wlan0: authenticate with AP 00:1b:11:67:99:dd
Sep 15 11:51:07 x300 wlan0: RX authentication from 00:1b:11:67:99:dd (alg=0 transaction=2 status=0)
Sep 15 11:51:07 x300 wlan0: authenticated
Sep 15 11:51:07 x300 wlan0: associate with AP 00:1b:11:67:99:dd
Sep 15 11:51:07 x300 wlan0: RX AssocResp from 00:1b:11:67:99:dd (capab=0x431 status=0 aid=41)
Sep 15 11:51:07 x300 wlan0: associated
Sep 15 11:51:07 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 11:51:09 x300 wpa_cli: interface wlan0 CONNECTED
Sep 15 11:51:15 x300 rc-scripts: Failed to configure wlan0 in the background
  ^^^ this one is not important, but if you will fix it - let me know, plz.
Sep 15 11:51:18 x300 squid[26417]: Squid Parent: child process 26420 started
  ^^^ services started
Sep 15 12:02:18 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 12:02:59 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 12:02:59 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 12:03:59 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 12:04:56 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 12:05:59 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 12:05:59 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 12:06:59 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
... then
Sep 15 13:42:12 x300 wlan0: RX disassociation from 00:1b:11:67:99:dd (reason=8)
Sep 15 13:42:12 x300 wlan0: disassociated
Sep 15 13:42:12 x300 wpa_cli: interface wlan0 DISCONNECTED
Sep 15 13:42:12 x300 squid[26417]: Squid Parent: child process 26420 exited with status 0
Sep 15 13:42:13 x300 wlan0: associate with AP 00:1b:11:67:99:dd
Sep 15 13:42:13 x300 wlan0: associate with AP 00:1b:11:67:99:dd
Sep 15 13:42:13 x300 wlan0: associate with AP 00:1b:11:67:99:dd
Sep 15 13:42:13 x300 wlan0: association with AP 00:1b:11:67:99:dd timed out
Sep 15 13:42:44 x300 wlan0: Initial auth_alg=0
Sep 15 13:42:44 x300 wlan0: authenticate with AP 00:1b:11:67:99:dd
Sep 15 13:42:44 x300 wlan0: RX deauthentication from 00:1b:11:67:99:dd (reason=7)
Sep 15 13:42:44 x300 wlan0: deauthenticated
Sep 15 13:42:44 x300 wlan0: RX authentication from 00:1b:11:67:99:dd (alg=0 transaction=2 status=0)
Sep 15 13:42:44 x300 wlan0: authenticated
Sep 15 13:42:44 x300 wlan0: associate with AP 00:1b:11:67:99:dd
Sep 15 13:42:44 x300 wlan0: Initial auth_alg=0
Sep 15 13:42:44 x300 wlan0: authenticate with AP 00:1b:11:67:99:dd
Sep 15 13:42:44 x300 wlan0: RX authentication from 00:1b:11:67:99:dd (alg=0 transaction=2 status=0)
Sep 15 13:42:44 x300 wlan0: authenticated
Sep 15 13:42:44 x300 wlan0: associate with AP 00:1b:11:67:99:dd
Sep 15 13:42:44 x300 wlan0: RX ReassocResp from 00:1b:11:67:99:dd (capab=0x31 status=0 aid=2)
Sep 15 13:42:44 x300 wlan0: associated
Sep 15 13:42:45 x300 wpa_cli: interface wlan0 CONNECTED
Sep 15 13:42:55 x300 squid[27933]: Squid Parent: child process 27935 started
Sep 15 13:46:27 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 13:46:43 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 13:46:44 x300 wlan0: CTS protection enabled (BSSID=00:1b:11:67:99:dd)
Sep 15 13:46:46 x300 wlan0: CTS protection disabled (BSSID=00:1b:11:67:99:dd)
Sep 15 13:50:27 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 13:54:28 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 13:56:27 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:00:28 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:03:27 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:07:28 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:09:27 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:13:28 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:15:27 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:17:16 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:19:27 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:23:28 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:25:27 x300 wlan0: switched to short barker preamble (BSSID=00:1b:11:67:99:dd)
Sep 15 14:29:28 x300 wlan0: switched to long barker preamble (BSSID=00:1b:11:67:99:dd)
...
and so on...

The "repair WiFi button" Fn+F5 (for ThinkPad's hotkeys) is also exists:

cat /etc/acpi/events/wifi
Code:
event=ibm/hotkey HKEY 00000080 00001005
action=rmmod iwl4965 ; sleep 5; modprobe iwl4965

N.B. don't forget to run 'pkill -HUP acpid' after acpid rules update.
N.B.2. Note the 5 second delay, otherwise this won't works! :twisted:

But it's unlucky case you will need it...

Suspend/Hibernate.
Almost OTB for tuxonice-source. I added
Code:
UnloadModules iwl4965
to /etc/hibernate/common.conf, but not sure is it really needed.

* * *

So, have a try.

P.S.
For other devices I guess playing with timeouts, sleeps and "-w" might also gives some positive.

Update, 16 Sep 2008:
I use static IP and have no confirmation if it works with DHCP or not. I guess it should...

Update, 20 Sep 2008:
If your are trying to configure WiFi and use wpa_supplicant with "-w" option ("daemonize") note this: Gentoo networking scripts won't restart it (but start it at the first time), kill wpa_supplicant manually if you changed anything at net/wpa configs.


Last edited by alexdu on Sat Sep 20, 2008 11:12 am; edited 3 times in total
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 2723
Location: The Peanut Gallery

PostPosted: Thu Sep 18, 2008 7:40 am    Post subject: Reply with quote

Great post, alexdu :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum