From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 26 12:39:22 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ABB81065673 for ; Tue, 26 Apr 2011 12:39:22 +0000 (UTC) (envelope-from freebsd@chillt.de) Received: from dd16434.kasserver.com (dd16434.kasserver.com [85.13.137.111]) by mx1.freebsd.org (Postfix) with ESMTP id E47B88FC25 for ; Tue, 26 Apr 2011 12:39:21 +0000 (UTC) Received: from taiko.lan (ppp-197-43.21-151.libero.it [151.21.43.197]) by dd16434.kasserver.com (Postfix) with ESMTPSA id 28D00188606E; Tue, 26 Apr 2011 14:39:20 +0200 (CEST) Message-ID: <4DB6BCC6.5050001@chillt.de> Date: Tue, 26 Apr 2011 14:38:30 +0200 From: Bartosz Fabianowski User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Thunderbird/3.1.9 MIME-Version: 1.0 To: Hans Petter Selasky References: <4DB695DB.1080505@chillt.de> <201104261217.23858.hselasky@c2i.net> In-Reply-To: <201104261217.23858.hselasky@c2i.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Is there some implicit locking of device methods? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 12:39:22 -0000 > 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? - Bartosz