libipmi_storlead_OEM.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Brief: Declare some functions.
  3. * Author: Jimbo_zhang@outlook.com
  4. * Data: 2019-4-27
  5. */
  6. #ifndef __LIBIPMI_STORLEAD_OEM_H__
  7. #define __LIBIPMI_STORLEAD_OEM_H__
  8. #include "libipmi_struct.h"
  9. #include <stdint.h>
  10. #define MAX_TITLE_LEN 20
  11. #define MAX_TEXT_LEN 256
  12. #define MAX_HISTORY_LEN 480
  13. #define MAX_BLADE_NUM 32
  14. #define MAX_FAN_NUM 8
  15. #pragma pack(1)
  16. typedef struct{
  17. uint8_t fanNum;
  18. } OemFanInfo_T;
  19. typedef struct{
  20. uint8_t index;
  21. uint8_t name[16];
  22. uint8_t mode;
  23. uint8_t level; //duty 0% - 100%
  24. uint32_t speed; //RPM
  25. } OemFanStatus_T;
  26. typedef struct{
  27. char *title;
  28. char *text;
  29. }SysInfo_T;
  30. typedef struct{
  31. uint8_t bladeNum; //index
  32. uint8_t isChmc; //is main blade
  33. uint8_t IPMBAddr; //physical ID
  34. uint8_t status; //0: not install, 1: normal, 2: error
  35. uint8_t reserve;
  36. } bladeStatus_T;
  37. typedef struct{
  38. uint8_t complecode;
  39. bladeStatus_T bdStatus[10];
  40. } CardStatus_T;
  41. typedef struct{
  42. uint8_t slotNum; //total slot numbers of chassis.
  43. uint8_t supportChassisManageFn;
  44. uint8_t chassisManageFnEnable;
  45. uint8_t chMCIndex;
  46. } OemChassisInfo_T;
  47. typedef struct{
  48. uint8_t status;
  49. uint8_t bladeName[12];
  50. uint8_t slotID;
  51. uint8_t bladePowerStatus;
  52. } OemBladeStatus_T;
  53. typedef struct{
  54. uint8_t supportEventLogs;
  55. uint8_t supportBMCDevInfo;
  56. uint8_t supportBMCNetworkInfo;
  57. uint8_t supportCPUInfo;
  58. uint8_t supportFanCtrl;
  59. uint8_t supportFRU;
  60. uint8_t supportRemoteCtrl; //power on/off
  61. } OemIPMCCapability_T;
  62. typedef struct{
  63. uint8_t IPMBAddr;
  64. OemBladeStatus_T bladeStatus;
  65. } OemBladeInfo_T;
  66. typedef struct{
  67. uint8_t bladeNum;
  68. uint8_t fanNum;
  69. uint8_t supportHistory;
  70. } OemWebFlags_T;
  71. typedef struct
  72. {
  73. /*
  74. sensor_name array length increased from 17 to 20.
  75. In some cases sensor_name length is more than 17 characters. webgo was giving some special character to web page in those cases and webpage was giving some weird behaviour when it found that special character.
  76. */
  77. uint8_t sensor_num;
  78. char sensor_name[ 20 ];
  79. float sensor_history[ 480 ];
  80. }sensor_history_st;
  81. typedef struct{
  82. uint8_t isSupportSensorHistory;
  83. uint8_t SensorHistoryEnable;
  84. } SensorHistoryCapability_T;
  85. extern OemWebFlags_T g_OemWebFlags;
  86. //uint16_t LIBIPMI_HL_GetIPMCSensorInfo(IPMI20_UDS_SESSION_T *pUDSSession, SenInfo_T *pSensorInfo,uint32_t *nNumSensor,int timeout);
  87. //uint16_t LIBIPMI_HL_FanCtrol( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t fanIndex, uint8_t fanMode, uint8_t fanLevel, int timeout);
  88. //int LIBIPMI_HL_GetFanStatus( IPMI20_UDS_SESSION_T *pUDSSession, uint8_t fanIndex, OemFanStatus_T *pFanStatus, int timeout);
  89. uint16_t LIBIPMI_HL_GetSysInfo( IPMI20_UDS_SESSION_T *pUDSSession, SysInfo_T *pSysInfo, int timeout);
  90. //uint16_t LIBIPMI_HL_GetSensorHistory( IPMI20_UDS_SESSION_T *pUDSSession, sensor_history_st *pSensorHistory_st, int card_index, int sensor_number, int IPMB_ADDR);
  91. //uint16_t LIBIPMI_HL_GetAllCards(IPMI20_UDS_SESSION_T *pUDSSession, CardStatus_T* pResBladeSts, int timeout);
  92. //int LIBIPMI_HL_GetChassisInfo(IPMI20_UDS_SESSION_T *pUDSSession, OemChassisInfo_T* pBladeInfo, int timeout);
  93. //int LIBIPMI_HL_GetBladeStatus(IPMI20_UDS_SESSION_T *pUDSSession, OemBladeStatus_T* pBladeStatus, int timeout);
  94. //int LIBIPMI_HL_GetIPMCCapability(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t bladeIndex, OemIPMCCapability_T* pIPMCCapability, int timeout);
  95. //int LIBIPMI_HL_SetBladeManageFn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t enable, int timeout);
  96. //int LIBIPMI_HL_GetManageWebName(IPMI20_UDS_SESSION_T *pUDSSession, char* webName, int timeout);
  97. //int LIBIPMI_HL_GetFanInfo(IPMI20_UDS_SESSION_T *pUDSSession, OemFanInfo_T* pFanInfo, int timeout);
  98. //int LIBIPMI_HL_GetSensorHistoryCapability(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t sensorNum, SensorHistoryCapability_T* pSensorHistoryCapability, int timeout);
  99. //int LIBIPMI_HL_GetSensorHistoryEn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t* SensorHistoryEnable, int timeout);
  100. //int LIBIPMI_HL_SetSensorHistoryEn(IPMI20_UDS_SESSION_T *pUDSSession, uint8_t sensorNum, uint8_t SensorHistoryEnable, int timeout);
  101. #pragma pack()
  102. #endif /* __LIBIPMI_STORLEAD_OEM_H__ */