Re: ugen and newbus

From: John Baldwin <jhb_at_freebsd.org>
Date: Fri, 29 May 2009 10:11:16 -0400
On Thursday 28 May 2009 6:26:30 pm Andrew Thompson wrote:
> Hi,
> 
> 
> On the new usb stack the ugen driver attaches to all usb devices and
> generates a devd attach event but doesnt actually have a device entry.
> 
> It either needs to be a device or use a different devd notification. It
> would be easier if it was a device as that takes care of the housekeeping. 
> 
> I am not sure that the best way to attach it into the device tree, a
> ugen device represents a physical unit and may have multiple usb drivers
> attach (like a 3g device with a built in sd reader).

I don't think ugen0 should be a new-bus device.  I think it is fine for the 
USB bus driver to just create suitable devices in /dev to allow side-band 
access to devices from userland.  Just as /dev/pci is not represented by a 
new-bus device_t, but is a service provided by the PCI driver that is exposed 
to /dev.

That is, I would store the 'cdev' for ugenX.Y in the ivars for each USB 
device_t.

There are other places in the device tree that need similar changes.  For 
example, 'smbX' should not be a device_t, instead each smbusX device should 
just create the file in /dev directly.  Similarly for iicbusX and /dev/iicX.

-- 
John Baldwin
Received on Fri May 29 2009 - 12:21:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:48 UTC