Date: Tue, 26 Apr 2011 15:44:03 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Bartosz Fabianowski <freebsd@chillt.de> Cc: freebsd-hackers@freebsd.org, Hans Petter Selasky <hselasky@c2i.net> Subject: Re: Is there some implicit locking of device methods? Message-ID: <20110426124403.GQ48734@deviant.kiev.zoral.com.ua> In-Reply-To: <4DB6BCC6.5050001@chillt.de> References: <4DB695DB.1080505@chillt.de> <201104261217.23858.hselasky@c2i.net> <4DB6BCC6.5050001@chillt.de>
next in thread | previous in thread | raw e-mail | index | archive | help
--WeAyUrhnD1IdQdNw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2011 at 02:38:30PM +0200, Bartosz Fabianowski wrote: > >You need to handle all cases in your driver. Fortunately there exists a > >solution for this already, called USB cdev. See >=20 > I went through all the USB drivers with a fine comb (the driver I am=20 > porting was based on the old USB stack and so I needed to adjust it for= =20 > the new stack). Drivers like ulpt seem to be based around usb_fifo_*=20 > structures. If I understand usb_fifo_* right, it gives you a single=20 > device with FIFO semantics. This is not sufficient in my case. My device= =20 > is opened for reading by several processes in parallel and needs to keep= =20 > a separate FIFO per process. I implemented this via device cloning - and= =20 > I could not see how to integrate that with usb_fifo_*. Thus, I based my= =20 > driver on the raw cdev framework. Am I missing something obvious and=20 > making my life unnecessarily hard? If you needs per-file private data for cdev, you would be better served by cdevpriv(9) KPI. Cloning is too hard to use correctly for such task. --WeAyUrhnD1IdQdNw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk22vhMACgkQC3+MBN1Mb4jq/ACgh7bEvUdwzsQyqdmlB0VAILBZ jmcAniztTn+VDRY8pitGjQ/F2RDTvHsI =noOB -----END PGP SIGNATURE----- --WeAyUrhnD1IdQdNw--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110426124403.GQ48734>