Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2007 00:40:43 +1000
From:      Alan Garfield <alan@fromorbit.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-hardware@freebsd.org
Subject:   Re: Porting a Linux ethernet driver to FreeBSD
Message-ID:  <1176302443.5057.17.camel@hiro.auspc.com.au>
In-Reply-To: <200704111032.02374.jhb@freebsd.org>
References:  <1175864703.4058.20.camel@hiro.auspc.com.au> <200704111032.02374.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2007-04-11 at 10:32 -0400, John Baldwin wrote:

> I think de(4) is kind of simple if you ignore all the ifmedia handling stuff.
> You basically need to alloc an ifnet, fill out if_init and if_start with routines
> to bring up the interface and to drain the tx queue, and then pass it to
> ether_ifattach().  When you get packets, you feed them to the stack by calling
> ifp->if_input().  You will probably need to set if_mtu during attach to your
> 256 byte MTU.  And you should add an if_ioctl routine as well.

Thanks John,

I've been heavily looking at if_ed.c and if_de.c. I've got the basics
worked out and the driver loading. But I'm struggling with getting the
resources sorted out. I'd like to not hard-code the io ports and irq
into the driver and instead get their details from the acpi bus, but I'm
having trouble understanding how this is done.

PnP, PCI and bus_* seem like magic to me!

Thanks again,
Alan.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1176302443.5057.17.camel>