关闭

中兴4g模块ME3760模块开发中遇到的问题

2256人阅读 评论(0) 收藏 举报
分类:

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







0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:47808次
    • 积分:1204
    • 等级:
    • 排名:千里之外
    • 原创:68篇
    • 转载:53篇
    • 译文:0篇
    • 评论:2条
    文章分类
    最新评论