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 5*28cdc3d7Sszhou * Common Development and Distribution License (the "License"). 6*28cdc3d7Sszhou * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*28cdc3d7Sszhou * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_USB_HCDI_H 277c478bd9Sstevel@tonic-gate #define _SYS_USB_HCDI_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #ifdef __cplusplus 327c478bd9Sstevel@tonic-gate extern "C" { 337c478bd9Sstevel@tonic-gate #endif 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate #include <sys/usb/usba/genconsole.h> 367c478bd9Sstevel@tonic-gate #include <sys/usb/usba/usba_types.h> 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate /* 397c478bd9Sstevel@tonic-gate * HCD ops structure 407c478bd9Sstevel@tonic-gate * 417c478bd9Sstevel@tonic-gate * - this structure defines all entry points into HCD 427c478bd9Sstevel@tonic-gate * 437c478bd9Sstevel@tonic-gate * - all client driver USBAI functions that require HCD 447c478bd9Sstevel@tonic-gate * involvement go through this ops table 457c478bd9Sstevel@tonic-gate * 467c478bd9Sstevel@tonic-gate * - at HCD attach time, the HCD ops are passed to 477c478bd9Sstevel@tonic-gate * to the USBA through usba_hcdi_attach() 487c478bd9Sstevel@tonic-gate * 497c478bd9Sstevel@tonic-gate * some of these ops implement the semantics of the corresponding 507c478bd9Sstevel@tonic-gate * USBAI interfaces. Refer to usbai.h for detailed description 517c478bd9Sstevel@tonic-gate */ 527c478bd9Sstevel@tonic-gate #define HCDI_OPS_VERSION_0 0 53*28cdc3d7Sszhou #define HCDI_OPS_VERSION_1 1 54*28cdc3d7Sszhou #define HCDI_OPS_VERSION HCDI_OPS_VERSION_1 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 614610e4a0Sfrits /* can this hcd support pm? */ 624610e4a0Sfrits int (*usba_hcdi_pm_support)(dev_info_t *dip); 634610e4a0Sfrits 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); 181*28cdc3d7Sszhou 182*28cdc3d7Sszhou 183*28cdc3d7Sszhou /* 184*28cdc3d7Sszhou * VERSION 1 ops: support for polled output 185*28cdc3d7Sszhou */ 186*28cdc3d7Sszhou int (*usba_hcdi_console_output_init)( 187*28cdc3d7Sszhou usba_pipe_handle_data_t *pipe_handle, 188*28cdc3d7Sszhou usb_console_info_impl_t *console_output_info); 189*28cdc3d7Sszhou 190*28cdc3d7Sszhou int (*usba_hcdi_console_output_fini)( 191*28cdc3d7Sszhou usb_console_info_impl_t *console_output_info); 192*28cdc3d7Sszhou 193*28cdc3d7Sszhou int (*usba_hcdi_console_output_enter)( 194*28cdc3d7Sszhou usb_console_info_impl_t *console_output_info); 195*28cdc3d7Sszhou 196*28cdc3d7Sszhou int (*usba_hcdi_console_write)( 197*28cdc3d7Sszhou usb_console_info_impl_t *console_output_info, 198*28cdc3d7Sszhou uchar_t *buf, 199*28cdc3d7Sszhou uint_t num_characters, 200*28cdc3d7Sszhou uint_t *num_characters_written); 201*28cdc3d7Sszhou 202*28cdc3d7Sszhou int (*usba_hcdi_console_output_exit)( 203*28cdc3d7Sszhou usb_console_info_impl_t *console_output_info); 2047c478bd9Sstevel@tonic-gate } usba_hcdi_ops_t; 2057c478bd9Sstevel@tonic-gate 2067c478bd9Sstevel@tonic-gate 2077c478bd9Sstevel@tonic-gate /* 2087c478bd9Sstevel@tonic-gate * callback support: 2097c478bd9Sstevel@tonic-gate * this function handles all HCD callbacks as follows: 2107c478bd9Sstevel@tonic-gate * - USB_FLAGS_SLEEP determines whether the client driver made 2117c478bd9Sstevel@tonic-gate * a synchronous or asynchronous USBAI call 2127c478bd9Sstevel@tonic-gate * - for synchronous calls, the args are copied into the pipe handle 2137c478bd9Sstevel@tonic-gate * and the sync cv of the pipe handle is signalled 2147c478bd9Sstevel@tonic-gate * - for async calls and completion_reason = 0, the normal callback 2157c478bd9Sstevel@tonic-gate * is invoked 2167c478bd9Sstevel@tonic-gate * - for async calls and completion_reason != 0, the exception 2177c478bd9Sstevel@tonic-gate * callback is invoked 2187c478bd9Sstevel@tonic-gate */ 2197c478bd9Sstevel@tonic-gate void 2207c478bd9Sstevel@tonic-gate usba_hcdi_cb(usba_pipe_handle_data_t *ph, 2217c478bd9Sstevel@tonic-gate usb_opaque_t req, 2227c478bd9Sstevel@tonic-gate usb_cr_t completion_reason); 2237c478bd9Sstevel@tonic-gate 2247c478bd9Sstevel@tonic-gate /* 2257c478bd9Sstevel@tonic-gate * function to duplicate a interrupt/isoc request (for HCD) 2267c478bd9Sstevel@tonic-gate */ 2277c478bd9Sstevel@tonic-gate usb_intr_req_t *usba_hcdi_dup_intr_req(dev_info_t *, 2287c478bd9Sstevel@tonic-gate usb_intr_req_t *, size_t, usb_flags_t); 2297c478bd9Sstevel@tonic-gate usb_isoc_req_t *usba_hcdi_dup_isoc_req(dev_info_t *, 2307c478bd9Sstevel@tonic-gate usb_isoc_req_t *, usb_flags_t); 2317c478bd9Sstevel@tonic-gate 2327c478bd9Sstevel@tonic-gate /* access to private member of requests */ 2337c478bd9Sstevel@tonic-gate usb_opaque_t usba_hcdi_get_req_private(usb_opaque_t); 2347c478bd9Sstevel@tonic-gate void usba_hcdi_set_req_private(usb_opaque_t, usb_opaque_t); 2357c478bd9Sstevel@tonic-gate usba_pipe_handle_data_t * 2367c478bd9Sstevel@tonic-gate usba_hcdi_get_ph_data(usba_device_t *, uint8_t); 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gate /* data toggle get and set */ 2397c478bd9Sstevel@tonic-gate uchar_t usba_hcdi_get_data_toggle(usba_device_t *, uint8_t); 2407c478bd9Sstevel@tonic-gate void usba_hcdi_set_data_toggle(usba_device_t *, uint8_t, uchar_t); 2417c478bd9Sstevel@tonic-gate 2427c478bd9Sstevel@tonic-gate /* 2437c478bd9Sstevel@tonic-gate * HCD Nexus driver support: 2447c478bd9Sstevel@tonic-gate */ 2457c478bd9Sstevel@tonic-gate 2467c478bd9Sstevel@tonic-gate /* 2477c478bd9Sstevel@tonic-gate * hcd_ops allocator/deallocator 2487c478bd9Sstevel@tonic-gate * USBA allocates the usba_hcdi_ops so we can easily handle 2497c478bd9Sstevel@tonic-gate * versioning 2507c478bd9Sstevel@tonic-gate */ 2517c478bd9Sstevel@tonic-gate usba_hcdi_ops_t *usba_alloc_hcdi_ops(); 2527c478bd9Sstevel@tonic-gate void usba_free_hcdi_ops(usba_hcdi_ops_t *); 2537c478bd9Sstevel@tonic-gate 2547c478bd9Sstevel@tonic-gate /* 2557c478bd9Sstevel@tonic-gate * Argument structure for usba_hcdi_register 2567c478bd9Sstevel@tonic-gate */ 2577c478bd9Sstevel@tonic-gate typedef struct usba_hcdi_register_args { 2587c478bd9Sstevel@tonic-gate uint_t usba_hcdi_register_version; 2597c478bd9Sstevel@tonic-gate dev_info_t *usba_hcdi_register_dip; 2607c478bd9Sstevel@tonic-gate usba_hcdi_ops_t *usba_hcdi_register_ops; 2617c478bd9Sstevel@tonic-gate ddi_dma_attr_t *usba_hcdi_register_dma_attr; 2627c478bd9Sstevel@tonic-gate ddi_iblock_cookie_t usba_hcdi_register_iblock_cookie; 2637c478bd9Sstevel@tonic-gate 2647c478bd9Sstevel@tonic-gate } usba_hcdi_register_args_t; 2657c478bd9Sstevel@tonic-gate 2667c478bd9Sstevel@tonic-gate #define HCDI_REGISTER_VERS_0 0 2677c478bd9Sstevel@tonic-gate #define HCDI_REGISTER_VERSION HCDI_REGISTER_VERS_0 2687c478bd9Sstevel@tonic-gate 2697c478bd9Sstevel@tonic-gate 2707c478bd9Sstevel@tonic-gate /* 2717c478bd9Sstevel@tonic-gate * make this instance known to USBA 2727c478bd9Sstevel@tonic-gate * 2737c478bd9Sstevel@tonic-gate * the HCD must initialize the hcdi_ops before calling this function 2747c478bd9Sstevel@tonic-gate */ 2757c478bd9Sstevel@tonic-gate int usba_hcdi_register(usba_hcdi_register_args_t *, uint_t); 2767c478bd9Sstevel@tonic-gate 2777c478bd9Sstevel@tonic-gate /* 2787c478bd9Sstevel@tonic-gate * detach support 2797c478bd9Sstevel@tonic-gate */ 2807c478bd9Sstevel@tonic-gate void usba_hcdi_unregister(dev_info_t *); 2817c478bd9Sstevel@tonic-gate 2827c478bd9Sstevel@tonic-gate /* 2837c478bd9Sstevel@tonic-gate * Hotplug kstats named structure 2847c478bd9Sstevel@tonic-gate * 2857c478bd9Sstevel@tonic-gate * Number of types of USB transfers 2867c478bd9Sstevel@tonic-gate */ 2877c478bd9Sstevel@tonic-gate #define USB_N_COUNT_KSTATS 4 2887c478bd9Sstevel@tonic-gate 2897c478bd9Sstevel@tonic-gate typedef struct hcdi_hotplug_stats { 2907c478bd9Sstevel@tonic-gate struct kstat_named hcdi_hotplug_total_success; 2917c478bd9Sstevel@tonic-gate struct kstat_named hcdi_hotplug_success; 2927c478bd9Sstevel@tonic-gate struct kstat_named hcdi_hotplug_total_failure; 2937c478bd9Sstevel@tonic-gate struct kstat_named hcdi_hotplug_failure; 2947c478bd9Sstevel@tonic-gate struct kstat_named hcdi_device_count; 2957c478bd9Sstevel@tonic-gate } hcdi_hotplug_stats_t; 2967c478bd9Sstevel@tonic-gate 2977c478bd9Sstevel@tonic-gate /* 2987c478bd9Sstevel@tonic-gate * USB error kstats named structure 2997c478bd9Sstevel@tonic-gate */ 3007c478bd9Sstevel@tonic-gate typedef struct hcdi_error_stats { 3017c478bd9Sstevel@tonic-gate /* transport completion codes */ 3027c478bd9Sstevel@tonic-gate struct kstat_named cc_crc; 3037c478bd9Sstevel@tonic-gate struct kstat_named cc_bitstuffing; 3047c478bd9Sstevel@tonic-gate struct kstat_named cc_data_toggle_mm; 3057c478bd9Sstevel@tonic-gate struct kstat_named cc_stall; 3067c478bd9Sstevel@tonic-gate struct kstat_named cc_dev_not_resp; 3077c478bd9Sstevel@tonic-gate struct kstat_named cc_pid_checkfailure; 3087c478bd9Sstevel@tonic-gate struct kstat_named cc_unexp_pid; 3097c478bd9Sstevel@tonic-gate struct kstat_named cc_data_overrun; 3107c478bd9Sstevel@tonic-gate struct kstat_named cc_data_underrun; 3117c478bd9Sstevel@tonic-gate struct kstat_named cc_buffer_overrun; 3127c478bd9Sstevel@tonic-gate struct kstat_named cc_buffer_underrun; 3137c478bd9Sstevel@tonic-gate struct kstat_named cc_timeout; 3147c478bd9Sstevel@tonic-gate struct kstat_named cc_not_accessed; 3157c478bd9Sstevel@tonic-gate struct kstat_named cc_no_resources; 3167c478bd9Sstevel@tonic-gate struct kstat_named cc_unspecified_err; 3177c478bd9Sstevel@tonic-gate struct kstat_named cc_stopped_polling; 3187c478bd9Sstevel@tonic-gate struct kstat_named cc_pipe_closing; 3197c478bd9Sstevel@tonic-gate struct kstat_named cc_pipe_reset; 3207c478bd9Sstevel@tonic-gate struct kstat_named cc_not_supported; 3217c478bd9Sstevel@tonic-gate struct kstat_named cc_flushed; 3227c478bd9Sstevel@tonic-gate 3237c478bd9Sstevel@tonic-gate #ifdef NOTYETNEEDED 3247c478bd9Sstevel@tonic-gate /* USBA function return values */ 3257c478bd9Sstevel@tonic-gate struct kstat_named hcdi_usb_failure; 3267c478bd9Sstevel@tonic-gate struct kstat_named hcdi_usb_no_resources; 3277c478bd9Sstevel@tonic-gate struct kstat_named hcdi_usb_no_bandwidth; 3287c478bd9Sstevel@tonic-gate struct kstat_named hcdi_usb_pipe_reserved; 3297c478bd9Sstevel@tonic-gate struct kstat_named hcdi_usb_pipe_unshareable; 3307c478bd9Sstevel@tonic-gate struct kstat_named hcdi_usb_not_supported; 3317c478bd9Sstevel@tonic-gate struct kstat_named hcdi_usb_pipe_error; 3327c478bd9Sstevel@tonic-gate struct kstat_named hcdi_usb_pipe_busy; 3337c478bd9Sstevel@tonic-gate #endif 3347c478bd9Sstevel@tonic-gate } hcdi_error_stats_t; 3357c478bd9Sstevel@tonic-gate 3367c478bd9Sstevel@tonic-gate /* 3377c478bd9Sstevel@tonic-gate * hcdi kstat defines 3387c478bd9Sstevel@tonic-gate * XXX this needs to be a function 3397c478bd9Sstevel@tonic-gate */ 3407c478bd9Sstevel@tonic-gate #define HCDI_HOTPLUG_STATS(hcdi) ((hcdi)->hcdi_hotplug_stats) 3417c478bd9Sstevel@tonic-gate #define HCDI_HOTPLUG_STATS_DATA(hcdi) \ 3427c478bd9Sstevel@tonic-gate ((hcdi_hotplug_stats_t *)HCDI_HOTPLUG_STATS((hcdi))->ks_data) 3437c478bd9Sstevel@tonic-gate 3447c478bd9Sstevel@tonic-gate #define HCDI_ERROR_STATS(hcdi) ((hcdi)->hcdi_error_stats) 3457c478bd9Sstevel@tonic-gate #define HCDI_ERROR_STATS_DATA(hcdi) \ 3467c478bd9Sstevel@tonic-gate ((hcdi_error_stats_t *)HCDI_ERROR_STATS((hcdi))->ks_data) 3477c478bd9Sstevel@tonic-gate 3487c478bd9Sstevel@tonic-gate 3497c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3507c478bd9Sstevel@tonic-gate } 3517c478bd9Sstevel@tonic-gate #endif 3527c478bd9Sstevel@tonic-gate 3537c478bd9Sstevel@tonic-gate #endif /* _SYS_USB_HCDI_H */ 354