10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57492SZhigang.Lu@Sun.COM * Common Development and Distribution License (the "License"). 67492SZhigang.Lu@Sun.COM * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*9430SRaymond.Chen@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_USB_REGISTER_IMPL_H 270Sstevel@tonic-gate #define _SYS_USB_REGISTER_IMPL_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate 300Sstevel@tonic-gate #ifdef __cplusplus 310Sstevel@tonic-gate extern "C" { 320Sstevel@tonic-gate #endif 330Sstevel@tonic-gate 340Sstevel@tonic-gate /* For binary dump function */ 350Sstevel@tonic-gate #define BINDUMP_BYTES_PER_LINE 16 /* For binary dump of class/vendor descr */ 360Sstevel@tonic-gate #define INDENT_SPACE_STR " " /* Spaces for indentation */ 370Sstevel@tonic-gate #define SPACES_PER_INDENT (strlen(INDENT_SPACE_STR) - 1) 380Sstevel@tonic-gate 390Sstevel@tonic-gate #define USBA_ALL -1 /* Build all */ 400Sstevel@tonic-gate 410Sstevel@tonic-gate /* State of the tree-building process */ 420Sstevel@tonic-gate typedef struct usba_reg_state { 430Sstevel@tonic-gate dev_info_t *dip; /* Dev info pointer */ 440Sstevel@tonic-gate usb_cfg_data_t *st_curr_cfg; /* Current cfg being init'ed */ 450Sstevel@tonic-gate usb_if_data_t *st_curr_if; /* Current if being init'ed */ 460Sstevel@tonic-gate usb_alt_if_data_t *st_curr_alt; /* Current alt being init'ed */ 470Sstevel@tonic-gate usb_ep_data_t *st_curr_ep; /* Current ep being init'ed */ 480Sstevel@tonic-gate int st_last_processed_descr_type; /* Type of last descr */ 490Sstevel@tonic-gate /* processed for placing c/vs */ 500Sstevel@tonic-gate int st_if_to_build; /* Interface to build */ 510Sstevel@tonic-gate int st_cfg_to_build; /* Configuration to build */ 520Sstevel@tonic-gate int st_total_cfg_length; /* Len of all descriptors */ 530Sstevel@tonic-gate /* for the current config */ 540Sstevel@tonic-gate uchar_t *st_curr_raw_descr; /* Ptr to raw curr descr */ 550Sstevel@tonic-gate uchar_t st_curr_raw_descr_type; /* Type of curr descr */ 560Sstevel@tonic-gate uchar_t st_curr_raw_descr_len; /* Length of curr descr */ 570Sstevel@tonic-gate char *st_curr_cfg_str; /* Cfg string from usba_device */ 580Sstevel@tonic-gate usb_reg_parse_lvl_t st_dev_parse_level; /* All, curr cfg, 1 iface */ 590Sstevel@tonic-gate usb_cfg_data_t *st_dev_cfg; /* Cfg array, root of tree */ 600Sstevel@tonic-gate uint_t st_dev_n_cfg; /* Number cfgs in tree */ 61*9430SRaymond.Chen@Sun.COM boolean_t st_build_ep_comp; /* for wusb only */ 620Sstevel@tonic-gate } usba_reg_state_t; 630Sstevel@tonic-gate 640Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_cvs_data)) 650Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_ep_data)) 660Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_alt_if_data)) 670Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_if_data)) 680Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usb_cfg_data)) 690Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", usba_reg_state)) 700Sstevel@tonic-gate 710Sstevel@tonic-gate 720Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 730Sstevel@tonic-gate usb_client_dev_data::dev_cfg)) 740Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 750Sstevel@tonic-gate usb_client_dev_data::dev_curr_cfg)) 760Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 770Sstevel@tonic-gate usb_client_dev_data::dev_n_cfg)) 780Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 790Sstevel@tonic-gate usb_client_dev_data::dev_parse_level)) 800Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 810Sstevel@tonic-gate usb_client_dev_data::dev_curr_if)) 820Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 830Sstevel@tonic-gate usb_client_dev_data::dev_default_ph)) 840Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 850Sstevel@tonic-gate usb_client_dev_data::dev_descr)) 860Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 87*9430SRaymond.Chen@Sun.COM usb_client_dev_data::dev_bos)) 88*9430SRaymond.Chen@Sun.COM _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 890Sstevel@tonic-gate usb_client_dev_data::dev_iblock_cookie)) 900Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 910Sstevel@tonic-gate usb_client_dev_data::dev_mfg)) 920Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 930Sstevel@tonic-gate usb_client_dev_data::dev_product)) 940Sstevel@tonic-gate _NOTE(SCHEME_PROTECTS_DATA("chg at attach only", 950Sstevel@tonic-gate usb_client_dev_data::dev_serial)) 960Sstevel@tonic-gate 970Sstevel@tonic-gate #ifdef __cplusplus 980Sstevel@tonic-gate } 990Sstevel@tonic-gate #endif 1000Sstevel@tonic-gate 1010Sstevel@tonic-gate #endif /* _SYS_USB_REGISTER_IMPL_H */ 102