`
ShadowHawk
  • 浏览: 5514 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

CentOS 7 安装Broadcom无线网卡

阅读更多

来源:https://wiki.centos.org/HowTos/Laptops/Wireless/Broadcom

 

Broadcom Corporation Based Wireless NICs 

 

BCM4311, BCM4312, BCM4313, BCM4321, BCM4322,

BCM43224, BCM43225, BCM43227 and BCM43228

 

 

 These chipsets are not natively supported by CentOS.

 

  • NOTE: This manual is primarily intended for EL6 and EL7. If you are running EL 5, 6, or 7, instead of compilation, you can opt to build your own kABI-compatible binary RPM package of the driver which is reusable after kernel updates. For more info, please refer to ELRepo kmod-wl page. Also, it's been reported that the this driver doesn't work with all chips, so kindly provide feedback on your experiences with Broadcom Wireless, so this manual can be kept up to date and further improved.
  • NOTE: Due to an excessively restrictive license accompanying this Broadcom driver, the ELRepo repository developers have refrained from supplying it via an rpm package - hence this manual was created with the purpose of providing a single comprehenssive driver installation manual.
  •  NOTE: This manual is based on CentOS 6 and tested with Broadcom BCM4313 (Vendor/DeviceID 14e4:4727). Previous Wiki version was written for CentOS 5 and Broadcom BCM4311/4312 chips have been tested on it.
  •  NOTE: Please note that driver compilation was tested only on latest kernel version 2.6.32-573.7.1.el6.x86_64 shipped with CentOS 6.7, wl driver version 6.30.223.271 (latest). With that in mind, also note that some sections, such as Appendix A, and RHEL 7 driver compilation may apply only to the previous driver version, and older kernel versions (pre-CentOS 6.7).

 

In order to install Broadcom BCM4311, BCM4312, BCM4313, BCM4321 or BCM4322, BCM43224, BCM43225, BCM43227, or BCM43228 based wireless network cards, the next steps should be followed:

 

Step 1: Determining WLAN chip and installing dependencies

First of all, make sure you are the "proud owner of Broadcom BCM43xx wireless card":

[user@host ~]$ /sbin/lspci | grep Broadcom
0b:00.0 Network controller: Broadcom Corporation BCM4312 802.11a/b/g (rev 01)

After the WLAN chip model was determined, make sure you have no missing packages needed at compile-time and install them if you do:

[root@host ~]# yum install kernel-headers kernel-devel gcc

Of course, if you're compiling the driver for Xen kernel (i.e. kernel-xen), you should install kernel-xen-devel instead of kernel-devel.

 

Step 2: Downloading and extracting Broadcom driver archive

Download the Broadcom BCM43xx linux driver archive from Broadcom Official website to your machine and extract it to /usr/local/src/hybrid-wl and feel free to change the ownership of the directory and it's contents to some unprivileged user

[root@host ~]# mkdir -p /usr/local/src/hybrid-wl
[root@host hybrid-wl]# cd /usr/local/src/hybrid-wl
[root@host hybrid-wl]# tar xvfz /path/to/the/tarball/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
[root@host hybrid-wl]# chown -R someuser.somegroup /usr/local/src/hybrid-wl

NOTE: Why not extract it to arbitrary location and leave the ownership it is?
Well, this way the driver module sources remain on the system - where you left them - so you can build the driver module whenever you want (e.g. in case you upgrade the kernel - since driver modules are always compiled for a particular kernel), plus, you can do this as an unprivileged user!

 

Step 3a: Compiling the Broadcom driver module (on EL6 and EL7)

Driver module can be compiled as follows:

[user@host hybrid-wl]$ make -C /lib/modules/`uname -r`/build/ M=`pwd`

In my case I just ran:

[user@host hybrid-wl]$ make
 Mind the quotes (i.e. back quotes).

Now, with the current driver (version 6.30.223.271) it's almost certain you'll get an error message instead of compiled driver module (in fact, different scenario other that this error message is unknown to the author). The message might/will vary depending on the kernel and OS version, but on CentOS 6 it should look something like this:

make: Entering directory `/usr/src/kernels/2.6.32-573.7.1.el6.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:83: warning: ‘enum tx_power_setting’ declared inside parameter list
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:83: warning: its scope is only this definition or declaration, <snip>
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_cfg80211_join_ibss’:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:730: error: ‘struct cfg80211_ibss_params’ has no member named ‘channel’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: At top level:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1096: warning: ‘enum tx_power_setting’ declared inside parameter list
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1096: error: parameter 2 (‘type’) has incomplete type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_cfg80211_set_tx_power’:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1107: error: ‘TX_POWER_AUTOMATIC’ undeclared (first use in this <snip>
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1107: error: (Each undeclared identifier is reported only once
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1107: error: for each function it appears in.)
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1109: error: ‘TX_POWER_LIMITED’ undeclared (first use in this function)
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1115: error: ‘TX_POWER_FIXED’ undeclared (first use in this function)
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: At top level:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1774: warning: initialization from incompatible pointer type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1779: warning: initialization from incompatible pointer type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1780: warning: initialization from incompatible pointer type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1781: warning: initialization from incompatible pointer type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1782: warning: initialization from incompatible pointer type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1783: warning: initialization from incompatible pointer type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1784: warning: initialization from incompatible pointer type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1789: warning: initialization from incompatible pointer type
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_inform_single_bss’:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:1984: error: too few arguments to function <snip>
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2023: warning: passing argument 1 of ‘cfg80211_put_bss’ from <snip> 
include/net/cfg80211.h:3380: note: expected ‘struct wiphy *’ but argument is of type ‘struct cfg80211_bss *’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2023: error: too few arguments to function ‘cfg80211_put_bss’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_update_bss_info’:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2276: error: ‘struct cfg80211_bss’ has no member named <snip>
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2277: error: ‘struct cfg80211_bss’ has no member named <snip>
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2283: warning: passing argument 1 of ‘cfg80211_put_bss’ from <snip>
include/net/cfg80211.h:3380: note: expected ‘struct wiphy *’ but argument is of type ‘struct cfg80211_bss *’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2283: error: too few arguments to function ‘cfg80211_put_bss’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_bss_roaming_done’:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2322: warning: passing argument 2 of ‘cfg80211_roamed’ from <snip>
include/net/cfg80211.h:3726: note: expected ‘struct ieee80211_channel *’ but argument is of type ‘u8 *’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2322: warning: passing argument 4 of ‘cfg80211_roamed’ makes <snip>
include/net/cfg80211.h:3726: note: expected ‘const u8 *’ but argument is of type ‘s32’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2322: warning: passing argument 5 of ‘cfg80211_roamed’ makes <snip>
include/net/cfg80211.h:3726: note: expected ‘size_t’ but argument is of type ‘u8 *’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2322: warning: passing argument 6 of ‘cfg80211_roamed’ makes <snip>
include/net/cfg80211.h:3726: note: expected ‘const u8 *’ but argument is of type ‘s32’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2322: error: too few arguments to function ‘cfg80211_roamed’
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_update_wowl’:
/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.c:2791: warning: unused variable ‘wdev’
make[1]: *** [/usr/local/src/hybrid-wl/src/wl/sys/wl_cfg80211_hybrid.o] Error 1
make: *** [_module_/usr/local/src/hybrid-wl] Error 2
make: Leaving directory `/usr/src/kernels/2.6.32-573.7.1.el6.x86_64'

 

NOTE: This is where the instructions for EL6 and EL7 differ. So, for EL6, you should follow through step 3a, while for EL7, you need to apply only the patches from both steps 3a and 3b, and compile it as shown in this step (3a). So yes, for EL7, skip the 'sed' commands.

On EL6, the driver won't compile because of the if-then-else clause for kernel version checking in file wl_cfg80211_hybrid.c. To remedy this, we'll run the following two commands:

 

[user@host hybrid-wl]$ sed -i 's/[ >][>=] KERNEL_VERSION(2, 6, 3.)/>= KERNEL_VERSION(2, 6, 32)/' src/wl/sys/wl_cfg80211_hybrid.c
[user@host hybrid-wl]$ sed -i 's/[ >][>=] KERNEL_VERSION(3, ., .)/>= KERNEL_VERSION(2, 6, 32)/' src/wl/sys/wl_cfg80211_hybrid.c
[user@host hybrid-wl]$ sed -i 's/[ >][>=] KERNEL_VERSION(3, 11, .)/>= KERNEL_VERSION(2, 6, 32)/' src/wl/sys/wl_cfg80211_hybrid.c
[user@host hybrid-wl]$ sed -i 's/< KERNEL_VERSION(3, 18, .)/< KERNEL_VERSION(2, 6, 30)/' src/wl/sys/wl_cfg80211_hybrid.c
[user@host hybrid-wl]$ sed -i 's/[ >][>=] KERNEL_VERSION(3, 15, .)/>= KERNEL_VERSION(2, 6, 32)/' src/wl/sys/wl_cfg80211_hybrid.c

Just these 'sed' replacements are not enough to ensure proper driver compilation. So, we also need to apply the following patch wl-kmod-fix-ioctl-handling.patch prior to actually compiling the driver. Download it to /usr/local/src and run the following command to patch the driver source code:

 

[user@host hybrid-wl]$ 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).

 

Now, try compiling the driver module again:

[user@host hybrid-wl]$ make -C /lib/modules/`uname -r`/build/ M=`pwd`

and the compile output should look something like this:

 

make: Entering directory `/usr/src/kernels/2.6.32-573.7.1.el6.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:1802: warning: initialization from incompatible pointer type
  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.unsigned
  NO SIGN [M] /usr/local/src/hybrid-wl/wl.ko
make: Leaving directory `/usr/src/kernels/2.6.32-573.7.1.el6.x86_64'

The module, once built, can be stripped of unnecessary symbols:

 

[user@host hybrid-wl]$ strip --strip-debug wl.ko

What you will notice, is that driver module file size reduces (from 8.2MB to 7.2MB). And yes, your driver module works ;-)

 

Step 3b: Compiling the Broadcom driver module (specifics required for EL7)

If you're running EL7, you won't need to run the 'sed' commands from the previous step, however, you will need to apply this one additional patch wl-kmod-rhel7_1.patch (along with the one from step 3a):

 

[user@host hybrid-wl]$ patch -p1 < ../wl-kmod-rhel7_1.patch
patching file src/wl/sys/wl_cfg80211_hybrid.c
Hunk #1 succeeded at 1801 (offset -3 lines).
Hunk #2 succeeded at 1867 (offset -3 lines).
Hunk #3 succeeded at 2071 (offset -3 lines).
Hunk #4 succeeded at 2804 (offset -3 lines).
 In my case, the above patch failed for Hunk #3, so I manually modified ./src/wl/sys/wl_cfg80211_hybrid.c
Replace: 
cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);
 with
cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid,
#if RHEL_MAJOR == 7 && RHEL_MINOR == 1
				&wl->conf->channel,
#endif
				GFP_KERNEL);
 
After applying this patch, just follow through the reminder of step 3a - compile the driver, and strip debugging info from it. Applying these two patches alone made the driver module compile, and reportedly, it works as such.

 

Step 4a: Loading the driver module into kernel

Having successfully compiled the driver module, you can now load it into kernel, and eventually set up automatic driver load on system boot (to do all this, you'll have to assume root privileges). Of course, driver module loading can be done only after you remove the existing/conflicting wireless driver modules from kernel (in case these are loaded):

 

[root@host ~]# modprobe -r bcm43xx
[root@host ~]# modprobe -r b43
[root@host ~]# modprobe -r b43legacy
[root@host ~]# modprobe -r ssb
[root@host ~]# modprobe -r bcma
[root@host ~]# modprobe -r brcmsmac
[root@host ~]# modprobe -r ndiswrapper

copy the driver module file to a location where kernel can find it:

 

[root@host hybrid-wl]# cp -vi /usr/local/src/hybrid-wl/wl.ko /lib/modules/`uname -r`/extra/

to be consistent with all other external modules that have been / may be installed from a kmod packages (e.g. fuse, ntfs-3g, etc.)

Next, run:

 

[root@host ~]# depmod $(uname -r)

in order to create a list of module dependencies, and now load the driver module:

 

[root@host hybrid-wl]# modprobe wl

If no error was reported, the driver module is now successfully loaded and ready to use. The 'ndiswrapper' kernel module can be removed, provided you don't use it for anything else but wireless driver - but this is not necessary.

 

Step 4b: Loading the driver module into kernel on boot time

Couple of more steps are needed to get your module load every time the system boots. First, edit the /etc/modprobe.d/blacklist.conf file adding the lines:

 

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

By doing so, you're preventing these modules from being loaded into kernel at boot time and conflicting with the wl module. Second, in order to load the wl module into the kernel on boot time, create/edit the file /etc/sysconfig/modules/kmod-wl.modules and copy-paste the following contents into it:

 

#!/bin/bash

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

 

 

Your driver should now load every time you reboot (except of course, when you install the new kernel, in which case the driver has to be re-compiled for it following these same steps). 

 

 

分享到:
评论

相关推荐

    Broadcom官方 CentOS7 64位无线网卡驱动,带一键安装脚本,自动编译和安装,解决make过程中的错误

    Broadcom官方的CentOS7 64位无线网卡驱动,带一键安装脚本,可自动编译和安装。官方下载下来的脚本直接make编译可能会报各种错误,这个资源里面附带一个一键安装脚本,可自动解决这些错误并安装。适用于Broadcom的 ...

    BCM4322(DW1510)无线网卡在CentOS7.4下的驱动

    CentOS7.4下BCM4322(DW1510)无线网卡的驱动源码。编译前安装依赖包: # yum install kernel-headers-`uname -r` kernel-devel-`uname -r` gcc 由于kernel 3.10以后去掉了部分兼容设置,从博通官网下载的驱动需要...

    无线网卡自动检测安装

    无线网卡的常见类型包括Intel、Realtek、Broadcom和Qualcomm等品牌,每种都有各自的驱动更新周期和特性。神舟电脑的无线网卡驱动自动安装工具需要与这些供应商的驱动库保持同步,以提供最新、最安全的驱动版本。 ...

    centos7系统上网设置教程.docx

    如果是无线网卡,选择“Broadcom 802.11n Network”;如果是有线网卡,选择“Realtek PCIe Controller”。如下图所示: 在虚拟机中,需要修改系统的网络配置文件。使用 Vim 编辑器打开 ifcfg-ens33 文件,添加以下...

    Linux 下无线网卡BCM4313驱动

    本文将深入探讨如何解决Linux下无线网卡Broadcom Corporation BCM4313 802.11bgn型号的驱动问题。 BCM4313是一款广泛使用的无线网络适配器,支持802.11b/g/n无线标准,提供高速无线连接。然而,在某些Linux发行版中...

    Centos5.6安装、java环境配置、驱动安装

    在本文中,我们将详细探讨如何在CentOS 5.6上进行系统安装、配置Java开发环境以及安装特定硬件驱动,特别是针对联想G460笔记本电脑的802.11无线网卡驱动和显卡驱动。以下是每一步的详细说明: 1. **CentOS 5.6安装*...

    BCM4322在CentOS 7驱动程序

    CentOS7.4下编译测试通过。改进了程序并增加了安装说明。 # cat README 1、以root身份执行如下语句安装依赖: yum install kernel-headers-`uname -r` kernel-devel-`uname -r` gcc 2、执行install.sh脚本编译、...

    linux下BCM43xx驱动安装方法

    本文将详细介绍如何在Linux环境下安装Broadcom BCM43xx系列无线网卡的驱动程序。 #### 支持的内核版本与限制 本方法适用于内核版本2.6.24以上的Linux发行版,部分Red Hat系统可能不适用。此外,该教程主要针对...

    Linux上安装无线网卡完美方案

    在Linux系统中,安装无线网卡可能涉及到一系列的步骤,因为不同的无线网卡可能需要不同的驱动程序和支持。本文将提供一个全面的方案,确保在Linux上成功安装无线网卡。 首先,了解你的无线网卡型号至关重要。在终端...

    博通 BCM4312 linux驱动

    7. **验证驱动**:安装完成后,你可以通过`iwconfig`或`ip link`命令检查无线网卡是否已被识别并启用。 值得注意的是,现代的Linux发行版通常包含了对BCM4312的支持,你可能不需要手动编译驱动。例如,Ubuntu和...

    BCM43142官方驱动文件

    总之,对于使用博通BCM43142无线网卡的CentOS 7用户来说,确保安装并正确配置官方驱动是保持无线网络连接的关键。遵循提供的安装说明,可以有效地解决可能的无线网络问题,享受无缝的上网体验。

    brcmfmacb.rar

    描述虽然简单,但我们可以推断出这个压缩包可能是一个针对树莓派4 Model B的无线网卡驱动更新或者安装指南。"brcmfmac43455-sdio.raspberrypi,4-model-b.txt" 这个文件名表明它是一个特定于树莓派4 Model B的SDIO...

    hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz

    描述中提到的博通网卡驱动是针对BCM43142型号的,这是一款常见的无线局域网(WLAN)和蓝牙芯片,广泛应用于笔记本电脑和平板电脑中。这个驱动程序是为了使操作系统能够识别和有效通信与该硬件。 在标签中,“博通...

Global site tag (gtag.js) - Google Analytics