SDRAPI.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. * SDRAPI.h
  17. * SDR Access API.
  18. *
  19. * Author: Govind Kothandapani <govindk@ami.com>
  20. *
  21. ******************************************************************/
  22. #ifndef SDRAPI_H
  23. #define SDRAPI_H
  24. #include "Types.h"
  25. #include "IPMI_SDR.h"
  26. #include "IPMI_Sensor.h"
  27. //#include "IPMI_SDRRecord.h"
  28. /*-----------------------------------------------------------------
  29. * @fn API_GetSDRRepositoryInfo
  30. * @brief Gets the information regarding the SDR.
  31. * @param pRepositoryInfo - Pointer to the repository information.
  32. * @return 0 if Success
  33. * -1 if no repository, or repository bad.
  34. *-----------------------------------------------------------------*/
  35. extern int API_GetSDRRepositoryInfo (SDRRepositoryInfo_T* pRepositoryInfo, int BMCInst);
  36. /*-----------------------------------------------------------------
  37. * @fn API_GetSDRAllocInfo
  38. * @brief Gets the SDR Allocation information.
  39. * @param pAllocInfo - Pointer to the allocation information.
  40. * @return 0 if Success
  41. * -1 if no repository, or repository bad.
  42. *-----------------------------------------------------------------*/
  43. extern int API_GetSDRAllocInfo (SDRRepositoryAllocInfo_T* pAllocInfo, int BMCInst);
  44. /*-----------------------------------------------------------------
  45. * @fn API_GetFirstSDR
  46. * @brief Gets the first SDR record.
  47. * @param pSDRRecord - Pointer to the buffer to hold the first SDR Record.
  48. * @return The next SDR Record ID
  49. * 0 if no SDR Record is found.
  50. *-----------------------------------------------------------------*/
  51. extern INT16U API_GetFirstSDR (_FAR_ INT8U* pSDRRecord, int BMCInst);
  52. /*-----------------------------------------------------------------
  53. * @fn API_GetSDRRecord
  54. * @brief Gets the SDR record corresponding to the record ID.
  55. * @param pRecordID - Pointer to ID of the record to fetch and set to Next ID.
  56. * @param pSDRRecord - Pointer to the buffer to hold the first SDR Record.
  57. * @return 1 the Next ID is stored in pNextID
  58. * 0 if no next SDR Record is found.
  59. * -1 if error
  60. *-----------------------------------------------------------------*/
  61. extern int API_GetNextSDR (INT16U* pRecordID, _FAR_ INT8U* pSDRRecord, int BMCInst);
  62. /*-----------------------------------------------------------------
  63. * @fn API_GetSensorSDR
  64. * @brief Finds SDR record corresponding to sensor number.
  65. * @param SensorNum - Sensor number to look for.
  66. * @return Pointer to sensor record
  67. * NULL if no SDR Record is found.
  68. *-----------------------------------------------------------------*/
  69. extern SDRRecHdr_T* API_GetSensorSDR (INT8U SensorNum, int BMCInst);
  70. /*-----------------------------------------------------------------
  71. * @fn API_AddSDRRecord
  72. * @brief Adds a new SDR Record.
  73. * @param pSDRRecord - Pointer to the buffer holding the SDR Record.
  74. * @param RecordLen - SDR Record length.
  75. * @return Record ID of the record added.
  76. * 0 if failed.
  77. *-----------------------------------------------------------------*/
  78. extern INT16U API_AddSDRRecord (_FAR_ INT8U* pSDRRecord, INT8U RecordLen, int BMCInst);
  79. /*-----------------------------------------------------------------
  80. * @fn API_ClearSDRRepository
  81. * @brief Clears the SDR repository.
  82. * @return 0 if success
  83. * -1 if failed.
  84. *-----------------------------------------------------------------*/
  85. extern int API_ClearSDRRepository (int BMCInst);
  86. /*-----------------------------------------------------------------
  87. * @fn API_GetSensorThresholds
  88. * @brief Retrieves the sensor thresholds for a particular sensor number
  89. * @param SensorNum - Sensor Number to look up
  90. * @param SensorThresh - Structure to store sensor thresholds in
  91. * @return 0 if success
  92. * -1 if failed.
  93. *-----------------------------------------------------------------*/
  94. extern int API_GetSensorThresholds (INT8U SensorNum, GetSensorThresholdRes_T* SensorThresh, int BMCInst);
  95. /*-----------------------------------------------------------------
  96. * @fn API_GetSensorReading
  97. * @brief Retrieves the sensor reading for a particular sensor number
  98. * @param SensorNum - Sensor Number to look up
  99. * @param SensorRead - Sensor Reading response
  100. * @return reading if success
  101. * 0 if no reading.
  102. * -1 if failed.
  103. *-----------------------------------------------------------------*/
  104. extern int API_GetSensorReading (INT8U SensorNum, GetSensorReadingRes_T* SensorRead, int BMCInst);
  105. /*-----------------------------------------------------------------
  106. * @fn API_GetSensorNum
  107. * @brief Return sensor number based on sensor name
  108. * @return sensor number on success
  109. * 0xFF if failed.
  110. *-----------------------------------------------------------------*/
  111. extern INT8U API_GetSensorNum (const char * SensorName, int BMCInst);
  112. /*-----------------------------------------------------------------
  113. * @fn API_GetSensorName
  114. * @brief Return sensor name based on sensor number
  115. * @return sensor name on success
  116. * NULL if failed.
  117. *-----------------------------------------------------------------*/
  118. extern const char* API_GetSensorName (INT8U SensorNum, int BMCInst);
  119. /*-----------------------------------------------------------------
  120. * @fn API_RunInitializationAgent
  121. * @brief Run Initialization Agent.
  122. * @return 0 if Success
  123. * -1 if failed.
  124. *-----------------------------------------------------------------*/
  125. extern int API_RunInitializationAgent (int BMCInst);
  126. #endif /* SDRAPI_H */