libipmi_ChassisDevice.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /* @(#)libipmi_ChassisDevice.h
  2. */
  3. #ifndef _LIBIPMI_CHASSISDEVICE_H
  4. #define _LIBIPMI_CHASSISDEVICE_H 1
  5. /* LIIPMI core header files */
  6. #include "libipmi_session.h"
  7. #include "libipmi_errorcodes.h"
  8. /* command specific header files */
  9. #include "com_IPMI_ChassisDevice.h"
  10. #include "com_IPMI_Chassis.h"
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. /*---------- LIBIPMI Higher level routines -----------*/
  15. #define CHASSIS_POWEROFF 0x00
  16. #define CHASSIS_POWERUP 0x01
  17. #define CHASSIS_POWERCYCLE 0x02
  18. #define CHASSIS_HARDRESET 0x03
  19. #define CHASSIS_DIAGINT 0x04
  20. #define CHASSIS_SOFTOFF 0x05
  21. /**
  22. \breif Higher level function for PowerOff Host.
  23. @param pUDSSession [in]Session handle
  24. @param timeout [in]timeout value in seconds.
  25. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  26. */
  27. uint16_t LIBIPMI_HL_PowerOff( IPMI20_UDS_SESSION_T *pUDSSession/*in*/, int timeout/*in*/);
  28. /**
  29. \breif Higher level function for PowerUP Host
  30. @param pUDSSession [in]Session handle
  31. @param timeout [in]timeout value in seconds.
  32. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  33. */
  34. uint16_t LIBIPMI_HL_PowerUp( IPMI20_UDS_SESSION_T *pUDSSession/*in*/, int timeout/*in*/);
  35. /**
  36. \breif Higher level function for PowerCycle host.
  37. @param pUDSSession [in]Session handle
  38. @param timeout [in]timeout value in seconds.
  39. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  40. */
  41. uint16_t LIBIPMI_HL_PowerCycle( IPMI20_UDS_SESSION_T *pUDSSession, int timeout );
  42. /**
  43. \breif Higher level function for HardReset
  44. @param pUDSSession [in]Session handle
  45. @param timeout [in]timeout value in seconds.
  46. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  47. */
  48. uint16_t LIBIPMI_HL_HardReset( IPMI20_UDS_SESSION_T *pUDSSession, int timeout );
  49. /**
  50. \breif Higher level function for DiagInt
  51. @param pUDSSession [in]Session handle
  52. @param timeout [in]timeout value in seconds.
  53. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  54. */
  55. uint16_t LIBIPMI_HL_DiagInt( IPMI20_UDS_SESSION_T *pUDSSession, int timeout );
  56. /**
  57. \breif Higher level function for SoftOff
  58. @param pUDSSession [in]Session handle
  59. @param timeout [in]timeout value in seconds.
  60. @retval Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  61. */
  62. uint16_t LIBIPMI_HL_SoftOff( IPMI20_UDS_SESSION_T *pUDSSession, int timeout );
  63. typedef enum tag_CHASSIS_ID_STATE
  64. {
  65. CHASSIS_ID_OFF=0,
  66. CHASSIS_ID_TIMED_ON=1,
  67. CHASSIS_ID_INDEFINITE_ON=2
  68. } CHASSIS_ID_STATE;
  69. typedef struct tag_chassis_status_T
  70. {
  71. unsigned char power_state;
  72. unsigned char last_power_event;
  73. unsigned char chassis_indetify_supported;
  74. CHASSIS_ID_STATE chassis_identify_state;
  75. } chassis_status_T;
  76. /**
  77. *
  78. *
  79. * @param pUDSSession [in]Session handle
  80. * @param timeout [in]timeout value in seconds.
  81. * @param status [out]status of the host is returned.
  82. *
  83. * @return Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  84. */
  85. uint16_t LIBIPMI_HL_GetChassisStatus( IPMI20_UDS_SESSION_T *pUDSSession, int timeout, chassis_status_T *status);
  86. /*---------------------Chassis Idnetify defines ---------------------*/
  87. #define CHASSIS_ID_INTERVAL_TURN_OFF 0
  88. #define CHASSIS_ID_INTERVAL_SPEC_DEFAULT 15
  89. typedef enum tag_FORCE_CHASSIS_ID
  90. {
  91. USE_INTERVAL=0,
  92. FORCE=1
  93. } FORCE_CHASSIS_ID;
  94. /**
  95. *
  96. *
  97. * @param pUDSSession [in]Session handle
  98. * @param timeout [in]timeout value in seconds.
  99. * @param BlinkTimeSecs [in]BlinkTimeInSecs.0 for Turn off (use #defs above)
  100. * @param ForceOn [in] Whether Interval is indefinite (Use enum above)
  101. *
  102. * @return Returns LIBIPMI_STATUS_SUCCESS on success and error codes on failure
  103. */
  104. uint16_t LIBIPMI_HL_ChassisIdentify(IPMI20_UDS_SESSION_T *pUDSSession, int timeout,uint8_t BlinkTimeSecs,FORCE_CHASSIS_ID ForceOn);
  105. uint16_t LIBIPMI_HL_GetSystemBootOptions_BootFlags( IPMI20_UDS_SESSION_T *pUDSSession, BootFlags_T* pBootFlags,int timeout);
  106. uint16_t LIBIPMI_HL_SetSystemBootOptions_BootFlags( IPMI20_UDS_SESSION_T *pUDSSession, BootFlags_T* pBootFlags,int timeout);
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110. #endif /* _LIBIPMI_CHASSISDEVICE_H */