I add a driver module to the linux kernel. according to the third edition of linux device driver, modify the Makefile as follows: obj-m: = GobiNetoGobiNet-objs: = GobiUSBNetoQMIDeviceoQMIo, but the following error occurs:
I add a driver module to the linux kernel. according to the third edition of linux device driver, modify the Makefile as follows:
obj-m := GobiNet.o GobiNet-objs := GobiUSBNet.o QMIDevice.o QMI.o
However, the following error occurs:
/home/sylvain/Projects/android_gingerbread_realv210_ver_1_0/kernel CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh CHK include/generated/compile.h LD drivers/cell/OptionGobiNet/built-in.o CC [M] drivers/cell/OptionGobiNet/GobiUSBNet.o CC [M] drivers/cell/OptionGobiNet/QMIDevice.o CC [M] drivers/cell/OptionGobiNet/QMI.o LD [M] drivers/cell/OptionGobiNet/GobiNet.o Kernel: arch/arm/boot/Image is ready SHIPPED arch/arm/boot/compressed/lib1funcs.S AS arch/arm/boot/compressed/lib1funcs.o LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage Kernel: arch/arm/boot/zImage is ready Building modules, stage 2. MODPOST 5 modules ERROR: "usbnet_suspend" [drivers/cell/OptionGobiNet/GobiNet.ko] undefined! ERROR: "usbnet_resume" [drivers/cell/OptionGobiNet/GobiNet.ko] undefined! ERROR: "usbnet_disconnect" [drivers/cell/OptionGobiNet/GobiNet.ko] undefined! ERROR: "usbnet_probe" [drivers/cell/OptionGobiNet/GobiNet.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2
"GobiNet. mod. c" and "GobiNet. o" are generated during compilation, but the GobiNet. ko file is not generated.
After some hard work, I found the cause of the problem.
I misunderstood the error message and did not know the ko generation process. The compilation module finds the external symbol table during the link process, but does not find it because the external symbol table is not compiled.
According to the above analysis, I checked the external symbols in the drivers/net/usb/usbnet. c file, which requires configuring CONFIG_USBNET = y in the. config file.
Hope to help you.
Http://stackoverflow.com/questions/7812418/kernel-driver-external-modules-not-building-completely