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