先参照 《本地yum源安装GCC 》安装好gcc

hp的笔记本上安装了CentOS6.3,没有安装无线网卡驱动,安装这个驱动,在Google上找了好多资料,最后终于解决了这个问题。在这里做点记录,希望也能帮到别人。

我的机子是32位,CentOS的内核版本是2.6.32-279.19.1.el6.i686,下载的无线网卡驱动是hybrid-portsrc_x86_32-v5_100_82_112.tar.gz

下面是具体的步骤

一:确定无线网卡的型号,驱动下载

第一步要确定机子的无线网卡型号是什么,可以用命令

[root@CentOS ~]$/sbin/lspci | grep Broadcom
02:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)

[root@CentOS ~]$lspci | grep Wireless

可见对应的驱动为:Broadcom BCM4313

下载驱动:http://www.broadcom.com/support/802.11/linux_sta.php

其中,在下载页面有一个README.txt文件,里面有一段话这样描述:

SUPPORTED DEVICES
—————–
The cards with the following PCI Device IDs are supported with this driver.
Both Broadcom and and Dell product names are described. Cards not listed
here may also work.

BRCM PCI PCI Dell
Product Name Vendor ID Device ID Product ID
————- ———- ——— ———–
4311 2.4 Ghz 0x14e4 0×4311 Dell 1390
4311 Dualband 0x14e4 0×4312 Dell 1490
4311 5 Ghz 0x14e4 0×4313
4312 2.4 Ghz 0x14e4 0×4315 Dell 1395
4313 2.4 Ghz 0x14e4 0×4727 Dell 1501
4321 Dualband 0x14e4 0×4328 Dell 1505
4321 Dualband 0x14e4 0×4328 Dell 1500
4321 2.4 Ghz 0x14e4 0×4329
4321 5 Ghz 0x14e4 0x432a
4322 Dualband 0x14e4 0x432b Dell 1510
4322 2.4 Ghz 0x14e4 0x432c
4322 5 Ghz 0x14e4 0x432d
43224 Dualband 0x14e4 0×4353 Dell 1520
43225 2.4 Ghz 0x14e4 0×4357
43227 2.4 Ghz 0x14e4 0×4358
43228 Dualband 0x14e4 0×4359 Dell 1530

To find the Device ID’s of Broadcom cards on your machines do:
# lspci -n | grep 14e4

运行:
[jimanyu@CentOS ~]$ lspci -n | grep 14e4
02:00.0 0280: 14e4:4727 (rev 01)
0b:00.0 0200: 14e4:1680 (rev 10)

CentOS的内核源码是放在 /usr/src/kernels 目录中; 如果通过在线升级内核, 也是放在这个目录中; 如果你的系统中的 /usr/src/kernels/ 中没有内容,说明没有安装内核的源码包 kernel-devel 软件包; 通过在线安装的内核源码包, 可以通过 yum 安装的, 内核源码会被放到 /usr/src/kernel 下的目录中

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

如果未安装内核的源码包,在后面make的时候会报错误:

[root@CentOS hybird-wl]$ make -C /lib/modules/`uname -r`/build/ M=`pwd`
make: *** /lib/modules/2.6.32-279.el6.i686/build/: No such file or directory. Stop.

二:建立安装目录

[root@CentOS ~]# mkdir -p /usr/local/src/hybrid-wl
[root@CentOS hybrid-wl]# cd /usr/local/src/hybrid-wl
[root@CentOS hybrid-wl]# tar xvfz /path/to/the/tarball/hybrid-portsrc_x86_32-v5_100_82_112.tar.gz(name of the downloaded file)
[root@CentOS hybrid-wl]# chown -R someuser.somegroup /usr/local/src/hybrid-wl

三:编译

[root@CentOS hybird-wl]$ make

第一次编译,报了如下的错误:

KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory `/usr/src/kernels/2.6.32-279.el6.i686′
CFG80211 API is prefered for this kernel version
Using CFG80211 API
LD /usr/local/src/hybird-wl/built-in.o
CC [M] /usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.o
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:64: warning: ‘enum tx_power_setting’ declared inside parameter list
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:64: warning: its scope is only this definition or declaration, which is probably not what you want
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1110: warning: ‘enum tx_power_setting’ declared inside parameter list
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1110: error: parameter 2 (‘type’) has incomplete type
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c: In function ‘wl_cfg80211_set_tx_power’:
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1123: error: ‘TX_POWER_AUTOMATIC’ undeclared (first use in this function)
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1123: error: (Each undeclared identifier is reported only once
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1123: error: for each function it appears in.)
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1125: error: ‘TX_POWER_LIMITED’ undeclared (first use in this function)
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1131: error: ‘TX_POWER_FIXED’ undeclared (first use in this function)
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c: At top level:
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1649: warning: initialization from incompatible pointer type
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1651: warning: initialization from incompatible pointer type
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1652: warning: initialization from incompatible pointer type
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1653: warning: initialization from incompatible pointer type
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1654: warning: initialization from incompatible pointer type
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1658: warning: initialization from incompatible pointer type
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c: In function ‘wl_inform_single_bss’:
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:1817: error: too few arguments to function ‘ieee80211_channel_to_frequency’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c: In function ‘wl_bss_roaming_done’:
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2117: warning: passing argument 2 of ‘cfg80211_roamed’ from incompatible pointer type
include/net/cfg80211.h:3035: note: expected ‘struct ieee80211_channel *’ but argument is of type ‘u8 *’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2117: warning: passing argument 4 of ‘cfg80211_roamed’ makes pointer from integer without a cast
include/net/cfg80211.h:3035: note: expected ‘const u8 *’ but argument is of type ‘s32’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2117: warning: passing argument 5 of ‘cfg80211_roamed’ makes integer from pointer without a cast
include/net/cfg80211.h:3035: note: expected ‘size_t’ but argument is of type ‘u8 *’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2117: warning: passing argument 6 of ‘cfg80211_roamed’ makes pointer from integer without a cast
include/net/cfg80211.h:3035: note: expected ‘const u8 *’ but argument is of type ‘s32’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2117: error: too few arguments to function ‘cfg80211_roamed’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c: In function ‘wl_bss_connect_done’:
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2149: warning: passing argument 2 of ‘cfg80211_roamed’ from incompatible pointer type
include/net/cfg80211.h:3035: note: expected ‘struct ieee80211_channel *’ but argument is of type ‘u8 *’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2149: warning: passing argument 4 of ‘cfg80211_roamed’ makes pointer from integer without a cast
include/net/cfg80211.h:3035: note: expected ‘const u8 *’ but argument is of type ‘s32’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2149: warning: passing argument 5 of ‘cfg80211_roamed’ makes integer from pointer without a cast
include/net/cfg80211.h:3035: note: expected ‘size_t’ but argument is of type ‘u8 *’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2149: warning: passing argument 6 of ‘cfg80211_roamed’ makes pointer from integer without a cast
include/net/cfg80211.h:3035: note: expected ‘const u8 *’ but argument is of type ‘s32’
/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.c:2149: error: too few arguments to function ‘cfg80211_roamed’
make[2]: *** [/usr/local/src/hybird-wl/src/wl/sys/wl_cfg80211.o] Error 1
make[1]: *** [_module_/usr/local/src/hybird-wl] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.32-279.el6.i686′
make: *** [all] Error 2

google了一下,发现CentOS6.3版本报的都是相同的错误,找了好多资料都没有好的解决办法。回头再看broadcom的REAMME.txt,里面写了一段话:

If your driver does not build, check to make sure you have installed the
kernel package described in the requirements above.

This driver now supports the new linux cfg80211 wireless configuration API in
addition to the older Wireless Extensions (Wext). The makefile will
automaticly build the right version for your system but it can be
overridden if needed:

# make API=WEXT
or
# make API=CFG80211

尝试重新编译

[root@CentOS hybird-wl]$ make clean
[root@CentOS hybird-wl]$ make API=WEXT

编译通过了,生成了wl.ko这个文件,发现还是得看官方的文档。完成编译后便是安装

[root@CentOS hybird-wl]$ make install

安装就是把文件COPY到/lib/modules/<kernel-version>/kernel/net/wireless 目录。

四:驱动配置

移除所有其它的BROADCOM 无线设备驱动。除了我们已经编译好的驱动外,其它的Broadcom 802.11芯片驱动象b43, bcma和ssb。 这个驱动和我们新的驱动是冲突的。所以我们要先把它们移除。

# lsmod  | grep “b43\|ssb\|bcma\|wl”

如果以下任何一种驱动存在,移除它:

[root@CentOS hybird-wl]$rmmod b43
[root@CentOS hybird-wl]$rmmod ssb
[root@CentOS hybird-wl]$rmmod bcma
[root@CentOS hybird-wl]$rmmod wl

所这些配置加入黑名单,不让它们被使用:

[root@CentOS hybird-wl]$echo “blacklist ssb” >> /etc/modprobe.d/blacklist.conf
[root@CentOS hybird-wl]$echo “blacklist bcma” >> /etc/modprobe.d/blacklist.conf
[root@CentOS hybird-wl]$echo “blacklist b43″ >> /etc/modprobe.d/blacklist.conf

载入新的驱动

[root@CentOS hybird-wl]$modprobe lib80211 # 因为 wl.ko 需要依赖该模块
[root@CentOS hybird-wl]$insmod wl.ko

现在你的网络管理程序应该可以找到设备, 你可以使用无线网络了!最后添加开机启动

[root@butbueatiful wireles_smoudules]# cp wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
[root@butbueatiful wireles_smoudules]# depmod -a
[root@butbueatiful wireles_smoudules]# echo modeprobe wl >> /etc/rc.local

linux 下手动编译安装无线网卡驱动的更多相关文章

  1. 如何在Linux下手动编译安装gcc

    如果可以通过apt来安装的话,尽量不要手工编译了,手工编译是最后的选择.用apt安装,只需要输入一条命令: sudo apt-get install gcc 手工编译的话,gcc和其他软件包存在如下的 ...

  2. Linux下nginx编译安装教程和编译参数详解

    这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...

  3. 在CDlinux下编译安装无线网卡驱动

    环境 主机:ThinkPadT440P 系统:CDlinux9.7.1 概述 准备利用CDlinux来破解周围的wifi密码来免费蹭网,由于笔记本是新买的,系统没有自带驱动,只能自己手动到网上下载.编 ...

  4. fedora下手动编译安装vim

    据说手动编译安装可以更适合自己的电脑哦- 1.首先,我门要下载源文件,下载地址:ftp://ftp.vim.org/pub/vim/unix/ 选择一个最新版本,我这里选择的是 vim-7.4.tar ...

  5. volcanol_Linux_ 问题汇总系列_4_Thinkpad_E40_0578MDC_在Fedora 13 Linux(FC13)中如何安装无线网卡驱动

    今天晚上,我突然想在自己到笔记本上安装linux系统,因为我自己第一次接触到的linux是红帽支持到Fedora Core 4,所以一直最中意的linux 发行版本是FC系列,同时由于FC 15以后到 ...

  6. Linux下手动编译shogun

    手动编译shogun,如果按照直接按照官网上的步骤进行,会踩非常多的坑,下面分享一下在下的编译过程,希望能为阁下提供些许借鉴. 1. git clone https://github.com/shog ...

  7. Linux下memcache编译安装与基本使用

    memcache是一套分布式的高速缓存系统,特点为key-value 存储 一.在 linux 编译安装memcache.redis等,需要 gcc,make,cmake,autoconf,libto ...

  8. C++ Boost在Windows和Linux下的编译安装

    再debian下直接apt-get install gcc g++就可以了.按照类似的逻辑,再Fedora下yum install gcc g++ 报告无法找到g++包. 差了一下,原来这个包的名字叫 ...

  9. Linux下Python编译安装

    1.安装python3 1.1下载python源码包 网址:https://www.python.org/downloads/release/python-362/ 下载地址:https://www. ...

随机推荐

  1. 利用新版ShareSDK进行手动分享(自定义分享界面)

    之前有用过Share SDK进行快捷分享,可是官方demo中的快捷分享的界面已经设置死了,而公司的产品又设计了自己的分享界面,这就需要我进行手动分享了.当前ShareSDK版本是2.5.4. 看了一堆 ...

  2. VIM+qmake编译示例程序HelloQt出错问题的解决(文件名一定要使用.cpp,否则就会默认使用gcc编译,当然通不过)

    之前看到很多初学Qt的Linux友们在使用qmake编译第一个HelloQt或者HelloWorld程序时报错,并且始终找不到原因. 前几天我也遇到了同样的问题,我用的是<精通Qt4编程> ...

  3. WPF:构建应用程序

    原文 http://www.cnblogs.com/free722/archive/2011/11/13/2247455.html WPF相关的项目内容包含在App.Xaml和Window1.xaml ...

  4. tomcat path配置

    <pre name="code" class="html">demo:/root# curl http://192.168.32.42:8082/a ...

  5. Lua学习2 Lua小框架的搭建

    看了上一篇Lua环境搭建具体http://blog.csdn.net/liuwumiyuhuiping/article/details/9196435 为了方便学习. 具体新开始搭建一下学习的小框架. ...

  6. winds引导配置数据文件包含的os项目无效

    我装了winds7与linux双系统,用easyBcd程序时,删除了一个winds7,之后winds7就进不去了, 进入winds7时显示winds未能启动,原因可能是最近更改了硬件或软件.解决此问题 ...

  7. JDBC Connection Reset问题分析

    2014年7月13日 半年前開始.项目组測试MM在验证功能时.常常报怨讲測试环境上的应用在启动时非常慢,偶尔会报失败,遇到类似问题多数情况下又一次启动一次就能够启动成功,但少数时候也有重复启动不成功的 ...

  8. JavaScript之面向对象学习五(JS原生引用类型Array、Object、String等等)的原型对象介绍

    1.原型模式的重要性不仅仅体现在创建自定义类型方面,就连所有的原生的引用类型(Obejct.Array.String等等)都在构造函数的原型上定义方法和属性.如下代码可以证明: alert(typeo ...

  9. Java 注解机制

    一.注解中的信息已经在Class中了,我们应该如何读取出来 java.lang.reflect.AnnotatedElement接口: public Annotation[] getAnnotatio ...

  10. vi、vim 配置上下左右方向键和删除键

    vi.vim 配置上下左右方向键和删除键 " An example for a vimrc file. " " Maintainer: Bram Moolenaar &l ...