From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 9 05:55:07 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F20F416A400 for ; Mon, 9 Apr 2007 05:55:07 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from thing1.auspcmarket.com.au (mail.fromorbit.com [203.31.169.65]) by mx1.freebsd.org (Postfix) with ESMTP id B8F6913C44B for ; Mon, 9 Apr 2007 05:55:07 +0000 (UTC) (envelope-from alan@fromorbit.com) Received: from [192.168.1.99] (unknown [192.168.1.99]) by thing1.auspcmarket.com.au (Postfix) with ESMTP id 7A2545DDE for ; Mon, 9 Apr 2007 15:33:35 +1000 (EST) From: Alan Garfield To: freebsd-hackers@freebsd.org Content-Type: text/plain Date: Mon, 09 Apr 2007 15:33:35 +1000 Message-Id: <1176096815.4064.6.camel@hiro.auspc.com.au> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit Subject: RFI: Ethernet driver ported from Linux X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2007 05:55:08 -0000 Hello all! I've got a couple of Sun Fire V20z (re-badged NewISys E2100) which have little dedicated Service Processor on-board running Linux. The "SP" can communicate via IPMI and also by Ethernet. It talks Ethernet to the SP by using two small fifo buffers in the PRS via the LPC. I have the GPL Linux source for the so-called 'jnet' Ethernet device. By my reading of the code and the comments it's basically a small Ethernet-looking driver that wraps around these 256 byte PRS buffers and a single interrupt for events from each side of the PRS buffers. -- 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/re-write this driver for FreeBSD but I cannot find enough documentation and examples of a basic Ethernet driver for FreeBSD. (if_wlan and if_ef look like good candidates but if_clone and the miibus confuse me a bit and there isn't any clear docs on them) Can someone point me in the direction of an example or the relevant man pages I should be reading to help with this. The device driver for Linux seems quite simple. Any help would be gratefully appreciated. Many thanks, Alan Garfield.