OBSMPwrMngr.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /****************************************************************
  2. ** **
  3. ** (C)Copyright 2007-2008, American Megatrends Inc. **
  4. ** **
  5. ** All Rights Reserved. **
  6. ** **
  7. ** 5555, Oakbrook Parkway, Suite 200, Norcross, **
  8. ** **
  9. ** Georgia - 30093, USA. Phone-(770)-246-8600. **
  10. ** **
  11. ****************************************************************/
  12. /****************************************************************
  13. * @file OBSMPwrMngr.h
  14. * @author Velu <velmuruganv@amiindia.co.in>
  15. * @brief
  16. ****************************************************************/
  17. #ifndef OBSMPWRMNGR_H
  18. #define OBSMPWRMNGR_H
  19. #include "Types.h"
  20. /*** Definitions and Macros ***/
  21. #define PARAM_OBSM_PWR_TIMER_TICK 1
  22. #define PARAM_OBSM_SANCTION_PWR 2
  23. #define PARAM_OBSM_SURRENDER_PWR 3
  24. #define PARAM_OBSM_PS_STATE_CHANGE 4
  25. /**
  26. * @brief Get the devices in the power domain
  27. * @param domNum is the cooling domain number
  28. * @return count of devices
  29. **/
  30. extern INT8U OBSM_GetPwrDomDeviceCount (INT8U domNum, int BMCInst);
  31. /**
  32. * @brief Process the blade pending power requests
  33. * @param pBlade is the Blade object
  34. * @return 0 if success, -1 if error
  35. **/
  36. extern int OBSM_ProcessPendingBladePwrReq (BladeInfo_T* pBlade, int BMCInst);
  37. /**
  38. * @brief Process the OBSM fan pending power requests
  39. * @param pFan is the fan object
  40. * @return None
  41. **/
  42. extern int OBSM_ProcessPendingFanPwrReq (FanInfo_T *pFan, int BMCInst);
  43. /**
  44. * @brief Process the blade power needs during M2 to M3 transition
  45. * @param pBlade is the Blade object
  46. * @return 0 if success, -1 if error
  47. **/
  48. extern int OBSM_ProcessM2ToM3BladePwr (BladeInfo_T* pBlade, int BMCInst);
  49. /**
  50. * @brief Process the blade power needs during M6 to M1 transition
  51. * @param pBlade is the Blade object
  52. * @return 0 if success, -1 if error
  53. **/
  54. extern int OBSM_ProcessM6ToM1BladePwr (BladeInfo_T* pBlade, int BMCInst);
  55. /**
  56. * @brief Get the current power and allocate it from pool
  57. * @param pBlade is the Blade object
  58. * @return 0 if success, -1 if error
  59. **/
  60. extern int OBSM_SanctionMissedStateBladePwr (BladeInfo_T* pBlade, int BMCInst);
  61. /**
  62. * @brief Give the allocated power back to the pool
  63. * @param pBlade is the Blade object
  64. * @return 0 if success, -1 if error
  65. **/
  66. extern int OBSM_SurrenderMissedStateBladePwr (BladeInfo_T* pBlade, int BMCInst);
  67. /**
  68. * @brief Process the pwr routines on removal of a blade
  69. * @param pBlade is the Blade object
  70. * @return 0 if success, -1 if error
  71. **/
  72. extern int OBSM_ProcessPwrOnBladeRemoval(BladeInfo_T* pBlade, int BMCInst);
  73. /**
  74. * @brief Get the power from power pool
  75. * @param pFan is the Fan object
  76. * @param pwr is the amount of power required
  77. * @return 0 if success, -1 if error
  78. **/
  79. extern int OBSM_ProcessSanctioningFanPwr (FanInfo_T *pFan, INT16U reqPwr, int BMCInst);
  80. /**
  81. * @brief Give the power back to the chassis pool
  82. * @param pFan is the Fan object
  83. * @param pwr is the amount of power to surrender
  84. * @return 0 if success, -1 if error
  85. **/
  86. extern int OBSM_ProcessSurrenderingFanPwr (FanInfo_T* pFan, INT16U pwr, int BMCInst);
  87. /**
  88. * @brief Routine called while the power supply insertion is detected
  89. * @param pwrDomNum is the power domain number
  90. * @param pwrSupplySlotNum is the slot number of the power supply
  91. * @return 0 if success, -1 if error
  92. **/
  93. extern int OBSM_ProcessPwrSupplyInsertion (INT8U pwrDomNum,INT8U pwrSupplySlotNum, int BMCInst);
  94. /**
  95. * @brief Invoked by OBSM task on arrival of power supply insertion/removal event
  96. * @param pEvent is the SEL event message
  97. * @return 0 if success, -1 if error
  98. **/
  99. extern int OBSM_PwrSupplyPresenceEventHndlr (SELEventRecord_T *pEvent, int BMCInst);
  100. /**
  101. * @brief Method to intialize the chassis power specific structs
  102. * @param None
  103. * @return 0 if success, -1 if error
  104. **/
  105. extern int OBSM_InitChassisPwrInfo (int BMCInst);
  106. /**
  107. * @brief OBSM Power task.
  108. **/
  109. extern void* OBSMPwrTask (void *pArg);
  110. #endif /*OBSMPWRMNGR_H*/