或以为孤权重,妄相忖度
分类: LINUX
2009-06-20 14:47:16
Linux2.6.26.8 移植之三:CS8900网卡驱动的移植
1、添加网卡驱动到内核
将cs8900.h和cs8900.c文件拷贝到内核代码目录drivers/net中:
2、修改drivers/net中Makefile文件
添加:
obj-$(CONFIG_CS8900) +=cs8900.o
3、修改drivers/net中Kconfig文件
在以下代码段下面
config DM9000
tristate "DM9000 support"
depends on ARM && NET_ETHERNET
select CRC32
select MII
---help---
Support for DM9000 chipset.
To compile this driver as a module, choose M here and read
called dm9000.
加入以下代码:
config CS8900
tristate "CS8900 support" #(注意开头使用TAB键,下同)
depends on ARM && NET_ETHERNET
---help---
Support for cs8900a chipset.
To compile this driver as a module, choose M here and read.
4、配置内核支持CS8900A网卡
Device Drivers ---> //配置网卡驱动:
Network device support --->
[*] Network device support
Ethernet (10 or 100Mbit) --->
[*] Ethernet (10 or 100Mbit)
<*> CS8900a support
保存退出,产生.config文件.
5、在arch\arm\mach-s3c2440\mach-smdk2440.c的smdk2440_iodesc[]中
增加{vSMDK2410_ETH_IO, pSMDK2410_ETH_IO, SZ_1M, MT_DEVICE},
};
新建文件include\asm\arch\smdk2410.h中,增加:
#define pSMDK2410_ETH_IO __phys_to_pfn(0x19000000)
#define vSMDK2410_ETH_IO 0xE0000000
#define SMDK2410_ETH_IRQ IRQ_EINT9
6、确保已经修改arch\arm\mach-s3c2410\mach-smdk2410.c的s3c24xx_init_clocks函数 为:s3c24xx_init_clocks(12000000);//串口晶振频率
7、如果提示implicit declaration of function `unregister_chrdev'则在cs8900.c增加:
extern void unregister_chrdev(unsigned int, const char *);