Configuring ipw3945 wireless card

On one of my laptops, I have an Intel Pro Wireless 3945 network card.  Initially, this was causing me some problems trying to get it working, but I managed it eventually.  There's also the iwl3945 driver available, however, I've not had much luck with this.  This was when I reverted to the ipw3945 driver, and found it started to work how it should have done originally.

First of all, install the ipw3945 packages:

emerge ipw3945

this should install ipw3945, ipw3945d and ipw3945-ucode.  I then also installed wpa_supplicant, because I wanted to have an encrypted connection since I didn't want to use WEP or leave my access point open.

emerge wpa_supplicant

To ensure the modules would get loaded automatically, I did:

update-modules --force

Configuring the wireless network card.

and then configured /etc/conf.d/net with all I needed for my networking:

modules=( "wpa_supplicant" )
wpa_supplicant_eth1="-Dwext"
config_eth1=( "dhcpcd" )

this is really all you need, providing you are using DHCP.  If not, replace the config_eth1 line with the following and add a default route:

config_eth1=( "192.168.1.10/24" )
routes_eth1=( "default gw 192.168.1.1" )

for example.  Then you can use a static IP instead.

Configuring wpa_supplicant.

I found this was all I needed for my configuration:

 network={
        disabled=0
        ssid="MYWIRELESS"
        mode=0
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk="MySecretPassword"
        priority=11
}

this worked perfectly fine for me.

Finishing Touches.

Now, I ensured I had a script to use to start/stop the interface:

ln -sf /etc/init.d/net.lo /etc/init.d/net.eth1
rc-update add net.eth1 default

and using /etc/init.d/net.eth1 start, I found my wireless was working using an encrypted connection with WPA.  Since the update-modules automatically loads the ipw3945 module on starting your system, there is no need to add ipw3945d to start at bootup.  This is because when the module loads, ipw3945d starts automatically.