我的笔记本电脑有一个高通的QCA9377。
lspci输出
03:00.0 Network controller: Qualcomm Atheros Device 0042 (rev 30)Ubuntu (在Windows上工作)还不支持它。错误报告这里
因为我不知道什么时候修补,所以我试了一下。
从软件中心安装,将导致
FATAL: Module ndiswrapper not found.通过ndisgtk和sudo modprobe ndiswrapper
所以我从源代码编译,但是sudo make给出了
/home/bhav/Downloads/ndiswrapper-1.59/driver/crt.c: In function ‘_win_srand’:
/home/bhav/Downloads/ndiswrapper-1.59/driver/crt.c:470:2: error: implicit declaration of function ‘net_srandom’ [-Werror=implicit-function-declaration]
net_srandom(seed);
^
cc1: some warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/home/bhav/Downloads/ndiswrapper-1.59/driver/crt.o' failed
make[3]: *** [/home/bhav/Downloads/ndiswrapper-1.59/driver/crt.o] Error 1
Makefile:1386: recipe for target '_module_/home/bhav/Downloads/ndiswrapper-1.59/driver' failed
make[2]: *** [_module_/home/bhav/Downloads/ndiswrapper-1.59/driver] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.2.0-040200rc8-generic'
Makefile:183: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/home/bhav/Downloads/ndiswrapper-1.59/driver'
Makefile:23: recipe for target 'driver' failed
make: *** [driver] Error 2我试过1.57,1.58,1.59。同样的错误。
然后,我为更新的linux内核这里找到了一个补丁版本。
但我也不能编译那个
/home/bhav/Downloads/nd/driver/loader.c: In function ‘load_sys_files’:
/home/bhav/Downloads/nd/driver/loader.c:157:4: error: implicit declaration of function ‘__vmalloc’ [-Werror=implicit-function-declaration]
__vmalloc(load_driver->sys_files[i].size,
^
/home/bhav/Downloads/nd/driver/loader.c:156:19: warning: assignment makes pointer from integer without a cast
pe_image->image =
^
/home/bhav/Downloads/nd/driver/loader.c:207:5: error: implicit declaration of function ‘vfree’ [-Werror=implicit-function-declaration]
vfree(driver->pe_images[i].image);
^
/home/bhav/Downloads/nd/driver/loader.c: In function ‘add_bin_file’:
/home/bhav/Downloads/nd/driver/loader.c:298:2: error: implicit declaration of function ‘vmalloc’ [-Werror=implicit-function-declaration]
bin_file->data = vmalloc(driver_file->size);
^
/home/bhav/Downloads/nd/driver/loader.c:298:17: warning: assignment makes pointer from integer without a cast
bin_file->data = vmalloc(driver_file->size);
^
/home/bhav/Downloads/nd/driver/loader.c: In function ‘wrapper_ioctl’:
/home/bhav/Downloads/nd/driver/loader.c:789:15: warning: assignment makes pointer from integer without a cast
load_driver = vmalloc(sizeof(*load_driver));
^
/home/bhav/Downloads/nd/driver/loader.c: In function ‘wrapper_ioctl_compat’:
/home/bhav/Downloads/nd/driver/loader.c:884:11: warning: assignment makes pointer from integer without a cast
kdriver = vmalloc(sizeof(*kdriver));
^
cc1: some warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/home/bhav/Downloads/nd/driver/loader.o' failed
make[3]: *** [/home/bhav/Downloads/nd/driver/loader.o] Error 1
Makefile:1386: recipe for target '_module_/home/bhav/Downloads/nd/driver' failed
make[2]: *** [_module_/home/bhav/Downloads/nd/driver] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-4.2.0-040200rc8-generic'
Makefile:183: recipe for target 'modules' failed
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/home/bhav/Downloads/nd/driver'
Makefile:23: recipe for target 'driver' failed
make: *** [driver] Error 2我需要帮助。
P.S.最近从14.04升级到15.04
bhav@kal-el:~/Downloads/nd$ uname -r
4.2.0-040200rc8-generic编辑-1:
lspci -knn | grep Net -A2输出
03:00.0 Network controller [0280]: Qualcomm Atheros Device [168c:0042] (rev 30)
Subsystem: Foxconn International, Inc. Device [105b:e09a]发布于 2015-10-09 18:01:43
我试过gcc 4.9.2的github版本
git clone https://github.com/Schwartz/ndiswrapper-patched-3.14.git
cd ndiswrapper-patched-3.14
make输出
make -C utils
make[1]: Entering directory '/home/aboettger/tmp/ndiswrapper-patched-3.14/utils'
gcc -g -Wall -I../driver -o loadndisdriver loadndisdriver.c
make[1]: Leaving directory '/home/aboettger/tmp/ndiswrapper-patched-3.14/utils'
make -C driver
make[1]: Entering directory '/home/aboettger/tmp/ndiswrapper-patched-3.14/driver'
make -C /usr/src/linux-headers-3.19.0-30-generic M=/home/aboettger/tmp/ndiswrapper-patched-3.14/driver
make[2]: Entering directory '/usr/src/linux-headers-3.19.0-30-generic'
LD /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/built-in.o
MKEXPORT /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/crt_exports.h
MKEXPORT /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/hal_exports.h
MKEXPORT /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ndis_exports.h
MKEXPORT /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ntoskernel_exports.h
MKEXPORT /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ntoskernel_io_exports.h
MKEXPORT /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/rtl_exports.h
MKEXPORT /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/usb_exports.h
MKSTUBS /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/win2lin_stubs.h
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/crt.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/hal.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/iw_ndis.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/loader.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ndis.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ntoskernel.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ntoskernel_io.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/pe_linker.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/pnp.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/proc.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/rtl.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/wrapmem.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/wrapndis.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/wrapper.o
CC [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/usb.o
AS [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/win2lin_stubs.o
AS [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/lin2win.o
LD [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ndiswrapper.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ndiswrapper.mod.o
LD [M] /home/aboettger/tmp/ndiswrapper-patched-3.14/driver/ndiswrapper.ko
make[2]: Leaving directory '/usr/src/linux-headers-3.19.0-30-generic'
make[1]: Leaving directory '/home/aboettger/tmp/ndiswrapper-patched-3.14/driverhttps://askubuntu.com/questions/683459
复制相似问题