Click to See Complete Forum and Search --> : How to port the e1000e driver to Kenerl 2.6.21?


shiner_chen
05-17-2008, 05:30 AM
I am developing a BSP based on WindRiver Linux 2.0 (kernel version 2.6.21). I have a Intel 82566DC-2 NIC on the board, so I must port the e1000e driver for the NIC to BSP. I get the e1000e-0.2.9.5.tar.gz from internet:http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=15817&lang=zht and I can compile it as a e1000e.ko in RHEL 4.3. Because the driver is only supported as a loadable module at this time. Intel is not supplying patches against the kernel source to allow for static linking of the driver.
I have put the source code in my kenerl source code at drivers/net/e1000e/. I modified the Makefile as follows.
#
# Makefile for the Intel(R) PRO/1000 ethernet driver
#

obj-$(CONFIG_E1000E) += e1000e.o

e1000e-objs := 82571.o ich8lan.o es2lan.o \
lib.o phy.o param.o ethtool.o netdev.o

When I compiled the kenerl i got the following errors. it seems that there are not some function in the kenerl for the driver.

drivers/net/e1000e/netdev.c: In function 'e1000_clean_rx_irq_ps':
drivers/net/e1000e/netdev.c:941: warning: implicit declaration of function 'skb_tail_pointer'
drivers/net/e1000e/netdev.c:941: warning: passing argument 1 of '__constant_memcpy' makes pointer from integer without a cast
drivers/net/e1000e/netdev.c:941: warning: passing argument 1 of '__memcpy' makes pointer from integer without a cast
drivers/net/e1000e/netdev.c: In function 'e1000_clean_rx_ring':
drivers/net/e1000e/netdev.c:1034: error: 'e1000_clean_rx_irq_jumbo' undeclared (first use in this function)
drivers/net/e1000e/netdev.c:1034: error: (Each undeclared identifier is reported only once
drivers/net/e1000e/netdev.c:1034: error: for each function it appears in.)
drivers/net/e1000e/netdev.c: In function 'e1000_configure_rx':
drivers/net/e1000e/netdev.c:2065: error: 'e1000_clean_rx_irq_jumbo' undeclared (first use in this function)
drivers/net/e1000e/netdev.c: In function 'e1000_tso':
drivers/net/e1000e/netdev.c:3079: warning: implicit declaration of function 'skb_transport_offset'
drivers/net/e1000e/netdev.c:3079: warning: implicit declaration of function 'tcp_hdrlen'
drivers/net/e1000e/netdev.c:3082: warning: implicit declaration of function 'ip_hdr'
drivers/net/e1000e/netdev.c:3082: warning: initialization makes pointer from integer without a cast
drivers/net/e1000e/netdev.c:3085: warning: implicit declaration of function 'tcp_hdr'
drivers/net/e1000e/netdev.c:3085: error: invalid type argument of '->'
drivers/net/e1000e/netdev.c:3092: warning: implicit declaration of function 'ipv6_hdr'
drivers/net/e1000e/netdev.c:3092: error: invalid type argument of '->'
drivers/net/e1000e/netdev.c:3093: error: invalid type argument of '->'
drivers/net/e1000e/netdev.c:3094: error: invalid type argument of '->'
drivers/net/e1000e/netdev.c:3095: error: invalid type argument of '->'
drivers/net/e1000e/netdev.c:3099: warning: implicit declaration of function 'skb_network_offset'
drivers/net/e1000e/netdev.c:3100: error: invalid type argument of '->'
drivers/net/e1000e/netdev.c:3102: error: invalid type argument of '->'
make[7]: *** [drivers/net/e1000e/netdev.o] Error 1

Who can tell me why I can compile the driver as a loading module in RHEL 4.3 and Fedora 7(2.6.21), but I can not compile it as static module in kernel.

How to solve it? thanks

Shiner

bwkaz
05-19-2008, 06:44 PM
Have you tried the normal e1000 driver that's already in your kernel?

The e1000e driver is probably using functions that were only added to the kernel after 2.6.21 -- kernels are NOT backwards compatible for drivers! (They are for user programs, but since drivers are running in kernel mode, they have no such guarantee. Stuff needs to be fixed in kernel mode, which means stuff needs to be changed.)