Is there some implicit locking of device methods?

Kostik Belousov kostikbel at gmail.com
Tue Apr 26 12:44:14 UTC 2011


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
> 
> I went through all the USB drivers with a fine comb (the driver I am 
> porting was based on the old USB stack and so I needed to adjust it for 
> the new stack). Drivers like ulpt seem to be based around usb_fifo_* 
> structures. If I understand usb_fifo_* right, it gives you a single 
> device with FIFO semantics. This is not sufficient in my case. My device 
> is opened for reading by several processes in parallel and needs to keep 
> a separate FIFO per process. I implemented this via device cloning - and 
> I could not see how to integrate that with usb_fifo_*. Thus, I based my 
> driver on the raw cdev framework. Am I missing something obvious and 
> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110426/d8c680ec/attachment.pgp


More information about the freebsd-hackers mailing list