xref: /illumos-gate/usr/src/uts/common/sys/usb/usba/hcdi.h (revision 4610e4a0)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23*4610e4a0Sfrits  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_SYS_USB_HCDI_H
287c478bd9Sstevel@tonic-gate #define	_SYS_USB_HCDI_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #include <sys/usb/usba/genconsole.h>
377c478bd9Sstevel@tonic-gate #include <sys/usb/usba/usba_types.h>
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate /*
407c478bd9Sstevel@tonic-gate  * HCD ops structure
417c478bd9Sstevel@tonic-gate  *
427c478bd9Sstevel@tonic-gate  * - this structure defines all entry points into HCD
437c478bd9Sstevel@tonic-gate  *
447c478bd9Sstevel@tonic-gate  * - all client driver USBAI functions that require HCD
457c478bd9Sstevel@tonic-gate  *   involvement go through this ops table
467c478bd9Sstevel@tonic-gate  *
477c478bd9Sstevel@tonic-gate  * - at HCD attach time, the HCD ops are passed to
487c478bd9Sstevel@tonic-gate  *   to the USBA through usba_hcdi_attach()
497c478bd9Sstevel@tonic-gate  *
507c478bd9Sstevel@tonic-gate  * some of these ops implement the semantics of the corresponding
517c478bd9Sstevel@tonic-gate  * USBAI interfaces. Refer to usbai.h for detailed description
527c478bd9Sstevel@tonic-gate  */
537c478bd9Sstevel@tonic-gate #define	HCDI_OPS_VERSION_0 0
547c478bd9Sstevel@tonic-gate #define	HCDI_OPS_VERSION	HCDI_OPS_VERSION_0
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate typedef struct usba_hcdi_ops {
577c478bd9Sstevel@tonic-gate 	int	usba_hcdi_ops_version;	/* implementation version */
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate 	dev_info_t	*usba_hcdi_dip;	/* HCD's devinfo ptr */
607c478bd9Sstevel@tonic-gate 
61*4610e4a0Sfrits 	/* can this hcd support pm? */
62*4610e4a0Sfrits 	int	(*usba_hcdi_pm_support)(dev_info_t *dip);
63*4610e4a0Sfrits 
647c478bd9Sstevel@tonic-gate 	/*
657c478bd9Sstevel@tonic-gate 	 * usba_hcdi_pipe_open:
667c478bd9Sstevel@tonic-gate 	 *	implements the semantics of usb_pipe_open()
677c478bd9Sstevel@tonic-gate 	 *	USBA allocate the pipe_handle which contains
687c478bd9Sstevel@tonic-gate 	 *	pipe_policy and endpoint pointers
697c478bd9Sstevel@tonic-gate 	 */
707c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_open)(
717c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
727c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate 	/*
757c478bd9Sstevel@tonic-gate 	 * close a pipe
767c478bd9Sstevel@tonic-gate 	 */
777c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_close)(
787c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
797c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate 	/*
827c478bd9Sstevel@tonic-gate 	 * pipe management
837c478bd9Sstevel@tonic-gate 	 */
847c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_reset)(
857c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
867c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate 	/*
897c478bd9Sstevel@tonic-gate 	 * data transfer management
907c478bd9Sstevel@tonic-gate 	 */
917c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_ctrl_xfer)(
927c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
937c478bd9Sstevel@tonic-gate 		usb_ctrl_req_t		*usb_ctrl_req,
947c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate 	/*
977c478bd9Sstevel@tonic-gate 	 * get HCD limitation on bulk xfer at a time?
987c478bd9Sstevel@tonic-gate 	 */
997c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_bulk_transfer_size)(
1007c478bd9Sstevel@tonic-gate 		usba_device_t		*usba_device,
1017c478bd9Sstevel@tonic-gate 		size_t			*size);
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate 	/*
1047c478bd9Sstevel@tonic-gate 	 * do bulk read/write
1057c478bd9Sstevel@tonic-gate 	 */
1067c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_bulk_xfer)(
1077c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
1087c478bd9Sstevel@tonic-gate 		usb_bulk_req_t		*usb_bulk_req,
1097c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
1107c478bd9Sstevel@tonic-gate 
1117c478bd9Sstevel@tonic-gate 	/*
1127c478bd9Sstevel@tonic-gate 	 * do interrupt pipe read/write
1137c478bd9Sstevel@tonic-gate 	 */
1147c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_intr_xfer)(
1157c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
1167c478bd9Sstevel@tonic-gate 		usb_intr_req_t		*usb_intr_req,
1177c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate 	/*
1207c478bd9Sstevel@tonic-gate 	 * stop interrupt pipe polling
1217c478bd9Sstevel@tonic-gate 	 */
1227c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_stop_intr_polling)(
1237c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
1247c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate 	/*
1277c478bd9Sstevel@tonic-gate 	 * do isoch pipe read/write
1287c478bd9Sstevel@tonic-gate 	 */
1297c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_isoc_xfer)(
1307c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
1317c478bd9Sstevel@tonic-gate 		usb_isoc_req_t		*usb_isoc_req,
1327c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate 	/*
1357c478bd9Sstevel@tonic-gate 	 * stop isoc pipe polling
1367c478bd9Sstevel@tonic-gate 	 */
1377c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_pipe_stop_isoc_polling)(
1387c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t	*pipe_handle,
1397c478bd9Sstevel@tonic-gate 		usb_flags_t		usb_flags);
1407c478bd9Sstevel@tonic-gate 
1417c478bd9Sstevel@tonic-gate 	/* utility isoc functions */
1427c478bd9Sstevel@tonic-gate 	usb_frame_number_t
1437c478bd9Sstevel@tonic-gate 		(*usba_hcdi_get_current_frame_number)(
1447c478bd9Sstevel@tonic-gate 		usba_device_t		*usba_device);
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate 	uint_t	(*usba_hcdi_get_max_isoc_pkts)(
1477c478bd9Sstevel@tonic-gate 		usba_device_t		*usba_device);
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate 	/*
1507c478bd9Sstevel@tonic-gate 	 * Initialize OBP support for input
1517c478bd9Sstevel@tonic-gate 	 */
1527c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_console_input_init)(
1537c478bd9Sstevel@tonic-gate 		usba_pipe_handle_data_t		*pipe_handle,
1547c478bd9Sstevel@tonic-gate 		uchar_t				**obp_buf,
1557c478bd9Sstevel@tonic-gate 		usb_console_info_impl_t		*console_input_info);
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate 	/*
1587c478bd9Sstevel@tonic-gate 	 * Free resources allocated by usba_hcdi_console_input_init
1597c478bd9Sstevel@tonic-gate 	 */
1607c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_console_input_fini)(
1617c478bd9Sstevel@tonic-gate 		usb_console_info_impl_t		*console_input_info);
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate 	/*
1647c478bd9Sstevel@tonic-gate 	 * Save controller state information
1657c478bd9Sstevel@tonic-gate 	 */
1667c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_console_input_enter)(
1677c478bd9Sstevel@tonic-gate 		usb_console_info_impl_t		*console_input_info);
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate 	/*
1707c478bd9Sstevel@tonic-gate 	 * Read character from controller
1717c478bd9Sstevel@tonic-gate 	 */
1727c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_console_read)(
1737c478bd9Sstevel@tonic-gate 		usb_console_info_impl_t		*console_input_info,
1747c478bd9Sstevel@tonic-gate 		uint_t				*num_characters);
1757c478bd9Sstevel@tonic-gate 
1767c478bd9Sstevel@tonic-gate 	/*
1777c478bd9Sstevel@tonic-gate 	 * Restore controller state information
1787c478bd9Sstevel@tonic-gate 	 */
1797c478bd9Sstevel@tonic-gate 	int	(*usba_hcdi_console_input_exit)(
1807c478bd9Sstevel@tonic-gate 		usb_console_info_impl_t		*console_input_info);
1817c478bd9Sstevel@tonic-gate } usba_hcdi_ops_t;
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate /*
1857c478bd9Sstevel@tonic-gate  * callback support:
1867c478bd9Sstevel@tonic-gate  *	this function handles all HCD callbacks as follows:
1877c478bd9Sstevel@tonic-gate  *	- USB_FLAGS_SLEEP determines whether the client driver made
1887c478bd9Sstevel@tonic-gate  *	  a synchronous or asynchronous USBAI call
1897c478bd9Sstevel@tonic-gate  *	- for synchronous calls, the args are copied into the pipe handle
1907c478bd9Sstevel@tonic-gate  *		and the sync cv of the pipe handle is signalled
1917c478bd9Sstevel@tonic-gate  *	- for async calls and completion_reason = 0, the normal callback
1927c478bd9Sstevel@tonic-gate  *		is invoked
1937c478bd9Sstevel@tonic-gate  *	- for async calls and completion_reason != 0, the exception
1947c478bd9Sstevel@tonic-gate  *		callback is invoked
1957c478bd9Sstevel@tonic-gate  */
1967c478bd9Sstevel@tonic-gate void
1977c478bd9Sstevel@tonic-gate usba_hcdi_cb(usba_pipe_handle_data_t	*ph,
1987c478bd9Sstevel@tonic-gate 		usb_opaque_t		req,
1997c478bd9Sstevel@tonic-gate 		usb_cr_t		completion_reason);
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate /*
2027c478bd9Sstevel@tonic-gate  * function to duplicate a interrupt/isoc request (for HCD)
2037c478bd9Sstevel@tonic-gate  */
2047c478bd9Sstevel@tonic-gate usb_intr_req_t	*usba_hcdi_dup_intr_req(dev_info_t *,
2057c478bd9Sstevel@tonic-gate 			usb_intr_req_t *, size_t, usb_flags_t);
2067c478bd9Sstevel@tonic-gate usb_isoc_req_t	*usba_hcdi_dup_isoc_req(dev_info_t *,
2077c478bd9Sstevel@tonic-gate 			usb_isoc_req_t *, usb_flags_t);
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate /* access to private member of requests */
2107c478bd9Sstevel@tonic-gate usb_opaque_t	usba_hcdi_get_req_private(usb_opaque_t);
2117c478bd9Sstevel@tonic-gate void		usba_hcdi_set_req_private(usb_opaque_t, usb_opaque_t);
2127c478bd9Sstevel@tonic-gate usba_pipe_handle_data_t *
2137c478bd9Sstevel@tonic-gate 		usba_hcdi_get_ph_data(usba_device_t *, uint8_t);
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate /* data toggle get and set */
2167c478bd9Sstevel@tonic-gate uchar_t		usba_hcdi_get_data_toggle(usba_device_t *, uint8_t);
2177c478bd9Sstevel@tonic-gate void 		usba_hcdi_set_data_toggle(usba_device_t *, uint8_t, uchar_t);
2187c478bd9Sstevel@tonic-gate 
2197c478bd9Sstevel@tonic-gate /*
2207c478bd9Sstevel@tonic-gate  * HCD Nexus driver support:
2217c478bd9Sstevel@tonic-gate  */
2227c478bd9Sstevel@tonic-gate 
2237c478bd9Sstevel@tonic-gate /*
2247c478bd9Sstevel@tonic-gate  * hcd_ops allocator/deallocator
2257c478bd9Sstevel@tonic-gate  *	USBA allocates the usba_hcdi_ops so we can easily handle
2267c478bd9Sstevel@tonic-gate  *	versioning
2277c478bd9Sstevel@tonic-gate  */
2287c478bd9Sstevel@tonic-gate usba_hcdi_ops_t	*usba_alloc_hcdi_ops();
2297c478bd9Sstevel@tonic-gate void		usba_free_hcdi_ops(usba_hcdi_ops_t *);
2307c478bd9Sstevel@tonic-gate 
2317c478bd9Sstevel@tonic-gate /*
2327c478bd9Sstevel@tonic-gate  * Argument structure for usba_hcdi_register
2337c478bd9Sstevel@tonic-gate  */
2347c478bd9Sstevel@tonic-gate typedef struct usba_hcdi_register_args {
2357c478bd9Sstevel@tonic-gate 	uint_t			usba_hcdi_register_version;
2367c478bd9Sstevel@tonic-gate 	dev_info_t		*usba_hcdi_register_dip;
2377c478bd9Sstevel@tonic-gate 	usba_hcdi_ops_t		*usba_hcdi_register_ops;
2387c478bd9Sstevel@tonic-gate 	ddi_dma_attr_t		*usba_hcdi_register_dma_attr;
2397c478bd9Sstevel@tonic-gate 	ddi_iblock_cookie_t	usba_hcdi_register_iblock_cookie;
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate } usba_hcdi_register_args_t;
2427c478bd9Sstevel@tonic-gate 
2437c478bd9Sstevel@tonic-gate #define	HCDI_REGISTER_VERS_0		0
2447c478bd9Sstevel@tonic-gate #define	HCDI_REGISTER_VERSION		HCDI_REGISTER_VERS_0
2457c478bd9Sstevel@tonic-gate 
2467c478bd9Sstevel@tonic-gate 
2477c478bd9Sstevel@tonic-gate /*
2487c478bd9Sstevel@tonic-gate  * make	this instance known to USBA
2497c478bd9Sstevel@tonic-gate  *
2507c478bd9Sstevel@tonic-gate  * the HCD must initialize the hcdi_ops before calling this function
2517c478bd9Sstevel@tonic-gate  */
2527c478bd9Sstevel@tonic-gate int	usba_hcdi_register(usba_hcdi_register_args_t *, uint_t);
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate /*
2557c478bd9Sstevel@tonic-gate  * detach support
2567c478bd9Sstevel@tonic-gate  */
2577c478bd9Sstevel@tonic-gate void	usba_hcdi_unregister(dev_info_t *);
2587c478bd9Sstevel@tonic-gate 
2597c478bd9Sstevel@tonic-gate /*
2607c478bd9Sstevel@tonic-gate  * Hotplug kstats named structure
2617c478bd9Sstevel@tonic-gate  *
2627c478bd9Sstevel@tonic-gate  * Number of types of USB transfers
2637c478bd9Sstevel@tonic-gate  */
2647c478bd9Sstevel@tonic-gate #define	USB_N_COUNT_KSTATS	4
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate typedef struct hcdi_hotplug_stats {
2677c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_hotplug_total_success;
2687c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_hotplug_success;
2697c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_hotplug_total_failure;
2707c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_hotplug_failure;
2717c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_device_count;
2727c478bd9Sstevel@tonic-gate } hcdi_hotplug_stats_t;
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate /*
2757c478bd9Sstevel@tonic-gate  * USB error kstats named structure
2767c478bd9Sstevel@tonic-gate  */
2777c478bd9Sstevel@tonic-gate typedef struct hcdi_error_stats {
2787c478bd9Sstevel@tonic-gate 	/* transport completion codes */
2797c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_crc;
2807c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_bitstuffing;
2817c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_data_toggle_mm;
2827c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_stall;
2837c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_dev_not_resp;
2847c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_pid_checkfailure;
2857c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_unexp_pid;
2867c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_data_overrun;
2877c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_data_underrun;
2887c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_buffer_overrun;
2897c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_buffer_underrun;
2907c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_timeout;
2917c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_not_accessed;
2927c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_no_resources;
2937c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_unspecified_err;
2947c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_stopped_polling;
2957c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_pipe_closing;
2967c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_pipe_reset;
2977c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_not_supported;
2987c478bd9Sstevel@tonic-gate 	struct kstat_named	cc_flushed;
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate #ifdef	NOTYETNEEDED
3017c478bd9Sstevel@tonic-gate 	/* USBA function return values */
3027c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_usb_failure;
3037c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_usb_no_resources;
3047c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_usb_no_bandwidth;
3057c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_usb_pipe_reserved;
3067c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_usb_pipe_unshareable;
3077c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_usb_not_supported;
3087c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_usb_pipe_error;
3097c478bd9Sstevel@tonic-gate 	struct kstat_named	hcdi_usb_pipe_busy;
3107c478bd9Sstevel@tonic-gate #endif
3117c478bd9Sstevel@tonic-gate } hcdi_error_stats_t;
3127c478bd9Sstevel@tonic-gate 
3137c478bd9Sstevel@tonic-gate /*
3147c478bd9Sstevel@tonic-gate  * hcdi kstat defines
3157c478bd9Sstevel@tonic-gate  * XXX this needs to be a function
3167c478bd9Sstevel@tonic-gate  */
3177c478bd9Sstevel@tonic-gate #define	HCDI_HOTPLUG_STATS(hcdi)	((hcdi)->hcdi_hotplug_stats)
3187c478bd9Sstevel@tonic-gate #define	HCDI_HOTPLUG_STATS_DATA(hcdi)	\
3197c478bd9Sstevel@tonic-gate 	((hcdi_hotplug_stats_t *)HCDI_HOTPLUG_STATS((hcdi))->ks_data)
3207c478bd9Sstevel@tonic-gate 
3217c478bd9Sstevel@tonic-gate #define	HCDI_ERROR_STATS(hcdi)		((hcdi)->hcdi_error_stats)
3227c478bd9Sstevel@tonic-gate #define	HCDI_ERROR_STATS_DATA(hcdi)	\
3237c478bd9Sstevel@tonic-gate 	((hcdi_error_stats_t *)HCDI_ERROR_STATS((hcdi))->ks_data)
3247c478bd9Sstevel@tonic-gate 
3257c478bd9Sstevel@tonic-gate 
3267c478bd9Sstevel@tonic-gate #ifdef __cplusplus
3277c478bd9Sstevel@tonic-gate }
3287c478bd9Sstevel@tonic-gate #endif
3297c478bd9Sstevel@tonic-gate 
3307c478bd9Sstevel@tonic-gate #endif	/* _SYS_USB_HCDI_H */
331