summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
Diffstat (limited to 'discover')
-rw-r--r--discover/ipmi.c33
-rw-r--r--discover/platform-powerpc.c23
2 files changed, 23 insertions, 33 deletions
diff --git a/discover/ipmi.c b/discover/ipmi.c
index 840fdee..ae02bb0 100644
--- a/discover/ipmi.c
+++ b/discover/ipmi.c
@@ -326,6 +326,7 @@ void ipmi_get_bmc_mac(struct ipmi *ipmi, uint8_t *buf)
uint16_t resp_len = 8;
uint8_t resp[8];
uint8_t req[] = { 0x1, 0x5, 0x0, 0x0 };
+ char *debug_buf;
int i, rc;
rc = ipmi_transaction(ipmi, IPMI_NETFN_TRANSPORT,
@@ -334,14 +335,15 @@ void ipmi_get_bmc_mac(struct ipmi *ipmi, uint8_t *buf)
resp, &resp_len,
ipmi_timeout);
- pb_debug_fn("BMC MAC resp [%d][%d]:\n", rc, resp_len);
+ debug_buf = format_buffer(ipmi, resp, resp_len);
+ pb_debug_fn("BMC MAC resp [%d][%d]:\n%s\n",
+ rc, resp_len, debug_buf);
+ talloc_free(debug_buf);
if (rc == 0 && resp_len > 0) {
for (i = 2; i < resp_len; i++) {
- pb_debug(" %x", resp[i]);
buf[i - 2] = resp[i];
}
- pb_debug("\n");
}
}
@@ -354,7 +356,8 @@ void ipmi_get_bmc_versions(struct ipmi *ipmi, struct system_info *info)
{
uint16_t resp_len = 16;
uint8_t resp[16], bcd;
- int i, rc;
+ char *debug_buf;
+ int rc;
/* Retrieve info from current side */
rc = ipmi_transaction(ipmi, IPMI_NETFN_APP,
@@ -363,13 +366,10 @@ void ipmi_get_bmc_versions(struct ipmi *ipmi, struct system_info *info)
resp, &resp_len,
ipmi_timeout);
- pb_debug_fn("BMC version resp [%d][%d]:\n", rc, resp_len);
- if (resp_len > 0) {
- for (i = 0; i < resp_len; i++) {
- pb_debug(" %x", resp[i]);
- }
- pb_debug("\n");
- }
+ debug_buf = format_buffer(ipmi, resp, resp_len);
+ pb_debug_fn("BMC version resp [%d][%d]:\n%s\n",
+ rc, resp_len, debug_buf);
+ talloc_free(debug_buf);
if (rc == 0 && (resp_len == 12 || resp_len == 16)) {
info->bmc_current = talloc_array(info, char *, 4);
@@ -407,13 +407,10 @@ void ipmi_get_bmc_versions(struct ipmi *ipmi, struct system_info *info)
resp, &resp_len,
ipmi_timeout);
- pb_debug_fn("BMC golden resp [%d][%d]:\n", rc, resp_len);
- if (resp_len > 0) {
- for (i = 0; i < resp_len; i++) {
- pb_debug(" %x", resp[i]);
- }
- pb_debug("\n");
- }
+ debug_buf = format_buffer(ipmi, resp, resp_len);
+ pb_debug_fn("BMC golden resp [%d][%d]:\n%s\n",
+ rc, resp_len, debug_buf);
+ talloc_free(debug_buf);
if (rc == 0 && (resp_len == 12 || resp_len == 16)) {
info->bmc_golden = talloc_array(info, char *, 4);
diff --git a/discover/platform-powerpc.c b/discover/platform-powerpc.c
index 2929077..f8f3305 100644
--- a/discover/platform-powerpc.c
+++ b/discover/platform-powerpc.c
@@ -368,6 +368,7 @@ static int get_ipmi_bootdev_ipmi(struct platform_powerpc *platform,
{
uint16_t resp_len;
uint8_t resp[8];
+ char *debug_buf;
int rc;
uint8_t req[] = {
0x05, /* parameter selector: boot flags */
@@ -392,10 +393,9 @@ static int get_ipmi_bootdev_ipmi(struct platform_powerpc *platform,
return -1;
}
- pb_debug("IPMI get_bootdev response:\n");
- for (int i = 0; i < resp_len; i++)
- pb_debug("%x ", resp[i]);
- pb_debug("\n");
+ debug_buf = format_buffer(platform, resp, resp_len);
+ pb_debug_fn("IPMI get_bootdev response:\n%s\n", debug_buf);
+ talloc_free(debug_buf);
if (resp[0] != 0) {
pb_log("platform: non-zero completion code %d from IPMI req\n",
@@ -472,6 +472,7 @@ static void get_ipmi_network_override(struct platform_powerpc *platform,
uint16_t min_len = 12, resp_len = 53, version;
const uint32_t magic_value = 0x21706221;
uint8_t resp[resp_len];
+ char *debug_buf;
uint32_t cookie;
bool persistent;
int i, rc;
@@ -487,17 +488,9 @@ static void get_ipmi_network_override(struct platform_powerpc *platform,
resp, &resp_len,
ipmi_timeout);
- pb_debug("IPMI net override resp [%d][%d]:\n", rc, resp_len);
- if (resp_len > 0) {
- for (i = 0; i < resp_len; i++) {
- pb_debug(" %02x", resp[i]);
- if (i && (i + 1) % 16 == 0 && i != resp_len - 1)
- pb_debug("\n");
- else if (i && (i + 1) % 8 == 0)
- pb_debug(" ");
- }
- pb_debug("\n");
- }
+ debug_buf = format_buffer(platform, resp, resp_len);
+ pb_debug_fn("IPMI net override response:\n%s\n", debug_buf);
+ talloc_free(debug_buf);
if (rc) {
pb_debug("IPMI network config option unavailable\n");
OpenPOWER on IntegriCloud