mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2026-01-27 10:22:15 +00:00
Improve CPU load by reduce IPMITOOL usage
Fix psu & led bug in I2C mode Signed-off-by: johnson <JOHNSON.LU@deltaww.com>
This commit is contained in:
@@ -517,29 +517,6 @@ int hex_to_ascii(char hex_high, char hex_low)
|
||||
return high + low;
|
||||
}
|
||||
|
||||
int dni_psu_present(int *r_data)
|
||||
{
|
||||
FILE *fptr = NULL;
|
||||
int rv = ONLP_STATUS_OK;
|
||||
char cmd[35] = {0};
|
||||
char str_data[50] = {0};
|
||||
|
||||
sprintf(cmd, "ipmitool raw 0x38 0x2 2 0x6a 0x0d 1");
|
||||
fptr = popen(cmd, "r");
|
||||
if(fptr != NULL)
|
||||
{
|
||||
if(fgets(str_data, sizeof(str_data), fptr) != NULL)
|
||||
*r_data = strtol(str_data, NULL, 16);
|
||||
else
|
||||
rv = ONLP_STATUS_E_INVALID;
|
||||
}
|
||||
else
|
||||
rv = ONLP_STATUS_E_INVALID;
|
||||
pclose(fptr);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
int dni_i2c_lock_read(mux_info_t * mux_info, dev_info_t * dev_info)
|
||||
{
|
||||
int r_data = 0;
|
||||
|
||||
@@ -226,7 +226,6 @@ int dni_bmc_fanpresent_info_get(uint8_t *fan_present_bit);
|
||||
int dni_i2c_lock_read( mux_info_t * mux_info, dev_info_t * dev_info);
|
||||
int dni_i2c_lock_read_attribute(mux_info_t * mux_info, char * fullpath);
|
||||
int dni_i2c_lock_write_attribute(mux_info_t * mux_info, char * data,char * fullpath);
|
||||
int dni_psu_present(int *r_data);
|
||||
int dni_bmc_data_get(int bus, int addr, int reg, int *r_data);
|
||||
int dni_bmc_data_set(int bus, int addr, int reg, uint8_t w_data);
|
||||
void lockinit();
|
||||
|
||||
Reference in New Issue
Block a user