More leaves on the device tree ?

M. Warner Losh imp at bsdimp.com
Sat Dec 22 22:47:30 PST 2007


In message: <200712202005.33263.hselasky at c2i.net>
            Hans Petter Selasky <hselasky at 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


More information about the freebsd-arch mailing list