internal_sensor.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*****************************************************************
  2. *****************************************************************
  3. *** **
  4. *** (C)Copyright 2006-2007, American Megatrends Inc. **
  5. *** **
  6. *** All Rights Reserved. **
  7. *** **
  8. *** 6145-F, Northbelt Parkway, Norcross, **
  9. *** **
  10. *** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. *** **
  12. *****************************************************************
  13. *****************************************************************
  14. ******************************************************************
  15. *
  16. * internal_sensor.h
  17. * Hanlders for Internal Sensors.
  18. *
  19. * Author: Vinothkumar S <vinothkumars@ami.com>
  20. *
  21. ******************************************************************/
  22. #ifndef INTERNAL_SENSOR_H
  23. #define INTERNAL_SENSOR_H
  24. #include "Types.h"
  25. #include "IPMI_Sensor.h"
  26. #include "bmc_type.h"
  27. //#include "SensorMonitor.h"
  28. /*** External Definitions ***/
  29. /*** Global definitions ***/
  30. /* SEL Sensor */
  31. #define EVENT_LOG_AREA_RESET 0x2
  32. #define EVENT_SEL_ALMOST_FULL 0x5
  33. #define EVENT_SEL_IS_FULL 0x4
  34. /* Watchdog Sensor */
  35. #define EVENT_TIMER_EXPIRED 0x00
  36. #define EVENT_HARD_RESET 0x01
  37. #define EVENT_POWER_DOWN 0x02
  38. #define EVENT_POWER_CYCLE 0x03
  39. #define EVENT_TIMER_INT 0x08
  40. typedef struct
  41. {
  42. INT8U SensorTypeCode; /* Sensor Type code */
  43. INT16U SensorReading; /* Sensor Reading */
  44. INT8U SensorNum; /* Sensor Number */
  45. INT16U u16AssertionHistory;/* Assertion tracking */
  46. INT8U u8TmrUse; /* WDT use */
  47. INT8U u8TmrActions; /* WDT actions */
  48. INT8U u8Restarted; /* WDT restarted */
  49. pPDK_SensorInitHook_T pInitSensor; /* Init Sensor hook */
  50. pPDK_MonitorHook_T pPreMonitor; /* Pre monitor hook */
  51. pPDK_MonitorHook_T pPostMonitor; /* Post monitor hook */
  52. pPDK_MonitorExtHook_T pPostMonitorExt; /* Post monitor Ext hook */
  53. INT8U EntityID; /* Entity ID */
  54. INT8U EntityInst; /* Entity Instance */
  55. INT32U FeatureSupport; /* Feature Supported or not*/
  56. INT8U SensorOwnerLun; /* OwnerLUN */
  57. } InternalSensorTbl_T;
  58. /*** Prototype Declaration ***/
  59. /* Functions for SEL Sensor Implementation */
  60. int SELSensorInit (void* pSensorInfo,int BMCInst);
  61. int SELMonitor (void* pSenInfo, INT8U* pReadFlags,int BMCInst);
  62. int SELEventLog (void* pSenInfo, INT8U* pReadFlags,int BMCInst);
  63. int SELEventLogExt (void* pSenInfo, INT8U* pReadFlags,int BMCInst);
  64. /* Functions for Watchdog Sensor Implementation */
  65. int WD2SensorInit (void* pSensorInfo, int BMCInst);
  66. int WD2Monitor (void* pSenInfo, INT8U* pReadFlags,int BMCInst);
  67. int WD2DummyEventLog (void* pSenInfo, INT8U* pReadFlags,int BMCInst);
  68. int WD2EventLog (void* pSenInfo, INT8U* pReadFlags,int BMCInst);
  69. int WD2EventLogExt (void* pSenInfo, INT8U* pReadFlags,int BMCInst);
  70. /* Functions for SSI Compute Blade Operational State Sensor Implementation */
  71. int OpStateSensorInit (void* pSenInfo, int BMCInst);
  72. int OpStateMonitor (void *pSenInfo, INT8U* pReadFlags, int BMCInst);
  73. int OpStateEventLog (void *pSenInfo, INT8U* pReadFlags, int BMCInst);
  74. int OpStateEventLogExt (void* pSenInfo, INT8U* pReadFlags, int BMCInst);
  75. /* Functions for SSI Compute Blade Aggregated Thermal Sensor Implementation */
  76. int AggregateThermalSensorInit (void* pSenInfo, int BMCInst);
  77. int AggregateThermalMonitor (void *pSenInfo, INT8U* pReadFlags, int BMCInst);
  78. int AggregateThermalEventLog (void *pSenInfo, INT8U* pReadFlags, int BMCInst);
  79. int AggregateThermalEventLogExt (void* pSenInfo, INT8U* pReadFlags, int BMCInst);
  80. /* Functions for SSI Compute Blade Aggregated Fault Sensor Implementation */
  81. int AggregateFaultSensorInit (void* pSenInfo, int BMCInst);
  82. int AggregateFaultMonitor (void *pSenInfo, INT8U* pReadFlags, int BMCInst);
  83. int AggregateFaultEventLog (void *pSenInfo, INT8U* pReadFlags, int BMCInst);
  84. int AggregateFaultEventLogExt (void* pSenInfo, INT8U* pReadFlags, int BMCInst);
  85. /* Functions for SSI Compute Blade Service State Sensor Implementation */
  86. int ServiceStateSensorInit (void* pSenInfo, int BMCInst);
  87. int ServiceStateMonitor (void *pSenInfo, INT8U* pReadFlags, int BMCInst);
  88. int ServiceStateEventLog (void *pSenInfo, INT8U* pReadFlags, int BMCInst);
  89. int ServiceStateEventLogExt (void* pSenInfo, INT8U* pReadFlags, int BMCInst);
  90. /*-----------------------------------------
  91. * GetSELFullPercentage
  92. *-----------------------------------------*/
  93. extern INT8U GetSELFullPercentage(int BMCInst);
  94. /**
  95. * @brief GetSensorNumFromSensorType.
  96. * @param SensorType - Sensor Type of the sensor.
  97. * @return SensorInfo if success, 0xFF if error.
  98. **/
  99. extern void* GetSensorInfoFromSensorType(INT8U SensorType, int BMCInst);
  100. /**
  101. * @brief SetSELSensorReading.
  102. * @param Res - Sensor reading to be set.
  103. * @return 0 if success, -1 if error.
  104. **/
  105. extern int SetSELSensorReading (INT16U Reading,int BMCinst);
  106. /**
  107. * @brief SetWD2SensorReading.
  108. * @param Res - Sensor reading to be set.
  109. * @return 0 if success, -1 if error.
  110. **/
  111. extern int SetWD2SensorReading (INT16U Reading, INT8U u8TmrUse, INT8U u8TmrActions,int BMCInst);
  112. extern int RestartWD2Sensor(int BMCInst);
  113. extern int WD2SELLog (INT8U Action);
  114. #endif /* INTERNAL_SENSOR_H */