|
@@ -43,7 +43,7 @@
|
|
|
#include <time.h>
|
|
|
|
|
|
#include <ipmitool/ipmi.h>
|
|
|
-#include <ipmitool/log.h>
|
|
|
+//#include <ipmitool/log.h>
|
|
|
#include <ipmitool/ipmi_mc.h>
|
|
|
#include <ipmitool/ipmi_sdr.h>
|
|
|
#include <ipmitool/ipmi_sdradd.h>
|
|
@@ -370,39 +370,39 @@ sdr_convert_sensor_tolerance(struct sdr_record_full_sensor *sensor, uint8_t val)
|
|
|
}
|
|
|
|
|
|
switch (sensor->linearization & 0x7f) {
|
|
|
- case SDR_SENSOR_L_LN:
|
|
|
- result = log(result);
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_LOG10:
|
|
|
- result = log10(result);
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_LOG2:
|
|
|
- result = (double) (log(result) / log(2.0));
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_E:
|
|
|
- result = exp(result);
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_EXP10:
|
|
|
- result = pow(10.0, result);
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_EXP2:
|
|
|
- result = pow(2.0, result);
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_1_X:
|
|
|
- result = pow(result, -1.0); /*1/x w/o exception */
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_SQR:
|
|
|
- result = pow(result, 2.0);
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_CUBE:
|
|
|
- result = pow(result, 3.0);
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_SQRT:
|
|
|
- result = sqrt(result);
|
|
|
- break;
|
|
|
- case SDR_SENSOR_L_CUBERT:
|
|
|
- result = cbrt(result);
|
|
|
- break;
|
|
|
+ // case SDR_SENSOR_L_LN:
|
|
|
+ // result = log(result);
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_LOG10:
|
|
|
+ // result = log10(result);
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_LOG2:
|
|
|
+ // result = (double) (log(result) / log(2.0));
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_E:
|
|
|
+ // result = exp(result);
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_EXP10:
|
|
|
+ // result = pow(10.0, result);
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_EXP2:
|
|
|
+ // result = pow(2.0, result);
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_1_X:
|
|
|
+ // result = pow(result, -1.0); /*1/x w/o exception */
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_SQR:
|
|
|
+ // result = pow(result, 2.0);
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_CUBE:
|
|
|
+ // result = pow(result, 3.0);
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_SQRT:
|
|
|
+ // result = sqrt(result);
|
|
|
+ // break;
|
|
|
+ // case SDR_SENSOR_L_CUBERT:
|
|
|
+ // result = cbrt(result);
|
|
|
+ // break;
|
|
|
case SDR_SENSOR_L_LINEAR:
|
|
|
default:
|
|
|
break;
|
|
@@ -440,7 +440,7 @@ sdr_convert_sensor_value_to_raw(struct sdr_record_full_sensor * sensor,
|
|
|
result = (((val / pow(10, k2)) - (b * pow(10, k1))) / m);
|
|
|
|
|
|
if ((result - (int) result) >= .5)
|
|
|
- return (uint8_t) ceil(result);
|
|
|
+ return (uint8_t) (result+0.5);
|
|
|
else
|
|
|
return (uint8_t) result;
|
|
|
}
|
|
@@ -578,8 +578,7 @@ ipmi_sdr_get_sensor_reading_ipmb(struct ipmi_intf *intf, uint8_t sensor,
|
|
|
uint32_t save_channel;
|
|
|
|
|
|
if ( BRIDGE_TO_SENSOR(intf, target, channel) ) {
|
|
|
- lprintf(LOG_DEBUG,
|
|
|
- "Bridge to Sensor "
|
|
|
+ printf("Bridge to Sensor "
|
|
|
"Intf my/%#x tgt/%#x:%#x Sdr tgt/%#x:%#x\n",
|
|
|
intf->my_addr, intf->target_addr, intf->target_channel,
|
|
|
target, channel);
|
|
@@ -794,12 +793,12 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
|
|
|
sdr_rq.reserve_id = itr->reservation;
|
|
|
rsp = intf->sendrecv(intf, &req);
|
|
|
if (rsp == NULL) {
|
|
|
- lprintf(LOG_ERR, "Get SDR %04x command failed",
|
|
|
+ printf( "Get SDR %04x command failed",
|
|
|
itr->next);
|
|
|
continue;
|
|
|
} else if (rsp->ccode == 0xc5) {
|
|
|
/* lost reservation */
|
|
|
- lprintf(LOG_DEBUG, "SDR reservation %04x cancelled. "
|
|
|
+ printf( "SDR reservation %04x cancelled. "
|
|
|
"Sleeping a bit and retrying...",
|
|
|
itr->reservation);
|
|
|
|
|
@@ -807,12 +806,12 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
|
|
|
|
|
|
if (ipmi_sdr_get_reservation(intf, itr->use_built_in,
|
|
|
&(itr->reservation)) < 0) {
|
|
|
- lprintf(LOG_ERR,
|
|
|
+ printf(
|
|
|
"Unable to renew SDR reservation");
|
|
|
return NULL;
|
|
|
}
|
|
|
} else if (rsp->ccode > 0) {
|
|
|
- lprintf(LOG_ERR, "Get SDR %04x command failed: %s",
|
|
|
+ printf( "Get SDR %04x command failed: %s",
|
|
|
itr->next, val2str(rsp->ccode,
|
|
|
completion_code_vals));
|
|
|
continue;
|
|
@@ -827,12 +826,12 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
|
|
|
if (!rsp)
|
|
|
return NULL;
|
|
|
|
|
|
- lprintf(LOG_DEBUG, "SDR record ID : 0x%04x", itr->next);
|
|
|
+ printf( "SDR record ID : 0x%04x", itr->next);
|
|
|
|
|
|
memcpy(&sdr_rs, rsp->data, sizeof (sdr_rs));
|
|
|
|
|
|
if (sdr_rs.length == 0) {
|
|
|
- lprintf(LOG_ERR, "SDR record id 0x%04x: invalid length %d",
|
|
|
+ printf( "SDR record id 0x%04x: invalid length %d",
|
|
|
itr->next, sdr_rs.length);
|
|
|
return NULL;
|
|
|
}
|
|
@@ -848,13 +847,13 @@ ipmi_sdr_get_header(struct ipmi_intf *intf, struct ipmi_sdr_iterator *itr)
|
|
|
*/
|
|
|
if ((itr->next != 0x0000) &&
|
|
|
(sdr_rs.id != itr->next)) {
|
|
|
- lprintf(LOG_DEBUG, "SDR record id mismatch: 0x%04x", sdr_rs.id);
|
|
|
+ printf( "SDR record id mismatch: 0x%04x", sdr_rs.id);
|
|
|
sdr_rs.id = itr->next;
|
|
|
}
|
|
|
|
|
|
- lprintf(LOG_DEBUG, "SDR record type : 0x%02x", sdr_rs.type);
|
|
|
- lprintf(LOG_DEBUG, "SDR record next : 0x%04x", sdr_rs.next);
|
|
|
- lprintf(LOG_DEBUG, "SDR record bytes: %d", sdr_rs.length);
|
|
|
+ printf( "SDR record type : 0x%02x", sdr_rs.type);
|
|
|
+ printf( "SDR record next : 0x%04x", sdr_rs.next);
|
|
|
+ printf( "SDR record bytes: %d", sdr_rs.length);
|
|
|
|
|
|
return &sdr_rs;
|
|
|
}
|
|
@@ -960,14 +959,12 @@ ipmi_sdr_print_sensor_event_status(struct ipmi_intf *intf,
|
|
|
target, lun, channel);
|
|
|
|
|
|
if (rsp == NULL) {
|
|
|
- lprintf(LOG_DEBUG,
|
|
|
- "Error reading event status for sensor #%02x",
|
|
|
+ printf("Error reading event status for sensor #%02x",
|
|
|
sensor_num);
|
|
|
return -1;
|
|
|
}
|
|
|
if (rsp->ccode > 0) {
|
|
|
- lprintf(LOG_DEBUG,
|
|
|
- "Error reading event status for sensor #%02x: %s",
|
|
|
+ printf("Error reading event status for sensor #%02x: %s",
|
|
|
sensor_num, val2str(rsp->ccode, completion_code_vals));
|
|
|
return -1;
|
|
|
}
|
|
@@ -1174,14 +1171,12 @@ ipmi_sdr_print_sensor_event_enable(struct ipmi_intf *intf,
|
|
|
target, lun, channel);
|
|
|
|
|
|
if (rsp == NULL) {
|
|
|
- lprintf(LOG_DEBUG,
|
|
|
- "Error reading event enable for sensor #%02x",
|
|
|
+ printf( "Error reading event enable for sensor #%02x",
|
|
|
sensor_num);
|
|
|
return -1;
|
|
|
}
|
|
|
if (rsp->ccode > 0) {
|
|
|
- lprintf(LOG_DEBUG,
|
|
|
- "Error reading event enable for sensor #%02x: %s",
|
|
|
+ printf( "Error reading event enable for sensor #%02x: %s",
|
|
|
sensor_num, val2str(rsp->ccode, completion_code_vals));
|
|
|
return -1;
|
|
|
}
|
|
@@ -1440,7 +1435,7 @@ ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
|
|
|
|
|
|
|
|
|
if (rsp == NULL) {
|
|
|
- lprintf(LOG_DEBUG, "Error reading sensor %s (#%02x)",
|
|
|
+ printf( "Error reading sensor %s (#%02x)",
|
|
|
sr.s_id, sensor->keys.sensor_num);
|
|
|
return &sr;
|
|
|
}
|
|
@@ -1448,8 +1443,7 @@ ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
|
|
|
if (rsp->ccode) {
|
|
|
if ( !((sr.full && rsp->ccode == 0xcb) ||
|
|
|
(sr.compact && rsp->ccode == 0xcd)) ) {
|
|
|
- lprintf(LOG_DEBUG,
|
|
|
- "Error reading sensor %s (#%02x): %s", sr.s_id,
|
|
|
+ printf("Error reading sensor %s (#%02x): %s", sr.s_id,
|
|
|
sensor->keys.sensor_num,
|
|
|
val2str(rsp->ccode, completion_code_vals));
|
|
|
}
|
|
@@ -1463,7 +1457,7 @@ ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
|
|
|
* the reading. If we don't have both of these we can't have
|
|
|
* a valid sensor reading.
|
|
|
*/
|
|
|
- lprintf(LOG_DEBUG, "Error reading sensor %s invalid len %d",
|
|
|
+ printf( "Error reading sensor %s invalid len %d",
|
|
|
sr.s_id, rsp->data_len);
|
|
|
return &sr;
|
|
|
}
|
|
@@ -1474,7 +1468,7 @@ ipmi_sdr_read_sensor_value(struct ipmi_intf *intf,
|
|
|
|
|
|
if (IS_SCANNING_DISABLED(rsp->data[1])) {
|
|
|
sr.s_scanning_disabled = 1;
|
|
|
- lprintf(LOG_DEBUG, "Sensor %s (#%02x) scanning disabled",
|
|
|
+ printf( "Sensor %s (#%02x) scanning disabled",
|
|
|
sr.s_id, sensor->keys.sensor_num);
|
|
|
return &sr;
|
|
|
}
|
|
@@ -1717,7 +1711,7 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
|
|
|
printf(" Sensor Type (Discrete): %s (0x%02x)\n",
|
|
|
ipmi_get_sensor_type(intf, sensor->sensor.type),
|
|
|
sensor->sensor.type);
|
|
|
- lprintf(LOG_DEBUG, " Event Type Code : 0x%02x",
|
|
|
+ printf( " Event Type Code : 0x%02x",
|
|
|
sensor->event_type);
|
|
|
|
|
|
printf(" Sensor Reading : ");
|
|
@@ -2095,7 +2089,7 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
|
|
|
printf("Sensor Type : %s (0x%02x)\n",
|
|
|
ipmi_get_sensor_type(intf, sensor->sensor_type),
|
|
|
sensor->sensor_type);
|
|
|
- lprintf(LOG_DEBUG, "Event Type Code : 0x%02x",
|
|
|
+ printf("Event Type Code : 0x%02x",
|
|
|
sensor->event_type);
|
|
|
printf("\n");
|
|
|
} else {
|
|
@@ -2422,7 +2416,7 @@ ipmi_sdr_print_sensor_oem_intel(struct ipmi_intf *intf,
|
|
|
case 0x07: /* Ambient Temperature Fan Speed Control */
|
|
|
break;
|
|
|
default:
|
|
|
- lprintf(LOG_DEBUG, "Unknown Intel OEM SDR Record type %02x",
|
|
|
+ printf( "Unknown Intel OEM SDR Record type %02x",
|
|
|
oem->data[3]);
|
|
|
}
|
|
|
|
|
@@ -2517,7 +2511,7 @@ ipmi_sdr_print_name_from_rawentry(struct ipmi_intf *intf, uint16_t id,
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- lprintf(LOG_INFO, "ID: 0x%04x , NAME: %-16s", id, desc);
|
|
|
+ printf( "ID: 0x%04x , NAME: %-16s", id, desc);
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
@@ -2660,12 +2654,12 @@ ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type)
|
|
|
struct sdr_record_list *e;
|
|
|
int rc = 0;
|
|
|
|
|
|
- lprintf(LOG_DEBUG, "Querying SDR for sensor list");
|
|
|
+ printf( "Querying SDR for sensor list");
|
|
|
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
sdr_list_itr = ipmi_sdr_start(intf, 0);
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR for reading");
|
|
|
+ printf( "Unable to open SDR for reading");
|
|
|
return -1;
|
|
|
}
|
|
|
}
|
|
@@ -2687,14 +2681,14 @@ ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type)
|
|
|
|
|
|
rec = ipmi_sdr_get_record(intf, header, sdr_list_itr);
|
|
|
if (rec == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: ipmi_sdr_get_record() failed");
|
|
|
+ printf( "ipmitool: ipmi_sdr_get_record() failed");
|
|
|
rc = -1;
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
sdrr = malloc(sizeof (struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
if (rec != NULL) {
|
|
|
free(rec);
|
|
|
rec = NULL;
|
|
@@ -2741,7 +2735,7 @@ ipmi_sdr_print_sdr(struct ipmi_intf *intf, uint8_t type)
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- lprintf(LOG_DEBUG, "SDR record ID : 0x%04x", sdrr->id);
|
|
|
+ printf( "SDR record ID : 0x%04x", sdrr->id);
|
|
|
|
|
|
if (type == header->type || type == 0xff ||
|
|
|
(type == 0xfe &&
|
|
@@ -2798,7 +2792,7 @@ ipmi_sdr_get_reservation(struct ipmi_intf *intf, int use_builtin,
|
|
|
return -1;
|
|
|
|
|
|
*reserve_id = ((struct sdr_reserve_repo_rs *) &(rsp->data))->reserve_id;
|
|
|
- lprintf(LOG_DEBUG, "SDR reservation ID %04x", *reserve_id);
|
|
|
+ printf( "SDR reservation ID %04x", *reserve_id);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -2821,7 +2815,7 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
|
|
|
|
|
|
itr = malloc(sizeof (struct ipmi_sdr_iterator));
|
|
|
if (itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
@@ -2834,13 +2828,13 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
|
|
|
rsp = intf->sendrecv(intf, &req);
|
|
|
|
|
|
if (rsp == NULL) {
|
|
|
- lprintf(LOG_ERR, "Get Device ID command failed");
|
|
|
+ printf( "Get Device ID command failed");
|
|
|
free(itr);
|
|
|
itr = NULL;
|
|
|
return NULL;
|
|
|
}
|
|
|
if (rsp->ccode > 0) {
|
|
|
- lprintf(LOG_ERR, "Get Device ID command failed: %#x %s",
|
|
|
+ printf( "Get Device ID command failed: %#x %s",
|
|
|
rsp->ccode, val2str(rsp->ccode, completion_code_vals));
|
|
|
free(itr);
|
|
|
itr = NULL;
|
|
@@ -2853,16 +2847,16 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
|
|
|
if (!use_builtin && (devid->device_revision & IPM_DEV_DEVICE_ID_SDR_MASK)) {
|
|
|
if ((devid->adtl_device_support & 0x02) == 0) {
|
|
|
if ((devid->adtl_device_support & 0x01)) {
|
|
|
- lprintf(LOG_DEBUG, "Using Device SDRs\n");
|
|
|
+ printf( "Using Device SDRs\n");
|
|
|
use_built_in = 1;
|
|
|
} else {
|
|
|
- lprintf(LOG_ERR, "Error obtaining SDR info");
|
|
|
+ printf( "Error obtaining SDR info");
|
|
|
free(itr);
|
|
|
itr = NULL;
|
|
|
return NULL;
|
|
|
}
|
|
|
} else {
|
|
|
- lprintf(LOG_DEBUG, "Using SDR from Repository \n");
|
|
|
+ printf( "Using SDR from Repository \n");
|
|
|
}
|
|
|
}
|
|
|
itr->use_built_in = use_builtin ? 1 : use_built_in;
|
|
@@ -2876,13 +2870,13 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
|
|
|
|
|
|
rsp = intf->sendrecv(intf, &req);
|
|
|
if (rsp == NULL) {
|
|
|
- lprintf(LOG_ERR, "Error obtaining SDR info");
|
|
|
+ printf( "Error obtaining SDR info");
|
|
|
free(itr);
|
|
|
itr = NULL;
|
|
|
return NULL;
|
|
|
}
|
|
|
if (rsp->ccode > 0) {
|
|
|
- lprintf(LOG_ERR, "Error obtaining SDR info: %s",
|
|
|
+ printf( "Error obtaining SDR info: %s",
|
|
|
val2str(rsp->ccode, completion_code_vals));
|
|
|
free(itr);
|
|
|
itr = NULL;
|
|
@@ -2897,22 +2891,22 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
|
|
|
if ((sdr_info.version != 0x51) &&
|
|
|
(sdr_info.version != 0x01) &&
|
|
|
(sdr_info.version != 0x02)) {
|
|
|
- lprintf(LOG_WARN, "WARNING: Unknown SDR repository "
|
|
|
+ printf( "WARNING: Unknown SDR repository "
|
|
|
"version 0x%02x", sdr_info.version);
|
|
|
}
|
|
|
|
|
|
itr->total = sdr_info.count;
|
|
|
itr->next = 0;
|
|
|
|
|
|
- lprintf(LOG_DEBUG, "SDR free space: %d", sdr_info.free);
|
|
|
- lprintf(LOG_DEBUG, "SDR records : %d", sdr_info.count);
|
|
|
+ printf( "SDR free space: %d", sdr_info.free);
|
|
|
+ printf( "SDR records : %d", sdr_info.count);
|
|
|
|
|
|
/* Build SDRR if there is no record in repository */
|
|
|
if( sdr_info.count == 0 ) {
|
|
|
- lprintf(LOG_DEBUG, "Rebuilding SDRR...");
|
|
|
+ printf( "Rebuilding SDRR...");
|
|
|
|
|
|
if( ipmi_sdr_add_from_sensors( intf, 0 ) != 0 ) {
|
|
|
- lprintf(LOG_ERR, "Could not build SDRR!");
|
|
|
+ printf( "Could not build SDRR!");
|
|
|
free(itr);
|
|
|
itr = NULL;
|
|
|
return NULL;
|
|
@@ -2936,12 +2930,12 @@ ipmi_sdr_start(struct ipmi_intf *intf, int use_builtin)
|
|
|
|
|
|
itr->total = sdr_info.count;
|
|
|
itr->next = 0;
|
|
|
- lprintf(LOG_DEBUG, "SDR records : %d", sdr_info.count);
|
|
|
+ printf( "SDR records : %d", sdr_info.count);
|
|
|
}
|
|
|
|
|
|
if (ipmi_sdr_get_reservation(intf, itr->use_built_in,
|
|
|
&(itr->reservation)) < 0) {
|
|
|
- lprintf(LOG_ERR, "Unable to obtain SDR reservation");
|
|
|
+ printf( "Unable to obtain SDR reservation");
|
|
|
free(itr);
|
|
|
itr = NULL;
|
|
|
return NULL;
|
|
@@ -2974,7 +2968,7 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
|
|
|
|
|
|
data = malloc(len + 1);
|
|
|
if (data == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
return NULL;
|
|
|
}
|
|
|
memset(data, 0, len + 1);
|
|
@@ -3015,7 +3009,7 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
|
|
|
len - i : sdr_max_read_len;
|
|
|
sdr_rq.offset = i + 5; /* 5 header bytes */
|
|
|
|
|
|
- lprintf(LOG_DEBUG, "Getting %d bytes from SDR at offset %d",
|
|
|
+ printf( "Getting %d bytes from SDR at offset %d",
|
|
|
sdr_rq.length, sdr_rq.offset);
|
|
|
|
|
|
rsp = intf->sendrecv(intf, &req);
|
|
@@ -3039,7 +3033,7 @@ ipmi_sdr_get_record(struct ipmi_intf * intf, struct sdr_get_rs * header,
|
|
|
continue;
|
|
|
case 0xc5:
|
|
|
/* lost reservation */
|
|
|
- lprintf(LOG_DEBUG, "SDR reservation cancelled. "
|
|
|
+ printf( "SDR reservation cancelled. "
|
|
|
"Sleeping a bit and retrying...");
|
|
|
|
|
|
sleep(rand() & 3);
|
|
@@ -3103,7 +3097,7 @@ __sdr_list_add(struct sdr_record_list *head, struct sdr_record_list *entry)
|
|
|
|
|
|
new = malloc(sizeof (struct sdr_record_list));
|
|
|
if (new == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
return -1;
|
|
|
}
|
|
|
memcpy(new, entry, sizeof (struct sdr_record_list));
|
|
@@ -3218,7 +3212,7 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf, uint16_t gen_id, uint8_t num
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
sdr_list_itr = ipmi_sdr_start(intf, 0);
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR for reading");
|
|
|
+ printf( "Unable to open SDR for reading");
|
|
|
return NULL;
|
|
|
}
|
|
|
}
|
|
@@ -3249,7 +3243,7 @@ ipmi_sdr_find_sdr_bynumtype(struct ipmi_intf *intf, uint16_t gen_id, uint8_t num
|
|
|
|
|
|
sdrr = malloc(sizeof (struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
break;
|
|
|
}
|
|
|
memset(sdrr, 0, sizeof (struct sdr_record_list));
|
|
@@ -3342,7 +3336,7 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
sdr_list_itr = ipmi_sdr_start(intf, 0);
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR for reading");
|
|
|
+ printf( "Unable to open SDR for reading");
|
|
|
return NULL;
|
|
|
}
|
|
|
}
|
|
@@ -3350,7 +3344,7 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
|
|
|
/* check what we've already read */
|
|
|
head = malloc(sizeof (struct sdr_record_list));
|
|
|
if (head == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
return NULL;
|
|
|
}
|
|
|
memset(head, 0, sizeof (struct sdr_record_list));
|
|
@@ -3376,7 +3370,7 @@ ipmi_sdr_find_sdr_bysensortype(struct ipmi_intf *intf, uint8_t type)
|
|
|
|
|
|
sdrr = malloc(sizeof (struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
break;
|
|
|
}
|
|
|
memset(sdrr, 0, sizeof (struct sdr_record_list));
|
|
@@ -3462,14 +3456,14 @@ ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity)
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
sdr_list_itr = ipmi_sdr_start(intf, 0);
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR for reading");
|
|
|
+ printf( "Unable to open SDR for reading");
|
|
|
return NULL;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
head = malloc(sizeof (struct sdr_record_list));
|
|
|
if (head == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
return NULL;
|
|
|
}
|
|
|
memset(head, 0, sizeof (struct sdr_record_list));
|
|
@@ -3530,7 +3524,7 @@ ipmi_sdr_find_sdr_byentity(struct ipmi_intf *intf, struct entity_id *entity)
|
|
|
|
|
|
sdrr = malloc(sizeof (struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
break;
|
|
|
}
|
|
|
memset(sdrr, 0, sizeof (struct sdr_record_list));
|
|
@@ -3642,14 +3636,14 @@ ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf, uint8_t type)
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
sdr_list_itr = ipmi_sdr_start(intf, 0);
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR for reading");
|
|
|
+ printf( "Unable to open SDR for reading");
|
|
|
return NULL;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
head = malloc(sizeof (struct sdr_record_list));
|
|
|
if (head == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
return NULL;
|
|
|
}
|
|
|
memset(head, 0, sizeof (struct sdr_record_list));
|
|
@@ -3666,7 +3660,7 @@ ipmi_sdr_find_sdr_bytype(struct ipmi_intf *intf, uint8_t type)
|
|
|
|
|
|
sdrr = malloc(sizeof (struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
break;
|
|
|
}
|
|
|
memset(sdrr, 0, sizeof (struct sdr_record_list));
|
|
@@ -3757,7 +3751,7 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
sdr_list_itr = ipmi_sdr_start(intf, 0);
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR for reading");
|
|
|
+ printf( "Unable to open SDR for reading");
|
|
|
return NULL;
|
|
|
}
|
|
|
}
|
|
@@ -3811,7 +3805,7 @@ ipmi_sdr_find_sdr_byid(struct ipmi_intf *intf, char *id)
|
|
|
|
|
|
sdrr = malloc(sizeof (struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
break;
|
|
|
}
|
|
|
memset(sdrr, 0, sizeof (struct sdr_record_list));
|
|
@@ -3936,13 +3930,13 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
|
|
|
int ret = 0, count = 0, bc = 0;
|
|
|
|
|
|
if (ifile == NULL) {
|
|
|
- lprintf(LOG_ERR, "No SDR cache filename given");
|
|
|
+ printf( "No SDR cache filename given");
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
fp = ipmi_open_file_read(ifile);
|
|
|
if (fp == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR cache %s for reading",
|
|
|
+ printf( "Unable to open SDR cache %s for reading",
|
|
|
ifile);
|
|
|
return -1;
|
|
|
}
|
|
@@ -3954,7 +3948,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
|
|
|
break;
|
|
|
|
|
|
if (bc != 5) {
|
|
|
- lprintf(LOG_ERR, "header read %d bytes, expected 5",
|
|
|
+ printf( "header read %d bytes, expected 5",
|
|
|
bc);
|
|
|
ret = -1;
|
|
|
break;
|
|
@@ -3966,7 +3960,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
|
|
|
if (header.version != 0x51 &&
|
|
|
header.version != 0x01 &&
|
|
|
header.version != 0x02) {
|
|
|
- lprintf(LOG_WARN, "invalid sdr header version %02x",
|
|
|
+ printf( "invalid sdr header version %02x",
|
|
|
header.version);
|
|
|
ret = -1;
|
|
|
break;
|
|
@@ -3974,7 +3968,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
|
|
|
|
|
|
sdrr = malloc(sizeof (struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
ret = -1;
|
|
|
break;
|
|
|
}
|
|
@@ -3985,7 +3979,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
|
|
|
|
|
|
rec = malloc(header.length + 1);
|
|
|
if (rec == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
ret = -1;
|
|
|
if (sdrr != NULL) {
|
|
|
free(sdrr);
|
|
@@ -3997,7 +3991,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
|
|
|
|
|
|
bc = fread(rec, 1, header.length, fp);
|
|
|
if (bc != header.length) {
|
|
|
- lprintf(LOG_ERR,
|
|
|
+ printf(
|
|
|
"record %04x read %d bytes, expected %d",
|
|
|
header.id, bc, header.length);
|
|
|
ret = -1;
|
|
@@ -4058,7 +4052,7 @@ ipmi_sdr_list_cache_fromfile(struct ipmi_intf *intf, const char *ifile)
|
|
|
|
|
|
count++;
|
|
|
|
|
|
- lprintf(LOG_DEBUG, "Read record %04x from file into cache",
|
|
|
+ printf( "Read record %04x from file into cache",
|
|
|
sdrr->id);
|
|
|
}
|
|
|
|
|
@@ -4090,7 +4084,7 @@ ipmi_sdr_list_cache(struct ipmi_intf *intf)
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
sdr_list_itr = ipmi_sdr_start(intf, 0);
|
|
|
if (sdr_list_itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR for reading");
|
|
|
+ printf( "Unable to open SDR for reading");
|
|
|
return -1;
|
|
|
}
|
|
|
}
|
|
@@ -4101,7 +4095,7 @@ ipmi_sdr_list_cache(struct ipmi_intf *intf)
|
|
|
|
|
|
sdrr = malloc(sizeof (struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
break;
|
|
|
}
|
|
|
memset(sdrr, 0, sizeof (struct sdr_record_list));
|
|
@@ -4193,11 +4187,11 @@ ipmi_sdr_get_info(struct ipmi_intf *intf,
|
|
|
rsp = intf->sendrecv(intf, &req);
|
|
|
|
|
|
if (rsp == NULL) {
|
|
|
- lprintf(LOG_ERR, "Get SDR Repository Info command failed");
|
|
|
+ printf( "Get SDR Repository Info command failed");
|
|
|
return -1;
|
|
|
}
|
|
|
if (rsp->ccode > 0) {
|
|
|
- lprintf(LOG_ERR, "Get SDR Repository Info command failed: %s",
|
|
|
+ printf( "Get SDR Repository Info command failed: %s",
|
|
|
val2str(rsp->ccode, completion_code_vals));
|
|
|
return -1;
|
|
|
}
|
|
@@ -4348,7 +4342,7 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
|
|
|
/* open connection to SDR */
|
|
|
itr = ipmi_sdr_start(intf, 0);
|
|
|
if (itr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to open SDR for reading");
|
|
|
+ printf( "Unable to open SDR for reading");
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
@@ -4358,12 +4352,12 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
|
|
|
while ((header = ipmi_sdr_get_next_header(intf, itr)) != NULL) {
|
|
|
sdrr = malloc(sizeof(struct sdr_record_list));
|
|
|
if (sdrr == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: malloc failure");
|
|
|
+ printf( "ipmitool: malloc failure");
|
|
|
return -1;
|
|
|
}
|
|
|
memset(sdrr, 0, sizeof(struct sdr_record_list));
|
|
|
|
|
|
- lprintf(LOG_INFO, "Record ID %04x (%d bytes)",
|
|
|
+ printf( "Record ID %04x (%d bytes)",
|
|
|
header->id, header->length);
|
|
|
|
|
|
sdrr->id = header->id;
|
|
@@ -4373,7 +4367,7 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
|
|
|
sdrr->raw = ipmi_sdr_get_record(intf, header, itr);
|
|
|
|
|
|
if (sdrr->raw == NULL) {
|
|
|
- lprintf(LOG_ERR, "ipmitool: cannot obtain SDR record %04x", header->id);
|
|
|
+ printf( "ipmitool: cannot obtain SDR record %04x", header->id);
|
|
|
if (sdrr != NULL) {
|
|
|
free(sdrr);
|
|
|
sdrr = NULL;
|
|
@@ -4409,7 +4403,7 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
|
|
|
|
|
|
r = fwrite(h, 1, 5, fp);
|
|
|
if (r != 5) {
|
|
|
- lprintf(LOG_ERR, "Error writing header "
|
|
|
+ printf( "Error writing header "
|
|
|
"to output file %s", ofile);
|
|
|
rc = -1;
|
|
|
break;
|
|
@@ -4417,14 +4411,14 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
|
|
|
|
|
|
/* write sdr entry */
|
|
|
if (!sdrr->raw) {
|
|
|
- lprintf(LOG_ERR, "Error: raw data is null (length=%d)",
|
|
|
+ printf( "Error: raw data is null (length=%d)",
|
|
|
sdrr->length);
|
|
|
rc = -1;
|
|
|
break;
|
|
|
}
|
|
|
r = fwrite(sdrr->raw, 1, sdrr->length, fp);
|
|
|
if (r != sdrr->length) {
|
|
|
- lprintf(LOG_ERR, "Error writing %d record bytes "
|
|
|
+ printf( "Error writing %d record bytes "
|
|
|
"to output file %s", sdrr->length, ofile);
|
|
|
rc = -1;
|
|
|
break;
|
|
@@ -4466,7 +4460,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
|
|
|
if (strncmp(type, "0x", 2) == 0) {
|
|
|
/* begins with 0x so let it be entered as raw hex value */
|
|
|
if (str2uchar(type, &sensor_type) != 0) {
|
|
|
- lprintf(LOG_ERR,
|
|
|
+ printf(
|
|
|
"Given type of sensor \"%s\" is either invalid or out of range.",
|
|
|
type);
|
|
|
return (-1);
|
|
@@ -4481,7 +4475,7 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
|
|
|
}
|
|
|
}
|
|
|
if (sensor_type != x) {
|
|
|
- lprintf(LOG_ERR, "Sensor Type \"%s\" not found.",
|
|
|
+ printf( "Sensor Type \"%s\" not found.",
|
|
|
type);
|
|
|
printf("Sensor Types:\n");
|
|
|
for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
|
|
@@ -4546,7 +4540,7 @@ ipmi_sdr_print_entity(struct ipmi_intf *intf, char *entitystr)
|
|
|
}
|
|
|
}
|
|
|
if (j == 0) {
|
|
|
- lprintf(LOG_ERR, "Invalid entity: %s", entitystr);
|
|
|
+ printf( "Invalid entity: %s", entitystr);
|
|
|
return -1;
|
|
|
}
|
|
|
} else {
|
|
@@ -4586,7 +4580,7 @@ ipmi_sdr_print_entry_byid(struct ipmi_intf *intf, int argc, char **argv)
|
|
|
int v, i;
|
|
|
|
|
|
if (argc < 1) {
|
|
|
- lprintf(LOG_ERR, "No Sensor ID supplied");
|
|
|
+ printf( "No Sensor ID supplied");
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
@@ -4596,7 +4590,7 @@ ipmi_sdr_print_entry_byid(struct ipmi_intf *intf, int argc, char **argv)
|
|
|
for (i = 0; i < argc; i++) {
|
|
|
sdr = ipmi_sdr_find_sdr_byid(intf, argv[i]);
|
|
|
if (sdr == NULL) {
|
|
|
- lprintf(LOG_ERR, "Unable to find sensor id '%s'",
|
|
|
+ printf( "Unable to find sensor id '%s'",
|
|
|
argv[i]);
|
|
|
} else {
|
|
|
if (ipmi_sdr_print_listentry(intf, sdr) < 0)
|
|
@@ -4661,17 +4655,14 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
|
|
|
rc = ipmi_sdr_print_sdr(intf,
|
|
|
SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR);
|
|
|
else if (strcmp(argv[1], "help") == 0) {
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
- "usage: sdr %s [all|full|compact|event|mcloc|fru|generic]",
|
|
|
+ printf( "usage: sdr %s [all|full|compact|event|mcloc|fru|generic]",
|
|
|
argv[0]);
|
|
|
return 0;
|
|
|
}
|
|
|
else {
|
|
|
- lprintf(LOG_ERR,
|
|
|
- "Invalid SDR %s command: %s",
|
|
|
+ printf( "Invalid SDR %s command: %s",
|
|
|
argv[0], argv[1]);
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
- "usage: sdr %s [all|full|compact|event|mcloc|fru|generic]",
|
|
|
+ printf( "usage: sdr %s [all|full|compact|event|mcloc|fru|generic]",
|
|
|
argv[0]);
|
|
|
return (-1);
|
|
|
}
|
|
@@ -4687,17 +4678,17 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
|
|
|
rc = ipmi_sdr_print_entry_byid(intf, argc - 1, &argv[1]);
|
|
|
} else if (strncmp(argv[0], "dump", 4) == 0) {
|
|
|
if (argc < 2) {
|
|
|
- lprintf(LOG_ERR, "Not enough parameters given.");
|
|
|
- lprintf(LOG_NOTICE, "usage: sdr dump <file>");
|
|
|
+ printf( "Not enough parameters given.");
|
|
|
+ printf( "usage: sdr dump <file>");
|
|
|
return (-1);
|
|
|
}
|
|
|
rc = ipmi_sdr_dump_bin(intf, argv[1]);
|
|
|
} else if (strncmp(argv[0], "fill", 4) == 0) {
|
|
|
if (argc <= 1) {
|
|
|
- lprintf(LOG_ERR, "Not enough parameters given.");
|
|
|
- lprintf(LOG_NOTICE, "usage: sdr fill sensors");
|
|
|
- lprintf(LOG_NOTICE, "usage: sdr fill file <file>");
|
|
|
- lprintf(LOG_NOTICE, "usage: sdr fill range <range>");
|
|
|
+ printf( "Not enough parameters given.");
|
|
|
+ printf( "usage: sdr fill sensors");
|
|
|
+ printf( "usage: sdr fill file <file>");
|
|
|
+ printf( "usage: sdr fill range <range>");
|
|
|
return (-1);
|
|
|
} else if (strncmp(argv[1], "sensors", 7) == 0) {
|
|
|
rc = ipmi_sdr_add_from_sensors(intf, 21);
|
|
@@ -4705,33 +4696,27 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
|
|
|
rc = ipmi_sdr_add_from_sensors(intf, 0);
|
|
|
} else if (strncmp(argv[1], "file", 4) == 0) {
|
|
|
if (argc < 3) {
|
|
|
- lprintf(LOG_ERR,
|
|
|
- "Not enough parameters given.");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
- "usage: sdr fill file <file>");
|
|
|
+ printf( "Not enough parameters given.");
|
|
|
+ printf( "usage: sdr fill file <file>");
|
|
|
return (-1);
|
|
|
}
|
|
|
rc = ipmi_sdr_add_from_file(intf, argv[2]);
|
|
|
} else if (strncmp(argv[1], "range", 4) == 0) {
|
|
|
if (argc < 3) {
|
|
|
- lprintf(LOG_ERR,
|
|
|
- "Not enough parameters given.");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
- "usage: sdr fill range <range>");
|
|
|
+ printf( "Not enough parameters given.");
|
|
|
+ printf( "usage: sdr fill range <range>");
|
|
|
return (-1);
|
|
|
}
|
|
|
rc = ipmi_sdr_add_from_list(intf, argv[2]);
|
|
|
} else {
|
|
|
- lprintf(LOG_ERR,
|
|
|
- "Invalid SDR %s command: %s",
|
|
|
+ printf("Invalid SDR %s command: %s",
|
|
|
argv[0], argv[1]);
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
- "usage: sdr %s <sensors|nosat|file|range> [options]",
|
|
|
+ printf( "usage: sdr %s <sensors|nosat|file|range> [options]",
|
|
|
argv[0]);
|
|
|
return (-1);
|
|
|
}
|
|
|
} else {
|
|
|
- lprintf(LOG_ERR, "Invalid SDR command: %s", argv[0]);
|
|
|
+ printf( "Invalid SDR command: %s", argv[0]);
|
|
|
rc = -1;
|
|
|
}
|
|
|
|
|
@@ -4741,66 +4726,35 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char **argv)
|
|
|
void
|
|
|
printf_sdr_usage()
|
|
|
{
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-"usage: sdr <command> [options]");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" list | elist [option]");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" all All SDR Records");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" full Full Sensor Record");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" compact Compact Sensor Record");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" event Event-Only Sensor Record");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" mcloc Management Controller Locator Record");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" fru FRU Locator Record");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" generic Generic Device Locator Record\n");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" type [option]");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" <Sensor_Type> Retrieve the state of specified sensor.");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" Sensor_Type can be specified either as");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" a string or a hex value.");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" list Get a list of available sensor types\n");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" get <Sensor_ID>");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" Retrieve state of the first sensor matched by Sensor_ID\n");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" info");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" Display information about the repository itself\n");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" entity <Entity_ID>[.<Instance_ID>]");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" Display all sensors associated with an entity\n");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" dump <file>");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" Dump raw SDR data to a file\n");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" fill <option>");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" sensors Creates the SDR repository for the current");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" configuration");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" nosat Creates the SDR repository for the current");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" configuration, without satellite scan");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" file <file> Load SDR repository from a file");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" range <range> Load SDR repository from a provided list");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" or range. Use ',' for list or '-' for");
|
|
|
- lprintf(LOG_NOTICE,
|
|
|
-" range, eg. 0x28,0x32,0x40-0x44");
|
|
|
+ printf( "usage: sdr <command> [options]");
|
|
|
+ printf(" list | elist [option]");
|
|
|
+ printf(" all All SDR Records");
|
|
|
+ printf(" full Full Sensor Record");
|
|
|
+ printf(" compact Compact Sensor Record");
|
|
|
+ printf(" event Event-Only Sensor Record");
|
|
|
+ printf(" mcloc Management Controller Locator Record");
|
|
|
+ printf(" fru FRU Locator Record");
|
|
|
+ printf(" generic Generic Device Locator Record\n");
|
|
|
+ printf(" type [option]");
|
|
|
+ printf(" <Sensor_Type> Retrieve the state of specified sensor.");
|
|
|
+ printf(" Sensor_Type can be specified either as");
|
|
|
+ printf(" a string or a hex value.");
|
|
|
+ printf(" list Get a list of available sensor types\n");
|
|
|
+ printf(" get <Sensor_ID>");
|
|
|
+ printf(" Retrieve state of the first sensor matched by Sensor_ID\n");
|
|
|
+ printf(" info");
|
|
|
+ printf(" Display information about the repository itself\n");
|
|
|
+ printf(" entity <Entity_ID>[.<Instance_ID>]");
|
|
|
+ printf(" Display all sensors associated with an entity\n");
|
|
|
+ printf(" dump <file>");
|
|
|
+ printf(" Dump raw SDR data to a file\n");
|
|
|
+ printf(" fill <option>");
|
|
|
+ printf(" sensors Creates the SDR repository for the current");
|
|
|
+ printf(" configuration");
|
|
|
+ printf(" nosat Creates the SDR repository for the current");
|
|
|
+ printf(" configuration, without satellite scan");
|
|
|
+ printf(" file <file> Load SDR repository from a file");
|
|
|
+ printf(" range <range> Load SDR repository from a provided list");
|
|
|
+ printf(" or range. Use ',' for list or '-' for");
|
|
|
+ printf(" range, eg. 0x28,0x32,0x40-0x44");
|
|
|
}
|