From owner-freebsd-drivers@FreeBSD.ORG Tue Dec 11 07:45:11 2007 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAACF16A418 for ; Tue, 11 Dec 2007 07:45:11 +0000 (UTC) (envelope-from alexander.pohoyda@gmx.net) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 1BC4613C4F3 for ; Tue, 11 Dec 2007 07:45:10 +0000 (UTC) (envelope-from alexander.pohoyda@gmx.net) Received: (qmail 1332 invoked by uid 0); 11 Dec 2007 07:45:09 -0000 Received: from 155.56.68.221 by www119.gmx.net with HTTP; Tue, 11 Dec 2007 08:45:09 +0100 (CET) Content-Type: text/plain; charset="us-ascii" Date: Tue, 11 Dec 2007 08:45:09 +0100 From: "Alexander Pohoyda" In-Reply-To: <20071211012711.GB64299@cdnetworks.co.kr> Message-ID: <20071211074509.281710@gmx.net> MIME-Version: 1.0 References: <200712102046.27504.alexander.pohoyda@gmx.net> <20071211012711.GB64299@cdnetworks.co.kr> To: freebsd-drivers@freebsd.org X-Authenticated: #14602519 X-Flags: 0001 X-Mailer: WWW-Mail 6100 (Global Message Exchange) X-Priority: 3 X-Provags-ID: V01U2FsdGVkX18cxgQ4aBccFqn4HBktdOvr6wc35JDXi4YjRnb6Pf FdhT5hFy1GSM0qu41jIBJN54EoHbrVsWdbuQ== Content-Transfer-Encoding: 7bit X-GMX-UID: PXdtc0kcf2IsDUC4smxo2DB4dWxlcxYQ Subject: Re: SiS 190 NIC driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2007 07:45:11 -0000 > > Attached is a driver for the SiS 190 NIC found in some Shuttle XPS > I've looked over the driver code and I guess the driver is not > for RELENG_6/RELENG_7/CURRENT. Would you make it work for CURRENT? I would like to, but neither RELENG_6, nor RELENG_7 boots on my Shuttle box. I have reported this in -current mailing list some time ago, but got no usable suggestion. Maybe I should try a recent CURRENT, but I don't have much time to play around with it. > - I guess SiS 190 is a gigabit controller but the probe message just > shows 10/100TX message. Does this driver supports 1Gbps? I don't know for sure, but SiS website mentions: SiS191 Gigabit LAN & SiS190 LAN Driver(v2.03) Other websites have it wrong, I guess, e.g.: SiS 190 Gigabit LAN & SiS 191 LAN Driver v 1.03b However, I will have a look at this. > - The usage of bus_dma(9) KPI seems to be incorrect. For example > there should be no reason to set BUS_DMA_ALLOCNOW flag in > bus_dma_tag_create. This code is left from the original sis driver and it works. Moreover, the Architecture Handbook does not mention bus_dmamap_load_mbuf_sg(9) and once again, newer FreeBSD releases do not start on this box at all, so if this new bus_dma API is not available in RELENG_5, I cannot use it. > needed to pass/get to/from callback. Please check other network > drivers for correct usage of bus_dma(9). The existing sis driver does no use bus_dmamap_load_mbuf_sg either. > - It seems that Tx/Rx ring have alignment restrictions, probably > 16 bytes or larger. Would you please check it? I do not understand, please elaborate. > - Descriptor counter 64 seems to be small for gigabit controllers. > I guess 256 or higher would be more reasonable one. Do you mean that: int sis_tx_cnt; should rather be: u_int256_t sis_tx_cnt; If not, please elaborate. > - I'm not sure SiS 190 can't handle DMA gathering in Tx path but > it seems that Linux doesn't use multiple Tx descriptors at all > in Tx path(NETIF_F_SG flag is absent in Linux) So I guess you can > simplify sis_encap() function. Please offer your version of a function and I will test it. Or explain how you mean to simplify it. Is there an existing driver with a simplified variant? > - It seems the driver name sis19x looks odd. How about sge(SiS > Gigabit Ethernet)? Yes, I would like sge better, but see above. > - Missing Makefile and man page. Sorry, cannot provide a man page other than a standard sis(4), but a Makefile is not a problem, will do. > - style(9) cleanup. I tried to stick to style(9), do you have any specific complaints? > I don't have SiS 190 hardware to test the driver. So it's hard for me > to make it work on CURRENT. Feel free to contact to me if you have > any questions. Thank you very much for useful comments! Please send me code snippets and I will test them! -- Alexander Pohoyda PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72 15 54 5F 62 20 23 C6 44