SDR.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. * SDR.h
  16. * SDR functions.
  17. *
  18. * Author: Rama Bisa <ramab@ami.com>
  19. *
  20. ******************************************************************/
  21. #ifndef SDR_H
  22. #define SDR_H
  23. #include "com_IPMI_SDR.h"
  24. #include "SDRRecord.h"
  25. //#include "main.h"
  26. #pragma pack( 1 )
  27. /**
  28. * @struct E2ROMHdr_T
  29. * @brief EEROM Header.
  30. **/
  31. typedef struct
  32. {
  33. uint8_t Valid;
  34. uint8_t Len;
  35. } E2ROMHdr_T;
  36. #pragma pack( )
  37. /**
  38. * @var g_SDRRAM
  39. * @brief SDR Repository.
  40. **/
  41. extern SDRRepository_T* g_SDRRAM;
  42. /**
  43. * @defgroup src SDR Repository Command handlers
  44. * @ingroup storage
  45. * IPMI Sensor Data Records Repository interface commands.
  46. * These commands provide read/write access to BMC's SDR repository.
  47. * @{
  48. **/
  49. int GetSDRRepositoryInfo ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  50. int GetSDRRepositoryAllocInfo ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  51. int ReserveSDRRepository ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  52. int GetSDR ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  53. int AddSDR ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  54. int PartialAddSDR ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  55. int DeleteSDR ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  56. int ClearSDRRepository ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  57. int GetSDRRepositoryTime ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  58. int SetSDRRepositoryTime ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  59. int EnterSDRUpdateMode ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  60. int ExitSDRUpdateMode ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  61. int RunInitializationAgent ( uint8_t* pReq, uint8_t ReqLen, uint8_t* pRes);
  62. /** @} */
  63. /**
  64. * @brief Get the next SDR record ID.
  65. * @param RecID - Current SDR record ID.
  66. * @return the next SDR record ID.
  67. **/
  68. uint16_t SDR_GetNextSDRId (uint16_t RecID);
  69. /**
  70. * @brief Reads SDR Repository contents.
  71. * @param pSDRRec - Current SDR Record header.
  72. * @return the next SDR Record header.
  73. **/
  74. SDRRecHdr_T* ReadSDRRepository ( SDRRecHdr_T* pSDRRec);
  75. /**
  76. * @brief Write into SDR Repository.
  77. * @param pSDRRec - Record to be written.
  78. * @param Offset - Write offset.
  79. * @param Size - Size of write.
  80. * @return the SDR Record header.
  81. **/
  82. void WriteSDRRepository ( SDRRecHdr_T* pSDRRec, uint8_t Offset, uint8_t Size,uint8_t SdrSize);
  83. /**
  84. * @brief Get the SDR Record.
  85. * @param RecID - SDR Record ID.
  86. * @return the SDR Record.
  87. **/
  88. SDRRecHdr_T* GetSDRRec (uint16_t RecID);
  89. /**
  90. * @brief Initialize SDR Repository.
  91. * @return 0 if success, -1 if error
  92. **/
  93. int InitSDR (void);
  94. #endif /* SDR_H */