xref: /illumos-gate/usr/src/uts/common/sys/usb/usba/usbai_register_impl.h (revision ff0e937b36dcde1a47ff7b00aa76a491c0dc07a8)
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
5d29f5a71Szhigang lu - Sun Microsystems - Beijing China  * Common Development and Distribution License (the "License").
6d29f5a71Szhigang lu - Sun Microsystems - Beijing China  * 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*ff0e937bSRaymond Chen  * Copyright 2009 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_REGISTER_IMPL_H
277c478bd9Sstevel@tonic-gate #define	_SYS_USB_REGISTER_IMPL_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
317c478bd9Sstevel@tonic-gate extern "C" {
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate /* For binary dump function */
357c478bd9Sstevel@tonic-gate #define	BINDUMP_BYTES_PER_LINE	16 /* For binary dump of class/vendor descr */
367c478bd9Sstevel@tonic-gate #define	INDENT_SPACE_STR	"    " /* Spaces for indentation */
377c478bd9Sstevel@tonic-gate #define	SPACES_PER_INDENT	(strlen(INDENT_SPACE_STR) - 1)
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #define	USBA_ALL	-1			/* Build all */
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate /* State of the tree-building process */
427c478bd9Sstevel@tonic-gate typedef struct usba_reg_state {
437c478bd9Sstevel@tonic-gate 	dev_info_t	*dip;			/* Dev info pointer */
447c478bd9Sstevel@tonic-gate 	usb_cfg_data_t	*st_curr_cfg;	/* Current cfg being init'ed */
457c478bd9Sstevel@tonic-gate 	usb_if_data_t	*st_curr_if;		/* Current if being init'ed */
467c478bd9Sstevel@tonic-gate 	usb_alt_if_data_t *st_curr_alt;	/* Current alt being init'ed */
477c478bd9Sstevel@tonic-gate 	usb_ep_data_t	*st_curr_ep;		/* Current ep being init'ed */
487c478bd9Sstevel@tonic-gate 	int		st_last_processed_descr_type; /* Type of last descr */
497c478bd9Sstevel@tonic-gate 					    /* processed for placing c/vs */
507c478bd9Sstevel@tonic-gate 	int		st_if_to_build;		/* Interface to build */
517c478bd9Sstevel@tonic-gate 	int		st_cfg_to_build;	/* Configuration to build */
527c478bd9Sstevel@tonic-gate 	int		st_total_cfg_length;	/* Len of all descriptors */
537c478bd9Sstevel@tonic-gate 						/* for the current config */
547c478bd9Sstevel@tonic-gate 	uchar_t 	*st_curr_raw_descr;	/* Ptr to raw curr descr */
557c478bd9Sstevel@tonic-gate 	uchar_t 	st_curr_raw_descr_type;    /* Type of curr descr */
567c478bd9Sstevel@tonic-gate 	uchar_t 	st_curr_raw_descr_len;    /* Length of curr descr */
577c478bd9Sstevel@tonic-gate 	char		*st_curr_cfg_str;    /* Cfg string from usba_device */
587c478bd9Sstevel@tonic-gate 	usb_reg_parse_lvl_t st_dev_parse_level;	/* All, curr cfg, 1 iface */
597c478bd9Sstevel@tonic-gate 	usb_cfg_data_t	*st_dev_cfg;		/* Cfg array, root of tree */
607c478bd9Sstevel@tonic-gate 	uint_t		st_dev_n_cfg;		/* Number cfgs in tree */
61*ff0e937bSRaymond Chen 	boolean_t	st_build_ep_comp;	/* for wusb only */
627c478bd9Sstevel@tonic-gate } usba_reg_state_t;
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_cvs_data))
657c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_ep_data))
667c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_alt_if_data))
677c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_if_data))
687c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_cfg_data))
697c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usba_reg_state))
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
737c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_cfg))
747c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
757c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_curr_cfg))
767c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
777c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_n_cfg))
787c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
797c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_parse_level))
807c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
817c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_curr_if))
827c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
837c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_default_ph))
847c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
857c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_descr))
867c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
87*ff0e937bSRaymond Chen 					usb_client_dev_data::dev_bos))
88*ff0e937bSRaymond Chen _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
897c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_iblock_cookie))
907c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
917c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_mfg))
927c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
937c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_product))
947c478bd9Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only",
957c478bd9Sstevel@tonic-gate 					usb_client_dev_data::dev_serial))
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
987c478bd9Sstevel@tonic-gate }
997c478bd9Sstevel@tonic-gate #endif
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate #endif	/* _SYS_USB_REGISTER_IMPL_H */
102