OpenClovis Logo

clCmApi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2012 OpenClovis Solutions Inc. All Rights Reserved.
3  *
4  * This file is available under a commercial license from the
5  * copyright holder or the GNU General Public License Version 2.0.
6  *
7  * The source code for this program is not published or otherwise
8  * divested of its trade secrets, irrespective of what has been
9  * deposited with the U.S. Copyright office.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * For more information, see the file COPYING provided with this
17  * material.
18  */
19 /*******************************************************************************
20  * ModuleName : cm
21  * File : clCmApi.h
22  *******************************************************************************/
23 
24 /*******************************************************************************
25  * Description :
26  * Header File for Chassis Manager
27  *
28  *
29  *****************************************************************************/
30 
43 #ifndef _CLCMAPI_H_
44 #define _CLCMAPI_H_
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50  /* If the flag is not defined this will define no-ops for all APIs that is enough to satisfy the compiler */
51 #ifndef CL_USE_CHASSIS_MANAGER
52 
53 #include <clCommon.h>
54 #include <clCommonErrors.h>
55 #include <clCorMetaData.h>
56 
57  /* the EO automatically generates a call to this to initalize the CM library, so give it a NULL pointer if CM is off */
58 #define clCmLibInitialize 0
59 #define clCmLibFinalize 0
60 
64 #define CL_CM_VERSION {(ClUint8T)'B', 0x1, 0x1}
65 
66 
67 /* Please note that the event publishing service by CM is currently
68  * disabled, hence they are not doxygen-visible comments
69  */
70 
71 /*
72  * Chassis Manager Event Channel on which events will be published.
73  */
74 #define CL_CM_EVENT_CHANNEL "CM_EVENT_CHANNEL"
75 
76 
77 /* The following are the events published by Chassis Manager. */
78 
79 /*
80  * Event issued after hot-swapping of an FRU is done.
81  */
82 #define CL_CM_FRU_STATE_TRANSITION_EVENT_STR "cmFruStateTranstionEvent"
83 
84 /*
85  * Payload of the FRU Event being published on the FRU state transition.
86  */
87 typedef struct ClCmFruEventInfo {
88 
89 /*
90  * Id of the FRU in the physical slot.
91  */
92  ClUint32T fruId;
93 
94 /*
95  * Physical slot of the FRU. Before using, always perform a check for the slot id against \c INVALID_PHYSICAL_SLOT_ID.
96  */
97  ClInt32T physicalSlot;
98 
99 #if 0 /* Note HPI is NOT being used so these structures are just fake placeholders */
100  /*
101  * Previous state of the FRU.
102  */
103  SaHpiHsStateT previousState;
104 
105 /*
106  * Present state of the FRU.
107  */
108  SaHpiHsStateT presentState;
109 #endif
110 } ClCmFruEventInfoT;
111 
112 /*
113  * Contents of buffer field in alarmPayload for sensor event payload.
114  */
115 typedef struct ClCmSensorEventInfo {
116 #if 0 /* Note HPI is NOT being used so these structures are just fake placeholders */
117  SaHpiRptEntryT rptEntry;
118  SaHpiRdrT rdr;
119  SaHpiSensorEventT sensorEvent;
120 #else
121  int fake;
122 #endif
123 } ClCmSensorEventInfoT;
124 
125 
126 typedef struct {
127 #if 0 /* Note HPI is NOT being used so these structures are just fake placeholders */
128  SaHpiEntityPathT eventReporter;
129  SaHpiEntityPathT *pImpactedEntities;
130 #else
131  int fake;
132 #endif
133 } ClCmEventCorrelatorT;
134 
135 #if 0
136 typedef ClRcT (* ClCmEventCallBackT) (SaHpiSessionIdT sessionid ,
137  SaHpiEventT *pEvent ,
138  SaHpiRptEntryT *pRptEntry,
139  SaHpiRdrT *pRdr);
140 #else
141  typedef ClRcT (* ClCmEventCallBackT) (unsigned int sessionid ,
142  void *pEvent ,
143  void *pRptEntry,
144  void *pRdr);
145 #endif
146 
147 typedef struct {
148 #if 0 /* Note HPI is NOT being used so these structures are just fake placeholders */
149  SaHpiEntityPathT impactedEntity;
150 #endif
151  ClCmEventCallBackT userEventHandler;
152 } ClCmUserPolicyT;
153 
154 #if 0
155 typedef enum ClCmThresholdLevel
156 {
157 
158  CL_CM_THRESHOLD_LOWER_MINOR = SAHPI_ES_LOWER_MINOR,
159  CL_CM_THRESHOLD_LOWER_MAJOR = SAHPI_ES_LOWER_MAJOR,
160  CL_CM_THRESHOLD_LOWER_CRIT = SAHPI_ES_LOWER_CRIT,
161  CL_CM_THRESHOLD_UPPER_MINOR = SAHPI_ES_UPPER_MINOR,
162  CL_CM_THRESHOLD_UPPER_MAJOR = SAHPI_ES_UPPER_MAJOR,
163  CL_CM_THRESHOLD_UPPER_CRIT = SAHPI_ES_UPPER_CRIT,
164 }ClCmThresholdLevelT;
165 #endif
166 
167 /*
168  * Event payload is \e ClAlarmInfoT defined in <em> clAlarmDefinitions.h </em>, the contents
169  * of buffer field in alarmPayload is \e ClCmSensorEventInfo defined above.
170  */
171 #define CL_CM_ALARM_EVENT_STR "cmAlarmEvent"
172 
173 
174 /*
175  * These error is returned for any HPI failures occur at the server side,
176  * HPI errors are printed on the console or any log file.
177  */
178 
182 #define CL_ERR_CM_HPI_ERROR (CL_ERR_COMMON_MAX+1)
183 
187 #define CL_ERR_CM_HPI_INVALID_PHY_SLOT (CL_ERR_COMMON_MAX+2)
188 
189 
193 typedef enum {
230 
232 
258 #define clCmFruStateGet(hMoId,pState) CL_RC(CL_CID_CM,CL_ERR_NOT_SUPPORTED)
259 
260 
290 #define clCmFruOperationRequest(hMoId,request) CL_RC(CL_CID_CM,CL_ERR_NOT_SUPPORTED)
291 
312 #define clCmVersionVerify(version) CL_RC(CL_CID_CM,CL_ERR_NOT_SUPPORTED)
313 
350 #define clCmBladeOperationRequest(chassisId,physSlot,request) CL_RC(CL_CID_CM,CL_ERR_NOT_SUPPORTED)
351 
352 
353 
354 
355 #define clCmThresholdStateGet(slot, pLevel,pStateAsserted) CL_RC(CL_CID_CM,CL_ERR_NOT_SUPPORTED)
356 
357 #else
358 
359 #include <clCommon.h>
360  /* These are automatically called by the EO so not really part of the public interface */
361 extern ClRcT clCmLibInitialize(void);
362 extern ClRcT clCmLibFinalize(void);
363 
364 #include <clChassisMgrApi.h>
365 
366 #endif
367 
368 #ifdef __cplusplus
369 }
370 #endif
371 #endif /* _CL_CHASSIS_MGR_API_H_ */
372 

Generated on Tue Jan 10 10:29:15 PST 2012 for OpenClovis SDK using Doxygen