热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

CentosRedhat下bcm43142博通无线网卡linux驱动之二

上次通过更换内核实现成功编译驱动无线网卡,但是启动到系统原内核下依然没有bcm43142的驱动,遂准备在原内核下编译驱动,记录一下ps&#

上次通过更换内核实现成功编译驱动无线网卡,但是启动到系统原内核下依然没有bcm43142的驱动,遂准备在原内核下编译驱动,记录一下

ps:更推荐这种方法,避免因更换内核出现其他兼容性问题

1.准备驱动包

hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz
点我下载 密cmet
下载拷贝进u盘,将源码包拷贝至/usr

2.安装工具

安装gccyum install -y gcc,如已安装可跳过
安装内核对应版本的kernel-headers,kerner-devel,本次使用当前系统镜像作为yum源,所以版本也是一致的

[root@king ~]# yum list|grep kernelkernel.x86_64 3.10.0-327.el7 @anaconda/7.2kernel-devel.x86_64 3.10.0-327.el7 @rhel7.2_iso kernel-headers.x86_64 3.10.0-327.el7 @rhel7.2_iso

3.编译源码与安装驱动

复制源码包并解压

[root@king ~]# mkdir -p /usr/local/other/wireless7_2[root@king ~]# cp /usr/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz /usr/local/other/wireless7_2[root@king ~]# cd /usr/local/other/wireless7_2[root@king wireless7_2]# tar zxf hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz[root@king wireless7_2]# lshybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz lib Makefile src

编译

[root@king wireless7_2]# makeKBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`make: *** /lib/modules/3.10.0-327.el7.x86_64/build: No such file or directory. Stop.make: *** [all] Error 2

报错,分析错误原因,发现/lib/modules/3.10.0-327.el7.x86_64/build软链接失效,重做之

ln -s /usr/src/kernels/3.10.0-327.el7.x86_64/ /lib/modules/3.10.0-327.el7.x86_64/build #注意做软链接要写绝对路径

重新编译

[root@king wireless7_2]# make clean && makeKBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd` cleanmake[1]: Entering directory `/usr/src/kernels/3.10.0-327.el7.x86_64'CFG80211 API is prefered for this kernel version/usr/local/other/wireless7_2/Makefile:85: Neither CFG80211 nor Wireless Extension is enabled in kernelCLEAN /usr/local/other/wireless7_2/.tmp_versionsCLEAN /usr/local/other/wireless7_2/Module.symversmake[1]: Leaving directory `/usr/src/kernels/3.10.0-327.el7.x86_64'KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`make[1]: Entering directory `/usr/src/kernels/3.10.0-327.el7.x86_64'CFG80211 API is prefered for this kernel versionUsing CFG80211 APILD /usr/local/other/wireless7_2/built-in.oCC [M] /usr/local/other/wireless7_2/src/shared/linux_osl.oCC [M] /usr/local/other/wireless7_2/src/wl/sys/wl_linux.oCC [M] /usr/local/other/wireless7_2/src/wl/sys/wl_iw.oCC [M] /usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.o/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_cfg80211_get_station’:/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:1460:20: error: ‘STATION_INFO_TX_BITRATE’ undeclared (first use in this function)sinfo->filled |= STATION_INFO_TX_BITRATE;^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:1460:20: note: each undeclared identifier is reported only once for each function it appears in/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:1477:20: error: ‘STATION_INFO_SIGNAL’ undeclared (first use in this function)sinfo->filled |= STATION_INFO_SIGNAL;^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c: At top level:/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:1799:2: warning: initialization from incompatible pointer type [enabled by default].get_station = wl_cfg80211_get_station,^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:1799:2: warning: (near initialization for ‘wl_cfg80211_ops.get_station’) [enabled by default]/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_alloc_wdev’:/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:1894:22: error: incompatible types when assigning to type ‘const struct wiphy_wowlan_support *’ from type ‘struct wiphy_wowlan_support’wdev->wiphy->wowlan = wl_wowlan_support;^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_inform_single_bss’:/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:2037:3: error: incompatible type for argument 3 of ‘cfg80211_inform_bss’(const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);^
In file included from /usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:33:0:
include/net/cfg80211.h:4029:1: note: expected ‘enum cfg80211_bss_frame_type’ but argument is of type ‘const u8 *’cfg80211_inform_bss(struct wiphy *wiphy,^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:2037:3: warning: passing argument 7 of ‘cfg80211_inform_bss’ makes integer from pointer without a cast [enabled by default](const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);^
In file included from /usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:33:0:
include/net/cfg80211.h:4029:1: note: expected ‘u16’ but argument is of type ‘const u8 *’cfg80211_inform_bss(struct wiphy *wiphy,^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:2037:3: warning: passing argument 8 of ‘cfg80211_inform_bss’ makes pointer from integer without a cast [enabled by default](const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);^
In file included from /usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:33:0:
include/net/cfg80211.h:4029:1: note: expected ‘const u8 *’ but argument is of type ‘size_t’cfg80211_inform_bss(struct wiphy *wiphy,^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:2037:3: error: too few arguments to function ‘cfg80211_inform_bss’(const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);^
In file included from /usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:33:0:
include/net/cfg80211.h:4029:1: note: declared herecfg80211_inform_bss(struct wiphy *wiphy,^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_notify_connect_status’:/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:2124:4: warning: passing argument 3 of ‘cfg80211_ibss_joined’ makes pointer from integer without a cast [enabled by default]cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);^
In file included from /usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:33:0:
include/net/cfg80211.h:4219:6: note: expected ‘struct ieee80211_channel *’ but argument is of type ‘unsigned int’void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:2124:4: error: too few arguments to function ‘cfg80211_ibss_joined’cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);^
In file included from /usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:33:0:
include/net/cfg80211.h:4219:6: note: declared herevoid cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,^
make[2]: *** [/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.o] Error 1
make[1]: *** [_module_/usr/local/other/wireless7_2] Error 2
make[1]: Leaving directory `/usr/src/kernels/3.10.0-327.el7.x86_64'
make: *** [all] Error 2

发现报错,依次排错
由报错信息知wl_cfg80211_hybrid.c文件第1460,1477,1894,2037,2124行有错,做出如下更改

[root@king wireless7_2]# vim src/wl/sys/wl_cfg80211_hybrid.c1460 // sinfo->filled |= STATION_INFO_TX_BITRATE;1477 // sinfo->filled |= STATION_INFO_SIGNAL;1894 wdev->wiphy->wowlan = &wl_wowlan_support;2035 cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)(bi->BSSID.octet),2036 0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,2037 (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);2124 cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, &wl->conf->channel, GFP_KERNEL);

tips:vim里按冒号输入set nu显示行号,冒号后接行号定位到该行

重新编译

[root@king wireless7_2]# make clean && makeKBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd` cleanmake[1]: Entering directory `/usr/src/kernels/3.10.0-327.el7.x86_64'CFG80211 API is prefered for this kernel version/usr/local/other/wireless7_2/Makefile:85: Neither CFG80211 nor Wireless Extension is enabled in kernelCLEAN /usr/local/other/wireless7_2/.tmp_versionsCLEAN /usr/local/other/wireless7_2/Module.symversmake[1]: Leaving directory `/usr/src/kernels/3.10.0-327.el7.x86_64'KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`make[1]: Entering directory `/usr/src/kernels/3.10.0-327.el7.x86_64'CFG80211 API is prefered for this kernel versionUsing CFG80211 APILD /usr/local/other/wireless7_2/built-in.oCC [M] /usr/local/other/wireless7_2/src/shared/linux_osl.oCC [M] /usr/local/other/wireless7_2/src/wl/sys/wl_linux.oCC [M] /usr/local/other/wireless7_2/src/wl/sys/wl_iw.oCC [M] /usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.o/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:1799:2: warning: initialization from incompatible pointer type [enabled by default].get_station = wl_cfg80211_get_station,^/usr/local/other/wireless7_2/src/wl/sys/wl_cfg80211_hybrid.c:1799:2: warning: (near initialization for ‘wl_cfg80211_ops.get_station’) [enabled by default]LD [M] /usr/local/other/wireless7_2/wl.oBuilding modules, stage 2.CFG80211 API is prefered for this kernel versionUsing CFG80211 APIMODPOST 1 modulesCC /usr/local/other/wireless7_2/wl.mod.oLD [M] /usr/local/other/wireless7_2/wl.komake[1]: Leaving directory `/usr/src/kernels/3.10.0-327.el7.x86_64'

没有报错

[root@king wireless7_2]# lsbuilt-in.o modules.order wl.mod.chybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz Module.symvers wl.mod.olib src wl.oMakefile wl.ko

发现已生成驱动文件wl.ko

安装驱动文件

[root@king wireless7_2]# make installinstall -D -m 755 wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless

4.驱动文件加载和配置

加载驱动文件

[root@king wireless7_2]# insmod wl.ko[root@king wireless7_2]# lsmod|grep wlwl 6445574 0 cfg80211 572836 1 wl

发现右上角出现wifi选项,驱动加载成功,可以连接wifi啦,Enjoying it!

参考
1
2


转载于:https://blog.51cto.com/kking/2096757


推荐阅读
  • Vagrant虚拟化工具的安装和使用教程
    本文介绍了Vagrant虚拟化工具的安装和使用教程。首先介绍了安装virtualBox和Vagrant的步骤。然后详细说明了Vagrant的安装和使用方法,包括如何检查安装是否成功。最后介绍了下载虚拟机镜像的步骤,以及Vagrant镜像网站的相关信息。 ... [详细]
  • CentOS7.8下编译muduo库找不到Boost库报错的解决方法
    本文介绍了在CentOS7.8下编译muduo库时出现找不到Boost库报错的问题,并提供了解决方法。文章详细介绍了从Github上下载muduo和muduo-tutorial源代码的步骤,并指导如何编译muduo库。最后,作者提供了陈硕老师的Github链接和muduo库的简介。 ... [详细]
  • PatchODAX8: ... [详细]
  • 使用nodejs爬取b站番剧数据,计算最佳追番推荐
    本文介绍了如何使用nodejs爬取b站番剧数据,并通过计算得出最佳追番推荐。通过调用相关接口获取番剧数据和评分数据,以及使用相应的算法进行计算。该方法可以帮助用户找到适合自己的番剧进行观看。 ... [详细]
  • 成功安装Sabayon Linux在thinkpad X60上的经验分享
    本文分享了作者在国庆期间在thinkpad X60上成功安装Sabayon Linux的经验。通过修改CHOST和执行emerge命令,作者顺利完成了安装过程。Sabayon Linux是一个基于Gentoo Linux的发行版,可以将电脑快速转变为一个功能强大的系统。除了作为一个live DVD使用外,Sabayon Linux还可以被安装在硬盘上,方便用户使用。 ... [详细]
  • 本文介绍了在mac环境下使用nginx配置nodejs代理服务器的步骤,包括安装nginx、创建目录和文件、配置代理的域名和日志记录等。 ... [详细]
  • CentOS 6.5安装VMware Tools及共享文件夹显示问题解决方法
    本文介绍了在CentOS 6.5上安装VMware Tools及解决共享文件夹显示问题的方法。包括清空CD/DVD使用的ISO镜像文件、创建挂载目录、改变光驱设备的读写权限等步骤。最后给出了拷贝解压VMware Tools的操作。 ... [详细]
  • 本文介绍了在CentOS上安装Python2.7.2的详细步骤,包括下载、解压、编译和安装等操作。同时提供了一些注意事项,以及测试安装是否成功的方法。 ... [详细]
  • CEPH LIO iSCSI Gateway及其使用参考文档
    本文介绍了CEPH LIO iSCSI Gateway以及使用该网关的参考文档,包括Ceph Block Device、CEPH ISCSI GATEWAY、USING AN ISCSI GATEWAY等。同时提供了多个参考链接,详细介绍了CEPH LIO iSCSI Gateway的配置和使用方法。 ... [详细]
  • Centos下安装memcached+memcached教程
    本文介绍了在Centos下安装memcached和使用memcached的教程,详细解释了memcached的工作原理,包括缓存数据和对象、减少数据库读取次数、提高网站速度等。同时,还对memcached的快速和高效率进行了解释,与传统的文件型数据库相比,memcached作为一个内存型数据库,具有更高的读取速度。 ... [详细]
  • Linux下安装免费杀毒软件ClamAV及使用方法
    本文介绍了在Linux系统下安装免费杀毒软件ClamAV的方法,并提供了使用该软件更新病毒库和进行病毒扫描的指令参数。同时还提供了官方安装文档和下载地址。 ... [详细]
  • PG12新增的VACUUM命令的SKIP_LOCKED选项
    PG12版本的VACUUM命令新增了SKIP_LOCKED选项,该选项使得vacuum命令在遇到被lock住的table时可以跳过并被视为成功执行。之前的版本中,vacuum命令会一直处于等待状态。本文还提到了PostgreSQL 12.1版本的相关信息。 ... [详细]
  • 本文介绍了在无法联网的情况下,通过下载rpm包离线安装zip和unzip的方法。详细介绍了如何搜索并下载合适的rpm包,以及如何使用rpm命令进行安装。 ... [详细]
  • tcpdump 4.5.1 crash 深入分析
    tcpdump 4.5.1 crash 深入分析 ... [详细]
  • LINUX学习之centos7营救模式
    今天卸载软件的时候,不小心把GNOME的一些组件给卸了,导致桌面无法正常开启,会卡在启动过程中,而我的开机启动模式又是设置为图形界面,所以一开LINUX就卡住了,进入不了命令行界面 ... [详细]
author-avatar
用户tbz3kln7yj
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有