From owner-freebsd-drivers@FreeBSD.ORG Thu Jun 21 09:08:54 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CD5B16A468 for ; Thu, 21 Jun 2007 09:08:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.230]) by mx1.freebsd.org (Postfix) with ESMTP id 423BC13C45D for ; Thu, 21 Jun 2007 09:08:54 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by nz-out-0506.google.com with SMTP id 14so429404nzn for ; Thu, 21 Jun 2007 02:08:53 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; 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; b=Fys6QjZl9BXQ1YaHOc/I2hQ9RVLjG1GnOVukMFx22GbREZ4hWt3asmPXcw9SQKA2cQLOORd0yYaq7Pp//+bN9V39VWZKXGkjWLd2Cad2dX0PTa1o8sHZt8F9rbH4VCaJUxpe8WswHczakrjnB91ODb8Rui9Clv5tC/n0pBCWL24= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=SVNjt+mid5/4dJD5A1HDLwzfOh5tOe/wzIxNMj/9jrdMLCvcd+uzpIyPe8a9z1yh68GMH8ZWtdr3FzpjLSWgcAlrXMdMMp93c8syt2tU87Ou8Od4bJ66iRn7kBMyPhItP9fGYtYeSwZflDwFpkOfF0waTLpKWFyOyRTt14LP0gI= Received: by 10.115.77.1 with SMTP id e1mr1334588wal.1182415197275; Thu, 21 Jun 2007 01:39:57 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTP id m10sm1210491waf.2007.06.21.01.39.55 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jun 2007 01:39:56 -0700 (PDT) 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 l5L8doSr023242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Jun 2007 17:39:50 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id l5L8dnND023241; Thu, 21 Jun 2007 17:39:49 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Thu, 21 Jun 2007 17:39:49 +0900 From: Pyun YongHyeon To: Alexander Pohoyda Message-ID: <20070621083949.GF21711@cdnetworks.co.kr> References: <20070621071814.271290@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070621071814.271290@gmx.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-drivers@freebsd.org Subject: Re: Finally SiS190 NIC driver ported! 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: Thu, 21 Jun 2007 09:08:54 -0000 On Thu, Jun 21, 2007 at 09:18:14AM +0200, Alexander Pohoyda wrote: > Hello, > > Based on the code of SiS900/7016 FreeBSD driver and using SiS190/191 Linux and Solaris drivers as references, I have developed a working FreeBSD driver for the above mentioned SiS190 NIC. > > It works stable for a few months on my amd64-based FreeBSD-5.4 machine in 64bit mode. I don't know whether it works in 32bit mode. I have also removed the sis_poll() code because I didn't have time to test it. > > Since this is my first driver ever, I have a few questions open which I would like to clarify. > > This NIC uses main memory for both receive and transmit descriptor rings but descriptor structures and registers are different from the ones used in SiS900/7016, so I decided to write a separate driver. How should I name this new driver? Is if_sis190.c + if_sis190reg.h right? It could later be extended to support also SiS191 NIC, I suppose. Or should I really merge the code with the sis(4) driver? I don't have any information for SiS190/191 so I don't know the differences between SiS190 and SiS900. However it's Gigabit ethernet so I guess it would require a seperate driver for the hardware. Personally, I think merging with sis(4) is not good idea. sis(4) needs big clean up for bus_dma/endian-ness. > > I do not clearly understand the reason of separating the data into list_data and chain_data structures. It seems unnecessary in my driver. It may help managing DMA tag/map and descriptor rings. > > In sis_encap() function I have to always defragment MBUF chain, otherwise big packets (e.g. during SSH connection there are packets consisting of 3 chunks) are broken. When defragmentation is done -- SSH and other protocols work. Is there a well-known mistake that causes this behavior? > Since I didn't see datasheet for the hardware I can not say what caused this. But the hardware may have required special DMA address alignment. Otherwise you may had missed descriptor set up sequences such that you may have seen the result of races with hardware. -- Regards, Pyun YongHyeon