From owner-p4-projects@FreeBSD.ORG Thu Dec 27 21:59:39 2007 Return-Path: <owner-p4-projects@FreeBSD.ORG> Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C0B3A16A420; Thu, 27 Dec 2007 21:59:39 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E53616A419 for <perforce@FreeBSD.org>; Thu, 27 Dec 2007 21:59:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 57B1013C448 for <perforce@FreeBSD.org>; Thu, 27 Dec 2007 21:59:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBRLxcUn015931 for <perforce@FreeBSD.org>; Thu, 27 Dec 2007 21:59:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBRLxcZ8015928 for perforce@freebsd.org; Thu, 27 Dec 2007 21:59:38 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 27 Dec 2007 21:59:38 GMT Message-Id: <200712272159.lBRLxcZ8015928@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Cc: Subject: PERFORCE change 131807 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes <p4-projects.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/p4-projects>, <mailto:p4-projects-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/p4-projects> List-Post: <mailto:p4-projects@freebsd.org> List-Help: <mailto:p4-projects-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/p4-projects>, <mailto:p4-projects-request@freebsd.org?subject=subscribe> X-List-Received-Date: Thu, 27 Dec 2007 21:59:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=131807 Change 131807 by hselasky@hselasky_laptop001 on 2007/12/27 21:58:59 Style change by "usb_style.sh". Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#94 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#94 (text+ko) ==== @@ -1046,10 +1046,10 @@ uint32_t temp = 0; if (bus->methods->get_dma_delay) { - (bus->methods->get_dma_delay)(bus, &temp); - /* round up and convert to milliseconds */ - temp += 0x3FF; - temp /= 0x400; + (bus->methods->get_dma_delay) (bus, &temp); + /* round up and convert to milliseconds */ + temp += 0x3FF; + temp /= 0x400; } return (temp); } @@ -1066,7 +1066,6 @@ temp = usbd_get_dma_delay(info->bus); usbd_pause_mtx(info->usb_mtx, temp); } - /* wait for interrupt thread to exit */ while (info->done_thread) { @@ -1194,8 +1193,8 @@ info->setup_refcount--; if (info->setup_refcount == 0) { - usbd_transfer_unsetup_sub(info, - needs_delay); + usbd_transfer_unsetup_sub(info, + needs_delay); } else { mtx_unlock(info->usb_mtx); } @@ -1548,7 +1547,6 @@ PRINTFN(-1, ("sanity checks failed\n")); return; } - /* Only open the USB transfer once! */ if (!xfer->flags_int.open) { xfer->flags_int.open = 1; @@ -1557,7 +1555,6 @@ (xfer->pipe->methods->open) (xfer); mtx_unlock(xfer->usb_mtx); } - /* set "transferring" and "recursed_2" flags */ xfer->flags_int.transferring = 1; xfer->flags_int.recursed_2 = 1; @@ -1704,48 +1701,48 @@ xfer = info->dma_curr_xfer; if (xfer) { - /* prepare next USB transfer to load, if any */ - info->dma_curr_xfer = - LIST_PREV(&(info->dma_head), xfer, dma_list); - LIST_REMOVE(xfer, dma_list); - xfer->dma_list.le_prev = NULL; + /* prepare next USB transfer to load, if any */ + info->dma_curr_xfer = + LIST_PREV(&(info->dma_head), xfer, dma_list); + LIST_REMOVE(xfer, dma_list); + xfer->dma_list.le_prev = NULL; - /* check for DMA error */ + /* check for DMA error */ - if (!xfer->flags_int.open) { + if (!xfer->flags_int.open) { - /* we got cancelled */ + /* we got cancelled */ - info->dma_refcount++; - usbd_premature_callback(xfer, - USBD_CANCELLED); - info->dma_refcount--; + info->dma_refcount++; + usbd_premature_callback(xfer, + USBD_CANCELLED); + info->dma_refcount--; - } else if (info->dma_error) { + } else if (info->dma_error) { - /* prevent recursion by increasing refcount */ + /* prevent recursion by increasing refcount */ - info->dma_refcount++; + info->dma_refcount++; - /* report error */ + /* report error */ - usbd_premature_callback(xfer, - USBD_DMA_LOAD_FAILED); + usbd_premature_callback(xfer, + USBD_DMA_LOAD_FAILED); - info->dma_refcount--; + info->dma_refcount--; - } else { + } else { /* go ahead */ usbd_bdma_pre_sync(xfer); /* finally start the hardware */ usbd_pipe_enter_wrapper(xfer); - } + } } else { /* get first USB transfer */ - info->dma_curr_xfer = - LIST_FIRST(&(info->dma_head)); + info->dma_curr_xfer = + LIST_FIRST(&(info->dma_head)); } xfer = info->dma_curr_xfer; @@ -1753,12 +1750,10 @@ /* nothing more to do */ return; } - if (!xfer->flags_int.open) { /* we got cancelled */ goto load_complete; } - /* reset BUS-DMA load state */ info->dma_refcount = 1; @@ -1925,15 +1920,13 @@ /* mark the USB transfer started */ if (!xfer->flags_int.started) { - xfer->flags_int.started = 1; + xfer->flags_int.started = 1; } - /* check if the USB transfer callback is already transferring */ if (xfer->flags_int.transferring) { return; } - /* call callback */ usbd_callback_wrapper(xfer, NULL, USBD_CONTEXT_START); @@ -1946,7 +1939,7 @@ * * NOTE: Calling this function more than one time will only * result in a single transfer stop. - * NOTE: When this function returns it is not safe to free nor + * NOTE: When this function returns it is not safe to free nor * reuse any DMA buffers. See "usbd_transfer_drain()". *------------------------------------------------------------------------*/ void @@ -2344,29 +2337,28 @@ if (xfer->flags_int.transferring && xfer->flags_int.bdma_enable && ((xfer->error == USBD_CANCELLED) || - (xfer->error == USBD_TIMEOUT)) && + (xfer->error == USBD_TIMEOUT)) && (!xfer->flags_int.did_dma_delay)) { - /* only do this one time */ - xfer->flags_int.did_dma_delay = 1; + /* only do this one time */ + xfer->flags_int.did_dma_delay = 1; - temp = usbd_get_dma_delay(xfer->udev->bus); + temp = usbd_get_dma_delay(xfer->udev->bus); - PRINTFN(2, ("DMA delay, %u ms, " - "on %p\n", temp, xfer)); + PRINTFN(2, ("DMA delay, %u ms, " + "on %p\n", temp, xfer)); - if (xfer->flags.use_polling) { - DELAY(temp * 1024); - } else { - mtx_lock(xfer->usb_mtx); - usb_callout_reset(&(xfer->timeout_handle), - USBD_MS_TO_TICKS(temp) + 1, - (void *)&usbd_dma_delay_done_cb, xfer); - mtx_unlock(xfer->usb_mtx); - break; /* wait for callback */ - } + if (xfer->flags.use_polling) { + DELAY(temp * 1024); + } else { + mtx_lock(xfer->usb_mtx); + usb_callout_reset(&(xfer->timeout_handle), + USBD_MS_TO_TICKS(temp) + 1, + (void *)&usbd_dma_delay_done_cb, xfer); + mtx_unlock(xfer->usb_mtx); + break; /* wait for callback */ + } } - /* set both recurse flags */ xfer->flags_int.recursed_1 = 1; xfer->flags_int.recursed_2 = 1; @@ -2475,7 +2467,6 @@ xfer->flags_int.draining = 0; wakeup(&(xfer->flags_int)); } - /* clear first recurse flag */ xfer->flags_int.recursed_1 = 0; } else {