From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 10 02:46:31 2006 Return-Path: X-Original-To: hackers@freebsd.org 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 51EDA16A402 for ; Mon, 10 Apr 2006 02:46:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7F0F43D46 for ; Mon, 10 Apr 2006 02:46:30 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id k3A2j7FZ028008; Sun, 9 Apr 2006 20:45:07 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 09 Apr 2006 20:45:10 -0600 (MDT) Message-Id: <20060409.204510.83724262.imp@bsdimp.com> To: darren.pilgrim@bitfreak.org From: "M. Warner Losh" In-Reply-To: <4439AF09.6030209@bitfreak.org> References: <44396D33.8070900@bitfreak.org> <20060409.185147.25157954.imp@bsdimp.com> <4439AF09.6030209@bitfreak.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org, mwm@mired.org Subject: Re: Using any network interface whatsoever (solution?) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2006 02:46:31 -0000 In message: <4439AF09.6030209@bitfreak.org> Darren Pilgrim writes: : M. Warner Losh wrote: : > : > The device subsystem already exports a bus-dependent plug and play : > position. No need to make it specific to USB/PCI/whatever. : : Where is this information found? I can't find anything obvious that : wouldn't change if you inserted a bus in the middle of the probe order. I was replying to the position stuff that was proposed as a way to find something. I was saying that you don't need to invent special locators, since all busses are required to provide them. For example: % devinfo -v | grep fxp0 fxp0 pnpinfo vendor=0x8086 device=0x103d subvendor=0x104d subdevice=0x8140 class=0x020000 at slot=8 function=0 handle=\_SB_.PCI0.PCIB.LANC You'd write the devd rule like: attach 10 { match "slot" "8"; match "function" "0"; action "configure-network $device-name"; }; This is technically independent of the bus, since the bus isn't exported (it should be). I'm told that some machines have multiple pci domains, so bus number isn't unique. devinfo(8) should provide a way to get this information as well, but it currently makes that kinda hard (you could parse out the parent device name). Warner