AX88782是一款双网口的网络芯片,从FAE那边要来了最新的驱动程序。原驱动是可以作为一个模块动态加载的。我想改成直接编译到内核里面去。把模块加载需要的部分去掉:
module_param(mem, int, 0);
module_param(irq, int, 0);
module_param(media0, int, 0);
module_param(media1, int, 0);
#ifdef HAVE_LOOPBACK_TEST
module_param(loopback, int, 0);
#endif
关于参数的描述也去掉
MODULE_PARM_DESC(mem, "MEMORY base address(s)");
MODULE_PARM_DESC(irq, "IRQ number(s)");
MODULE_PARM_DESC(media0, "Port0 Media Mode(0:auto, 1:100full, 2:100half, 3:10full, 4:10half)");
MODULE_PARM_DESC(media1, "Port1 Media Mode(0:auto, 1:100full, 2:100half, 3:10full, 4:10half)");
#ifdef HAVE_LOOPBACK_TEST
MODULE_PARM_DESC(loopback, "HW Performance Test Mode(0:Normal, 1:Rx Infinite, 2:Tx Infite, 3:Echo)");
#endif
给这些需要给定的参数设置值。
static struct net_device *global_dev = NULL;
static int mem = 0x08000000;
static int irq = 56;
static int media0 = 0;
static int media1 = 0;
#ifdef HAVE_LOOPBACK_TEST
static int loopback = 0;
#endif
AX88782有多个文件,写makefile的时候需要这样写:
obj-$(CONFIG_AX88782) += ax88782_driver.o
ax88782_driver-objs := ax88782.o \
switch/access_port.o \
switch/switch.o \
switch/smac_api.o \
switch/stp_api.o \
switch/vlan_api.o \
switch/qos_api.o \
switch/fdtbl_api.o \
switch/rmon_api.o \
switch/eeprom_api.o |