Subject: how to write/port network drivers?
To: None <tech-net@NetBSD.org>
From: Christoph Fuchs <christoph@fuchs.cc>
List: tech-net
Date: 10/13/2006 16:57:08
Hello,

I'm trying hard to make the Intel 82573 network controllers work with 
the NetBSD 3.0 kernel.

Somehow I managed it to "port" the if_em.c mentioned at 
<http://users.ece.gatech.edu/~dheeraj/netbsd.html> to kernel 3.0 - the 
network interface works with with some major flaws (only 100mbit 
connections work "correct", but if you pull the cable and plug it in 
again the connection is very slow -- setting the device down and up 
makes it fast again; gigabit support doesn't really work (very slow, 
just 4 MB/s)).

I have no previous experience in writing device drivers, are there any 
hints on writing/porting network device drivers for NetBSD? Is there any 
documentation? The things I already found don't help that much. Where 
can I find more information about when the driver functions get called 
by the stack?

For example, where can I find documentation about what the driver is 
expected to do when the link goes down/up?

Thanks a lot for your help,

Christoph