SEL.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /****************************************************************
  2. ****************************************************************
  3. ** **
  4. ** (C)Copyright 2005-2006, American Megatrends Inc. **
  5. ** **
  6. ** All Rights Reserved. **
  7. ** **
  8. ** 6145-F, Northbelt Parkway, Norcross, **
  9. ** **
  10. ** Georgia - 30071, USA. Phone-(770)-246-8600. **
  11. ** **
  12. ****************************************************************
  13. ****************************************************************/
  14. /*****************************************************************
  15. *
  16. * Sel.h
  17. * Sel command handler
  18. *
  19. * Author: Bakka Ravinder Reddy <bakkar@ami.com>
  20. *
  21. *****************************************************************/
  22. #ifndef SEL_H
  23. #define SEL_H
  24. #include "com_BmcType.h"
  25. /*--------------System Event Record-------------*/
  26. #define SYSTEM_EVT_RECORD 0x02
  27. #define SYS_EVENT_LOGGING_MASK 0x08
  28. #define IGNORE_SEL_PEF 0x0
  29. #define ENABLE_SEL_MASK 0x1
  30. #define ENABLE_PEF_MASK 0x2
  31. #define POST_ONLY_SEL ENABLE_SEL_MASK
  32. #define POST_SEL_AND_PEF (ENABLE_SEL_MASK | ENABLE_PEF_MASK)
  33. #define LINEAR_SEL 0x00
  34. #define CIRCULAR_SEL 0x01
  35. /**
  36. * @defgroup sic SEL Command handlers
  37. * @ingroup storage
  38. * IPMI System Event Log interface commands.
  39. * This set of commands provides read/write access to BMC's SEL.
  40. * @{
  41. **/
  42. extern int GetSELInfo ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  43. extern int GetSELAllocationInfo ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  44. extern int ReserveSEL ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  45. extern int ClearSEL ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  46. extern int GetSELEntry ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  47. extern int AddSELEntry ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  48. extern int PartialAddSELEntry ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  49. extern int DeleteSELEntry ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  50. extern int GetSELTime ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  51. extern int SetSELTime ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  52. extern int GetAuxiliaryLogStatus( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  53. extern int SetAuxiliaryLogStatus( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  54. extern int LockedAddSELEntry ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  55. extern int GetSELTimeUTC_Offset ( uint8_t * pReq, uint8_t ReqLen, uint8_t * pRes);
  56. extern int SetSELTimeUTC_Offset ( uint8_t * pReq, uint8_t ReqLen, uint8_t * pRes);
  57. /** @} */
  58. /**
  59. * @brief Get SEL timestamp.
  60. * @return The timestamp.
  61. **/
  62. extern uint32_t GetSelTimeStamp (void);
  63. /**
  64. * @brief Initialize SEL Device.
  65. * @return 0 if success, -1 if error
  66. **/
  67. extern int InitSEL (void);
  68. /*---------------------------------------------------------------------------
  69. * @fn SetSELPolicy
  70. *
  71. * @brief This function is invoked when switch SEL policy, make appropriate
  72. * adjustment for environment variables that related to SEL buffer.
  73. *
  74. * @param Policy - Specify Linear SEL policy or Circular SEL policy.
  75. * @param BMCInst - Index of BMC instance.
  76. *---------------------------------------------------------------------------*/
  77. //extern void SetSELPolicy(uint8_t Policy);
  78. /*-----------------------------------------------------------------
  79. * @fn CheckLastSELRecordID
  80. *
  81. * @brief This function is called after PEF Postpone timer expires.
  82. * When LastSELRecordID and LastSWProcessedEventID are mismatch,
  83. * BMC will automatically perform PEF against any existing,
  84. * unprocessed events in SEL. Please refer IPMI spec 17.4.1 for details.
  85. *
  86. * @param BMCInst
  87. *-----------------------------------------------------------------*/
  88. extern void CheckLastSELRecordID (void);
  89. #endif /* SEL_H */