Date: Sat, 22 Dec 2007 23:45:26 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: hselasky@c2i.net Cc: phk@phk.freebsd.dk, alfred@freebsd.org, freebsd-arch@freebsd.org Subject: Re: More leaves on the device tree ? Message-ID: <20071222.234526.246317277.imp@bsdimp.com> In-Reply-To: <200712202005.33263.hselasky@c2i.net> References: <200712202005.33263.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200712202005.33263.hselasky@c2i.net> Hans Petter Selasky <hselasky@c2i.net> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071222.234526.246317277.imp>