BmcType.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. //lan configuration
  63. LanInfo_T LanInfo[1]; //方便扩展多个网卡。
  64. } IPMIConfig_T;
  65. typedef struct
  66. {
  67. IPMIConfig_T IpmiConfig;
  68. OemFRUData_T FRU;
  69. uint8_t* pSDR;
  70. uint8_t* pSEL;
  71. //time
  72. uint32_t CurTimerTick; //uint: 1ms
  73. uint32_t CurTimerSecond;
  74. uint32_t BootValidMinutes; //This work time
  75. uint32_t TotalBootValidMinutes; //Total work time
  76. // uint32_t SELTimeSecond; //seconds from 1970-1-1 00:00:00, UTC
  77. //chassis
  78. uint8_t SlotID;
  79. uint8_t ChassisID;
  80. uint8_t PowerGoodFlag;
  81. uint8_t FirstPowerOn;
  82. uint8_t SelfTestByte;
  83. uint8_t ChassisIdentifyForce;
  84. uint8_t ChassisIdentifyTimeout;
  85. uint8_t ChassisIdentify;
  86. uint8_t HealthLevel;
  87. SensorSharedMem_T SensorSharedMem;
  88. SENSOR_T SenConfig;
  89. //message handler
  90. uint8_t SendMsgSeqNum;
  91. SDR_T SDRConfig;
  92. SEL_T SELConfig;
  93. uint8_t DeviceGUID[16];
  94. // OEM_FLAGS_T OemFlags;
  95. // SessionInfo_T LanSession;
  96. uint8_t SessionHandle;
  97. SessionTblInfo_T SessionTblInfo;
  98. uint8_t UDSSessionHandle;
  99. UDSSessionTblInfo_T UDSSessionTblInfo;
  100. uint8_t TimerTaskTblSize;
  101. TimerTaskTbl_T TimerTaskTbl[20];
  102. //bool loginOk;
  103. //uint32_t logOutCnt;
  104. UserInfo_T UserInfoTbl[MAX_USER_NUM];
  105. UserInfo_T *pUserInfo;
  106. uint8_t CurrentNoUser;
  107. uint8_t m_Lan_SetInProgress;
  108. uint8_t FwMajorVer;
  109. uint8_t FwMinorVer;
  110. //global_flags
  111. uint8_t BladeManageEn;
  112. uint8_t isChMC;
  113. uint8_t IndexInChassis; //刀片插在机箱里的第几个槽,index从0开始。
  114. } BMCInfo_t;
  115. #pragma pack()
  116. #endif /* __BMC_TYPE_H__ */