1 /*
2  * Copyright (c) 2003 Sun Microsystems, Inc.  All Rights Reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistribution of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistribution in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * Neither the name of Sun Microsystems, Inc. or the names of
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * This software is provided "AS IS," without a warranty of any kind.
20  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
21  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
22  * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
23  * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
24  * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
25  * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.  IN NO EVENT WILL
26  * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
27  * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
28  * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
29  * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
30  * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
31  */
32 
33 #ifndef IPMI_CONSTANTS_H
34 #define IPMI_CONSTANTS_H
35 
36 
37 /*
38  * COMMANDS
39  */
40 #define IPMI_GET_SDR_REPOSITORY_INFO            0x20
41 #define IPMI_SOL_ACTIVATING                     0x20
42 #define IPMI_SET_SOL_CONFIG_PARAMETERS          0x21
43 #define IPMI_GET_SOL_CONFIG_PARAMETERS          0x22
44 #define IPMI_SET_USER_ACCESS                    0x43
45 #define IPMI_GET_USER_ACCESS                    0x44
46 #define IPMI_SET_USER_NAME                      0x45
47 #define IPMI_GET_USER_NAME                      0x46
48 #define IPMI_SET_USER_PASSWORD                  0x47
49 #define IPMI_ACTIVATE_PAYLOAD                   0x48
50 #define IPMI_DEACTIVATE_PAYLOAD                 0x49
51 #define IPMI_SUSPEND_RESUME_PAYLOAD_ENCRYPTYION 0x55
52 #define IPMI_GET_SEL_TIME                       0x48
53 #define IPMI_SET_SEL_TIME                       0x49
54 #define IPMI_SET_USER_PAYLOAD_ACCESS		0x4c
55 #define IPMI_GET_USER_PAYLOAD_ACCESS		0x4d
56 
57 #define IPMI_1_5_AUTH_TYPE_BIT_NONE     0x01
58 #define IPMI_1_5_AUTH_TYPE_BIT_MD2      0x02
59 #define IPMI_1_5_AUTH_TYPE_BIT_MD5      0x04
60 #define IPMI_1_5_AUTH_TYPE_BIT_PASSWORD 0x10
61 #define IPMI_1_5_AUTH_TYPE_BIT_OEM      0x20
62 
63 #define IPMI_SESSION_AUTHTYPE_NONE      0x0
64 #define IPMI_SESSION_AUTHTYPE_MD2       0x1
65 #define IPMI_SESSION_AUTHTYPE_MD5   	0x2
66 #define IPMI_SESSION_AUTHTYPE_KEY	0x4
67 #define IPMI_SESSION_AUTHTYPE_PASSWORD	IPMI_SESSION_AUTHTYPE_KEY
68 #define IPMI_SESSION_AUTHTYPE_OEM       0x5
69 #define IPMI_SESSION_AUTHTYPE_RMCP_PLUS 0x6
70 
71 #define IPMI_SESSION_PRIV_UNSPECIFIED   0x0
72 #define IPMI_SESSION_PRIV_CALLBACK	0x1
73 #define IPMI_SESSION_PRIV_USER		0x2
74 #define IPMI_SESSION_PRIV_OPERATOR	0x3
75 #define IPMI_SESSION_PRIV_ADMIN		0x4
76 #define IPMI_SESSION_PRIV_OEM		0x5
77 
78 #define IPMI_SET_IN_PROGRESS_SET_COMPLETE 0x00
79 #define IPMI_SET_IN_PROGRESS_IN_PROGRESS  0x01
80 #define IPMI_SET_IN_PROGRESS_COMMIT_WRITE 0x02
81 
82 #define IPMI_CHANNEL_MEDIUM_RESERVED	0x0
83 #define IPMI_CHANNEL_MEDIUM_IPMB_I2C	0x1
84 #define IPMI_CHANNEL_MEDIUM_ICMB_1	0x2
85 #define IPMI_CHANNEL_MEDIUM_ICMB_09	0x3
86 #define IPMI_CHANNEL_MEDIUM_LAN		0x4
87 #define IPMI_CHANNEL_MEDIUM_SERIAL	0x5
88 #define IPMI_CHANNEL_MEDIUM_LAN_OTHER	0x6
89 #define IPMI_CHANNEL_MEDIUM_SMBUS_PCI	0x7
90 #define IPMI_CHANNEL_MEDIUM_SMBUS_1	0x8
91 #define IPMI_CHANNEL_MEDIUM_SMBUS_2	0x9
92 #define IPMI_CHANNEL_MEDIUM_USB_1	0xa
93 #define IPMI_CHANNEL_MEDIUM_USB_2	0xb
94 #define IPMI_CHANNEL_MEDIUM_SYSTEM	0xc
95 
96 #define IPMI_CHASSIS_CTL_POWER_DOWN	0x0
97 #define IPMI_CHASSIS_CTL_POWER_UP	0x1
98 #define IPMI_CHASSIS_CTL_POWER_CYCLE	0x2
99 #define IPMI_CHASSIS_CTL_HARD_RESET	0x3
100 #define IPMI_CHASSIS_CTL_PULSE_DIAG	0x4
101 #define IPMI_CHASSIS_CTL_ACPI_SOFT	0x5
102 
103 #define IPMI_CHASSIS_POLICY_NO_CHANGE	0x3
104 #define IPMI_CHASSIS_POLICY_ALWAYS_ON	0x2
105 #define IPMI_CHASSIS_POLICY_PREVIOUS	0x1
106 #define IPMI_CHASSIS_POLICY_ALWAYS_OFF	0x0
107 
108 #define IPMI_CHASSIS_BOOTPARAM_SET_IN_PROGRESS	0
109 #define IPMI_CHASSIS_BOOTPARAM_SVCPART_SELECT	1
110 #define IPMI_CHASSIS_BOOTPARAM_SVCPART_SCAN	2
111 #define IPMI_CHASSIS_BOOTPARAM_FLAG_VALID	3
112 #define IPMI_CHASSIS_BOOTPARAM_INFO_ACK		4
113 #define IPMI_CHASSIS_BOOTPARAM_BOOT_FLAGS	5
114 #define IPMI_CHASSIS_BOOTPARAM_INIT_INFO	6
115 #define IPMI_CHASSIS_BOOTPARAM_INIT_MBOX	7
116 
117 /* From table 13-17 of the IPMI v2 specification */
118 #define IPMI_AUTH_RAKP_NONE         0x00
119 #define IPMI_AUTH_RAKP_HMAC_SHA1    0x01
120 #define IPMI_AUTH_RAKP_HMAC_MD5     0x02
121 
122 /* From table 13-18 of the IPMI v2 specification */
123 #define IPMI_INTEGRITY_NONE         0x00
124 #define IPMI_INTEGRITY_HMAC_SHA1_96 0x01
125 #define IPMI_INTEGRITY_HMAC_MD5_128 0x02
126 #define IPMI_INTEGRITY_MD5_128      0x03
127 
128 /* From table 13-19 of the IPMI v2 specfication */
129 #define IPMI_CRYPT_NONE             0x00
130 #define IPMI_CRYPT_AES_CBC_128      0x01
131 #define IPMI_CRYPT_XRC4_128         0x02
132 #define IPMI_CRYPT_XRC4_40          0x03
133 
134 #endif /*IPMI_CONSTANTS_H*/
135