From owner-freebsd-arch@FreeBSD.ORG Sun Sep 28 22:23:44 2008 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF685106569F; Sun, 28 Sep 2008 22:23:44 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.9.129]) by mx1.freebsd.org (Postfix) with ESMTP id 697FC8FC14; Sun, 28 Sep 2008 22:23:44 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 60659730AE; Mon, 29 Sep 2008 00:27:18 +0200 (CEST) Date: Mon, 29 Sep 2008 00:27:18 +0200 From: Luigi Rizzo To: "M. Warner Losh" Message-ID: <20080928222718.GA56058@onelab2.iet.unipi.it> References: <20080928100731.GA49323@onelab2.iet.unipi.it> <20080928.135855.1708680935.imp@bsdimp.com> <20080928201948.GE36572@elvis.mu.org> <20080928.161010.1649769915.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080928.161010.1649769915.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: alfred@FreeBSD.org, freebsd-arch@FreeBSD.org Subject: Re: dynamic update of usb/pci/quirks tables X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2008 22:23:44 -0000 On Sun, Sep 28, 2008 at 04:10:10PM -0600, M. Warner Losh wrote: > In message: <20080928201948.GE36572@elvis.mu.org> > Alfred Perlstein writes: > : * M. Warner Losh [080928 13:01] wrote: ... > : > Maybe it will work out for the other tables you want to update, but it > : > won't work well for device tables. > : > : I really like the idea of using a kmod to just add the new device > : strings.. (some form of what Hans did). > > The problem is that except for the most trivial driver, that doesn't > work. Most of the NIC drivers in the tree do special things based on > what chip they thing they are talking to. An unknown chip may work, it really depends on what you are looking at -- in some drivers the "special things" are called inline in the code looking at the device IDs; in other drivers, they are implemented as functions that are called depending on the content of the quirks info, so the behaviour is (or aims to be) entirely table driven. In this respect I believe USB stuff tends to be more table-driven (probably because there is also a huge variety of devices, and the inline approach wouldn't scale well). NIC drivers are different as most of them are derived one from another by copying and modifications, and there wasn't always a lot of design involved in making them generic and configurable -- nor was it worth the effort once they are working (and i don't mean to blame anyone -- there is no point to optimize a driver for a broken piece of hardware if you can get better hw). cheers luigi