From owner-p4-projects@FreeBSD.ORG Tue Mar 18 20:27:39 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1297F1065677; Tue, 18 Mar 2008 20:27: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 C5A0C1065673 for ; Tue, 18 Mar 2008 20:27:38 +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 C852E8FC1A for ; Tue, 18 Mar 2008 20:27:38 +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 m2IKRcLN036358 for ; Tue, 18 Mar 2008 20:27:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2IKRc24036356 for perforce@freebsd.org; Tue, 18 Mar 2008 20:27:38 GMT (envelope-from hselasky@FreeBSD.org) Date: Tue, 18 Mar 2008 20:27:38 GMT Message-Id: <200803182027.m2IKRc24036356@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 138044 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: Tue, 18 Mar 2008 20:27:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=138044 Change 138044 by hselasky@hselasky_laptop001 on 2008/03/18 20:27:26 Correct and add more documentation. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#101 edit .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#120 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#101 (text+ko) ==== @@ -1516,8 +1516,8 @@ /*------------------------------------------------------------------------* * usbd_probe_and_attach * - * This function is called from "uhub_explore_sub()" and - * "usbd_serve_request_callback_sub()" + * This function is called from "uhub_explore_sub()", + * "usbd_handle_set_config()" and "usbd_handle_request()". * * Returns: * 0: Success ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#120 (text+ko) ==== @@ -3827,6 +3827,48 @@ /*------------------------------------------------------------------------* * usbd_do_request_flags and usbd_do_request * + * Description of arguments passed to these functions: + * + * "udev" - this is the "usb_device" structure pointer on which the + * request should be performed. It is possible to call this function + * in both Host Side mode and Device Side mode. + * + * "mtx" - if this argument is non-NULL the mutex pointed to by it + * will get dropped and picked up during the execution of this + * function, hence this function sometimes needs to sleep. If this + * argument is NULL it has no effect. + * + * "req" - this argument must always be non-NULL and points to an + * 8-byte structure holding the USB request to be done. The USB + * request structure has a bit telling the direction of the USB + * request, if it is a read or a write. + * + * "data" - if the "wLength" part of the structure pointed to by "req" + * is non-zero this argument must point to a valid kernel buffer which + * can hold at least "wLength" bytes. If "wLength" is zero "data" can + * be NULL. + * + * "flags" - here is a list of valid flags: + * + * o USBD_SHORT_XFER_OK: allows the data transfer to be shorter than + * specified + * + * o USBD_USE_POLLING: forces the transfer to complete from the + * current context by polling the interrupt handler. This flag can be + * used to perform USB transfers after that the kernel has crashed. + * + * o USBD_DELAY_STATUS_STAGE: allows the status stage to be performed + * at a later point in time. This is tunable by the "hw.usb.ss_delay" + * sysctl. This flag is mostly useful for debugging. + * + * "actlen" - if non-NULL the actual transfer length will be stored in + * the 16-bit unsigned integer pointed to by "actlen". This + * information is mostly useful when the "USBD_SHORT_XFER_OK" flag is + * used. + * + * "timeout" - gives the timeout for the control transfer in + * milliseconds. + * * Returns: * 0: Success * Else: Failure