From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 9 14:28:53 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EAEBA16A4CE; Fri, 9 Jan 2004 14:28:53 -0800 (PST) Received: from praetor.linc-it.com (adsl-068-157-070-217.sip.jan.bellsouth.net [68.157.70.217]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2233743D96; Fri, 9 Jan 2004 14:27:39 -0800 (PST) (envelope-from fullermd@over-yonder.net) Received: from mortis.over-yonder.net (adsl-19-157-169.jan.bellsouth.net [68.19.157.169]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by praetor.linc-it.com (Postfix) with ESMTP id 31E98153D2; Fri, 9 Jan 2004 16:26:57 -0600 (CST) Received: by mortis.over-yonder.net (Postfix, from userid 100) id 24D4720F2A; Fri, 9 Jan 2004 16:26:55 -0600 (CST) Date: Fri, 9 Jan 2004 16:26:54 -0600 From: "Matthew D. Fuller" To: Scott Long Message-ID: <20040109222654.GS48603@over-yonder.net> References: <200401091400.40550.doconnor@gsoft.com.au> <3FFE5211.5040606@freebsd.org> <20040109.075929.90380697.imp@bsdimp.com> <20040109210153.GP25474@server.vk2pj.dyndns.org> <3FFF1BEE.9090400@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FFF1BEE.9090400@freebsd.org> User-Agent: Mutt/1.4.1i-fullermd.1 X-Editor: vi X-OS: FreeBSD cc: Dag-Erling Sm?rgrav cc: hackers@freebsd.org Subject: Re: Discussion on the future of floppies in 5.x and 6.x X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2004 22:28:54 -0000 On Fri, Jan 09, 2004 at 02:23:58PM -0700 I heard the voice of Scott Long, and lo! it spake thus: > Dag-Erling Sm?rgrav wrote: > > > >yes, we need something like > > > >struct pci_device_info { > > uint32_t pciid; > > char brand[64]; > > char model[64]; > >} my_supported_devices[] = { > > { 0x12345678, "Acme", "Nutcracker 2000" } > >}; > > > >which is placed in a separate ELF section so we can extract it from > >the module. > > > >except it needs to be flexible enough to support other buses than PCI > >(SBUS, USB...) > > > >DES > > Yeah, this is a good suggestion, the only problem being in making it > flexible enough to not be a burden on the drivers. Many drivers > keep one or more flag elements in their tables to flag hardware than > needs special attention. I'm sure that there are also countless other > pieces of state that drivers would want to associate with a table like > this. I was poking around a bit (in my completely kernel-fu-lacking way) at this last night. For one thing, we could avoid the struct definition, and instead just mandate a few fields in the structure with given names as above. Then, write a little helper .c file with a main() that goes through the array (with the name given as a preprocessor -D or something) and spits the info out into a text file. Compile it up and run it for each module as we compile it, and assemble the results in a big reference file. Then, a userland program (like sysinstall, in this case) can easily poke through that text file to find and describe the drivers for devices found. I also was thinking that perhaps we should just stick the vendor/model ID's (and maybe submodel and bus, too) into a string and export it via sysctl; that was we don't have to use another tool or manually grub around /dev/pci and whatever other buses there might be, to identify devices pining away for a driver to mate with. -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ "The only reason I'm burning my candle at both ends, is because I haven't figured out how to light the middle yet"