Tuesday, May 10, 2011

Installing Broadcom 43xx Wireless Drivers after Kernel Update in fedora

Broadcom Logo

After a kernel update in Toshiba Satellite laptops which are running on fedora may lose the wireless network capability which is based on Broadcom chips. Even drivers are available from RPMFusion repo, it will take couple of days to update drivers with newly released kernel. Best option is compling the driver as following steps which gives wireless capability instantly.

Step 1:
Run 'lspci | grep -i broadcom' in terminal to make sure wireless hardware is there.
[kasun@katalyst ~]$ lspci | grep -i broadcom
02:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g LP-PHY (rev 01)
[kasun@katalyst ~]$
As in this example it is BCM 4313


Step 2:
Run 'uname -m' on the terminal and get the system architecture to know whether it is 32 bit or 64 bit.

Step 3:
Remove any previous installed wireless drivers if something shows after run this command in terminal as root.
lsmod  | grep "b43\|ssb\|wl

If any of these are installed, remove them:

rmmod b43
rmmod ssb
rmmod wl

To blacklist these drivers and prevent them from loading in the future:
echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf

Step 4:
Download the driver source from as match to system architecture (32 bit or 64 bit)
http://www.broadcom.com/support/802.11/linux_sta.php

Step 5:
Install gcc, kernel-headers and kernel-devel package if you not installed. Use
yum install kernel-headers
yum install kernel-devel
in terminal as root to install these.

Step 6:
Un tar the archive.
[root@katalyst wget]# wget http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_64-v5_100_82_38.tar.gz
--2011-05-10 17:32:53--  http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_64-v5_100_82_38.tar.gz
Resolving www.broadcom.com... 208.70.88.55
Connecting to www.broadcom.com|208.70.88.55|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1150253 (1.1M) [application/x-gzip]
Saving to: “hybrid-portsrc_x86_64-v5_100_82_38.tar.gz”

100%[===================================================>] 1,150,253    291K/s   in 4.9s    

2011-05-10 17:32:59 (228 KB/s) - “hybrid-portsrc_x86_64-v5_100_82_38.tar.gz” saved [1150253/1150253]

[root@katalyst wget]# tar -xvf hybrid-portsrc_x86_64-v5_100_82_38.tar.gz 
Makefile
lib/
lib/wlc_hybrid.o_shipped
lib/LICENSE.txt
src/
src/wl/
src/wl/sys/
src/wl/sys/wl_dbg.h
src/wl/sys/wl_export.h
src/wl/sys/wl_iw.c
src/wl/sys/wl_iw.h
src/wl/sys/wlc_pub.h
src/wl/sys/wl_linux.c
src/wl/sys/wlc_types.h
src/wl/sys/wl_linux.h
src/wl/sys/wlc_key.h
src/include/
src/include/proto/
src/include/proto/802.11.h
src/include/proto/802.1d.h
src/include/proto/bcmeth.h
src/include/proto/bcmevent.h
src/include/proto/ethernet.h
src/include/proto/wpa.h
src/include/packed_section_start.h
src/include/linux_osl.h
src/include/wlioctl.h
src/include/osl.h
src/include/typedefs.h
src/include/packed_section_end.h
src/include/epivers.h
src/include/bcmdefs.h
src/include/bcmutils.h
src/include/bcmcdc.h
src/include/bcmendian.h
src/include/pcicfg.h
src/include/bcmwifi.h
src/include/linuxver.h
src/shared/
src/shared/linux_osl.c
[root@katalyst wget]# 

Step 7: Run make command in a terminal from above files were extracted.
[root@katalyst wget]# make
KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory `/usr/src/kernels/2.6.35.13-91.fc14.x86_64'
  LD      /home/kasun/Downloads/wget/built-in.o
  CC [M]  /home/kasun/Downloads/wget/src/shared/linux_osl.o
  CC [M]  /home/kasun/Downloads/wget/src/wl/sys/wl_linux.o
  CC [M]  /home/kasun/Downloads/wget/src/wl/sys/wl_iw.o
  LD [M]  /home/kasun/Downloads/wget/wl.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: modpost: missing MODULE_LICENSE() in /home/kasun/Downloads/wget/wl.o
see include/linux/module.h for more information
  CC      /home/kasun/Downloads/wget/wl.mod.o
  LD [M]  /home/kasun/Downloads/wget/wl.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.35.13-91.fc14.x86_64'
[root@katalyst wget]# 

Step 8: Run make install.
[root@katalyst wget]# make install
install -D -m 755 wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/wl.ko
[root@katalyst wget]# 

Step 9: Insert compiled kernel module by entering following commands.
modprobe lib80211
insmod wl.ko

[root@katalyst wget]# modprobe lib80211
[root@katalyst wget]# insmod wl.ko
[root@katalyst wget]#

After several minutes wireless connection will be shown in network manager.

Step 10: To load these complied kernel module at boot time enter the following commands.
cp wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
depmod -a
echo modeprobe wl >> /etc/rc.local

[root@katalyst wget]# cp wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
cp: overwrite `/lib/modules/2.6.35.13-91.fc14.x86_64/kernel/drivers/net/wireless/wl.ko'? y
[root@katalyst wget]# depmod -a
[root@katalyst wget]# echo modeprobe wl >> /etc/rc.local

In above Step 10, it might asked overwrite existing wl.ko. In this case enter y.

Books Related Linux Networking

Understanding Linux Network Internals Linux Network Administrator's Guide The Definitive Guide to Linux Network Programming (Expert's Voice)

2 comments:

Unknown said...

[root@localhost wifi]# make
KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory `/usr/src/kernels/2.6.40-4.fc15.x86_64'
/usr/src/kernels/2.6.40-4.fc15.x86_64/arch/x86/Makefile:81: stack protector enabled but no compiler support
make[1]: gcc: Command not found
CC [M] /home/samlabs821/compile/wifi/src/shared/linux_osl.o
/bin/sh: gcc: command not found
make[2]: *** [/home/samlabs821/compile/wifi/src/shared/linux_osl.o] Error 127
make[1]: *** [_module_/home/samlabs821/compile/wifi] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.40-4.fc15.x86_64'
make: *** [all] Error 2


it shows me this error

Unknown said...

You need to install GCC Sam.
Run this as root.
yum install gcc