Showing posts with label Broadcom wl driver. Show all posts
Showing posts with label Broadcom wl driver. Show all posts

2009-05-10

Wireless networking on the Dell Mini 9 - Broadcom wl driver

One of the first things you might notice when you boot into Debian with the Mini 9 is that the wireless card does not work out of the box. The reason for this is that the wireless card in the Mini 9 is not compatible with the b43 driver with which you may be familiar. Broadcom has released a driver specifically for the wireless card in the Mini 9. To confirm that you need the wl driver from Broadcom, open a terminal session and run the following command:

$ lspci -nn | grep 14e4

This should return something that looks like this:

03:00.0 Network controller [0280]: Broadcom Corporation BCM4312 802.11b/g [14e4:4315] (rev 01)

The important things above are the BCM4312 and the [14e4:4315]. If you see these things, then you know that you'll need to download the wl driver here. Or you can use wget from the terminal:

$ mkdir broadcom_wl && cd broadcom_wl
$ wget http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v5_10_91_9.tar.gz

Before we can compile and install the driver, we're going to have to make sure we have a couple packages installed on our system:

# apt-get update
# apt-get install build-essential linux-headers-`uname -r`

Now we want to untar the file so we can get to installing it

$ tar -xvf hybrid-postsrc-x86_32-v5_10_91_9.tar.gz

You should notice two directories: lib and src as well as one file: Makefile in the directory where you untarred the download. Now we're going to do some cleanup and then compile the driver:

$ sudo make -C /lib/modules/`uname -r`/build M=`pwd` clean
$ sudo make -C /lib/modules/`uname -r`/build M=`pwd`

Now you should see a file wl.ko in the directory. Now we want to see if there are any of the following moudles loaded on your system: b43, b43legacy, or bcm43xx.

$ lsmod | grep 43

Make a note of which of the above mentioned modules you found with the above command. You'll want to unload the corresponding module with the appropriate command:

# rmmod b43
# rmmod b43legacy
# rmmod bcm43xx

You will want to double check that the module(s) got unloaded correctly with the lsmod command above. After confirming that these modules have been unloaded, we will want to copy the wl.ko file into the appropriate directory for the system to find it:

# cp wl.ko /lib/modules/`uname -r`/kernel/net/wireless/wl.ko

Now we should be able to load the wl driver, and if you need to use wpa_supplicant, we'll load the ieee80211_crypt_tkip module as well:

# depmod
# modprobe ieee80211_crypt_tkip
# modprobe wl

Now your wireless adapter should be working properly. You should confirm that the system sees the adapter now:

$ /sbin/ifconfig

You should see at least three adapters displayed:
  • eth0 - This is your ethernet adapter
  • lo - This is your loopback adapter
  • eth1 or wlan0 - This is your wireless adapter, mine shows up as eth1

Now you should be able to connect to your wireless network through network-manager, wicd, or whatever program you use to manage your network connections.

The next important step is that we want to make sure that our new wireless driver starts up on system start up. This means we get to roll up our sleeves and edit some system files. First we'll start by blacklisting the drivers that we had to unload before. You'll want to add the appropriate lines from the following into your /etc/modprobe.d/blacklist file:

blacklist b43
blacklist b43legacy
blacklist bcm43xx

You can add these lines by opening the file with your favorite text editor:

# vim /etc/modprobe.d/blacklist

Or:

# gedit /etc/modprobe.d/blacklist

If you want to be a little quicker about it, you can use the echo command:

# echo "blacklist b43" >> /etc/modprobe.d/blacklist
# echo "blacklist b43legacy" >> /etc/modprobe.d/blacklist
# echo "blacklist bcm43xx" >> /etc/modprobe.d/blacklist

This will prevent the above modules from being loaded in the future. Now we want to make sure the ieee80211_crypt_tkip and wl modules are loaded by default. We'll have to edit the /etc/modules file to add the following lines to it:

ieee80211_crypt_tkip
wl

Again, you can edit this file in your favorite text editor or with the echo command:

# vim /etc/modules

Or:

# gedit /etc/modules

Or:

# echo "ieee80211_crypt_tkip" >> /etc/modules
# echo "wl" >> /etc/modules

Now that we've got the wireless adapter working and loading on system start up, the next thing you may notice is that the wireless adapter does not work after resuming from suspend. There is a pretty easy fix for this. We are going to create a file that will tell the system how to deal with the wireless adapter on suspend. It doesn't really matter what you name this file, as long as it is located in /etc/pm/config.d/ you're ok. I followed a convention that you may notice in other Linux system folders and named my file 01-modules. The file needs to contain the following text:

SUSPEND_MODULES="wl"

You can create this file with your favorite text editor or with the echo command:

# vim /etc/pm/config.d/01-modules

Or:

# gedit /etc/pm/config.d/01-modules

Or:

# echo "SUSPEND_MODULES=\"wl\"" > /etc/pm/config.d/01-modules

Now that you've got that file created, your wireless adapter should be working whenever you boot up your Mini 9 and when you resume from standby.

Next time we'll get the audio working on the Mini 9