From owner-freebsd-stable@FreeBSD.ORG Thu May 3 21:49:53 2007 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8DCB016A403 for ; Thu, 3 May 2007 21:49:53 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-3-125.belrs4.nsw.optusnet.com.au [220.239.3.125]) by mx1.freebsd.org (Postfix) with ESMTP id 08EF313C45B for ; Thu, 3 May 2007 21:49:52 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.14.1/8.14.1) with ESMTP id l43Lnp0Z009166; Fri, 4 May 2007 07:49:51 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.14.1/8.14.1/Submit) id l43LnohW009165; Fri, 4 May 2007 07:49:50 +1000 (EST) (envelope-from peter) Date: Fri, 4 May 2007 07:49:50 +1000 From: Peter Jeremy To: "Patrick M. Hausen" Message-ID: <20070503214950.GS818@turion.vk2pj.dyndns.org> References: <20070503082309.GG8556@hugo10.ka.punkt.de> <4639DA64.9090608@jellydonut.org> <20070503133048.GA42241@hugo10.ka.punkt.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hYooF8G/hrfVAmum" Content-Disposition: inline In-Reply-To: <20070503133048.GA42241@hugo10.ka.punkt.de> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.14 (2007-02-12) Cc: Michael Proto , freebsd-stable@freebsd.org Subject: Re: Limiting the number of probed interfaces? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2007 21:49:53 -0000 --hYooF8G/hrfVAmum Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-May-03 15:30:48 +0200, "Patrick M. Hausen" wrote: >Hello! > >On Thu, May 03, 2007 at 08:49:40AM -0400, Michael Proto wrote: > >> > Is there a way to limit the number of probed entities for >> > a certain pci device class to, say, 1 in my case? >> > I'd like to use bge0 for FreeBSD but the kernel should leave >> > everything else that might be a bge interface alone. >>=20 >> Would the following in /boot/device.hints achieve what you are after? >>=20 >> hint.bge.1.disabled=3D"1" >> hint.bge.2.disabled=3D"1" > >That would be the feature I am seeking. Unfortunately this >had no effect. I already tried. The latest statement I was able >to find via Google claimed, that for FBSD 5.2 "you cannot disable >PCI devices other than completely removing the driver". >I don't know if this has changed since then. Unfortunately, the 'disabled' hint is not handled generically. There is support for disabling ISA devices and a handful of other devices but bge is not amongst them. Possibly the following (untested) code would work but I have a feeling it would run afoul of dynamic device numbering. (It seems too simple a solution to have not been implemented if it would work). Index: /usr/src/sys/kern/subr_bus.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/ncvs/src/sys/kern/subr_bus.c,v retrieving revision 1.184.2.5 diff -u -r1.184.2.5 subr_bus.c --- /usr/src/sys/kern/subr_bus.c 28 Dec 2006 22:13:26 -0000 1.184.2.5 +++ /usr/src/sys/kern/subr_bus.c 3 May 2007 21:45:49 -0000 @@ -1722,7 +1722,10 @@ resource_int_value(dl->driver->name, child->unit, "flags", &child->devflags); =20 - result =3D DEVICE_PROBE(child); + if (resource_disabled(dl->driver->name, child->unit)) + result =3D ENXIO; + else + result =3D DEVICE_PROBE(child); =20 /* Reset flags and devclass before the next probe. */ child->devflags =3D 0; @@ -1805,7 +1808,8 @@ * A bit bogus. Call the probe method again to make * sure that we have the right description. */ - DEVICE_PROBE(child); + if (!resource_disabled(dl->driver->name, child->unit)) + DEVICE_PROBE(child); #if 0 child->flags |=3D DF_REBID; #endif --=20 Peter Jeremy --hYooF8G/hrfVAmum Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGOlj+/opHv/APuIcRAsNnAJ4ifGgD+wdBs/DoNqaUoBHWF7h22gCgtV6y xKIG2B7ao89HIy85QYQe+HA= =8aHe -----END PGP SIGNATURE----- --hYooF8G/hrfVAmum--