PDA

View Full Version : How to port the e1000e driver into kenerl(2.6.21)?



shiner_chen
17th May 2008, 10:34 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

jcliburn
18th May 2008, 01:29 PM
The driver you're trying to build is too new for a vanilla 2.6.21 kernel. I looked up the functions tcp_hdrlen() and skb_transport_offset(), and they were introduced in kernel version 2.6.22.

As to why you can build the driver module under RHEL 4.3 and Fedora 7, I suspect Redhat and Fedora incorporated the kernel patches that added these functions (and others) in their respective distribution releases.

Also, the Fedora 7 kernel might actually be a 2.6.22-rcX version; you'll have to check the rpm changelog to be sure. If that's the case, then the missing functions would've been incorporated into the underlying vanilla kernel.

shiner_chen
18th May 2008, 03:04 PM
The driver you're trying to build is too new for a vanilla 2.6.21 kernel. I looked up the functions tcp_hdrlen() and skb_transport_offset(), and they were introduced in kernel version 2.6.22.

As to why you can build the driver module under RHEL 4.3 and Fedora 7, I suspect Redhat and Fedora incorporated the kernel patches that added these functions (and others) in their respective distribution releases.

Also, the Fedora 7 kernel might actually be a 2.6.22-rcX version; you'll have to check the rpm changelog to be sure. If that's the case, then the missing functions would've been incorporated into the underlying vanilla kernel.


Thank you for your help!