Date: Mon, 4 Jun 2007 07:18:21 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 120886 for review Message-ID: <200706040718.l547ILKQ045675@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=120886 Change 120886 by hselasky@hselasky_mini_itx on 2007/06/04 07:18:14 Remove unused function. Use usbd_transfer_start() where possible instead of usbd_transfer_start_safe(). Some style changes (tabify). Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#25 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#25 (text+ko) ==== @@ -1,3 +1,6 @@ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD: src/sys/dev/usb/usb_transfer.c $"); + /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -35,7 +38,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/cdefs.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -47,8 +49,6 @@ #include <dev/usb/usb_subr.h> #include <dev/usb/usb_hid.h> -__FBSDID("$FreeBSD: src/sys/dev/usb2/usb_transfer.c $"); - #ifdef USB_DEBUG void usbd_dump_iface(struct usbd_interface *iface) @@ -1284,7 +1284,11 @@ usbd_copy_in(&(xfer->buf_data), sizeof(*req), data, length); } - usbd_transfer_start_safe(xfer); + if (mtx) { + usbd_transfer_start(xfer); + } else { + usbd_transfer_start_safe(xfer); + } if(req->bmRequestType & UT_READ) { @@ -1318,11 +1322,12 @@ usbd_fill_get_report(usb_device_request_t *req, u_int8_t iface_no, u_int8_t type, u_int8_t id, u_int16_t size) { - req->bmRequestType = UT_READ_CLASS_INTERFACE; - req->bRequest = UR_GET_REPORT; - USETW2(req->wValue, type, id); - USETW(req->wIndex, iface_no); - USETW(req->wLength, size); + req->bmRequestType = UT_READ_CLASS_INTERFACE; + req->bRequest = UR_GET_REPORT; + USETW2(req->wValue, type, id); + req->wIndex[0] = iface_no; + req->wIndex[1] = 0; + USETW(req->wLength, size); return; } @@ -1330,12 +1335,12 @@ usbd_fill_set_report(usb_device_request_t *req, u_int8_t iface_no, u_int8_t type, u_int8_t id, u_int16_t size) { - req->bmRequestType = UT_WRITE_CLASS_INTERFACE; - req->bRequest = UR_SET_REPORT; - USETW2(req->wValue, type, id); + req->bmRequestType = UT_WRITE_CLASS_INTERFACE; + req->bRequest = UR_SET_REPORT; + USETW2(req->wValue, type, id); req->wIndex[0] = iface_no; req->wIndex[1] = 0; - USETW(req->wLength, size); + USETW(req->wLength, size); return; } @@ -1464,23 +1469,6 @@ } /* - * usbd_ratecheck() can limit the number of error messages that occurs. - * When a device is unplugged it may take up to 0.25s for the hub driver - * to notice it. If the driver continuosly tries to do I/O operations - * this can generate a large number of messages. - */ -int -usbd_ratecheck(struct timeval *last) -{ - if(last->tv_sec == time_second) - { - return (0); - } - last->tv_sec = time_second; - return (1); -} - -/* * Search for a vendor/product pair in an array. The item size is * given as an argument. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706040718.l547ILKQ045675>