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