1

The Problem

I've been successfully using a Broadcom 4352 wireless adapter in CentOS 7, using these instructions on how to compile Broadcom's STA driver for Linux in the CentOS wiki.

Since the kernel update for 3.10.0-693 (which I think is 7.4?) came out, I can compile the driver, but I can't get it to work. After installing, it freezes the system:

[root]# depmod $(uname -r)
[root]# sudo modprobe wl
[root]#

After that, mouse input worked for a couple seconds, then everything froze: the clock didn't change, system stopped accepting input of any kind, had to pull the power.

The wl.ko file is here:

$ ls -alZ /lib/modules/3.10.0-693.21.1.el7.x86_64/extra/wl.ko
-rw-r--r--. root root unconfined_u:object_r:modules_object_t:s0 /lib/modules/3.10.0-693.21.1.el7.x86_64/extra/wl.ko

Rebooting doesn't bring up the adapter either, but the system doesn't freeze; it only seems to act as if it doesn't exist. If I subsequently open a terminal and issue the modprobe wl command, it freezes as described above.

Not knowing what else to do, I tried this for fun:

insmod /lib/modules/`uname -r`/extra/wl.ko

Which also froze the system immediately.

I didn't see anything in /var/log/messages from these freeze events - there's almost nothing in the log for those times, though I don't know precisely what I'm looking for.

If I roll back to the previous (3.10.0-514) kernel, for which the driver was installed in a similar manner, I can use my wireless. There is a source-RPM way to install the driver here, but I prefer this simple compile-your-own method and would appreciate tips how to debug this.

Should I do something like strace modprobe wl > /tmp/modprobe_log?


How I Installed The Driver

This may be redundant, but the instructions on the CentOS wiki page are out of control (they need separate sections for each point release IMO), so to clarify what I did and possibly help some other hapless soul, here is what I understand they recommend for 7.4 kernels:

yum install kernel-devel kernel-headers gcc
tar xzf hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
patch -p1 < wl-kmod-fix-ioctl-handling.patch
patch -p1 < wl-kmod-kernel_4.7_IEEE80211_BAND_to_NL80211_BAND.patch
sed -i 's/ >= KERNEL_VERSION(3, 11, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c
sed -i 's/ >= KERNEL_VERSION(3, 15, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c
sed -i 's/ < KERNEL_VERSION(3, 18, 0)/ < KERNEL_VERSION(3, 9, 0)/' src/wl/sys/wl_cfg80211_hybrid.c
sed -i 's/ >= KERNEL_VERSION(4, 0, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c
sed -i 's/ < KERNEL_VERSION(4,2,0)/ < KERNEL_VERSION(3, 9, 0)/' src/wl/sys/wl_cfg80211_hybrid.c
sed -i 's/ >= KERNEL_VERSION(4, 7, 0)/ >= KERNEL_VERSION(3, 10, 0)/' src/wl/sys/wl_cfg80211_hybrid.c
make -C /lib/modules/`uname -r`/build/ M=`pwd`
strip --strip-debug wl.ko
cp -vi wl.ko /lib/modules/`uname -r`/extra/

Create file /etc/modprobe.d/blacklist.conf:

blacklist bcm43xx
blacklist b43
blacklist b43legacy
blacklist bcma
blacklist brcmsmac
blacklist ssb
blacklist ndiswrapper

Create file /etc/sysconfig/modules/kmod-wl.modules

#!/bin/bash
for M in lib80211 cfg80211 wl; do
    modprobe $M &>/dev/null
done

chown root:root /etc/sysconfig/modules/kmod-wl.modules
chmod 744 /etc/sysconfig/modules/kmod-wl.modules

Oh, and it looks like Broadcom has changed around the location of the STA driver. It hasn't been updated in a few years, so I used the one I already have but I think it can be downloaded here. The patches can be downloaded from the above-linked CentOS wiki page.

In case seeing patch and compilation output is helpful, here it is:

$ patch -p1 < wl-kmod-fix-ioctl-handling.patch
patching file src/wl/sys/wl_cfg80211_hybrid.c
Hunk #1 succeeded at 1467 (offset 17 lines).
patching file src/wl/sys/wl_linux.c
Hunk #1 succeeded at 1659 (offset 8 lines).

$ patch -p1 < wl-kmod-kernel_4.7_IEEE80211_BAND_to_NL80211_BAND.patch
patching file src/wl/sys/wl_cfg80211_hybrid.c
Hunk #6 succeeded at 1911 (offset 3 lines).
Hunk #7 succeeded at 2040 (offset 3 lines).
Hunk #8 succeeded at 2160 (offset 3 lines).
Hunk #9 succeeded at 2298 (offset 3 lines).
Hunk #10 succeeded at 2941 (offset 3 lines).

<sed commands ran with no errors>

$ make -C /lib/modules/`uname -r`/build/ M=`pwd`
make: Entering directory `/usr/src/kernels/3.10.0-693.21.1.el7.x86_64'
CFG80211 API is prefered for this kernel version
Using CFG80211 API
  LD      /usr/local/src/hybrid-wl/built-in.o
  CC [M]  /usr/local/src/hybrid-wl/src/shared/linux_osl.o
  CC [M]  /usr/local/src/hybrid-wl/src/wl/sys/wl_linux.o
  CC [M]  /usr/local/src/hybrid-wl/src/wl/sys/wl_iw.o
  CC [M]  /usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.o
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1834:2: warning: initialization from incompatible pointer type [enabled by default]
  .get_station = wl_cfg80211_get_station,
  ^
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1834:2: warning: (near initialization for ‘wl_cfg80211_ops.get_station’) [enabled by default]
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_bss_connect_done’:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2446:3: warning: passing argument 2 of ‘cfg80211_scan_done’ makes pointer from integer without a cast [enabled by default]
   cfg80211_scan_done(wl->scan_request, true);
   ^
In file included from /usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:33:0:
include/net/cfg80211.h:4496:6: note: expected ‘struct cfg80211_scan_info *’ but argument is of type ‘int’
 void cfg80211_scan_done(struct cfg80211_scan_request *request,
      ^
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_cfg80211_down’:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2976:3: warning: passing argument 2 of ‘cfg80211_scan_done’ makes pointer from integer without a cast [enabled by default]
   cfg80211_scan_done(wl->scan_request, true);
   ^
In file included from /usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:33:0:
include/net/cfg80211.h:4496:6: note: expected ‘struct cfg80211_scan_info *’ but argument is of type ‘int’
 void cfg80211_scan_done(struct cfg80211_scan_request *request,
      ^
  LD [M]  /usr/local/src/hybrid-wl/wl.o
  Building modules, stage 2.
CFG80211 API is prefered for this kernel version
Using CFG80211 API
  MODPOST 1 modules
  CC      /usr/local/src/hybrid-wl/wl.mod.o
  LD [M]  /usr/local/src/hybrid-wl/wl.ko
make: Leaving directory `/usr/src/kernels/3.10.0-693.21.1.el7.x86_64'
  • Link about source RPM isn't work. – Yurij Goncharuk Mar 17 '18 at 22:33
0

I'm not sure but Red Hat could changed something in new kernel release even between one release (in another build).

I had some issue when update from 7.2 to 7.3 (kernel release is still one, but build is different): driver that our company developed wasn't compiled (API was changed). I ask about this to Red Hat bugzilla tracker and get this answer:

"Because we as RedHat only guarantee the ABI remains constant, not the API, and as such, so does centos. If you are compiling your own out of tree module, you will need to keep up with any api changes in the kernel you are compiling against. Alternatively you can have your out of tree code merged with the upstream kernel, and that work will be handled on your behalf whenever an api change is made."

In another words, if out of tree module isn't compiled or not worked against new kernel release, then it's customer side task. I know that answer was about API, but who can guaranty about another changes.

I think that some of the patches is not adopted to the new kernel build. Also, you can post this question to Red Hat bugzilla tracker. I not recommend ask in Centos tracker, because (in kernel/module questions) they more likely redirect to Red Hat tracker.


About source RPM (RPM-s). This is more preferred way that keeps your environment clean. Also, you can adopt source to DKMS package and you will not have routine with build new modules for recent version of kernel.

  • How does srpm keep environment clean? The instructions provided (link fixed) require a massive number of development libraries installed in a non-development environment just to build the srpm. What do you mean by clean and how is a hand-compiled driver dirty in your opinion? Do you know where I can learn about DKMS solution for this particular driver? Thanks! – myday Mar 17 '18 at 23:03
  • About DKMS: you need prepare DKMS-tarball from sources (it's not difficult but need some little time for understanding) and put it in DKMS manager. Manager works as system service and check if the kernel release was changed. If it's true, then it recompile and load module by itself during the boot. It's very powerful tool for third party drivers - github.com/dell/dkms. Some companies (such NVIDIA) propose drivers in dkms-ready tarballs to download. – Yurij Goncharuk Mar 17 '18 at 23:27
  • About source RPM (RPM-s): I mean that keep clean from system opinion. Yes, you've installed such couple of development packages, but you prepare RPM in several minutes and this routine will be automatised (it's convenient for you). When you have RPM-package you don't need to put files (modules and rules) of driver by hand to system places and therefore you don't need to remember where installed components are located. All as you need is remove RPM-package that contains driver, compile over rpmbuld (it's take just several seconds) and install new RPM. – Yurij Goncharuk Mar 17 '18 at 23:38
0

All of this is seriously bad version of the centos kernel which says its 3.10 or whatever but behaves like 4.15 at times.

I have put up a repo at https://github.com/rohitggarg/broadcom-sta which has working wifi driver for centos 7.5 x64 machine. I use it on my laptop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.