From owner-cvs-src@FreeBSD.ORG Sat May 29 12:14:26 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C9E116A4CE; Sat, 29 May 2004 12:14:26 -0700 (PDT) Received: from newtrinity.zeist.de (newtrinity.zeist.de [217.24.217.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0616C43D39; Sat, 29 May 2004 12:14:26 -0700 (PDT) (envelope-from marius@newtrinity.zeist.de) Received: from newtrinity.zeist.de (localhost [127.0.0.1]) i4TJEDfQ067114; Sat, 29 May 2004 21:14:13 +0200 (CEST) (envelope-from marius@newtrinity.zeist.de) Received: (from marius@localhost) by newtrinity.zeist.de (8.12.10/8.12.10/Submit) id i4TJE8xa067113; Sat, 29 May 2004 21:14:08 +0200 (CEST) (envelope-from marius) Date: Sat, 29 May 2004 21:14:08 +0200 From: Marius Strobl To: Luigi Rizzo Message-ID: <20040529211408.P251@newtrinity.zeist.de> References: <200405291809.i4TI9Bds073061@repoman.freebsd.org> <20040529112342.A55353@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040529112342.A55353@xorpc.icir.org>; from rizzo@icir.org on Sat, May 29, 2004 at 11:23:42AM -0700 X-AntiVirus: checked by AntiVir Milter 1.1-beta; AVE 6.25.0.60; VDF 6.25.0.80 (host: newtrinity.zeist.de) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/mii acphy.c amphy.c bmtphy.c brgphy.c dcphy.c exphy.c lxtphy.c mii.c mii_physubr.c nsgphy.c nsphy.c pnaphy.c pnphy.c qsphy.c rgephy.c rlphy.c tdkphy.c tlphy.c ukphy.c ukphy_subr.c xmphy.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2004 19:14:27 -0000 On Sat, May 29, 2004 at 11:23:42AM -0700, Luigi Rizzo wrote: > any chance that one day we try to collapse the common code into > a set of default functions and a table with device types etc ? > > At a quick glance many routines seem to be cut&pasted, with > minor reordering of blocks that i am not even sure if they > are correct or just the result of partial fixes to some modules > but not others. > I agree with you that these drivers are quite messy (to a lesser extent also in NetBSD) and much of this could be fixed by collapsing common code. NetBSD already went into that direction by e.g. using mii_phy_setmedia() in a lot of drivers where the FreeBSD ones still have their own code for MII_MEDIACHG in the respective xxx_service() function. However, converting the FreeBSD drivers to also use such functions which factor out common code may also cause problems as decribed in e.g. the commit log of nsphy.c 1.22, so each conversion would have to be tested thoroughly which requires owning a NIC with the particular PHY :(