SSIDefs.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /****************************************************************
  2. ****************************************************************
  3. ** **
  4. ** (C)Copyright 2011, American Megatrends Inc. **
  5. ** **
  6. ** All Rights Reserved. **
  7. ** **
  8. ** 5555 Oakbrook Pkwy Suite 200, Norcross, **
  9. ** **
  10. ** Georgia - 30093, USA. Phone-(770)-246-8600. **
  11. ** **
  12. ****************************************************************
  13. ****************************************************************
  14. ****************************************************************
  15. *
  16. * SSIDefs.h
  17. * SSI Common Definitions
  18. *
  19. * Author: Kevin Cheng <kevincheng@ami.com.tw>
  20. *
  21. ****************************************************************/
  22. #ifndef _H_SSIDEFS_
  23. #define _H_SSIDEFS_
  24. #define SSI_ID 0x02
  25. #define DEFAULT_FRU_DEV_ID 0x00
  26. #define IPMB_PRIMARY 1
  27. #define IPMB_SECONDARY 2
  28. /*
  29. * Operational State Defined Conditions
  30. * Conditions numbered 8 and above are available for FRU type class use.
  31. * A value of 1 for a condition indicates the condition is true/asserted.
  32. */
  33. #define BIT32(x) (((INT32U)1) << (x))
  34. #define COND_PRESENT 0 /* FRU presence state (true = present) */
  35. #define COND_INSERTION_CRITERIA 1 /* Handle Switch State (true = closed) */
  36. #define COND_ACT_POLICY 2 /* Activation Policy Bit State */
  37. #define COND_ACTIVATED 3 /* Activation State (true = activated) */
  38. #define COND_POWER_ON 4 /* Asserted means that power is on */
  39. #define COND_POWER_FAILURE 5 /* Asserted means that power failure */
  40. #define COND_POWER_BUDGET 6 /* Power Budget Allocated */
  41. #define COND_EKEYED 7 /* EKeying process complete */
  42. #define COND_SDR_INTEGRATE 8 /* Message to managed FRUs to integrate their SDRs */
  43. #define COND_STANDBY 9 /* Standby State */
  44. #define COND_MAX_CONDITION 32 /* Includes OBSM and FRU type specific conditions */
  45. #define COND_RESERVED 0xFF /* Special condition value used internally */
  46. /* Bit map versions */
  47. #define COND_PRESENT_BIT BIT32(COND_PRESENT)
  48. #define COND_INSERTION_CRITERIA_BIT BIT32(COND_INSERTION_CRITERIA)
  49. #define COND_ACT_POLICY_BIT BIT32(COND_ACT_POLICY)
  50. #define COND_ACTIVATED_BIT BIT32(COND_ACTIVATED)
  51. #define COND_POWER_ON_BIT BIT32(COND_POWER_ON)
  52. #define COND_POWER_FAILURE_BIT BIT32(COND_POWER_FAILURE)
  53. #define COND_POWER_BUDGET_BIT BIT32(COND_POWER_BUDGET)
  54. #define COND_EKEYED_BIT BIT32(COND_EKEYED)
  55. #define COND_SDR_INTEGRATE_BIT BIT32(COND_SDR_INTEGRATE)
  56. #define COND_STANDBY_BIT BIT32(COND_STANDBY)
  57. /* Service State */
  58. #define SERV_STATE_INACTIVE 0
  59. #define SERV_STATE_ACTIVE 2
  60. #define SERV_STATE_ENTITY_ID 0xD0
  61. /* Service Index */
  62. #define SERV_INDEX_SOL 0
  63. #define SERV_INDEX_KVM 1
  64. #define SERV_INDEX_CDMEDIA 2
  65. #define SERV_INDEX_FDMEDIA 3
  66. #define SERV_INDEX_HDMEDIA 4
  67. #define DEF_ACTIVE_SESSION_VAL 128
  68. #pragma pack (1)
  69. /**
  70. * @enum STATUS
  71. * @brief Error type status codes.
  72. **/
  73. typedef enum
  74. {
  75. ST_OK,
  76. ST_INVALID_PARAM,
  77. ST_OUT_OF_RANGE,
  78. ST_ERROR,
  79. ST_MAX
  80. } STATUS;
  81. /**
  82. * @enum OpState
  83. * @brief Operational States
  84. **/
  85. typedef enum
  86. {
  87. MSTATE_M0 = 0, /* Not Present State */
  88. MSTATE_M1, /* Inactive State */
  89. MSTATE_M2, /* Activation Requested State */
  90. MSTATE_M3, /* Activation In Progress State */
  91. MSTATE_M4, /* Active State (running) */
  92. MSTATE_M5, /* Deactivation Requested State */
  93. MSTATE_M6, /* Deactivation In Progress State */
  94. MSTATE_M7, /* Communication Lost State */
  95. MSTATE_M8, /* Active State (standby) */
  96. MSTATE_UNKNOWN,
  97. MSTATE_MAX_STATE,
  98. MSTATE_BAD_STATE = 0xFF
  99. } OpState;
  100. /**
  101. * @enum OpStateChangeCause
  102. * @brief Cause of Operational State Change
  103. **/
  104. typedef enum
  105. {
  106. CAUSE_NORMAL = 0,
  107. CAUSE_CMD_SHELF_MGR = 1,
  108. CAUSE_OPERATOR_EJECTOR = 2,
  109. CAUSE_PROG_ACTION = 3,
  110. CAUSE_COMM_LOST = 4,
  111. CAUSE_LOCAL_FAILURE = 5,
  112. CAUSE_SURPRISE_EXTRXN = 6,
  113. CAUSE_PROVIDED = 7,
  114. CAUSE_INVALID_HW_ADDR = 8,
  115. CAUSE_UNEXPECTED_DEACT = 9,
  116. CAUSE_UNEXPECTED_ACT = 10,
  117. CAUSE_UNKNOWN = 15
  118. } OpStateChangeCause;
  119. /**
  120. * @struct OpStateFruObj_T
  121. * @brief Operational State FRU Object
  122. **/
  123. typedef struct
  124. {
  125. INT8U FruId; /* FRU Id for this FRU */
  126. OpState CurrentState; /* Current M State */
  127. OpState PreviousState; /* Last M State */
  128. INT32U CurrentConditions; /* FRU type specific conditions */
  129. INT32U NewConditions; /* Condition change notification */
  130. OpStateChangeCause ChangeCause; /* Last M state change cause */
  131. INT8U CurrentPowerLevel; /* Current granted power level */
  132. } PACKED OpStateFruObj_T;
  133. #pragma pack ()
  134. #endif //_H_SSIDEFS_