X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ls-caps.c;h=a4bf713cac7b8e1a12e75fcfc88768c5a400ed3e;hb=a242f574431f6624475acdedcb2b4cbeef385766;hp=507771a95ab139758a792a563bb081b4def0ef8c;hpb=c08ed5dbe4ec300416a841b0f6df00d3724da1a6;p=pciutils.git diff --git a/ls-caps.c b/ls-caps.c index 507771a..a4bf713 100644 --- a/ls-caps.c +++ b/ls-caps.c @@ -1,7 +1,7 @@ /* * The PCI Utilities -- Show Capabilities * - * Copyright (c) 1997--2008 Martin Mares + * Copyright (c) 1997--2010 Martin Mares * * Can be freely distributed and used under the terms of the GNU GPL. */ @@ -674,7 +674,7 @@ static void cap_express_dev(struct device *d, int where, int type) FLAG(t, PCI_EXP_DEVCAP_RBE), FLAG(t, PCI_EXP_DEVCAP_FLRESET)); if (type == PCI_EXP_TYPE_UPSTREAM) - printf("SlotPowerLimit %fW", + printf("SlotPowerLimit %.3fW", power_limit((t & PCI_EXP_DEVCAP_PWR_VAL) >> 18, (t & PCI_EXP_DEVCAP_PWR_SCL) >> 26)); printf("\n"); @@ -806,7 +806,7 @@ static void cap_express_slot(struct device *d, int where) FLAG(t, PCI_EXP_SLTCAP_PWRI), FLAG(t, PCI_EXP_SLTCAP_HPC), FLAG(t, PCI_EXP_SLTCAP_HPS)); - printf("\t\t\tSlot #%3x, PowerLimit %f; Interlock%c NoCompl%c\n", + printf("\t\t\tSlot #%d, PowerLimit %.3fW; Interlock%c NoCompl%c\n", t >> 19, power_limit((t & PCI_EXP_SLTCAP_PWR_VAL) >> 7, (t & PCI_EXP_SLTCAP_PWR_SCL) >> 15), FLAG(t, PCI_EXP_SLTCAP_INTERLOCK), @@ -1164,6 +1164,29 @@ cap_af(struct device *d, int where) printf("\t\tAFStatus: TP%c\n", FLAG(reg, PCI_AF_STATUS_TP)); } +static void +cap_sata_hba(struct device *d, int where, int cap) +{ + u32 bars; + int bar; + + printf("SATA HBA v%d.%d", BITS(cap, 4, 4), BITS(cap, 0, 4)); + if (verbose < 2 || !config_fetch(d, where + PCI_SATA_HBA_BARS, 4)) + { + printf("\n"); + return; + } + + bars = get_conf_long(d, where + PCI_SATA_HBA_BARS); + bar = BITS(bars, 0, 4); + if (bar >= 4 && bar <= 9) + printf(" BAR%d Offset=%08x\n", bar - 4, BITS(bars, 4, 20)); + else if (bar == 15) + printf(" InCfgSpace\n"); + else + printf(" BAR??%d\n", bar); +} + void show_caps(struct device *d) { @@ -1225,7 +1248,7 @@ show_caps(struct device *d) cap_ht(d, where, cap); break; case PCI_CAP_ID_VNDR: - printf("Vendor Specific Information \n"); + printf("Vendor Specific Information: Len=%02x \n", BITS(cap, 0, 8)); break; case PCI_CAP_ID_DBG: cap_debug_port(cap); @@ -1253,7 +1276,7 @@ show_caps(struct device *d) cap_msix(d, where, cap); break; case PCI_CAP_ID_SATA: - printf("SATA HBA \n"); + cap_sata_hba(d, where, cap); break; case PCI_CAP_ID_AF: cap_af(d, where);