From owner-freebsd-drivers@FreeBSD.ORG Tue Dec 11 01:56:35 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 2AAFE16A420 for ; Tue, 11 Dec 2007 01:56:35 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by mx1.freebsd.org (Postfix) with ESMTP id AC20813C448 for ; Tue, 11 Dec 2007 01:56:33 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so701121pyb for ; Mon, 10 Dec 2007 17:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; bh=NhwIwMfMGMM8yvggpRrjC5O4lUmqiBUAhqHfchwL/tA=; b=C/zhtA96+X1uSL/N6z8oHWByuEW+0XuQbFKyB0RIRapfRdIbnjw0x6TldZMqrLoXnZfeB+Gt7uCanl0ihMyXRIfnRmZR5c4WMrsrvHJBdf4hDTfLh/airjojBBoJ8SdThczPLD1oiatrno+Vkn+9xe0vKOOXbXuipRJyiOCn32E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=nDEiAQW3EmA56bq6CcF0IV78+04UUOQxcR3qa55HEWAcATrGQg8+42O1CCbhovl/3tfniRqq/tNSUyyrOus8/PRVsz7nTM31u+zIO2qN1tk1F8ig+bwjBE1aWHNlTqE8jBC7YDLXlBCt5XMKV+acx/cpsbWKZdZbL3qT5JKtotE= Received: by 10.65.40.16 with SMTP id s16mr15491182qbj.1197336647850; Mon, 10 Dec 2007 17:30:47 -0800 (PST) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id 7sm1121267nzn.2007.12.10.17.30.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Dec 2007 17:30:46 -0800 (PST) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id lBB1RCnN064672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Dec 2007 10:27:12 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id lBB1RBAn064671; Tue, 11 Dec 2007 10:27:11 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Tue, 11 Dec 2007 10:27:11 +0900 From: Pyun YongHyeon To: Alexander Pohoyda Message-ID: <20071211012711.GB64299@cdnetworks.co.kr> References: <200712102046.27504.alexander.pohoyda@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200712102046.27504.alexander.pohoyda@gmx.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-drivers@freebsd.org Subject: Re: SiS 190 NIC driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com 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 01:56:35 -0000 On Mon, Dec 10, 2007 at 08:46:27PM +0100, Alexander Pohoyda wrote: > Hello! > > Attached is a driver for the SiS 190 NIC found in some Shuttle XPS boxes. I > have developed it based on the code of SiS 900 BSD driver using hints and > enums from Linux and Solaris drivers. > > It is developed and tested to be working on FreeBSD 5.4 amd64. Please bear in > mind that this is my first driver ever. The driver surely needs some > corrections and more work (collision handling, polling mode, etc) but I'm not > able to do this right now becasue of the missing documentation. > > Please review the code and add it into the source with any corrections you > dimi necessary. > > Thank you! > Great work! 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? Some conmments: - I guess SiS 190 is a gigabit controller but the probe message just shows 10/100TX message. Does this driver supports 1Gbps? - 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. You can also use bus_dmamap_load_mbuf_sg(9) for newer FreeBSD which make it possible to remove book-keepings needed to pass/get to/from callback. Please check other network drivers for correct usage of bus_dma(9). - It seems that Tx/Rx ring have alignment restrictions, probably 16 bytes or larger. Would you please check it? - Descriptor counter 64 seems to be small for gigabit controllers. I guess 256 or higher would be more reasonable one. - 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. - It seems the driver name sis19x looks odd. How about sge(SiS Gigabit Ethernet)? - Missing Makefile and man page. - style(9) cleanup. 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. -- Regards, Pyun YongHyeon