From owner-freebsd-new-bus Thu Oct 14 12:29:30 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 468821508F for ; Thu, 14 Oct 1999 12:29:27 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id NAA31136 for ; Thu, 14 Oct 1999 13:29:26 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id NAA54711 for ; Thu, 14 Oct 1999 13:30:37 -0600 (MDT) Message-Id: <199910141930.NAA54711@harmony.village.org> To: new-bus@freebsd.org Subject: Asking the musical question... Date: Thu, 14 Oct 1999 13:30:37 -0600 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Is there some way for a bus to ask "Is there a driver named foo that can that has a barbus attachment?" Taking a step back, I'm trying to add a child to an instance of the pccard bus (there may be several in a system). I know that it is named fdc or sio or whatever. Do I just add a child with device_add_child(dev, NULL, -1, cisinfo) and let probing somehow magically take care of it (this was cribbed from pci.c)? Or is there some other approved way of coping? If it makes more sense to answer this question, please do so and ignore the first one :-) Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Thu Oct 14 12:58: 7 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id 2117B15109 for ; Thu, 14 Oct 1999 12:57:49 -0700 (PDT) (envelope-from dfr@nlsystems.com) Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id VAA22528; Thu, 14 Oct 1999 21:00:29 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Thu, 14 Oct 1999 21:00:29 +0100 (BST) From: Doug Rabson To: Warner Losh Cc: new-bus@freebsd.org Subject: Re: Asking the musical question... In-Reply-To: <199910141930.NAA54711@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 14 Oct 1999, Warner Losh wrote: > > Is there some way for a bus to ask "Is there a driver named foo that > can that has a barbus attachment?" Not right now. There should be a devclass_get_drivers() function at least but there isn't. What I actually want is a decent set of iterators for the newbus objects, particularly for the device tree. An iterator with an optional filter function would be extremely handy for device searches. > > Taking a step back, I'm trying to add a child to an instance of the > pccard bus (there may be several in a system). I know that it is > named fdc or sio or whatever. Do I just add a child with > device_add_child(dev, NULL, -1, cisinfo) and let probing somehow > magically take care of it (this was cribbed from pci.c)? Or is there > some other approved way of coping? If it makes more sense to answer > this question, please do so and ignore the first one :-) Assuming the drivers have a way of recognising the device instance as one of their own (e.g. by checking PnP IDs for isa), this is the best way to do it. For 'unnamed' devices, the system presents the device to all drivers in the parent's devclass and chooses the one which returns the highest probe value. If the device is named (e.g. "sio") it will only be presented to drivers whose name matches. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message From owner-freebsd-new-bus Thu Oct 14 13: 3:51 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id DF3F414FF1 for ; Thu, 14 Oct 1999 13:03:46 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id OAA31259; Thu, 14 Oct 1999 14:03:45 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id OAA54950; Thu, 14 Oct 1999 14:04:56 -0600 (MDT) Message-Id: <199910142004.OAA54950@harmony.village.org> To: Doug Rabson Subject: Re: Asking the musical question... Cc: new-bus@freebsd.org In-reply-to: Your message of "Thu, 14 Oct 1999 21:00:29 BST." References: Date: Thu, 14 Oct 1999 14:04:56 -0600 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Doug Rabson writes: : Assuming the drivers have a way of recognising the device instance as one : of their own (e.g. by checking PnP IDs for isa), this is the best way to : do it. Right now pccardd makes this determination. It knows, from its config files, that a driver supports a given card. So I was going to have the probe routine be a strcmp between the driver's name and the named passed down from pccardd. That way the old-style pccard driver's probe routines will only match the right one, and the new style are free to do other things if so desired. : For 'unnamed' devices, the system presents the device to all : drivers in the parent's devclass and chooses the one which returns the : highest probe value. If the device is named (e.g. "sio") it will only be : presented to drivers whose name matches. OK. Sounds like how I wanted to go, so I'll keep going down that path. This should make doing a sio driver fairly simple... Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message