1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Copyright 2019 Joyent, Inc.
*/
#ifndef _SYS_DDI_HP_H
#define _SYS_DDI_HP_H
/*
* Sun DDI hotplug support definitions
*
* See the big theory statement in uts/common/os/ddi_hp_impl.c for more
* information.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* ddi_hp_cn_state_t
*
* Typedef of generic hotplug state machine for Hotplug Connection (CN)
*/
typedef enum {
DDI_HP_CN_STATE_EMPTY = 0x1000, /* Empty */
DDI_HP_CN_STATE_PRESENT = 0x2000, /* A Device Present */
DDI_HP_CN_STATE_POWERED = 0x3000, /* Powered */
DDI_HP_CN_STATE_ENABLED = 0x4000, /* Enabled */
DDI_HP_CN_STATE_PORT_EMPTY = 0x5000, /* PORT Empty */
DDI_HP_CN_STATE_PORT_PRESENT = 0x6000, /* A Device Node Present */
DDI_HP_CN_STATE_OFFLINE = 0x7000, /* Driver not attached */
DDI_HP_CN_STATE_ATTACHED = 0x8000, /* Device driver attached */
DDI_HP_CN_STATE_MAINTENANCE = 0x9000, /* Device in maintenance */
DDI_HP_CN_STATE_ONLINE = 0xa000 /* Device is ready */
} ddi_hp_cn_state_t;
/*
* ddi_hp_cn_type_t
*
* Typedef for Hotplug Connection (CN) types.
*/
typedef enum {
DDI_HP_CN_TYPE_VIRTUAL_PORT = 0x1, /* Virtual Hotplug Port */
DDI_HP_CN_TYPE_PCI = 0x2, /* PCI bus slot */
DDI_HP_CN_TYPE_PCIE = 0x3 /* PCI Express slot */
} ddi_hp_cn_type_t;
#define DDI_HP_CN_TYPE_STR_PORT "Virtual-Port"
/*
* The value set to ddi_hp_cn_info_t->cn_num_dpd_on in the case of the
* connection does not depend on any other connections.
*/
#define DDI_HP_CN_NUM_NONE -1
/*
* ddi_hp_cn_info_t
*
* Hotplug Connection (CN) information structure.
* A Connection is either a Connector or a Port.
*/
typedef struct ddi_hp_cn_info {
char *cn_name; /* Name of the Connection */
/*
* Connection number.
*/
int cn_num;
/*
* Depend-on connection number;
* The connection number on which this connection is depending on.
* If this connection does not depend on any other connections
* under the same parent node, then it's cn_num_dpd_on is set to
* DDI_HP_CN_NUM_NONE.
*/
int cn_num_dpd_on;
ddi_hp_cn_type_t cn_type; /* Type: Port, PCI, PCIE, ... */
/*
* Description string for types of Connection. Set by bus software
* and read by users only.
*/
char *cn_type_str;
/*
* The child device of this Port.
* It is NULL if this is a Connector.
*/
dev_info_t *cn_child;
ddi_hp_cn_state_t cn_state; /* Hotplug Connection state */
time32_t cn_last_change; /* Last time state changed. */
} ddi_hp_cn_info_t;
typedef struct ddi_hp_property {
char *nvlist_buf;
size_t buf_size;
} ddi_hp_property_t;
#if defined(_SYSCALL32)
typedef struct ddi_hp_property32 {
caddr32_t nvlist_buf;
uint32_t buf_size;
} ddi_hp_property32_t;
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DDI_HP_H */
|