mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
Add missing onlp_sysi_onie_data_get() implementation.
This commit is contained in:
@@ -46,6 +46,8 @@
|
||||
#define PSU1_AC_HWMON_NODE(node) PSU1_AC_HWMON_PREFIX#node
|
||||
#define PSU2_AC_HWMON_NODE(node) PSU2_AC_HWMON_PREFIX#node
|
||||
|
||||
#define IDPROM_PATH "/sys/class/i2c-adapter/i2c-1/1-0057/eeprom"
|
||||
|
||||
int deviceNodeWriteInt(char *filename, int value, int data_len);
|
||||
int deviceNodeReadBinary(char *filename, char *buffer, int buf_size, int data_len);
|
||||
int deviceNodeReadString(char *filename, char *buffer, int buf_size, int data_len);
|
||||
@@ -63,7 +65,7 @@ psu_type_t get_psu_type(int id, char* modelname, int modelname_len);
|
||||
#if (DEBUG_MODE == 1)
|
||||
#define DEBUG_PRINT(format, ...) printf(format, __VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_PRINT(format, ...)
|
||||
#define DEBUG_PRINT(format, ...)
|
||||
#endif
|
||||
|
||||
#endif /* __PLATFORM_LIB_H__ */
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
|
||||
#include "x86_64_accton_as7512_32x_int.h"
|
||||
#include "x86_64_accton_as7512_32x_log.h"
|
||||
#include "platform_lib.h"
|
||||
#include <onlplib/file.h>
|
||||
|
||||
#define NUM_OF_THERMAL_ON_MAIN_BROAD 5
|
||||
#define NUM_OF_FAN_ON_MAIN_BROAD 6
|
||||
@@ -46,13 +48,28 @@ onlp_sysi_platform_get(void)
|
||||
return "x86-64-accton-as7512-32x-r0";
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sysi_onie_data_get(uint8_t** data, int* size)
|
||||
{
|
||||
uint8_t* rdata = aim_zmalloc(256);
|
||||
if(onlp_file_read(rdata, 256, size, IDPROM_PATH) == ONLP_STATUS_OK) {
|
||||
if(*size == 256) {
|
||||
*data = rdata;
|
||||
return ONLP_STATUS_OK;
|
||||
}
|
||||
}
|
||||
aim_free(rdata);
|
||||
*size = 0;
|
||||
return ONLP_STATUS_E_INTERNAL;
|
||||
}
|
||||
|
||||
int
|
||||
onlp_sysi_oids_get(onlp_oid_t* table, int max)
|
||||
{
|
||||
int i;
|
||||
onlp_oid_t* e = table;
|
||||
memset(table, 0, max*sizeof(onlp_oid_t));
|
||||
|
||||
|
||||
/* 4 Thermal sensors on the chassis */
|
||||
for (i = 1; i <= NUM_OF_THERMAL_ON_MAIN_BROAD; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user