1.貌似很多错误,但主要的问题是头文件缺少导致的问题。drivers/net/usb/cdc_ether.c:43:20: error: usbnet.h: No such file or directory

root@ubuntu:/opt/EmbedSky/kernel/3g/linux-2.6.30.4# make
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CALL    scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
  CHK     include/linux/compile.h
  CC [M]  drivers/net/usb/cdc_ether.o
drivers/net/usb/cdc_ether.c:43:20: <span style="background-color: rgb(255, 0, 0);">error: usbnet.h: No such file or directory</span>
drivers/net/usb/cdc_ether.c:115: warning: 'struct usbnet' declared inside parameter list
drivers/net/usb/cdc_ether.c:115: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/net/usb/cdc_ether.c:117: warning: 'struct usbnet' declared inside parameter list
drivers/net/usb/cdc_ether.c: In function 'usbnet_get_ethernet_addr':
drivers/net/usb/cdc_ether.c:122: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:124: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:124: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:131: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c: At top level:
drivers/net/usb/cdc_ether.c:136: warning: 'struct usbnet' declared inside parameter list
drivers/net/usb/cdc_ether.c:175: warning: 'struct usbnet' declared inside parameter list
drivers/net/usb/cdc_ether.c: In function 'usbnet_generic_cdc_bind':
drivers/net/usb/cdc_ether.c:180: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:183: error: implicit declaration of function 'driver_of'
drivers/net/usb/cdc_ether.c:183: warning: initialization makes pointer from integer without a cast
drivers/net/usb/cdc_ether.c:185: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:185: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:191: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:195: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:196: error: dereferencing pointer to incomplete type
drivers/net/usb/cdc_ether.c:225: error: dereferencing pointer to incomplete type

解决:查找头文件的位置,并添加头文件

 


2.ERROR: "cdc_encap_uninit" [drivers/net/usb/cdc_ether.ko] undefined!

root@ubuntu:/opt/EmbedSky/kernel/3g/linux-2.6.30.4# make
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CALL    scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
  CHK     include/linux/compile.h
  CC [M]  drivers/net/usb/cdc_ether.o
drivers/net/usb/cdc_ether.c:626: warning: 'lte_tx_fixup' defined but not used
drivers/net/usb/cdc_ether.c:619: warning: 'lte_rx_fixup' defined but not used
  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready
  Building modules, stage 2.
  MODPOST 20 modules
<span style="color:#ff0000;">ERROR: "cdc_encap_uninit" [drivers/net/usb/cdc_ether.ko] undefined!
ERROR: "cdc_encap_init" [drivers/net/usb/cdc_ether.ko] undefined!
ERROR: "cdc_encap_response_avail" [drivers/net/usb/cdc_ether.ko] undefined!</span>
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

解决:

ERROR: "cdc_encap_uninit" [drivers/net/usb/cdc_ether.ko] undefined!

意思是在生成 cdc_ether.ko 文件的时候没有找到 cdc_encap_uninit 函数的定义。

cdc_ether.c => cdc_encap_uninit(encap);

cdc_encap.c => void cdc_encap_uninit(struct cdc_encap *encap) => EXPORT_SYMBOL_GPL(cdc_encap_uninit);

所以:

文件:/linux-2.6.24/drivers/net/usb/Makefile
找到如下行:
obj-$(CONFIG_USB_USBNET) += usbnet.o
在其下添加内容:
obj-m += cdc_encap.o


3.模块加载时会有模块依赖关系。

[root@mbike /]# insmod rndis_host.ko
insmod: can't insert 'rndis_host.ko': unknown symbol in module, or unknown parameter

解决:

insmod usbnet.ko

insmod cdc_encap.ko

insmod cdc_ether.ko

insmod rndis_host.ko







GitHub 加速计划 / li / linux-dash
6
1
下载
A beautiful web dashboard for Linux
最近提交(Master分支:4 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐