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