Date: Tue, 18 Mar 2008 20:27:38 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 138044 for review Message-ID: <200803182027.m2IKRc24036356@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803182027.m2IKRc24036356>