系统信息:
1
2
|
root
@
lsw
:
~
# uname -a
Linux
lsw
3.14
-
kali1
-
686
-
pae
#1 SMP Debian 3.14.5-1kali1 (2014-06-07) i686 GNU/Linux
|
无线网卡信息:
1
2
|
root
@
lsw
:
~
# lspci
03
:
00.0
Network
controller
:
Broadcom
Corporation
BCM43227
802.11b
/
g
/
n
|
正常情况下,可以通过软件包的方式进行安装:
1
2
3
|
# aptitude update
# aptitude dist-upgrade
# aptitude install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms
|
但软件包安装时出现编译错误,故选择从源码手动安装:
1. 首先下载网卡驱动(官网下载 ,本站备份下载 ),如官网可用,请勿下载备份文件。
该驱动支持的硬件为(包含笔者的BCM43227网卡):
Broadcom’s BCM4311-, BCM4312-, BCM4313-, BCM4321-, BCM4322-, BCM43224-, and BCM43225-, BCM43227- and BCM43228-based hardware
2. 编译安装该驱动
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
root
@
lsw
:
~
/
hybrid_tmp
# make clean; make;
KBUILD_NOPEDANTIC
=
1
make
-
C
/
lib
/
modules
/
`
uname
-
r
`
/
build
M
=
`
pwd
`
clean
make
[
1
]
:
Entering
directory
`
/
usr
/
src
/
linux
-
headers
-
3.14
-
kali1
-
686
-
pae'
CFG80211
API
is
prefered
for
this
kernel
version
/
root
/
hybrid_tmp
/
Makefile
:
85
:
Neither
CFG80211
nor
Wireless
Extension
is
enabled
in
kernel
CLEAN
/
root
/
hybrid_tmp
/
.tmp_versions
make
[
1
]
:
Leaving
directory
`
/
usr
/
src
/
linux
-
headers
-
3.14
-
kali1
-
686
-
pae'
KBUILD_NOPEDANTIC
=
1
make
-
C
/
lib
/
modules
/
`
uname
-
r
`
/
build
M
=
`
pwd
`
make
[
1
]
:
Entering
directory
`
/
usr
/
src
/
linux
-
headers
-
3.14
-
kali1
-
686
-
pae'
CFG80211
API
is
prefered
for
this
kernel
version
Using
CFG80211
API
LD
/
root
/
hybrid_tmp
/
built
-
in
.o
CC
[
M
]
/
root
/
hybrid_tmp
/
src
/
shared
/
linux_osl
.o
CC
[
M
]
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.o
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
In
function
‘
wl_tkip
_printstats’
:
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3246
:
7
:
warning
:
passing
argument
1
of
‘
wl
->
tkipmodops
->
print
_stats’
from
incompatible
pointer
type
[
enabled
by
default
]
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3246
:
7
:
note
:
expected
‘
struct
seq_file
*’
but
argument
is
of
type
‘
char
*’
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3249
:
4
:
warning
:
passing
argument
1
of
‘
wl
->
tkipmodops
->
print
_stats’
from
incompatible
pointer
type
[
enabled
by
default
]
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3249
:
4
:
note
:
expected
‘
struct
seq_file
*’
but
argument
is
of
type
‘
char
*’
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
In
function
‘
wl_reg_proc
_entry’
:
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3470
:
2
:
error
:
implicit
declaration
of
function
‘
create_proc
_entry’
[
-
Werror
=
implicit
-
function
-
declaration
]
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3470
:
22
:
warning
:
assignment
makes
pointer
from
integer
without
a
cast
[
enabled
by
default
]
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3475
:
16
:
error
:
dereferencing
pointer
to
incomplete
type
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3476
:
16
:
error
:
dereferencing
pointer
to
incomplete
type
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.c
:
3477
:
16
:
error
:
dereferencing
pointer
to
incomplete
type
cc1
:
some
warnings
being
treated
as
errors
make
[
4
]
:
*
*
*
[
/
root
/
hybrid_tmp
/
src
/
wl
/
sys
/
wl_linux
.o
]
错误
1
make
[
3
]
:
*
*
*
[
_module_
/
root
/
hybrid_tmp
]
错误
2
make
[
2
]
:
*
*
*
[
sub
-
make
]
错误
2
make
[
1
]
:
*
*
*
[
all
]
错误
2
make
[
1
]
:
Leaving
directory
`
/
usr
/
src
/
linux
-
headers
-
3.14
-
kali1
-
686
-
pae'
make
:
*
*
*
[
all
]
错误
2
|
编译错误,原因是使用的 create_proc_entry() 函数已经废弃了, 与新的proc_create() 函数接受的参数不同导致的。
需要修改wl_linux.c 文件。下载针对kernel3.1补丁文件,并应用该补丁:
1
2
3
4
5
6
7
|
root
@
lsw
:
~
/
hybrid_tmp
# patch -p1 ./src/wl/sys/wl_linux.c < ../wl-6xx-kmod-011_kernel_3.10.patch
patching
file
.
/
src
/
wl
/
sys
/
wl_linux
.c
Hunk
#1 succeeded at 3236 (offset 7 lines).
Hunk
#2 succeeded at 3254 (offset 7 lines).
Hunk
#3 succeeded at 3417 (offset 7 lines).
Hunk
#4 succeeded at 3447 (offset 7 lines).
Hunk
#5 succeeded at 3483 (offset 7 lines).
|
然后编译安装:
1
|
make
clean
;
make
;
|
此时会在当前目录下生成wl.ko文件,然后安装该模块:
1
2
3
|
# modprobe lib80211
# modprobe cfg80211
# insmod wl.ko
|
此时点击网络图标应该会列出附近的无线网络了。
如果网络驱动依旧无法使用,很可能是 ssb 模块导致的,需要卸载掉该模块。但有时候仅阻止加载ssb模块还不够,因为在Debian 、Ubuntu这类系统上还是会运行,需将其连带的模块一起卸载掉。
首先检查ssb,bcma,wl,或者b43模块是否加载:
1
|
# lsmod | grep "brcmsmac\|ssb\|wl\|b43\|bcma"
|
如果安装了,就卸载掉:
1
2
3
4
5
|
# rmmod brcmsmac
# rmmod ssb
# rmmod bcma
# rmmod wl
# insmod wl.ko
|
此时无线网络就可以正常使用了。
为了重启后能自动加载,应用以下命令:
1
2
3
|
# cp wl.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
# depmod -a
# echo modeprobe wl >> /etc/rc.local
|
但是重启后会出现无线网络再次无法使用的情况,此时需要把ssb模块添加到禁用名单:
1
2
3
4
|
# echo "blacklist ssb" >> /etc/modprobe.d/blacklist-libnfc.conf
# echo "blacklist bcma" >> /etc/modprobe.d/blacklist-libnfc.conf
# echo "blacklist b43" >> /etc/modprobe.d/blacklist-libnfc.conf
# echo "blacklist brcmsmac" >> /etc/modprobe.d/blacklist-libnfc.conf
|
并生成新的ramfs文件:
1
2
3
|
# cp /boot/initrd.img-`uname -r` /你备份的路径/
# update-initramfs -u
# reboot
|
搞定。