1*3db86aabSstevel /*
2*3db86aabSstevel  * CDDL HEADER START
3*3db86aabSstevel  *
4*3db86aabSstevel  * The contents of this file are subject to the terms of the
5*3db86aabSstevel  * Common Development and Distribution License (the "License").
6*3db86aabSstevel  * You may not use this file except in compliance with the License.
7*3db86aabSstevel  *
8*3db86aabSstevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*3db86aabSstevel  * or http://www.opensolaris.org/os/licensing.
10*3db86aabSstevel  * See the License for the specific language governing permissions
11*3db86aabSstevel  * and limitations under the License.
12*3db86aabSstevel  *
13*3db86aabSstevel  * When distributing Covered Code, include this CDDL HEADER in each
14*3db86aabSstevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*3db86aabSstevel  * If applicable, add the following below this CDDL HEADER, with the
16*3db86aabSstevel  * fields enclosed by brackets "[]" replaced with your own identifying
17*3db86aabSstevel  * information: Portions Copyright [yyyy] [name of copyright owner]
18*3db86aabSstevel  *
19*3db86aabSstevel  * CDDL HEADER END
20*3db86aabSstevel  */
21*3db86aabSstevel /*
22*3db86aabSstevel  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23*3db86aabSstevel  * Use is subject to license terms.
24*3db86aabSstevel  */
25*3db86aabSstevel /*
26*3db86aabSstevel  * Copyright (c)  * Copyright (c) 2001 Tadpole Technology plc
27*3db86aabSstevel  * All rights reserved.
28*3db86aabSstevel  */
29*3db86aabSstevel 
30*3db86aabSstevel #ifndef	_SYS_CARDBUS_IMPL_H
31*3db86aabSstevel #define	_SYS_CARDBUS_IMPL_H
32*3db86aabSstevel 
33*3db86aabSstevel #ifdef  __cplusplus
34*3db86aabSstevel extern "C" {
35*3db86aabSstevel #endif
36*3db86aabSstevel 
37*3db86aabSstevel /*
38*3db86aabSstevel  * Device property initialization structures and defines
39*3db86aabSstevel  */
40*3db86aabSstevel struct cb_deviceset_props {
41*3db86aabSstevel 	struct cb_deviceset_props *next;
42*3db86aabSstevel 	char	*binding_name;
43*3db86aabSstevel 	uint16_t	venid;
44*3db86aabSstevel 	uint16_t	devid;
45*3db86aabSstevel 	char	*nodename;
46*3db86aabSstevel 	ddi_prop_t	*prop_list;
47*3db86aabSstevel };
48*3db86aabSstevel 
49*3db86aabSstevel typedef struct {
50*3db86aabSstevel 	char	*token;	/* token to look for */
51*3db86aabSstevel 	int	state;	/* state machine state */
52*3db86aabSstevel } cb_props_parse_tree_t;
53*3db86aabSstevel 
54*3db86aabSstevel #define	PARSE_QUOTE		'\''
55*3db86aabSstevel #define	PARSE_COMMENT		'#'
56*3db86aabSstevel #define	PARSE_ESCAPE		'\\'
57*3db86aabSstevel #define	PARSE_UNDERSCORE	'_'
58*3db86aabSstevel #define	PARSE_DASH		'-'
59*3db86aabSstevel #define	PARSE_SEMICOLON		';'
60*3db86aabSstevel #define	PARSE_COMMA		','
61*3db86aabSstevel #define	PARSE_EQUALS		'='
62*3db86aabSstevel 
63*3db86aabSstevel /*
64*3db86aabSstevel  * state defines for the valued variable state machine
65*3db86aabSstevel  */
66*3db86aabSstevel #define	PT_STATE_UNKNOWN	0
67*3db86aabSstevel #define	PT_STATE_TOKEN		1
68*3db86aabSstevel #define	PT_STATE_STRING_VAR	2
69*3db86aabSstevel #define	PT_STATE_HEX_VAR	3
70*3db86aabSstevel #define	PT_STATE_DEC_VAR	4
71*3db86aabSstevel #define	PT_STATE_ESCAPE		5
72*3db86aabSstevel #define	PT_STATE_CHECK		6
73*3db86aabSstevel 
74*3db86aabSstevel #undef	isalpha
75*3db86aabSstevel #undef	isxdigit
76*3db86aabSstevel #undef	ixdigit
77*3db86aabSstevel #undef	toupper
78*3db86aabSstevel 
79*3db86aabSstevel #define	isalpha(ch)	(((ch) >= 'a' && (ch) <= 'z') || \
80*3db86aabSstevel 			((ch) >= 'A' && (ch) <= 'Z'))
81*3db86aabSstevel #define	isxdigit(ch)	(isdigit(ch) || ((ch) >= 'a' && (ch) <= 'f') || \
82*3db86aabSstevel 			((ch) >= 'A' && (ch) <= 'F'))
83*3db86aabSstevel #define	isx(ch)		((ch) == 'x' || (ch) == 'X')
84*3db86aabSstevel #define	isdigit(ch)	((ch) >= '0' && (ch) <= '9')
85*3db86aabSstevel #define	toupper(C)	(((C) >= 'a' && (C) <= 'z')? (C) - 'a' + 'A': (C))
86*3db86aabSstevel 
87*3db86aabSstevel #ifdef  __cplusplus
88*3db86aabSstevel }
89*3db86aabSstevel #endif
90*3db86aabSstevel 
91*3db86aabSstevel #endif	/* _SYS_CARDBUS_IMPL_H */
92