Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 May 2009 10:11:16 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-current@freebsd.org
Cc:        Andrew Thompson <thompsa@freebsd.org>
Subject:   Re: ugen and newbus
Message-ID:  <200905291011.16919.jhb@freebsd.org>
In-Reply-To: <20090528222630.GF74376@citylink.fud.org.nz>
References:  <20090528222630.GF74376@citylink.fud.org.nz>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905291011.16919.jhb>