From owner-freebsd-arch Mon Jun 24 13:46:51 2002 Delivered-To: freebsd-arch@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id D409737B403 for ; Mon, 24 Jun 2002 13:46:45 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g5OKkiY77845; Mon, 24 Jun 2002 14:46:45 -0600 (MDT) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g5OKkgG53425; Mon, 24 Jun 2002 14:46:42 -0600 (MDT) (envelope-from imp@village.org) Date: Mon, 24 Jun 2002 14:46:27 -0600 (MDT) Message-Id: <20020624.144627.115021679.imp@village.org> To: dfr@nlsystems.com Cc: arch@freebsd.org Subject: Re: It is time to admit that removable devices exist From: "M. Warner Losh" In-Reply-To: <200206240958.48240.dfr@nlsystems.com> References: <20020623.171200.96231110.imp@village.org> <200206240958.48240.dfr@nlsystems.com> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <200206240958.48240.dfr@nlsystems.com> Doug Rabson writes: : In your implementation of bus_generic_child_present, you pass the original : device to the parent bus' child_present method. The idea of cascading the : request is a good one (e.g. the phy of a cardbus ethernet card is clearly not : present if the card itself isn't present). It might be better for the bus : implementation though if you pass the bus rather than the original child : device, e.g.: : : int : +bus_generic_child_present(device_t bus, device_t child) : +{ : + return (BUS_CHILD_PRESENT(device_get_parent(bus), bus)); : +} : : This would give the parent bus enough information to find the ivars etc. to : make a decision about whether 'bus' is still present. Maybe. However, I do not know if all busses can tell if an immediate child can be detached always. I'm thinking specifically about USB and its device tree. But USB could be written such that it can cope with this. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message