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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SCHPC_MSG_H
#define _SYS_SCHPC_MSG_H
/*
* This header file describes the messages that are sent between the
* schpc Hot Plug Controller Driver running on the domain and the System
* Controller.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Format of the Get Slot Status specific part of
* PCI Hot Plug message.
*/
typedef struct {
uint16_t slot_power_on :1, /* Slot Power is on */
slot_powergood :1, /* Slot Power is good */
slot_powerfault :1, /* Slot Power has faulted */
slot_empty :1, /* No occupant in slot */
slot_freq_cap :2, /* Slot's Freq Capability */
slot_freq_setting :2, /* Slot Freq setting */
slot_condition :2, /* Condition of slot */
slot_HEALTHY :1, /* Value of HEALTHY# sig */
slot_ENUM :1, /* Value of ENUM# sig */
slot_mode_cap :1, /* Conven or PCI-X */
slot_mode_setting :1, /* Conven or PCI-X */
reserved :2;
uint8_t slot_replystatus;
} pci_getslot_t;
/*
* Format of the Set Slot Status specific part of
* PCI Hot Plug message.
*/
typedef struct {
uint16_t slot_power_on :1, /* Connect Slot to bus */
slot_power_off :1, /* Disconnect from bus */
slot_led_power :2, /* Slot Power LED */
slot_led_service :2, /* OK To Remove LED */
slot_led_fault :2, /* Fault LED */
slot_disable_ENUM :1, /* Disable ENUM Event */
slot_enable_ENUM :1, /* Enable ENUM Event */
slot_disable_HEALTHY :1, /* Disable HEALTHY EVENT */
slot_enable_HEALTHY :1, /* Enable HEALTHY EVENT */
reserved :4;
uint8_t slot_replystatus;
} pci_setslot_t;
/*
* Format of the Slot Event specific part of
* the PCI Hot Plug message.
*/
typedef struct {
uint16_t slot_power :1, /* Slot Power has changed */
slot_presence :1, /* occupant has been */
/* inserted or removed */
slot_ENUM :1, /* ENUM# has changed */
slot_HEALTHY :1, /* HEALTHY# has changed */
slot_powergood :1, /* Power is good */
slot_powerfault :1, /* Power has faulted */
reserved :10;
} pci_slotevent_t;
/*
* PCI Hot Plug message
*/
typedef struct {
uint8_t pcimsg_node;
uint8_t pcimsg_board;
uint8_t pcimsg_slot;
uint8_t pcimsg_revision;
uint8_t pcimsg_command;
union {
pci_setslot_t pcimsg_setslot;
pci_getslot_t pcimsg_getslot;
pci_slotevent_t pcimsg_slotevent;
} pcimsg_type;
} pcimsg_t;
/*
* Keys for the outgoing and incoming mailboxes
*/
#define KEY_PCSC 0x50435343 /* Outgoing Mailbox 'PCSC' */
#define KEY_SCPC 0x53435043 /* Incoming Mailbox 'SCPC' */
/*
* default timeout in seconds for mboxsc_getmsg calls
*/
#define PCSC_TIMEOUT 30
/* Commands */
#define PCIMSG_GETSLOTSTATUS 0x1
#define PCIMSG_SETSLOTSTATUS 0x2
#define PCIMSG_SLOTEVENT 0x3
/* Message Revisions */
#define PCIMSG_REVISION 0x10
#define PCIMSG_REVISION_1_0 0x10
/*
* Values for the slot_condition field of the get slot status command.
*/
#define PCIMSG_SLOTCOND_UNKNOWN 0x0
#define PCIMSG_SLOTCOND_GOOD 0x1
#define PCIMSG_SLOTCOND_REC_FAIL 0x2
#define PCIMSG_SLOTCOND_OCC_FAIL 0x3
/*
* Values for the slot_freq_cap and slot_freq_setting fields of the get
* slot status command.
*/
#define PCIMSG_FREQ_33MHZ 0x0
#define PCIMSG_FREQ_66MHZ 0x1
#define PCIMSG_FREQ_90MHZ 0x2
#define PCIMSG_FREQ_133MHZ 0x3
/*
* Values for the slot_mode_cap and slot_mode_setting of the get
* slot status command.
*/
#define PCIMSG_MODE_CONVEN 0x0
#define PCIMSG_MODE_PCIX 0x1
/*
* Values for the PRSNT signals.
*/
#define PCIMSG_PRSNT_NOADAPTER 0x0
#define PCIMSG_PRSNT_25W 0x1
#define PCIMSG_PRSNT_15W 0x2
#define PCIMSG_PRSNT_7_5W 0x3
/*
* Values to turn on and off slot characteristics.
*/
#define PCIMSG_ON 0x1
#define PCIMSG_OFF 0x0
/*
* Values to set the power, service and fault LEDs
*/
#define PCIMSG_LED_OFF 0x00
#define PCIMSG_LED_ON 0x01
#define PCIMSG_LED_FLASH 0x02
/*
* Return values for the slot_replystatus field for the get/set slot status
* commands.
*/
#define PCIMSG_REPLY_GOOD 0x0
#define PCIMSG_REPLY_FAIL 0x1
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SCHPC_MSG_H */
|