diff options
| author | mb158278 <none@none> | 2007-04-12 11:39:20 -0700 |
|---|---|---|
| committer | mb158278 <none@none> | 2007-04-12 11:39:20 -0700 |
| commit | e95892231f152151fa2f18b4dbadf9b76d952297 (patch) | |
| tree | eb8de8304b9a4a0a6334e182175ed245936652d9 /usr/src/lib/libprtdiag_psr | |
| parent | 1c070cc61610a26cde9ba1e3b72d1c83a2f1f505 (diff) | |
| download | illumos-joyent-e95892231f152151fa2f18b4dbadf9b76d952297.tar.gz | |
6500293 prtdiag utility does not display the information of the pyramid HBA
Diffstat (limited to 'usr/src/lib/libprtdiag_psr')
| -rw-r--r-- | usr/src/lib/libprtdiag_psr/sparc/ontario/common/ontario.c | 44 |
1 files changed, 31 insertions, 13 deletions
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 e9984b5c16..b0f81db1ae 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/ontario/common/ontario.c +++ b/usr/src/lib/libprtdiag_psr/sparc/ontario/common/ontario.c @@ -88,7 +88,7 @@ get_bus_type(char *path, struct io_card *card) } static void -get_slot_number(char *path, struct io_card *card) +get_slot_number(picl_nodehdl_t nodeh, char *path, struct io_card *card) { if (strncmp(path, PCIE_SLOT0, PCIE_COMP_NUM) == 0) { (void) strcpy(card->slot_str, "0"); @@ -99,12 +99,29 @@ get_slot_number(char *path, struct io_card *card) } else if (strncmp(path, PCIE_SLOT2, PCIE_COMP_NUM) == 0) { (void) strcpy(card->slot_str, "2"); card->slot = 2; - } else if (strncmp(path, PCIX_SLOT1, strlen(PCIX_SLOT1)) == 0) { - (void) strcpy(card->slot_str, "PCIX"); - card->slot = -1; - } else if (strncmp(path, PCIX_SLOT0, strlen(PCIX_SLOT0)) == 0) { + } else if ((strncmp(path, PCIX_SLOT1, strlen(PCIX_SLOT1)) == 0) || + (strncmp(path, PCIX_SLOT0, strlen(PCIX_SLOT0)) == 0)) { + char ua[MAXSTRLEN]; + int err; + (void) strcpy(card->slot_str, "PCIX"); card->slot = -1; + + /* + * PCIX_SLOT0 and PCIX_SLOT1 are actually the same path so + * use the unit address to distinguish the slot number. + */ + err = picl_get_propval_by_name(nodeh, PICL_PROP_UNIT_ADDRESS, + ua, sizeof (ua)); + if (err == PICL_SUCCESS) { + if (ua[0] == '2') { + card->slot = 0; + (void) strcpy(card->slot_str, "0"); + } else if (ua[0] == '1') { + card->slot = 1; + (void) strcpy(card->slot_str, "1"); + } + } } else { (void) strcpy(card->slot_str, IOBOARD); card->slot = -1; @@ -162,18 +179,17 @@ ontario_pci_callback(picl_nodehdl_t pcih, void *args) if (err != PICL_SUCCESS) return (err); - if (strcmp(piclclass, "pciex") == 0) { + /* + * Skip PCI and PCIEX devices because they will be processed + * later in the picl tree walk. + */ + if ((strcmp(piclclass, "pci") == 0) || + (strcmp(piclclass, "pciex") == 0)) { err = picl_get_propval_by_name(nodeh, PICL_PROP_PEER, &nodeh, sizeof (picl_nodehdl_t)); continue; } - if (strcmp(piclclass, PICL_CLASS_PCI) == 0) { - err = picl_get_propval_by_name(nodeh, PICL_PROP_CHILD, - &nodeh, sizeof (picl_nodehdl_t)); - continue; - } - err = picl_get_propval_by_name(nodeh, PICL_PROP_DEVFS_PATH, path, sizeof (path)); if (err != PICL_SUCCESS) { @@ -184,7 +200,7 @@ ontario_pci_callback(picl_nodehdl_t pcih, void *args) get_bus_type(parent_path, &pci_card); - get_slot_number(parent_path, &pci_card); + get_slot_number(nodeh, parent_path, &pci_card); err = picl_get_propval_by_name(nodeh, PICL_PROP_NAME, &name, sizeof (name)); @@ -324,6 +340,8 @@ sun4v_display_pci(picl_nodehdl_t plafh) strlen(ONTARIO_PLATFORM2)) == 0)) { (void) picl_walk_tree_by_class(plafh, "pciex", "pciex", ontario_pci_callback); + (void) picl_walk_tree_by_class(plafh, "pci", + "pci", ontario_pci_callback); } else if ((strncmp(platbuf, PELTON_PLATFORM, strlen(PELTON_PLATFORM))) == 0) { (void) picl_walk_tree_by_class(plafh, "pciex", |
