From owner-cvs-src@FreeBSD.ORG Sat Oct 2 22:49:54 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A2CD216A4CE; Sat, 2 Oct 2004 22:49:54 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 982B043D1D; Sat, 2 Oct 2004 22:49:54 +0000 (GMT) (envelope-from green@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i92MnsQq029979; Sat, 2 Oct 2004 22:49:54 GMT (envelope-from green@repoman.freebsd.org) Received: (from green@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i92MnslF029978; Sat, 2 Oct 2004 22:49:54 GMT (envelope-from green) Message-Id: <200410022249.i92MnslF029978@repoman.freebsd.org> From: Brian Feldman Date: Sat, 2 Oct 2004 22:49:54 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/dev/usb ugen.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2004 22:49:54 -0000 green 2004-10-02 22:49:54 UTC FreeBSD src repository Modified files: sys/dev/usb ugen.c Log: * Use two cdevsw's for ugen(4): one for control endpoints, and one for data endpoints. The control endpoint doesn't need read/write/poll operations, and more importantly, the thread counts should be separate so that the control endpoint can properly reference itself while deleting and recreating the data endpoints. * Add some macros that handle referencing/releasing devices, and use them for sleeping/woken-up and open/close operations as apppropriate. * Use d_purge for FreeBSD, and a loop testing the open status for all the endpoints for NetBSD and OpenBSD, so that when the device is detached, the right thing always happens. Revision Changes Path 1.94 +91 -20 src/sys/dev/usb/ugen.c