From owner-freebsd-usb@FreeBSD.ORG Tue Jan 9 16:47:12 2007 Return-Path: X-Original-To: usb@freebsd.org Delivered-To: freebsd-usb@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6730116A417 for ; Tue, 9 Jan 2007 16:47:12 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.freebsd.org (Postfix) with ESMTP id 3F84813C4A6 for ; Tue, 9 Jan 2007 16:47:12 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id l09GGTes074925; Tue, 9 Jan 2007 08:16:29 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id l09GGT0O074924; Tue, 9 Jan 2007 08:16:29 -0800 (PST) (envelope-from rizzo) Date: Tue, 9 Jan 2007 08:16:29 -0800 From: Luigi Rizzo To: usb@freebsd.org Message-ID: <20070109081629.A74724@xorpc.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Cc: Subject: any way to detect usb detached from a device driver ? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2007 16:47:12 -0000 I am modifying a kernel device driver for webcams (see http://info.iet.unipi.it/~luigi/FreeBSD/usb-cameras.html) packing together various projects around, and i was wondering how to handle the situation of a device being detached while in use. Right now the code (from ports/multimedia/pwcbsd) detects that the device is in use while the driver-specific USB_DETACH routine is called, however then it goes on without doing anything. In another driver in the dree (urio.c) i see the driver calls usb_detach_wait() to wait up to 60s for the drivers to complete. However that function is not documented and used a bit inconsistently in the rest of /sys/dev/usb Any suggestions ? cheers luigi