Thursday, August 4, 2011

Fedora 15 : How to compile a module wl.ko for Acer Aspire 5742 Wireless Broadcom BCM43225 802.11b/g/n

Today I updated my Fedora 15 to the kernel 2.6.40-4.fc15.x86_64.
The update installed also  kmod-wl-, but the /lib/modules/2.6.40-4.fc15.x86_64/extra/wl/wl.ko was missing. Because I could not find a module on available repos (fedora, rpmfusion, livna..) I decided to compile one.

Download source for your architecture, patch and readme file from:

Follow the readme to extract the source files and make sure you have kernel-devel, gcc, make and patch packages installed.

When I tried to compile the module I received an error:

[root@aspire hybrid-portsrc_x86_64-v5_100_82_38]# 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'
[M]  /home/gescape/Downloads/Broadcom/Oryginal/hybrid-portsrc_x86_64-v5_100_82_38/src/wl/sys/wl_linux.o
/home/gescape/Downloads/Broadcom/Oryginal/hybrid-portsrc_x86_64-v5_100_82_38/src/wl/sys/wl_linux.c: In function ‘wl_attach’:
/home/gescape/Downloads/Broadcom/Oryginal/hybrid-portsrc_x86_64-v5_100_82_38/src/wl/sys/wl_linux.c:485:3: error: implicit declaration of function ‘init_MUTEX’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

make[2]: ***
[/home/gescape/Downloads/Broadcom/Oryginal/hybrid-portsrc_x86_64-v5_100_82_38/src/wl/sys/wl_linux.o] Error 1
make[1]: ***
[_module_/home/gescape/Downloads/Broadcom/Oryginal/hybrid-portsrc_x86_64-v5_100_82_38] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.40-4.fc15.x86_64'
make: *** [all] Error 2

I applied the patch to the source:
patch -p1 5_100_82_38.patch
(Add a path to the patch if required and in a different location.)

That let me to compile and install the module.
cp wl.ko /lib/modules/2.6.40-4.fc15.x86_64/extra/wl
insmod wl

No further steps were required. After the reboot the module is loaded and your wireless card should work.

# lsmod | grep wl
wl         2554232  0
lib80211   4999  2 lib80211_crypt_tkip,wl

Note: What I noticed (maybe just an impression), that now when I login the wireless network card is already up and connected to my home network. Before, when using free drivers, I had to wait about 1 minute after login before the card connected with my network. Now it is instantly ready :)