openSUSE 13.2 and Broadcom BCM43228 wireless: Driver woes in the Linux world

openSUSE 13.2 arrived in the beginning of November 2014. I was a bit too busy to try it. I found some free time yesterday and utilized it to install openSUSE on my workstation.

My workstation is a Dell Optiplex 9020 with i7-4770 CPU, 32 GB RAM and Broadcom BCM43228 based Dell 1540 wireless module. I managed to avoid the Microsoft Windows tax because Dell was savvy enough to ship me a machine with Linux (Ubuntu) preinstalled.

The driver for the said wireless module was already available in Ubuntu. So, when I received the machine everything was working like clockwork. I wanted to remove Ubuntu but I also wanted to avoid hunting down the drivers in the World Wide Web. Disappointingly, openSUSE did not have the driver binary in its repositories. I tried Manjaro as it was the only other distro that boasted of precompiled binaries for Broadcom BCM43228. Manjaro did not disappoint me.

For some reason, I like openSUSE more than all the other distros. I really do not know why. So, I decided to do whatever it would take to get openSUSE working on my workstation.

I searched and found that Broadcom provides the source code for the following modules:

BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware

Make sure that your device is in the above list. To detect the device ID, do the following:

sudo lspci | grep "Broad"
 04:00.0 Network controller: Broadcom Corporation BCM43228 802.11a/b/g/n

To build any kernel module, the following packages are necessary. I had downloaded them earlier to compile the vbox driver for Virtualbox:

sudo zypper in kernel-devel gcc make

I downloaded the 64-bit version of the source. The README.txt (available for download on the Broadcom website) is an utterly important document. Read that carefully.

I started the compilation and found some errors:

<path to the extracted source>/src/wl/sys/wl_cfg80211_hybrid.c:2074:4: error: too few arguments to function ‘cfg80211_ibss_joined’ cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);

There is a solution to this problem. Look for the following file in the extracted Broadcom source code:

<path to the extracted source>src/wl/sys/wl_cfg80211_hybrid.c

Now, look for the following line:


cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);

Replace the above line with the following piece of code:


#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, &wl->conf->channel, GFP_KERNEL);
#else
cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);
#endif

Evidently, the Kernel API has changed and the code is not compatible with it. Compile again.

It worked fine for me and I had a driver ready to be deployed in quick time.

I just hope Broadcom fixes this issue and releases the updated code.

Further Reading:

How to load the wl.ko driver

Advertisements

9 comments

  1. Pingback: openSUSE 13.2: Day 1 troubles and troubleshooting – VLC, wireless etcetera | The Autodidactic Hacker

    • I do not think the pkg was there when I wrote this post 🙂
      Also, modprobe does not work unless all dependencies are met and needs the driver to be placed in a particular directory hierarchy etcetera. So to load without dependency and path matching, insmod needs to be used – insmod ./wl.ko should work.
      I created a bash script with the following lines. This solves all my issues.:

      #!/bin/bash

      rmmod bcma
      modprobe lib80211
      modprobe cfg80211
      insmod ./wl.ko

      The rmmod bcma and loading of lib80211 and cfg80211 modules are mentioned in the ReadMe.txt as dependencies. This script can be run at startup too!

      Regards
      msiyer 🙂

      Like

  2. msiyer,
    What can I say… after updating my openSUSE 13.2 yesterday, my Broadcom BCM43228 stopped working. Tried re-installing the broadcom-wl package more than two times with no success.
    I found the source drivers but they did not compile…
    Followed your instructions and … Voila!!! Started working.
    I would really like to thank you for your excellent explanation and great work.
    Armando

    Like


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s