如果是使用我移植好的CS8900驱动,则不会有问题,如果是使用从网上下载或从我博客资源上下载的未移植好的C8900驱动,则编译时会出现很多错误,包括头文件、宏定义、priv成员等错误,如下所示:
drivers/net/arm/cs8900.c:56:26: asm/hardware.h: No such file or directory
drivers/net/arm/cs8900.c:71:30: asm/arch/bit-map.h: No such file or directory
drivers/net/arm/cs8900.c:72:31: asm/arch/regs-mem.h: No such file or directory
drivers/net/arm/cs8900.c:96: error: unknown field `init' specified in initializer
drivers/net/arm/cs8900.c:97: warning: missing braces around initializer
drivers/net/arm/cs8900.c:97: warning: (near initialization for `cs8900_dev.name')
drivers/net/arm/cs8900.c:97: warning: initialization makes integer from pointer without a cast
drivers/net/arm/cs8900.c:97: error: initializer element is not computable at load time
drivers/net/arm/cs8900.c:97: error: (near initialization for `cs8900_dev.name[0]')
drivers/net/arm/cs8900.c:97: error: initializer element is not constant
drivers/net/arm/cs8900.c:97: error: (near initialization for `cs8900_dev.name')
drivers/net/arm/cs8900.c:117: error: variable `cs8900_eeprom_fops' has initializer but incomplete type
drivers/net/arm/cs8900.c:118: error: unknown field `owner' specified in initializer
drivers/net/arm/cs8900.c:118: warning: excess elements in struct initializer
drivers/net/arm/cs8900.c:118: warning: (near initialization for `cs8900_eeprom_fops')
drivers/net/arm/cs8900.c:119: error: unknown field `open' specified in initializer
drivers/net/arm/cs8900.c:119: warning: excess elements in struct initializer
drivers/net/arm/cs8900.c:119: warning: (near initialization for `cs8900_eeprom_fops')
drivers/net/arm/cs8900.c:120: error: unknown field `release' specified in initializer
drivers/net/arm/cs8900.c:120: warning: excess elements in struct initializer
drivers/net/arm/cs8900.c:120: warning: (near initialization for `cs8900_eeprom_fops')
drivers/net/arm/cs8900.c:121: error: unknown field `llseek' specified in initializer
drivers/net/arm/cs8900.c:121: warning: excess elements in struct initializer
drivers/net/arm/cs8900.c:121: warning: (near initialization for `cs8900_eeprom_fops')
drivers/net/arm/cs8900.c:122: error: unknown field `read' specified in initializer
drivers/net/arm/cs8900.c:122: warning: excess elements in struct initializer
drivers/net/arm/cs8900.c:122: warning: (near initialization for `cs8900_eeprom_fops')
drivers/net/arm/cs8900.c:123: error: unknown field `write' specified in initializer
drivers/net/arm/cs8900.c:123: warning: excess elements in struct initializer
drivers/net/arm/cs8900.c:123: warning: (near initialization for `cs8900_eeprom_fops')
drivers/net/arm/cs8900.c: In function `cs8900_receive':
drivers/net/arm/cs8900.c:343: error: structure has no member named `priv'
drivers/net/arm/cs8900.c: In function `cs8900_send_start':
drivers/net/arm/cs8900.c:382: error: structure has no member named `priv'
drivers/net/arm/cs8900.c: In function `cs8900_interrupt':
drivers/net/arm/cs8900.c:434: error: structure has no member named `priv'
drivers/net/arm/cs8900.c:439: error: structure has no member named `priv'
drivers/net/arm/cs8900.c: In function `cs8900_transmit_timeout':
drivers/net/arm/cs8900.c:496: error: structure has no member named `priv'
drivers/net/arm/cs8900.c: In function `cs8900_start':
drivers/net/arm/cs8900.c:508: error: implicit declaration of function `set_irq_type'
drivers/net/arm/cs8900.c:508: error: `IRQT_RISING' undeclared (first use in this function)
drivers/net/arm/cs8900.c:508: error: (Each undeclared identifier is reported only once
drivers/net/arm/cs8900.c:508: error: for each function it appears in.)
drivers/net/arm/cs8900.c:523: warning: passing arg 2 of `request_irq' from incompatible pointer type
drivers/net/arm/cs8900.c: In function `cs8900_get_stats':
drivers/net/arm/cs8900.c:580: error: structure has no member named `priv'
drivers/net/arm/cs8900.c: In function `cs8900_eeprom':
drivers/net/arm/cs8900.c:599: error: structure has no member named `priv'
drivers/net/arm/cs8900.c:618: error: implicit declaration of function `register_chrdev'
drivers/net/arm/cs8900.c: In function `cs8900_eeprom_fllseek':
drivers/net/arm/cs8900.c:674: error: dereferencing pointer to incomplete type
drivers/net/arm/cs8900.c:686: error: dereferencing pointer to incomplete type
drivers/net/arm/cs8900.c: In function `cs8900_probe':
drivers/net/arm/cs8900.c:778: error: `S3C2410_BWSCON' undeclared (first use in this function)
drivers/net/arm/cs8900.c:779: error: `S3C2410_BANKCON3' undeclared (first use in this function)
drivers/net/arm/cs8900.c:807: error: structure has no member named `priv'
drivers/net/arm/cs8900.c:811: error: implicit declaration of function `SET_MODULE_OWNER'
drivers/net/arm/cs8900.c: In function `cs8900_cleanup':
drivers/net/arm/cs8900.c:916: error: structure has no member named `priv'
drivers/net/arm/cs8900.c:919: error: implicit declaration of function `unregister_chrdev'
drivers/net/arm/cs8900.c: In function `cs8900_probe':
drivers/net/arm/cs8900.c:778: warning: statement with no effect
drivers/net/arm/cs8900.c:779: warning: statement with no effect
drivers/net/arm/cs8900.c: At top level:
drivers/net/arm/cs8900.c:117: error: storage size of `cs8900_eeprom_fops' isn't known
make[3]: *** [drivers/net/arm/cs8900.o] Error 1
make[2]: *** [drivers/net/arm] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2
————————————————————————
上述错误如下处理:
1) 把#include <asm/hardware.h> 、#include "asm/arch/bit-map.h"和#include <asm/arch/regs-mem.h>屏蔽掉,同时增加如下头文件: