xref: /onnv-gate/usr/src/uts/common/sys/usb/usb_ia/usb_iavar.h (revision 7492:2387323b838f)
13341Sgc161489 /*
23341Sgc161489  * CDDL HEADER START
33341Sgc161489  *
43341Sgc161489  * The contents of this file are subject to the terms of the
53341Sgc161489  * Common Development and Distribution License (the "License").
63341Sgc161489  * You may not use this file except in compliance with the License.
73341Sgc161489  *
83341Sgc161489  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93341Sgc161489  * or http://www.opensolaris.org/os/licensing.
103341Sgc161489  * See the License for the specific language governing permissions
113341Sgc161489  * and limitations under the License.
123341Sgc161489  *
133341Sgc161489  * When distributing Covered Code, include this CDDL HEADER in each
143341Sgc161489  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153341Sgc161489  * If applicable, add the following below this CDDL HEADER, with the
163341Sgc161489  * fields enclosed by brackets "[]" replaced with your own identifying
173341Sgc161489  * information: Portions Copyright [yyyy] [name of copyright owner]
183341Sgc161489  *
193341Sgc161489  * CDDL HEADER END
203341Sgc161489  */
213341Sgc161489 /*
22*7492SZhigang.Lu@Sun.COM  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
233341Sgc161489  * Use is subject to license terms.
243341Sgc161489  */
253341Sgc161489 
263341Sgc161489 #ifndef	_SYS_USB_USB_IA_H
273341Sgc161489 #define	_SYS_USB_USB_IA_H
283341Sgc161489 
293341Sgc161489 
303341Sgc161489 #ifdef	__cplusplus
313341Sgc161489 extern "C" {
323341Sgc161489 #endif
333341Sgc161489 
343341Sgc161489 #include <sys/usb/usba/usbai_private.h>
353341Sgc161489 
363341Sgc161489 /*
373341Sgc161489  * soft	state information for this usb_ia
383341Sgc161489  */
393341Sgc161489 typedef struct usb_ia {
403341Sgc161489 	int			ia_instance;
413341Sgc161489 
423341Sgc161489 	uint_t			ia_init_state;
433341Sgc161489 
443341Sgc161489 	kmutex_t		ia_mutex;
453341Sgc161489 
463341Sgc161489 	/*
473341Sgc161489 	 * dev_info_t reference
483341Sgc161489 	 */
493341Sgc161489 	dev_info_t		*ia_dip;
503341Sgc161489 
513341Sgc161489 	/* pointer to usb_ia_power_t */
523341Sgc161489 	usb_common_power_t	*ia_pm;
533341Sgc161489 
543341Sgc161489 	int			ia_dev_state;
553341Sgc161489 
563341Sgc161489 	int			ia_first_if;
573341Sgc161489 	int			ia_n_ifs;
583341Sgc161489 
593341Sgc161489 	/* track event registration of children */
603341Sgc161489 	uint8_t			*ia_child_events;
613341Sgc161489 	/*
623341Sgc161489 	 * ia_children_dips is a  array for holding
633341Sgc161489 	 * each child dip indexed by interface number
643341Sgc161489 	 */
653341Sgc161489 	dev_info_t		**ia_children_dips;
663341Sgc161489 
673341Sgc161489 	size_t			ia_cd_list_length;
683341Sgc161489 
693341Sgc161489 	/* logging of messages */
703341Sgc161489 	usb_log_handle_t	ia_log_handle;
713341Sgc161489 
723341Sgc161489 	/* usb registration */
733341Sgc161489 	usb_client_dev_data_t	*ia_dev_data;
743341Sgc161489 
753341Sgc161489 	/* event support */
763341Sgc161489 	ndi_event_hdl_t		ia_ndi_event_hdl;
773341Sgc161489 
783341Sgc161489 } usb_ia_t;
793341Sgc161489 
803341Sgc161489 _NOTE(MUTEX_PROTECTS_DATA(usb_ia::ia_mutex, usb_ia))
813341Sgc161489 _NOTE(MUTEX_PROTECTS_DATA(usb_ia::ia_mutex, usb_common_power_t))
823341Sgc161489 _NOTE(DATA_READABLE_WITHOUT_LOCK(usb_ia::ia_instance
833341Sgc161489 		usb_ia::ia_ndi_event_hdl
843341Sgc161489 		usb_ia::ia_dev_data
853341Sgc161489 		usb_ia::ia_log_handle
863341Sgc161489 		usb_ia::ia_dip
873341Sgc161489 		usb_ia::ia_pm))
883341Sgc161489 
893341Sgc161489 /* init state */
903341Sgc161489 #define	USB_IA_LOCK_INIT		0x0001
913341Sgc161489 #define	USB_IA_MINOR_NODE_CREATED	0x0002
923341Sgc161489 #define	USB_IA_EVENTS_REGISTERED	0x0004
933341Sgc161489 
943341Sgc161489 /* Tracking events registered by children */
953341Sgc161489 #define	USB_IA_CHILD_EVENT_DISCONNECT	0x01
963341Sgc161489 #define	USB_IA_CHILD_EVENT_PRESUSPEND	0x02
973341Sgc161489 
983341Sgc161489 /*
993341Sgc161489  * Debug printing
1003341Sgc161489  * Masks
1013341Sgc161489  */
1023341Sgc161489 #define	DPRINT_MASK_ATTA	0x00000001
1033341Sgc161489 #define	DPRINT_MASK_CBOPS	0x00000002
1043341Sgc161489 #define	DPRINT_MASK_EVENTS	0x00000004
1053341Sgc161489 #define	DPRINT_MASK_PM		0x00000010
1063341Sgc161489 #define	DPRINT_MASK_ALL 	0xFFFFFFFF
1073341Sgc161489 
1083341Sgc161489 
1093341Sgc161489 #ifdef	__cplusplus
1103341Sgc161489 }
1113341Sgc161489 #endif
1123341Sgc161489 
1133341Sgc161489 #endif	/* _SYS_USB_USB_IA_H */
114