From owner-freebsd-arch@FreeBSD.ORG Sun Dec 23 06:47:30 2007 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31F6B16A41A; Sun, 23 Dec 2007 06:47:30 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0746313C461; Sun, 23 Dec 2007 06:47:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.1/8.14.1) with ESMTP id lBN6fptc065424; Sat, 22 Dec 2007 23:41:51 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 22 Dec 2007 23:45:26 -0700 (MST) Message-Id: <20071222.234526.246317277.imp@bsdimp.com> To: hselasky@c2i.net From: "M. Warner Losh" In-Reply-To: <200712202005.33263.hselasky@c2i.net> References: <200712202005.33263.hselasky@c2i.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: phk@phk.freebsd.dk, alfred@freebsd.org, freebsd-arch@freebsd.org Subject: Re: More leaves on the device tree ? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2007 06:47:30 -0000 In message: <200712202005.33263.hselasky@c2i.net> Hans Petter Selasky writes: : I'm currently working on USB and I have been thinking about a simple way to : find what devices an USB device creates, and how to easily present that : information to the user. : : I know there is "devinfo" and I would like to extend this utility to also show : which devices under /dev belongs to the device. : : Implementation: : : "make_dev" takes an additional "device_t parent_device" argument and creates a : child device with some magic flags set. : : Any comments ? What do you do for all the devices in /dev/ for which there is no device_t parent? In general, we've tried to keep dev_t and device_t separate inside of the kernel. They are orthogonal, but related, things. This gets especially messy when you add to the mix NIC drivers, which create no devices, but have network interfaces. Do you also track that? What about the relationship to cloned or otherwise faked devices such as the floppy driver and many tty drivers produce. While it sounds simple and straight forward, I don't think that a good implementation that takes into account the complexities of actual hardware would be worth the complexity. Warner