/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_USB_HCDI_H
#define _SYS_USB_HCDI_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* HCD ops structure
*
* - this structure defines all entry points into HCD
*
* - all client driver USBAI functions that require HCD
* involvement go through this ops table
*
* - at HCD attach time, the HCD ops are passed to
* to the USBA through usba_hcdi_attach()
*
* some of these ops implement the semantics of the corresponding
* USBAI interfaces. Refer to usbai.h for detailed description
*/
#define HCDI_OPS_VERSION_0 0
typedef struct usba_hcdi_ops {
/* can this hcd support pm? */
/*
* usba_hcdi_pipe_open:
* implements the semantics of usb_pipe_open()
* USBA allocate the pipe_handle which contains
* pipe_policy and endpoint pointers
*/
int (*usba_hcdi_pipe_open)(
/*
* close a pipe
*/
int (*usba_hcdi_pipe_close)(
/*
* pipe management
*/
int (*usba_hcdi_pipe_reset)(
/*
* pipe management
*/
void (*usba_hcdi_pipe_reset_data_toggle)(
/*
* data transfer management
*/
int (*usba_hcdi_pipe_ctrl_xfer)(
/*
* get HCD limitation on bulk xfer at a time?
*/
int (*usba_hcdi_bulk_transfer_size)(
/*
*/
int (*usba_hcdi_pipe_bulk_xfer)(
/*
*/
int (*usba_hcdi_pipe_intr_xfer)(
/*
* stop interrupt pipe polling
*/
int (*usba_hcdi_pipe_stop_intr_polling)(
/*
*/
int (*usba_hcdi_pipe_isoc_xfer)(
/*
* stop isoc pipe polling
*/
int (*usba_hcdi_pipe_stop_isoc_polling)(
/* utility isoc functions */
int (*usba_hcdi_get_max_isoc_pkts)(
/*
* Initialize OBP support for input
*/
int (*usba_hcdi_console_input_init)(
/*
* Free resources allocated by usba_hcdi_console_input_init
*/
int (*usba_hcdi_console_input_fini)(
/*
* Save controller state information
*/
int (*usba_hcdi_console_input_enter)(
/*
* Read character from controller
*/
int (*usba_hcdi_console_read)(
/*
* Restore controller state information
*/
int (*usba_hcdi_console_input_exit)(
/*
* VERSION 1 ops: support for polled output
*/
int (*usba_hcdi_console_output_init)(
int (*usba_hcdi_console_output_fini)(
int (*usba_hcdi_console_output_enter)(
int (*usba_hcdi_console_write)(
int (*usba_hcdi_console_output_exit)(
/*
* callback support:
* this function handles all HCD callbacks as follows:
* - USB_FLAGS_SLEEP determines whether the client driver made
* a synchronous or asynchronous USBAI call
* - for synchronous calls, the args are copied into the pipe handle
* and the sync cv of the pipe handle is signalled
* - for async calls and completion_reason = 0, the normal callback
* is invoked
* - for async calls and completion_reason != 0, the exception
* callback is invoked
*/
void
/*
*/
/* access to private member of requests */
/* data toggle get and set */
/*
* HCD Nexus driver support:
*/
/*
* hcd_ops allocator/deallocator
* USBA allocates the usba_hcdi_ops so we can easily handle
* versioning
*/
void usba_free_hcdi_ops(usba_hcdi_ops_t *);
/*
* Argument structure for usba_hcdi_register
*/
typedef struct usba_hcdi_register_args {
#define HCDI_REGISTER_VERS_0 0
/*
* make this instance known to USBA
*
* the HCD must initialize the hcdi_ops before calling this function
*/
/*
* detach support
*/
void usba_hcdi_unregister(dev_info_t *);
/*
* Hotplug kstats named structure
*
* Number of types of USB transfers
*/
typedef struct hcdi_hotplug_stats {
/*
* USB error kstats named structure
*/
typedef struct hcdi_error_stats {
/* transport completion codes */
/*
* hcdi kstat defines
* XXX this needs to be a function
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_HCDI_H */