From owner-cvs-all Mon Jul 3 7: 8:19 2000 Delivered-To: cvs-all@freebsd.org Received: from finch-post-11.mail.demon.net (finch-post-11.mail.demon.net [194.217.242.39]) by hub.freebsd.org (Postfix) with ESMTP id E36CF37B5B7; Mon, 3 Jul 2000 07:08:06 -0700 (PDT) (envelope-from n_hibma@qubesoft.com) Received: from calcaphon.demon.co.uk ([193.237.19.5] helo=bluebottle.qubesoft.com) by finch-post-11.mail.demon.net with esmtp (Exim 2.12 #1) id 1396t6-000BF9-0B; Mon, 3 Jul 2000 14:07:53 +0000 Received: from henny.webweaving.org (henny.qubesoft.com [192.168.1.5]) by bluebottle.qubesoft.com (8.9.3/8.9.1) with ESMTP id PAA47301; Mon, 3 Jul 2000 15:07:44 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Received: from localhost (localhost [127.0.0.1]) by henny.webweaving.org (8.9.3/8.9.3) with ESMTP id PAA20853; Mon, 3 Jul 2000 15:02:03 +0100 (BST) (envelope-from n_hibma@qubesoft.com) Date: Mon, 3 Jul 2000 15:02:03 +0100 (BST) From: Nick Hibma X-Sender: n_hibma@localhost Reply-To: Nick Hibma To: Poul-Henning Kamp Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys bus.h bus_private.h src/sys/kern subr_bus.c In-Reply-To: <6139.962631876@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > In fact: I object to newbus allocating the softc for exactly the > reason this one is needed: There may be a 1:N or N:1 correspondence > between softc's and newbus devices. In this case I have two > newbus devices for one softc. (Well, actually I have two newbus > devices for five softc's, but lets not get into that) As you have noticed yourself the problem is not having the same softc but the fact that you can't claim all the appropriate newbus devices in one go. Setting the softc of the individual devices to point at the central struct basically links several unrelated devices together in an obscure way. You will have to start doing reference counting on the central struct. Your 1:N or N:1 relationship to _a_ struct (which you conveniently call the softc) can be expressed by a reference in the original softc to the central struct, the super-softc struct if you will. It is logically much clearer to have a set of drivers claiming the individual devices and a second stage that contains the actual code including the super-softc, be that a separate newbus device or something else. Bottom line: the conceptual design of your driver doesn't fit newbus. Nick -- n_hibma@webweaving.org n_hibma@freebsd.org USB project http://www.etla.net/~n_hibma/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message