From owner-p4-projects@FreeBSD.ORG Thu Jun 8 10:45:13 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 B6B1C16EDC6; Thu, 8 Jun 2006 09:14:05 +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 444EC16E14B for ; Thu, 8 Jun 2006 07:10:02 +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 EBB4E43D46 for ; Thu, 8 Jun 2006 07:10:01 +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 k587865u059200 for ; Thu, 8 Jun 2006 07:08:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k587853E059197 for perforce@freebsd.org; Thu, 8 Jun 2006 07:08:05 GMT (envelope-from hselasky@FreeBSD.org) Date: Thu, 8 Jun 2006 07:08:05 GMT Message-Id: <200606080708.k587853E059197@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 98775 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, 08 Jun 2006 10:45:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=98775 Change 98775 by hselasky@hselasky_mini_itx on 2006/06/08 07:08:02 Added more information about the new USB API to the README file. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/README#2 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/README#2 (text+ko) ==== @@ -99,9 +99,122 @@ USB device driver examples: /sys/dev/usb/ugen.c +/sys/dev/usb/ulpt.c +/sys/dev/usb/uhid.c http://www.turbocat.net/~hselasky/isdn4bsd/sources/src/sys/i4b/layer1/ihfc2/i4b_regdata.h http://www.turbocat.net/~hselasky/isdn4bsd/sources/src/sys/i4b/layer1/ihfc2/i4b_wibusb.h ---hselasky + +QUICK REFERENCE +=============== + + +/*------------------------------------------------------------------------* + * usbd_status + * usbd_transfer_setup(udev, iface_index, pxfer, setup_start, + * n_setup, priv_sc, priv_mtx, priv_func) + *------------------------------------------------------------------------*/ + +- "udev" is a pointer to "struct usbd_device" + +- "iface_index" is the interface index number + +- "pxfer" is a pointer to an array of USB transfer pointers that are + initialized to NULL, and then pointed to the allocated DMA-able USB + transfers + +- "setup_start" is a pointer to an array of USB config structures + +- "n_setup" is a number telling the USB system how many USB transfers + should be setup + +- "priv_sc" is the private softc pointer, which will be used to + initialize "xfer->priv_sc" + +- "priv_mtx" is the private mutex protecting the transfer structure and + the softc. This pointer is used to initialize "xfer->priv_mtx". + +- "priv_func" is a pointer to a function that is called back when the USB + system is finished using the "priv_mtx" mutex. + +/*------------------------------------------------------------------------* + * void + * usbd_transfer_unsetup(pxfer, n_setup) + *------------------------------------------------------------------------*/ + +- "pxfer" is a pointer to an array of USB transfer pointers, that may + be NULL, that should be freed by the USB system. + +- "n_setup" is a number telling the USB system how many USB transfers + should be unsetup + +/*------------------------------------------------------------------------* + * void + * usbd_transfer_start(xfer) + *------------------------------------------------------------------------*/ + +- "xfer" is pointer to a USB transfer that should be started + +NOTE: this function must be called with "priv_mtx" locked + +/*------------------------------------------------------------------------* + * void + * usbd_transfer_stop(xfer) + *------------------------------------------------------------------------*/ + +- "xfer" is a pointer to a USB transfer that should be stopped + +NOTE: this function must be called with "priv_mtx" locked + +NOTE: if the transfer was in progress, the callback will called with + "xfer->error=USBD_CANCELLED", before this function returns + +/*------------------------------------------------------------------------* + * struct usbd_config { + * type, endpoint, direction, interval, timeout, frames, index + * flags, bufsize, callback + * }; + *------------------------------------------------------------------------*/ + +- The "type" field selects the USB pipe type. Valid values are: + UE_INTERRUPT, UE_CONTROL, UE_BULK, UE_ISOCHRONOUS. This field is + mandatory. + +- The "endpoint" field selects the USB endpoint number. A value of + 0xFF or "-1" will select the first matching endpoint. This field is + mandatory. + +- The "direction" field selects the USB endpoint direction. A value of 0xFF + or "-1" will select the first matching endpoint. Else valid values + are: "UE_DIR_IN" and "UE_DIR_OUT". This field is mandatory. + +- The "interval" field selects the interrupt interval, for "type" = UE_INTERRUPT. + The "interval" is given in milliseconds. "0" selects the default + interrupt interval. + +- The "timeout" field, if non-zero, will set the transfer timeout, in + milliseconds. + +- The "frames" field sets the number of isochronous frames, for + "type" = UE_ISOCHRONOUS. + +- The "index" field allows one to give a number, in case more + endpoints match the description, that selects which matching + "index" should be used. + +- The "flags" field allows one to set flags for the transfer. Valid flags are: + USBD_SYNCHRONOUS + USBD_FORCE_SHORT_XFER + USBD_SHORT_XFER_OK + USBD_CUSTOM_CLEARSTALL + USBD_USE_POLLING + USBD_SELF_DESTRUCT + +- The "bufsize" field sets the total pipe buffer size in bytes. This + field is mandatory. + +- The "callback" field sets the USB callback. This field is mandatory. + +--HPS