59190ecd61435d19ba3515b876272aee7bd12298vboxsync * CDDL HEADER START
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * The contents of this file are subject to the terms of the
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Common Development and Distribution License (the "License").
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * You may not use this file except in compliance with the License.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * See the License for the specific language governing permissions
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * and limitations under the License.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * When distributing Covered Code, include this CDDL HEADER in each
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * If applicable, add the following below this CDDL HEADER, with the
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * fields enclosed by brackets "[]" replaced with your own identifying
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * CDDL HEADER END
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Copyright 2009-2010 Oracle Corporation. All rights reserved.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Use is subject to license terms.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Unstable interfaces not part of USBAI but used by Solaris client drivers.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * These interfaces may not be present in future releases and are highly
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * unstable.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Status key:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * C = Remove from Sun client drivers before removing from this file
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * D = May be needed by legacy (DDK) drivers.
59190ecd61435d19ba3515b876272aee7bd12298vboxsyncextern "C" {
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * convenience function for getting default config index
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * as saved in usba_device structure
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Status: C
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Error and status definitions, and reporting functions
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * convenience functions to get string corresponding to value
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_cb_flags_name requires a workbuffer of sufficient length
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * for the concatenation of all strings as usb_cb_flags_t is a bit
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Status: C and D
59190ecd61435d19ba3515b876272aee7bd12298vboxsyncconst char *usb_str_pipe_state(usb_pipe_state_t state);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* function convert a USB return value to an errno */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Transfer-related definitions and functions
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* Status C and D for whole section. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* Serialize callbacks per interface or device. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* default timeout for control requests (in seconds) */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_pipe_sync_ctrl_xfer():
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * for simple synchronous control transactions this wrapper function
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * will perform the allocation, xfer, and deallocation.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_ATTRS_AUTOCLEARING will be enabled
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * ARGUMENTS:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * dip - pointer to clients devinfo.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * pipe_handle - control pipe pipehandle (obtained via usb_pipe_open().
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * bmRequestType - characteristics of request.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * bRequest - specific request.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * wValue - varies according to request.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * wIndex - index or offset.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * wLength - number of bytes to xfer.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * data - pointer to pointer to data
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * IN: HCD will allocate data
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * OUT: clients driver allocates data.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * attrs - required request attributes.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * completion_reason - completion status.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * cb_flags - request completions flags.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * flags - none.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * RETURN VALUES:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_SUCCESS - request successfully executed.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_FAILURE - request failed.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * - in the case of failure, the client should check completion_reason and
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * and cb_flags and determine further recovery action
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * - the client should check data and if non-zero, free the data on
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * completion
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Event registration / pre-suspend and post-resume handling
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* Status: C and D for whole section. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Event registration info for both hotplug and pre-suspend/post-resume
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * callbacks. Eventually pre-suspend and post-resume callbacks will not be
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * needed, so this is for this OS release only and will go away in a
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * subsequent release.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync /* device reconnected */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync /* notification that system is about to checkpoint */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync /* notification that system resumed after a checkpoint */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Event callbacks
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * the callbacks should always return USB_SUCCESS.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB CPR support
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync * A client driver must call this function in pre-suspend event handler
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * to inform the USBA framework that it can't suspend because
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * driver instance or device could not be quiesced.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Logging functions remaining Contracted Consolidation Private
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* Status: C and D for whole section. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Usb logging, debug and console message handling.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#define USB_LOG_L0 0 /* warnings, console & syslog buffer */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#define USB_LOG_L2 2 /* recoverable errors, debug only */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#define USB_LOG_L3 3 /* interesting data, debug only */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/*PRINTFLIKE3*/
59190ecd61435d19ba3515b876272aee7bd12298vboxsync char *fmt, ...);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/*PRINTFLIKE3*/
59190ecd61435d19ba3515b876272aee7bd12298vboxsync char *fmt, ...);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/*PRINTFLIKE3*/
59190ecd61435d19ba3515b876272aee7bd12298vboxsync char *fmt, ...);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/*PRINTFLIKE3*/
59190ecd61435d19ba3515b876272aee7bd12298vboxsync char *fmt, ...);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/*PRINTFLIKE3*/
59190ecd61435d19ba3515b876272aee7bd12298vboxsync char *fmt, ...);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* free the log handle */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* log message */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/*PRINTFLIKE4*/
59190ecd61435d19ba3515b876272aee7bd12298vboxsync char *fmt, ...);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_check_same_device:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Check if the device connected to the port is the same as
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * the previous device that was in the port. The previous device is
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * represented by the dip on record for the port. Print a message
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * if the device is different. If device_string arg is not NULL, it is
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * included in the message. Can block.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Arguments:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * dip - pointer to devinfo of the client
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * log_handle - handle to which messages are logged
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * log_level - one of USB_LOG_*
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * log_mask - logging mask
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * check_mask - one mask containing things to check:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_CHK_BASIC: empty mask;
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * these checks are always done.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_CHK_SERIAL: check match on device
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * serial number.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_CHK_CFG: compare config clouds
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * byte by byte
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_CHK_VIDPID: compare product
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * and vendor ID
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_CHK_ALL: perform all checks
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * NOTE: descr length and content always checked
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * device_string - Device string to appear in error message
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * return values:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_SUCCESS: same device
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_INVALID_VERSION not same device
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_FAILURE: Failure processing request
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_INVALID_ARG: dip is invalid
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* Checking bits for checks made by usb_check_same_device */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#define USB_CHK_BASIC 0 /* Empty mask. Basics always done. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#define USB_CHK_SERIAL 0x00000001 /* Compare device serial numbers. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#define USB_CHK_CFG 0x00000002 /* Compare raw config clouds. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#define USB_CHK_VIDPID 0x00000004 /* Compare product and vendor ID. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#define USB_CHK_ALL 0xFFFFFFFF /* Perform maximum checking. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Power management functions remaining Contracted Consolidation Private
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb wrapper around pm_raise_power & pm_lower_power to allow for
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * non blocking behavior
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Arguments:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * dip - pointer to devinfo node of client.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * comp - component.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * level - power level.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * flags - USB_FLAGS_SLEEP:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * wait for completion.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * cb - function called on completion, may be NULL.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * arg - callback argument.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * rval - USB_SUCCESS or USB_FAILURE.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Return Values:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_SUCCESS - if no USB_FLAGS_SLEEP has been specified, the request
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * has been queued for async execution. If
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_FLAGS_SLEEP has been specified, the raising or
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * lowering of power
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * succeeded.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_FAILURE - request could not be queued or raising or lowering
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * of power failed.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* Status: C and D */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* Status: D */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB wrapper functions to set usb device power level.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Note : Power levels indicated here are USB power levels
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * and not OS power levels.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Note that these were never implemented, and are noops. However, they are
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * included here as the skeleton driver in DDK 0.8 and 0.9 mentioned them.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Status: C and D.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Serialization functions remaining Contracted Consolidation Private
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* This whole section: status: C and D. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * opaque serialization handle.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Used by all usb_serialization routines.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * This handle is opaque to the client driver.
59190ecd61435d19ba3515b876272aee7bd12298vboxsynctypedef struct usb_serialization *usb_serialization_t;
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_init_serialization
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * setup for serialization
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * ARGUMENTS:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * s_dip - devinfo pointer
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * flag - USB_INIT_SER_CHECK_SAME_THREAD
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * when set, usb_release_access() will
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * verify that the same thread releases
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * access. If not, a console warning will
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * be issued but access will be released
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_serialization handle
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* fini for serialization */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Various ways of calling usb_serialize_access. These correspond to
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * their cv_*wait* function counterparts for usb_serialize_access.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_serialize_access:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * acquire serialized access
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * ARGUMENTS:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_serp - usb_serialization handle
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * how_to_wait - Which cv_*wait* function to wait for condition.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_WAIT: use cv_wait
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_WAIT_SIG: use cv_wait_sig
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_TIMEDWAIT: use cv_timedwait
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_TIMEDWAIT_SIG: use cv_timedwait_sig
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * delta_timeout - Time in ms from current time to timeout. Checked
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * only if USB_TIMEDWAIT or USB_TIMEDWAIT_SIG
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * specified in how_to_wait.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Same as values returned by cv_*wait* functions,
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * except for when how_to_wait == USB_WAIT, where 0 is always returned.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * For calls where a timeout or signal could be expected, use this value
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * to tell whether a kill(2) signal or timeout occurred.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_try_serialize_access:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * try acquiring serialized access
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * ARGUMENTS:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_serp - usb_serialization handle
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * flag - unused
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_SUCCESS - access has been acquired
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_FAILURE - access has not been acquired
59190ecd61435d19ba3515b876272aee7bd12298vboxsyncint usb_try_serialize_access(usb_serialization_t usb_serp, uint_t flag);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_release_access:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * release serialized access
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * ARGUMENTS:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * usb_serp - usb_serialization handle
59190ecd61435d19ba3515b876272aee7bd12298vboxsyncvoid usb_release_access(usb_serialization_t usb_serp);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Asynchronous functions remaining Contracted Consolidation Private
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* This whole section: status: C and D. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* For async_req functions. */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Issue a request to the asynchronous request service
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * All async request functions return USB_SUCCESS or USB_FAILURE
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Arguments:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * dip - pointer to devinfo node
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * func - pointer of function to execute asynchronously
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * arg - argument to function
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * flag - USB_FLAGS_SLEEP or USB_FLAGS_NOSLEEP or
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_FLAGS_NOQUEUE
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Return Values:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_SUCCESS - function was scheduled
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_FAILURE - function could not be scheduled
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Flag combinations:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * SLEEP - block waiting for resources. always succeeds
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * NOSLEEP - do not wait for resources, may fail.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * NOSLEEP+NOQUEUE - do not wait for resources, do not queue
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * SLEEP+NOQUEUE - block waiting for resources but may still fail
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * if no thread available
59190ecd61435d19ba3515b876272aee7bd12298vboxsync void (*func)(void *),
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * index for getting to usb_pipehandle_list in usba_device
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB device driver registration and callback functions remaining
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Contracted Project Private (for VirtualBox USB Device Capture)
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * **************************************************************************
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#if 0 /* Uncomment this section if usbai.h doesn't have this these bits (required for snv < 123) */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * getting the device strings of manufacturer, product and serial number
59190ecd61435d19ba3515b876272aee7bd12298vboxsynctypedef struct usb_dev_str {
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * It is the callback function type for capture driver.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Arguments:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * dev_descr - pointer to device descriptor
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * dev_str - pointer to device strings
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * path - pointer to device physical path
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * bus - USB bus address
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * port - USB port number
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * drv - capture driver name.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * It is returned by the callback func.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Return Values:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_SUCCESS - VirtualBox will capture the device
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * USB_FAILURE - VirtualBox will not capture the device
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Register the callback function in the usba.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Argument:
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * dip - client driver's devinfo pointer
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * cb - callback function
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Return Values:
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync * USB_SUCCESS - the registration was successful
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync * USB_FAILURE - the registration failed
59190ecd61435d19ba3515b876272aee7bd12298vboxsync * Unregister the callback function in the usba.
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#endif /* ALLOCB_TEST */
59190ecd61435d19ba3515b876272aee7bd12298vboxsync/* create an USB style M_CTL message */
59190ecd61435d19ba3515b876272aee7bd12298vboxsyncmblk_t *usba_mk_mctl(struct iocblk, void *, size_t);
59190ecd61435d19ba3515b876272aee7bd12298vboxsync#endif /* _SYS_USB_USBA_USBAI_PRIVATE_H */