Discussion:
how to write/port network drivers?
(too old to reply)
Christoph Fuchs
2006-10-13 14:57:08 UTC
Permalink
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

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ignatios Souvatzis
2006-10-14 09:58:19 UTC
Permalink
Post by Christoph Fuchs
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?
Wright/Stevens, TCP/IP Illustrated Volume 2, should get you the background.
However, a lot of stuff has changed a bit since 4.4BSD. I've written a
device driver porting guide for the 4.4BSD / new ARP subsystem (that I
wrote) transition[1], but there have been more small changes. I *think*
most should be transparent to the device driver writer...

-is

[1] http://ezine.daemonnews.org/199809/underhood.html
--
seal your e-mail: http://www.gnupg.org/
Manuel Bouyer
2006-10-14 15:16:35 UTC
Permalink
Post by Christoph Fuchs
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 think you should just backport the wm(4) driver from current, it supports
the 82573. This will probably be much easier.
--
Manuel Bouyer <***@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...