00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 #ifndef _IPMI_TYPES_H
00057 #define _IPMI_TYPES_H
00058
00059 #ifndef IPMI_FUNC_DEPRECATED
00060 # if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2))
00061 # define IPMI_FUNC_DEPRECATED __attribute__ ((deprecated))
00062 # define IPMI_TYPE_DEPRECATED __attribute__ ((deprecated))
00063 # define IPMI_VAR_DEPRECATED __attribute__ ((deprecated))
00064 # else
00065 # define IPMI_FUNC_DEPRECATED
00066 # define IPMI_TYPE_DEPRECATED
00067 # define IPMI_VAR_DEPRECATED
00068 # endif
00069 #endif
00070
00071 #include <stdint.h>
00072 #include <OpenIPMI/ipmi_addr.h>
00073
00074 #ifdef __cplusplus
00075 extern "C" {
00076 #endif
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 typedef struct ipmi_domain_s ipmi_domain_t;
00087 typedef struct ipmi_domain_id_s ipmi_domain_id_t;
00088
00089
00090
00091
00092 typedef struct ipmi_entity_s ipmi_entity_t;
00093 typedef struct ipmi_entity_id_s ipmi_entity_id_t;
00094
00095
00096
00097
00098
00099 typedef struct ipmi_fru_s ipmi_fru_t;
00100
00101
00102
00103
00104
00105 typedef struct ipmi_sensor_s ipmi_sensor_t;
00106 typedef struct ipmi_sensor_id_s ipmi_sensor_id_t;
00107
00108
00109
00110
00111 typedef struct ipmi_control_s ipmi_control_t;
00112 typedef struct ipmi_control_id_s ipmi_control_id_t;
00113
00114
00115 typedef int64_t ipmi_timeout_t;
00116
00117 #define IPMI_INVALID_TIME INT64_MIN
00118
00119
00120 typedef int64_t ipmi_time_t;
00121
00122 #ifndef __LINUX_IPMI_H
00123
00124 #define IPMI_MAX_MSG_LENGTH 80
00125
00126
00127
00128
00129
00130 typedef struct ipmi_msg
00131 {
00132 unsigned char netfn;
00133 unsigned char cmd;
00134 unsigned short data_len;
00135 unsigned char *data;
00136 } ipmi_msg_t;
00137
00138 #else
00139
00140
00141 typedef struct ipmi_msg ipmi_msg_t;
00142
00143 #endif
00144
00145
00146
00147 typedef struct ipmi_msg_item_s
00148 {
00149 ipmi_addr_t addr;
00150 unsigned int addr_len;
00151 ipmi_msg_t msg;
00152 unsigned char data[IPMI_MAX_MSG_LENGTH];
00153 struct ipmi_msg_item_s *next;
00154 void *data1;
00155 void *data2;
00156 void *data3;
00157 void *data4;
00158 } ipmi_msgi_t;
00159
00160
00161 #define IPMI_MSG_ITEM_NOT_USED 0
00162 #define IPMI_MSG_ITEM_USED 1
00163
00164
00165 struct ipmi_domain_id_s
00166 {
00167 ipmi_domain_t *domain;
00168 };
00169 #define IPMI_DOMAIN_ID_INVALID { NULL }
00170
00171 struct ipmi_entity_id_s
00172 {
00173 ipmi_domain_id_t domain_id;
00174 unsigned int entity_id : 8;
00175 unsigned int entity_instance : 8;
00176 unsigned int channel : 4;
00177 unsigned int address : 8;
00178 long seq;
00179 };
00180 #define IPMI_ENTITY_ID_INVALID { IPMI_DOMAIN_ID_INVALID, 0, 0, 0, 0, 0 }
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192 typedef struct ipmi_mcid_s
00193 {
00194 ipmi_domain_id_t domain_id;
00195 unsigned char mc_num;
00196 unsigned char channel;
00197 long seq;
00198 } ipmi_mcid_t;
00199 #define IPMI_MCID_INVALID { IPMI_DOMAIN_ID_INVALID, 0, 0, 0 }
00200
00201 typedef struct ipmi_mc_s ipmi_mc_t;
00202
00203 struct ipmi_sensor_id_s
00204 {
00205 ipmi_mcid_t mcid;
00206 unsigned int lun : 3;
00207 unsigned int sensor_num : 8;
00208 };
00209 #define IPMI_SENSOR_ID_INVALID { IPMI_MCID_INVALID, 0, 0 }
00210
00211 struct ipmi_control_id_s
00212 {
00213 ipmi_mcid_t mcid;
00214 unsigned int lun : 3;
00215 unsigned int control_num : 8;
00216 };
00217 #define IPMI_CONTROL_ID_INVALID { IPMI_MCID_INVALID, 0, 0 }
00218
00219
00220 typedef struct ipmi_event_s ipmi_event_t;
00221
00222
00223 typedef struct ipmi_con_s ipmi_con_t;
00224
00225
00226
00227
00228 typedef struct ipmi_chan_info_s
00229 {
00230 unsigned int medium : 7;
00231 unsigned int xmit_support : 1;
00232 unsigned int recv_lun : 3;
00233 unsigned int protocol : 5;
00234 unsigned int session_support : 2;
00235 unsigned int vendor_id : 24;
00236 unsigned int aux_info : 16;
00237 } ipmi_chan_info_t;
00238
00239 #define MAX_IPMI_USED_CHANNELS 8
00240
00241 #ifdef __cplusplus
00242 }
00243 #endif
00244
00245 #endif