From owner-freebsd-current@FreeBSD.ORG Fri May 29 14:21:43 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 763171065742; Fri, 29 May 2009 14:21:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 49FD28FC14; Fri, 29 May 2009 14:21:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 0138C46B2A; Fri, 29 May 2009 10:21:43 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BEA108A028; Fri, 29 May 2009 10:21:41 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Fri, 29 May 2009 10:11:16 -0400 User-Agent: KMail/1.9.7 References: <20090528222630.GF74376@citylink.fud.org.nz> In-Reply-To: <20090528222630.GF74376@citylink.fud.org.nz> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200905291011.16919.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 29 May 2009 10:21:41 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Andrew Thompson Subject: Re: ugen and newbus X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 May 2009 14:21:44 -0000 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