BmcType.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. #ifndef __BMC_TYPE_H__
  2. #define __BMC_TYPE_H__
  3. #include <stdint.h>
  4. #include <unistd.h>
  5. #include <pthread.h>
  6. #include "Session.h"
  7. #include "com_IPMI_ChassisDevice.h"
  8. #include "PMConfig.h"
  9. #include "SensorMonitor.h"
  10. #include "com_BmcType.h"
  11. #include "MsgHndlr.h"
  12. #pragma pack(1)
  13. /***************************************** IPMI ******************************************************/
  14. typedef struct
  15. {
  16. pthread_key_t CurSessionID;
  17. pthread_key_t CurPrivLevel;
  18. pthread_key_t CurChannel;
  19. pthread_key_t CurKCSIfcNum;
  20. pthread_key_t CurSessionType;
  21. pthread_key_t OwnerLUN;
  22. }TLS_T;
  23. typedef enum
  24. {
  25. ORIGIN_UNSPECIFIED = 0,
  26. ORIGIN_SENDMSG,
  27. ORIGIN_CMDFWD,
  28. ORIGIN_INT_REQ,
  29. ORIGIN_NM,
  30. }BridgeOrigin;
  31. typedef struct
  32. {
  33. char FirstPowerOnStr[32]; //first power on the bmc
  34. uint8_t SendMsgTimeout;
  35. uint8_t SessionTimeOut;
  36. uint32_t ChassisTimerInterval;
  37. uint8_t SerialIfcSupport ;
  38. uint8_t SerialTerminalSupport;
  39. uint8_t LANIfcSupport ;
  40. uint8_t SYSIfcSupport;
  41. uint8_t GrpExtnSupport ;
  42. uint8_t UDSIfcSupport;
  43. uint32_t FanControlInterval;
  44. //IPMB
  45. uint8_t PrimaryIPMBSupport ;
  46. uint8_t SecondaryIPMBSupport ;
  47. uint32_t PrimaryIPMBBus;
  48. uint32_t SecondaryIPMBBus;
  49. uint8_t PrimaryIPMBAddr; //8bit
  50. uint8_t SecondaryIPMBAddr; //8bit
  51. //chassis config
  52. uint8_t SysRestartCause;
  53. uint8_t PowerRestorePolicy;
  54. ChassisPowerState_T ChassisPowerState;
  55. ChassisCapabilities_T ChassisCapabilities;
  56. uint8_t PowerCycleInterval;
  57. uint8_t SysPartitionScan;
  58. uint8_t RearmSetSensorThreshold;
  59. int16_t SELTimeUTCOffset;
  60. uint8_t MaxSession;
  61. uint32_t LogOutTimeout;
  62. } IPMIConfig_T;
  63. typedef struct
  64. {
  65. IPMIConfig_T IpmiConfig;
  66. OemFRUData_T FRU;
  67. uint8_t* pSDR;
  68. uint8_t* pSEL;
  69. //time
  70. uint32_t CurTimerTick; //uint: 1ms
  71. uint32_t CurTimerSecond;
  72. uint32_t BootValidMinutes; //This work time
  73. uint32_t TotalBootValidMinutes; //Total work time
  74. // uint32_t SELTimeSecond; //seconds from 1970-1-1 00:00:00, UTC
  75. //chassis
  76. uint8_t SlotID;
  77. uint8_t ChassisID;
  78. uint8_t PowerGoodFlag;
  79. uint8_t FirstPowerOn;
  80. uint8_t SelfTestByte;
  81. uint8_t ChassisIdentifyForce;
  82. uint8_t ChassisIdentifyTimeout;
  83. uint8_t ChassisIdentify;
  84. uint8_t HealthLevel;
  85. SensorSharedMem_T SensorSharedMem;
  86. SENSOR_T SenConfig;
  87. //message handler
  88. uint8_t SendMsgSeqNum;
  89. SDR_T SDRConfig;
  90. SEL_T SELConfig;
  91. uint8_t DeviceGUID[16];
  92. // OEM_FLAGS_T OemFlags;
  93. // SessionInfo_T LanSession;
  94. uint8_t SessionHandle;
  95. SessionTblInfo_T SessionTblInfo;
  96. uint8_t UDSSessionHandle;
  97. UDSSessionTblInfo_T UDSSessionTblInfo;
  98. uint8_t TimerTaskTblSize;
  99. TimerTaskTbl_T TimerTaskTbl[20];
  100. //bool loginOk;
  101. //uint32_t logOutCnt;
  102. UserInfo_T UserInfoTbl[MAX_USER_NUM];
  103. UserInfo_T *pUserInfo;
  104. uint8_t CurrentNoUser;
  105. uint8_t FwMajorVer;
  106. uint8_t FwMinorVer;
  107. //global_flags
  108. uint8_t BladeManageEn;
  109. uint8_t isChMC;
  110. uint8_t IndexInChassis; //刀片插在机箱里的第几个槽,index从0开始。
  111. } BMCInfo_t;
  112. #pragma pack()
  113. #endif /* __BMC_TYPE_H__ */