From owner-p4-projects@FreeBSD.ORG Thu Oct 12 16:24:32 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3408F16A4C8; Thu, 12 Oct 2006 16:24:32 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1F0E16A534 for ; Thu, 12 Oct 2006 16:24:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D458843D68 for ; Thu, 12 Oct 2006 16:24:04 +0000 (GMT) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9CGO2Gq027297 for ; Thu, 12 Oct 2006 16:24:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9CGO12O027294 for perforce@freebsd.org; Thu, 12 Oct 2006 16:24:01 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 12 Oct 2006 16:24:01 GMT Message-Id: <200610121624.k9CGO12O027294@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 107766 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2006 16:24:32 -0000 http://perforce.freebsd.org/chv.cgi?CH=107766 Change 107766 by hselasky@hselasky_mini_itx on 2006/10/12 16:23:04 Remove USBD_SELF_DESTRUCT. The flag is broken, and currently not used. Calling "usbd_transfer_unsetup()" from the callback of a USB transfer is depreciated. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/README#12 edit .. //depot/projects/usb/src/sys/dev/usb/usb_subr.h#25 edit .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#19 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/README#12 (text+ko) ==== @@ -148,6 +148,8 @@ should be unsetup NOTE: This function can sleep, waiting for active mutexes to become unlocked! +NOTE: It is not allowed to call "usbd_transfer_unsetup" from the callback + of a USB transfer. /*------------------------------------------------------------------------* * void @@ -229,10 +231,6 @@ without exiting any mutexes, until the transfer is finished or has timed out. - USBD_SELF_DESTRUCT - This flag allows one to free a transfer from its - callback function. - USBD_USE_DMA This flag will cause the USB host controller driver to not allocate a second data buffer, "xfer->buffer". Instead of ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.h#25 (text+ko) ==== @@ -312,7 +312,7 @@ #define USBD_USE_POLLING 0x0200 /* used to make synchronous transfers * use polling instead of sleep/wakeup */ -#define USBD_SELF_DESTRUCT 0x0400 /* set if callback is allowed to unsetup itself */ +#define USBD_UNUSED_3 0x0400 #define USBD_USE_DMA 0x0800 #define USBD_UNUSED_4 0x1000 #define USBD_UNUSED_5 0x2000 ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#19 (text+ko) ==== @@ -286,7 +286,6 @@ USBD_SHORT_XFER_OK| USBD_CUSTOM_CLEARSTALL| USBD_USE_POLLING| - USBD_SELF_DESTRUCT| USBD_USE_DMA))) { error = USBD_BAD_FLAG; @@ -740,17 +739,6 @@ */ if(!(xfer->flags & (USBD_DEV_TRANSFERRING))) { - if(xfer->flags & USBD_SELF_DESTRUCT) - { - /* increment refcount - * in case the callback - * frees itself: - */ - mtx_lock(xfer->usb_mtx); - xfer->usb_root->memory_refcount++; - mtx_unlock(xfer->usb_mtx); - } - /* call callback */ __usbd_callback(xfer); @@ -800,10 +788,6 @@ } } } - if(xfer->flags & USBD_SELF_DESTRUCT) - { - usbd_drop_refcount(xfer->usb_root); - } } return; } @@ -839,17 +823,6 @@ /* always set error */ xfer->error = USBD_CANCELLED; - if(xfer->flags & USBD_SELF_DESTRUCT) - { - /* increment refcount - * in case the callback - * frees itself: - */ - mtx_lock(xfer->usb_mtx); - xfer->usb_root->memory_refcount++; - mtx_unlock(xfer->usb_mtx); - } - if(xfer->flags & USBD_DEV_TRANSFERRING) { /* increment refcount so that scheduled @@ -864,11 +837,6 @@ __usbd_callback(xfer); } mtx_unlock(xfer->usb_mtx); - - if(xfer->flags & USBD_SELF_DESTRUCT) - { - usbd_drop_refcount(xfer->usb_root); - } } return; }