summaryrefslogtreecommitdiff
path: root/usr/src/lib/libprtdiag_psr
diff options
context:
space:
mode:
authormb158278 <none@none>2008-06-25 07:44:50 -0700
committermb158278 <none@none>2008-06-25 07:44:50 -0700
commit087113e1a972d4b6246cf32a83c330968117b93e (patch)
tree544a32f5fed3267a3a11f03df0abc83850d4e609 /usr/src/lib/libprtdiag_psr
parent1dcb0627c1305a455747cd984078829b578113a7 (diff)
downloadillumos-joyent-087113e1a972d4b6246cf32a83c330968117b93e.tar.gz
6696236 prtdiag -v dumps core on sun4v
Diffstat (limited to 'usr/src/lib/libprtdiag_psr')
-rw-r--r--usr/src/lib/libprtdiag_psr/sparc/ontario/common/huron.c39
-rw-r--r--usr/src/lib/libprtdiag_psr/sparc/ontario/common/ontario.c9
-rw-r--r--usr/src/lib/libprtdiag_psr/sparc/ontario/common/pelton.c9
-rw-r--r--usr/src/lib/libprtdiag_psr/sparc/ontario/common/stpaul.c21
4 files changed, 45 insertions, 33 deletions
diff --git a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/huron.c b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/huron.c
index e7226bc5e7..2c83d3674c 100644
--- a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/huron.c
+++ b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/huron.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -77,27 +77,27 @@ huron_get_slot_number(char *path, struct io_card *card)
(void) strcpy(card->slot_str, "1");
card->slot = 1;
} else if (strncmp(path, HURON_PCIE_SLOT0,
- strlen(HURON_PCIE_SLOT0)) == 0) {
+ strlen(HURON_PCIE_SLOT0)) == 0) {
(void) strcpy(card->slot_str, "0");
card->slot = 0;
} else if (strncmp(path, HURON_PCIE_SLOT1,
- strlen(HURON_PCIE_SLOT1)) == 0) {
+ strlen(HURON_PCIE_SLOT1)) == 0) {
(void) strcpy(card->slot_str, "1");
card->slot = 1;
} else if (strncmp(path, HURON_PCIE_SLOT2,
- strlen(HURON_PCIE_SLOT2)) == 0) {
+ strlen(HURON_PCIE_SLOT2)) == 0) {
(void) strcpy(card->slot_str, "2");
card->slot = 2;
} else if (strncmp(path, HURON_PCIE_SLOT3,
- strlen(HURON_PCIE_SLOT3)) == 0) {
+ strlen(HURON_PCIE_SLOT3)) == 0) {
(void) strcpy(card->slot_str, "3");
card->slot = 3;
} else if (strncmp(path, HURON_PCIE_SLOT4,
- strlen(HURON_PCIE_SLOT4)) == 0) {
+ strlen(HURON_PCIE_SLOT4)) == 0) {
(void) strcpy(card->slot_str, "4");
card->slot = 4;
} else if (strncmp(path, HURON_PCIE_SLOT5,
- strlen(HURON_PCIE_SLOT5)) == 0) {
+ strlen(HURON_PCIE_SLOT5)) == 0) {
(void) strcpy(card->slot_str, "5");
card->slot = 5;
} else {
@@ -310,7 +310,7 @@ huron_hw_rev_callback(picl_nodehdl_t pcih, void *args)
(strcmp(path, HURON_NETWORK_1) == 0)) {
device_found = 1;
(void) snprintf(NAC, sizeof (NAC), "%s/%s%d",
- MOTHERBOARD, OPHIR, 0);
+ MOTHERBOARD, OPHIR, 0);
revision = huron_get_int_propval(pcih, OBP_PROP_REVISION_ID,
&err);
}
@@ -319,7 +319,7 @@ huron_hw_rev_callback(picl_nodehdl_t pcih, void *args)
(strcmp(path, HURON_NETWORK_3) == 0)) {
device_found = 1;
(void) snprintf(NAC, sizeof (NAC), "%s/%s%d", MOTHERBOARD,
- OPHIR, 1);
+ OPHIR, 1);
revision = huron_get_int_propval(pcih, OBP_PROP_REVISION_ID,
&err);
}
@@ -327,7 +327,7 @@ huron_hw_rev_callback(picl_nodehdl_t pcih, void *args)
if (strcmp(path, HURON_SWITCH_A_PATH) == 0) {
device_found = 1;
(void) snprintf(NAC, sizeof (NAC), "%s/%s",
- MOTHERBOARD, HURON_SWITCH_A);
+ MOTHERBOARD, HURON_SWITCH_A);
revision = huron_get_int_propval(pcih, OBP_PROP_REVISION_ID,
&err);
}
@@ -335,7 +335,7 @@ huron_hw_rev_callback(picl_nodehdl_t pcih, void *args)
if (strcmp(path, HURON_SWITCH_B_PATH) == 0) {
device_found = 1;
(void) snprintf(NAC, sizeof (NAC), "%s/%s", MOTHERBOARD,
- HURON_SWITCH_B);
+ HURON_SWITCH_B);
revision = huron_get_int_propval(pcih, OBP_PROP_REVISION_ID,
&err);
}
@@ -343,7 +343,7 @@ huron_hw_rev_callback(picl_nodehdl_t pcih, void *args)
if (strcmp(path, HURON_SWITCH_C_PATH) == 0) {
device_found = 1;
(void) snprintf(NAC, sizeof (NAC), "%s/%s", MOTHERBOARD,
- HURON_SWITCH_C);
+ HURON_SWITCH_C);
revision = huron_get_int_propval(pcih, OBP_PROP_REVISION_ID,
&err);
}
@@ -367,8 +367,11 @@ huron_hw_rev_callback(picl_nodehdl_t pcih, void *args)
else
log_printf("%46s", device_path);
/* Print Compatible # */
- log_printf("%31s", compatible);
- free(compatible);
+ if (err == PICL_SUCCESS) {
+ log_printf("%31s", compatible);
+ free(compatible);
+ } else
+ log_printf("%31s", " ");
/* Print Revision */
log_printf("%6d", revision);
log_printf("\n");
@@ -393,7 +396,7 @@ huron_get_first_compatible_value(picl_nodehdl_t nodeh, char **outbuf)
err = picl_get_propinfo_by_name(nodeh, OBP_PROP_COMPATIBLE,
&pinfo, &proph);
if (err != PICL_SUCCESS)
- return (err);
+ return (err);
if (pinfo.type == PICL_PTYPE_CHARSTRING) {
pval = malloc(pinfo.size);
@@ -422,7 +425,7 @@ huron_get_first_compatible_value(picl_nodehdl_t nodeh, char **outbuf)
err = picl_get_propinfo(rowproph, &pinfo);
if (err != PICL_SUCCESS)
- return (err);
+ return (err);
pval = malloc(pinfo.size);
if (pval == NULL)
@@ -459,8 +462,8 @@ huron_get_int_propval(picl_nodehdl_t modh, char *prop_name, int *ret)
* If it is not an int, uint or byte array prop, return failure
*/
if ((pinfo.type != PICL_PTYPE_INT) &&
- (pinfo.type != PICL_PTYPE_UNSIGNED_INT) &&
- (pinfo.type != PICL_PTYPE_BYTEARRAY)) {
+ (pinfo.type != PICL_PTYPE_UNSIGNED_INT) &&
+ (pinfo.type != PICL_PTYPE_BYTEARRAY)) {
*ret = PICL_FAILURE;
return (0);
}
diff --git a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/ontario.c b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/ontario.c
index 4977328d8c..479fc92039 100644
--- a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/ontario.c
+++ b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/ontario.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -490,8 +490,11 @@ ontario_hw_rev_callback(picl_nodehdl_t pcih, void *args)
else
log_printf("%39s", device_path);
/* Print Compatible # */
- log_printf("%31s", compatible);
- free(compatible);
+ if (err == PICL_SUCCESS) {
+ log_printf("%31s", compatible);
+ free(compatible);
+ } else
+ log_printf("%31s", " ");
/* Print Revision */
log_printf("%6d", revision);
log_printf("\n");
diff --git a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/pelton.c b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/pelton.c
index ebef8bab91..06df6c9177 100644
--- a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/pelton.c
+++ b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/pelton.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -377,8 +377,11 @@ pelton_hw_rev_callback(picl_nodehdl_t pcih, void *args)
else
log_printf("%39s", device_path);
/* Print Compatible # */
- log_printf("%31s", compatible);
- free(compatible);
+ if (err == PICL_SUCCESS) {
+ log_printf("%31s", compatible);
+ free(compatible);
+ } else
+ log_printf("%31s", " ");
/* Print Revision */
log_printf("%6d", revision);
log_printf("\n");
diff --git a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/stpaul.c b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/stpaul.c
index ae1140c497..1b5866abd9 100644
--- a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/stpaul.c
+++ b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/stpaul.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -352,8 +352,11 @@ stpaul_hw_rev_callback(picl_nodehdl_t pcih, void *args)
else
log_printf("%39s", device_path);
/* Print Compatible # */
- log_printf("%31s", compatible);
- free(compatible);
+ if (err == PICL_SUCCESS) {
+ log_printf("%31s", compatible);
+ free(compatible);
+ } else
+ log_printf("%31s", " ");
/* Print Revision */
log_printf("%6d", revision);
log_printf("\n");
@@ -408,10 +411,10 @@ static int
stpaul_get_network_instance(char *path)
{
if (strncmp(path, SPL_NETWORK_1_PATH,
- strlen(SPL_NETWORK_1_PATH)) == 0)
+ strlen(SPL_NETWORK_1_PATH)) == 0)
return (1);
else if (strncmp(path, SPL_NETWORK_0_PATH,
- strlen(SPL_NETWORK_0_PATH)) == 0)
+ strlen(SPL_NETWORK_0_PATH)) == 0)
return (0);
else
return (-1);
@@ -464,7 +467,7 @@ stpaul_get_first_compatible_value(picl_nodehdl_t nodeh, char **outbuf)
err = picl_get_propinfo_by_name(nodeh, OBP_PROP_COMPATIBLE,
&pinfo, &proph);
if (err != PICL_SUCCESS)
- return (err);
+ return (err);
if (pinfo.type == PICL_PTYPE_CHARSTRING) {
pval = malloc(pinfo.size);
@@ -493,7 +496,7 @@ stpaul_get_first_compatible_value(picl_nodehdl_t nodeh, char **outbuf)
err = picl_get_propinfo(rowproph, &pinfo);
if (err != PICL_SUCCESS)
- return (err);
+ return (err);
pval = malloc(pinfo.size);
if (pval == NULL)
@@ -530,8 +533,8 @@ stpaul_get_int_propval(picl_nodehdl_t modh, char *prop_name, int *ret)
* If it is not an int, uint or byte array prop, return failure
*/
if ((pinfo.type != PICL_PTYPE_INT) &&
- (pinfo.type != PICL_PTYPE_UNSIGNED_INT) &&
- (pinfo.type != PICL_PTYPE_BYTEARRAY)) {
+ (pinfo.type != PICL_PTYPE_UNSIGNED_INT) &&
+ (pinfo.type != PICL_PTYPE_BYTEARRAY)) {
*ret = PICL_FAILURE;
return (0);
}