Porting a Linux ethernet driver to FreeBSD

Alan Garfield alan at fromorbit.com
Fri Apr 6 13:26:47 UTC 2007


Hello all!

I'm posting here because I cannot find enough information elsewhere.

I've got a Sun Fire V20z (re-badged NewISys E2100) which has a little
dedicated Service Processor on board running Linux. The "SP" can
communicate via IPMI and also by Ethernet via two small fifo buffer in
the PRS via the LPC.

I have the GPL source for the so-called 'jnet' device which is basically
a small Ethernet-looking driver that wraps around these 256 byte PRS
buffers and a single interrupt. 

-- FROM THE GPL DRIVER COMMENTS
 
Jnet is a ethernet adapter driver.  As such, it provides what appears
to be a typical ethernet adapter interface which the platform can use
to send/receive IP traffic to the SP.  The actual physical medium is
the PRS, which resides on the LPC bus, and provides two 256 byte fifo's
along with an interrupt and a status register.

When an interrupt is received, the status register can be read, which
will indicate either a Data Available (DAV), or a Data Acknowledge
(DAK). We can then choose to read or write data to the fifo, and thus
facilitate communication between the SP and Platform.

Because the fifo's provided by the PRS are only 256 bytes, our packet
size is limited.  As a result, the only feature we can't support is
DHCP, since a DHCP packet is 313 bytes.

--

I'd like to port this driver to FreeBSD but I cannot find any decent
examples of a basic Ethernet driver. Most have miibus which I don't need
because there is no PHY, the loopback is clone-able and seems to simple
and most of the others are all so different from each other I cannot
really tell where to start. 

Can someone point me in the direction of an example or the relevant man
pages I should be reading.

The device driver for Linux seems quite simple and clearly defined, but
I cannot find a similar driver that I can hack apart.

Any help would be gratefully appreciated.

Many thanks,

Alan Garfield.



More information about the freebsd-hardware mailing list