需要 Wifi 方面的帮助,请尝试 ndiswrapper

需要 Wifi 方面的帮助,请尝试 ndiswrapper

我的笔记本电脑有 Qualcomm Atheros QCA9377。

lspci 的输出

03:00.0 Network controller: Qualcomm Atheros Device 0042 (rev 30)

Ubuntu 尚不支持此功能(适用于 Windows)。错误报告这里

由于我不知道什么时候会修补它,所以我尝试了 ndiswrapper。

从软件中心安装将导致

FATAL: Module ndiswrapper not found.

通过ndisgtksudo 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

我需要帮助。

PS 最近从 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]

答案1

我已经尝试过使用 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/driver

相关内容