Andrew J. Nelson
Published: 21 July 2011
The Broadcom BCM43XX wireless networking card has proven to be as troublesome to use with Slackware as it is prevalent in many popular laptop models. This article provides a step by step guide on how to get your wireless up and running on a laptop with a BCM43XX wireless card running Slackware Linux. We will try to provide detailed information on why we do what we do, and link to references for more information if the reader wants to explore a specific topic in depth.
You will, ofcourse, need a laptop with a BCM43XX card that has Slackware installed on it. A fresh install of the OS is preferred. A working knowledge of the Slackware BASH (or another shell) environment will be a big help. Commands that are specific to the process will be explained, but general navigation and working commands will not be. This method was developed from using a Dell Latitude E5500 with Slackware 13.1 (32 bit) installed on it. Make sure Slackware is fully updated. (This article tells you how to update Slackware with Slackpkg.
The first step is to make sure that the card you are running is actually a Broadcom BCM43XX. You may be sure, but lets make really sure by running lspci -v from the shell. LSPCI lists all PCI devices on your computer. The switch v requests verbosity in the reporting.
There will be a fairly long output. Scroll through it, looking for something that looks like the output in the screenshot to the right, where the first line reads, "Network Controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless Lan Controller". If you see that, you know that you have the card.
Presuming that you see the card in your output, we can move on to the next step of installing the driver.
The first step is to create a directory to work in with the new driver. Where to do this is a personal choice; I use /usr/local/src. We will create a directory here called hybrid_wl.
We need to obtain the driver next. Download the driver from the Broadcom website to /usr/local/src/hybrid_wl. After downloading the driver, we need to extract it. (Make sure that you get the appropriate version, either 32 or 64 bit.)
tar -xzf hybrid-portsrc_x86_32-v5_100_82_38.tar.gz
We will build the driver as a loadable kernel module (lkm). We do this with the the "make clean" and "make" commands. The "make clean" command deletes any executable files and all object files that could be left over from a prior execution of "make". Running "make" then determines automatically which pieces of a large program need to be recompiled, and issues the command to recompile them.
In essence, "make clean" ensures we have a fresh starting point for building the driver, and "make" builds the driver. After running the commands, a file called "wl.ko" will appear at the top of the wl_hybrid directory. This is the driver. The .ko indicates it is a "kernel object", which is the new terminology for the .lkm for kernel 2.6 and up.
Before we load the driver into the kernel, we need to make sure that no other driver will conflict with it, and that it has a security module to work with. To find conflicting modules, we will use the lsmod command, which lists all the loaded kernel modules. The modules that can conflict are "b43", "ssb", and "wl".
Check out the screenshot to the right for an example of the output from running the command. The command example is shown below. You can see from the screenshot that on my system I had "b43" and "ssb" loaded. The next step in the process is to unload those modules.
lsmod | grep "b43\|ssb\|wl"
To unload the conflicting modules, we use the rmmod command, which is "a simple program to remove a module from the Linux kernel". The shell commands below are specific to my example; you may need to remove more or fewer modules.
To borrow a phrase from object oriented programming, removing the modules only does so from this instantiation of the kernel. To prevent them from being loaded the next time the system reboots, we need to blacklist them. We do this by adding them to the blacklist.conf located in /etc/modprobe.d.
Open /etc/modprobe.d/blacklist.conf with your favorite text editor (I like pico- don't hate me vi lovers!). Add the following lines to the end of the file. Once again, this is specific to my example. You may have to blacklist more or fewer modules depending upon the output of your lsmod.
The last step in this section is to make sure that the driver has a security module to work with. To do this, we use modprobe to add the security modules. Try both of these commands:
Those are the two prevalent security modules, with the first being the newest and most common. If both commands return "FATAL: Module not found", you will need to install a security module. It is fine for one of the two to do so, but not both.
We want to first load the module, make sure it works, and then set things up so that it loads at boot every time. To first load the module, we use insmod, which is "a simple program to insert a module into the Linux Kernel". Still at the top of /wl_hybrid:
That should insert the module. To test that it is functioning, we can run iwconfig, which will display your wireless adapaters. If everything has gone correctly, a new wireless adapter should be seen in the output which was not there before. Check out the screenshot to the left for an example of this output.
Now that we have confirmed that the module successfully loads, we need to set it up so that it will do so at boot. First, we need to copy the driver wl.ko into the directory where kernel objects are kept. From /wl_hybrid:
cp wl.ko /lib/modules/`uname -r`/kernel/net/wireless
Lets talk about that copy command for a minute, because there are a couple things to point out. First, in the middle of the target path you will notice `uname -r`. The leading and trailing symbols are backticks, not single quotes. A backtick tells the shell to execute a system command, which in this case is uname -r. The uname -r command prints the current kernel version. Because /lib/modules/ can contain multiple kernels, it could be difficult to know which kernel path to follow to insert the module into. By using uname -r, we guarantee that we will follow the path to the current kernel.
Now that the module is located in its new home, we will remove the copy in /wl_hybrid from the kernel, once again with rmmod.
Ok, so we have a driver which we know works stored in the place that kernel modules belong. We need to build dependencies for that object, then start the module. To build the dependencies, we use depmod -a, which examines the modules and exports their dependencies to modules.dep. Then we activate the module with modprobe.
So, why did we use insmod to activate the module the first time and modprobe the second time? Insmod activates a specified module without settings or dependencies. Modprobe is used to activate a module which has dependencies; as well, modprobe will only activate modules located in certain directories. Insmod can operate on a module no matter where it is located, such as the directory we created for this exercise.
We are almost there. The final step is to make sure the kernel object (wl.ko) loads at boot time. We do this by editing /etc/rc.d/rc.local. The rc.local file is the initialization script; any commands appended to it will run at system boot. Add this line to the end of the file:
The driver is now fully functional and automated. The final step in our process is using it!
I am a Slacker. I like Slackware because I can do so much from the command line and from config files. But, wireless configuration escapes me. It is easier to work with httpd.conf or php.ini than try to figure out wireless configuration for Slackware. I do like it when a GUI tool does what it is supposed to do and does it quickly and well.
The WICD network manager is such a tool. It makes wireless networking with Slackware simple, easy, and quick. By default, wicd is shipped with Slackware in /extra. We can install it with using slackpkg. (If you haven't used slackpkg before, you can reference the Webgnuru Slackpkg How To as a starting point.)
slackpkg install wicd
Once wicd is installed, it is simply a matter of opening it from your desktop environment, selecting the wireless network you want to connect to and joining it. If the network is secured, click properties and enter the password. Voila! Check our the screenshot to the right for an example of what wicd looks like in use.
If you want to try your hand at understanding how to configure your wireless network settings from the shell, a good place to start is at Alienbob's Wireless Networking Page. It is by no means an impossible task, and I have made it work in the past.
I hope this article provides some insight into getting a BCM43XX card to work with Slackware, along with why you do things a certain way. Thanks for sticking with it!
If you have any questions, concerns, suggestions, or constructive criticism, please email me.