X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lspci.c;h=e86fe77b94a288a850673a5421f128218d5af58f;hb=1c7f2b08e95ead73368299d080c81347baa45604;hp=207ca60aae725c75449c583cc57dd9d7411272e8;hpb=06cb86c3839ba50106fb578c815733a7d2d94b04;p=pciutils.git diff --git a/lspci.c b/lspci.c index 207ca60..e86fe77 100644 --- a/lspci.c +++ b/lspci.c @@ -177,7 +177,7 @@ scan_devices(void) struct pci_dev *p; pci_scan_bus(pacc); - for(p=pacc->devices; p; p=p->next) + for (p=pacc->devices; p; p=p->next) if (d = scan_device(p)) { d->next = first_dev; @@ -256,10 +256,10 @@ sort_them(void) struct device *d; cnt = 0; - for(d=first_dev; d; d=d->next) + for (d=first_dev; d; d=d->next) cnt++; h = index = alloca(sizeof(struct device *) * cnt); - for(d=first_dev; d; d=d->next) + for (d=first_dev; d; d=d->next) *h++ = d; qsort(index, cnt, sizeof(struct device *), compare_them); last_dev = &first_dev; @@ -287,6 +287,25 @@ show_slot_name(struct device *d) printf("%02x:%02x.%d", p->bus, p->dev, p->func); } +static void +get_subid(struct device *d, word *subvp, word *subdp) +{ + byte htype = get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f; + + if (htype == PCI_HEADER_TYPE_NORMAL) + { + *subvp = get_conf_word(d, PCI_SUBSYSTEM_VENDOR_ID); + *subdp = get_conf_word(d, PCI_SUBSYSTEM_ID); + } + else if (htype == PCI_HEADER_TYPE_CARDBUS && d->config_cached >= 128) + { + *subvp = get_conf_word(d, PCI_CB_SUBSYSTEM_VENDOR_ID); + *subdp = get_conf_word(d, PCI_CB_SUBSYSTEM_ID); + } + else + *subvp = *subdp = 0xffff; +} + static void show_terse(struct device *d) { @@ -320,25 +339,19 @@ show_terse(struct device *d) } } putchar('\n'); -} - -static void -get_subid(struct device *d, word *subvp, word *subdp) -{ - byte htype = get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f; - if (htype == PCI_HEADER_TYPE_NORMAL) + if (verbose || opt_kernel) { - *subvp = get_conf_word(d, PCI_SUBSYSTEM_VENDOR_ID); - *subdp = get_conf_word(d, PCI_SUBSYSTEM_ID); + word subsys_v, subsys_d; + char ssnamebuf[256]; + + get_subid(d, &subsys_v, &subsys_d); + if (subsys_v && subsys_v != 0xffff) + printf("\tSubsystem: %s\n", + pci_lookup_name(pacc, ssnamebuf, sizeof(ssnamebuf), + PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE, + p->vendor_id, p->device_id, subsys_v, subsys_d)); } - else if (htype == PCI_HEADER_TYPE_CARDBUS && d->config_cached >= 128) - { - *subvp = get_conf_word(d, PCI_CB_SUBSYSTEM_VENDOR_ID); - *subdp = get_conf_word(d, PCI_CB_SUBSYSTEM_ID); - } - else - *subvp = *subdp = 0xffff; } /*** Capabilities ***/ @@ -385,7 +398,7 @@ format_agp_rate(int rate, char *buf, int agp3) char *c = buf; int i; - for(i=0; i<=2; i++) + for (i=0; i<=2; i++) if (rate & (1 << i)) { if (c != buf) @@ -571,10 +584,10 @@ cap_ht_pri(struct device *d, int where, int cmd) if (!config_fetch(d, where + PCI_HT_PRI_LCTR0, PCI_HT_PRI_SIZEOF - PCI_HT_PRI_LCTR0)) return; rid = get_conf_byte(d, where + PCI_HT_PRI_RID); - if (rid < 0x23 && rid > 0x11) + if (rid < 0x22 && rid > 0x11) printf("\t\t!!! Possibly incomplete decoding\n"); - if (rid >= 0x23) + if (rid >= 0x22) fmt = "\t\tCommand: BaseUnitID=%u UnitCnt=%u MastHost%c DefDir%c DUL%c\n"; else fmt = "\t\tCommand: BaseUnitID=%u UnitCnt=%u MastHost%c DefDir%c\n"; @@ -585,7 +598,7 @@ cap_ht_pri(struct device *d, int where, int cmd) FLAG(cmd, PCI_HT_PRI_CMD_DD), FLAG(cmd, PCI_HT_PRI_CMD_DUL)); lctr0 = get_conf_word(d, where + PCI_HT_PRI_LCTR0); - if (rid >= 0x23) + if (rid >= 0x22) fmt = "\t\tLink Control 0: CFlE%c CST%c CFE%c = 0x23) + if (rid >= 0x22) fmt = "\t\tLink Config 0: MLWI=%1$s DwFcIn%5$c MLWO=%2$s DwFcOut%6$c LWI=%3$s DwFcInEn%7$c LWO=%4$s DwFcOutEn%8$c\n"; else fmt = "\t\tLink Config 0: MLWI=%s MLWO=%s LWI=%s LWO=%s\n"; @@ -617,7 +630,7 @@ cap_ht_pri(struct device *d, int where, int cmd) FLAG(lcnf0, PCI_HT_LCNF_DFIE), FLAG(lcnf0, PCI_HT_LCNF_DFOE)); lctr1 = get_conf_word(d, where + PCI_HT_PRI_LCTR1); - if (rid >= 0x23) + if (rid >= 0x22) fmt = "\t\tLink Control 1: CFlE%c CST%c CFE%c = 0x23) + if (rid >= 0x22) fmt = "\t\tLink Config 1: MLWI=%1$s DwFcIn%5$c MLWO=%2$s DwFcOut%6$c LWI=%3$s DwFcInEn%7$c LWO=%4$s DwFcOutEn%8$c\n"; else fmt = "\t\tLink Config 1: MLWI=%s MLWO=%s LWI=%s LWO=%s\n"; @@ -650,7 +663,7 @@ cap_ht_pri(struct device *d, int where, int cmd) FLAG(lcnf1, PCI_HT_LCNF_DFOE)); printf("\t\tRevision ID: %u.%02u\n", (rid & PCI_HT_RID_MAJ) >> 5, (rid & PCI_HT_RID_MIN)); - if (rid < 0x23) + if (rid < 0x22) return; lfrer0 = get_conf_byte(d, where + PCI_HT_PRI_LFRER0); printf("\t\tLink Frequency 0: %s\n", ht_link_freq(lfrer0 & PCI_HT_LFRER_FREQ)); @@ -739,10 +752,10 @@ cap_ht_sec(struct device *d, int where, int cmd) if (!config_fetch(d, where + PCI_HT_SEC_LCTR, PCI_HT_SEC_SIZEOF - PCI_HT_SEC_LCTR)) return; rid = get_conf_byte(d, where + PCI_HT_SEC_RID); - if (rid < 0x23 && rid > 0x11) + if (rid < 0x22 && rid > 0x11) printf("\t\t!!! Possibly incomplete decoding\n"); - if (rid >= 0x23) + if (rid >= 0x22) fmt = "\t\tCommand: WarmRst%c DblEnd%c DevNum=%u ChainSide%c HostHide%c Slave%c = 0x23) + if (rid >= 0x22) fmt = "\t\tLink Control: CFlE%c CST%c CFE%c = 0x23) + if (rid >= 0x22) fmt = "\t\tLink Config: MLWI=%1$s DwFcIn%5$c MLWO=%2$s DwFcOut%6$c LWI=%3$s DwFcInEn%7$c LWO=%4$s DwFcOutEn%8$c\n"; else fmt = "\t\tLink Config: MLWI=%s MLWO=%s LWI=%s LWO=%s\n"; @@ -789,7 +802,7 @@ cap_ht_sec(struct device *d, int where, int cmd) FLAG(lcnf, PCI_HT_LCNF_DFOE)); printf("\t\tRevision ID: %u.%02u\n", (rid & PCI_HT_RID_MAJ) >> 5, (rid & PCI_HT_RID_MIN)); - if (rid < 0x23) + if (rid < 0x22) return; lfrer = get_conf_byte(d, where + PCI_HT_SEC_LFRER); printf("\t\tLink Frequency: %s\n", ht_link_freq(lfrer & PCI_HT_LFRER_FREQ)); @@ -922,11 +935,11 @@ cap_msi(struct device *d, int where, int cap) u32 t; u16 w; - printf("Message Signalled Interrupts: Mask%c 64bit%c Queue=%d/%d Enable%c\n", + printf("MSI: Mask%c 64bit%c Count=%d/%d Enable%c\n", FLAG(cap, PCI_MSI_FLAGS_MASK_BIT), FLAG(cap, PCI_MSI_FLAGS_64BIT), - (cap & PCI_MSI_FLAGS_QSIZE) >> 4, - (cap & PCI_MSI_FLAGS_QMASK) >> 1, + 1 << ((cap & PCI_MSI_FLAGS_QSIZE) >> 4), + 1 << ((cap & PCI_MSI_FLAGS_QMASK) >> 1), FLAG(cap, PCI_MSI_FLAGS_ENABLE)); if (verbose < 2) return; @@ -1501,21 +1514,21 @@ cap_aer(struct device *d, int where) l = get_conf_long(d, where + PCI_ERR_UNCOR_STATUS); printf("\t\tUESta:\tDLP%c SDES%c TLP%c FCP%c CmpltTO%c CmpltAbrt%c UnxCmplt%c RxOF%c " - "MalfTLP%c ECRC%c UnsupReq%c ACSVoil%c\n", + "MalfTLP%c ECRC%c UnsupReq%c ACSViol%c\n", FLAG(l, PCI_ERR_UNC_DLP), FLAG(l, PCI_ERR_UNC_SDES), FLAG(l, PCI_ERR_UNC_POISON_TLP), FLAG(l, PCI_ERR_UNC_FCP), FLAG(l, PCI_ERR_UNC_COMP_TIME), FLAG(l, PCI_ERR_UNC_COMP_ABORT), FLAG(l, PCI_ERR_UNC_UNX_COMP), FLAG(l, PCI_ERR_UNC_RX_OVER), FLAG(l, PCI_ERR_UNC_MALF_TLP), FLAG(l, PCI_ERR_UNC_ECRC), FLAG(l, PCI_ERR_UNC_UNSUP), FLAG(l, PCI_ERR_UNC_ACS_VIOL)); l = get_conf_long(d, where + PCI_ERR_UNCOR_MASK); printf("\t\tUEMsk:\tDLP%c SDES%c TLP%c FCP%c CmpltTO%c CmpltAbrt%c UnxCmplt%c RxOF%c " - "MalfTLP%c ECRC%c UnsupReq%c ACSVoil%c\n", + "MalfTLP%c ECRC%c UnsupReq%c ACSViol%c\n", FLAG(l, PCI_ERR_UNC_DLP), FLAG(l, PCI_ERR_UNC_SDES), FLAG(l, PCI_ERR_UNC_POISON_TLP), FLAG(l, PCI_ERR_UNC_FCP), FLAG(l, PCI_ERR_UNC_COMP_TIME), FLAG(l, PCI_ERR_UNC_COMP_ABORT), FLAG(l, PCI_ERR_UNC_UNX_COMP), FLAG(l, PCI_ERR_UNC_RX_OVER), FLAG(l, PCI_ERR_UNC_MALF_TLP), FLAG(l, PCI_ERR_UNC_ECRC), FLAG(l, PCI_ERR_UNC_UNSUP), FLAG(l, PCI_ERR_UNC_ACS_VIOL)); l = get_conf_long(d, where + PCI_ERR_UNCOR_SEVER); printf("\t\tUESvrt:\tDLP%c SDES%c TLP%c FCP%c CmpltTO%c CmpltAbrt%c UnxCmplt%c RxOF%c " - "MalfTLP%c ECRC%c UnsupReq%c ACSVoil%c\n", + "MalfTLP%c ECRC%c UnsupReq%c ACSViol%c\n", FLAG(l, PCI_ERR_UNC_DLP), FLAG(l, PCI_ERR_UNC_SDES), FLAG(l, PCI_ERR_UNC_POISON_TLP), FLAG(l, PCI_ERR_UNC_FCP), FLAG(l, PCI_ERR_UNC_COMP_TIME), FLAG(l, PCI_ERR_UNC_COMP_ABORT), FLAG(l, PCI_ERR_UNC_UNX_COMP), FLAG(l, PCI_ERR_UNC_RX_OVER), FLAG(l, PCI_ERR_UNC_MALF_TLP), @@ -1525,7 +1538,7 @@ cap_aer(struct device *d, int where) FLAG(l, PCI_ERR_COR_RCVR), FLAG(l, PCI_ERR_COR_BAD_TLP), FLAG(l, PCI_ERR_COR_BAD_DLLP), FLAG(l, PCI_ERR_COR_REP_ROLL), FLAG(l, PCI_ERR_COR_REP_TIMER), FLAG(l, PCI_ERR_COR_REP_ANFE)); l = get_conf_long(d, where + PCI_ERR_COR_MASK); - printf("\t\tCESta:\tRxErr%c BadTLP%c BadDLLP%c Rollover%c Timeout%c NonFatalErr%c\n", + printf("\t\tCEMsk:\tRxErr%c BadTLP%c BadDLLP%c Rollover%c Timeout%c NonFatalErr%c\n", FLAG(l, PCI_ERR_COR_RCVR), FLAG(l, PCI_ERR_COR_BAD_TLP), FLAG(l, PCI_ERR_COR_BAD_DLLP), FLAG(l, PCI_ERR_COR_REP_ROLL), FLAG(l, PCI_ERR_COR_REP_TIMER), FLAG(l, PCI_ERR_COR_REP_ANFE)); l = get_conf_long(d, where + PCI_ERR_CAP); @@ -1535,6 +1548,107 @@ cap_aer(struct device *d, int where) } +static void +cap_acs(struct device *d, int where) +{ + u16 w; + + printf("Access Control Services\n"); + if (!config_fetch(d, where + PCI_ACS_CAP, 4)) + return; + + w = get_conf_word(d, where + PCI_ACS_CAP); + printf("\t\tACSCap:\tSrcValid%c TransBlk%c ReqRedir%c CmpltRedir%c UpstreamFwd%c EgressCtrl%c " + "DirectTrans%c\n", + FLAG(w, PCI_ACS_CAP_VALID), FLAG(w, PCI_ACS_CAP_BLOCK), FLAG(w, PCI_ACS_CAP_REQ_RED), + FLAG(w, PCI_ACS_CAP_CMPLT_RED), FLAG(w, PCI_ACS_CAP_FORWARD), FLAG(w, PCI_ACS_CAP_EGRESS), + FLAG(w, PCI_ACS_CAP_TRANS)); + w = get_conf_word(d, where + PCI_ACS_CTRL); + printf("\t\tACSCtl:\tSrcValid%c TransBlk%c ReqRedir%c CmpltRedir%c UpstreamFwd%c EgressCtrl%c " + "DirectTrans%c\n", + FLAG(w, PCI_ACS_CTRL_VALID), FLAG(w, PCI_ACS_CTRL_BLOCK), FLAG(w, PCI_ACS_CTRL_REQ_RED), + FLAG(w, PCI_ACS_CTRL_CMPLT_RED), FLAG(w, PCI_ACS_CTRL_FORWARD), FLAG(w, PCI_ACS_CTRL_EGRESS), + FLAG(w, PCI_ACS_CTRL_TRANS)); +} + +static void +cap_ari(struct device *d, int where) +{ + u16 w; + + printf("Alternative Routing-ID Interpretation (ARI)\n"); + if (!config_fetch(d, where + PCI_ARI_CAP, 4)) + return; + + w = get_conf_word(d, where + PCI_ARI_CAP); + printf("\t\tARICap:\tMFVC%c ACS%c, Next Function: %d\n", + FLAG(w, PCI_ARI_CAP_MFVC), FLAG(w, PCI_ARI_CAP_ACS), + PCI_ARI_CAP_NFN(w)); + w = get_conf_word(d, where + PCI_ARI_CTRL); + printf("\t\tARICtl:\tMFVC%c ACS%c, Function Group: %d\n", + FLAG(w, PCI_ARI_CTRL_MFVC), FLAG(w, PCI_ARI_CTRL_ACS), + PCI_ARI_CTRL_FG(w)); +} + +static void +cap_ats(struct device *d, int where) +{ + u16 w; + + printf("Address Translation Service (ATS)\n"); + if (!config_fetch(d, where + PCI_ATS_CAP, 4)) + return; + + w = get_conf_word(d, where + PCI_ATS_CAP); + printf("\t\tATSCap:\tInvalidate Queue Depth: %02x\n", PCI_ATS_CAP_IQD(w)); + w = get_conf_word(d, where + PCI_ATS_CTRL); + printf("\t\tATSCtl:\tEnable%c, Smallest Translation Unit: %02x\n", + FLAG(w, PCI_ATS_CTRL_ENABLE), PCI_ATS_CTRL_STU(w)); +} + +static void +cap_sriov(struct device *d, int where) +{ + u16 b; + u16 w; + u32 l; + + printf("Single Root I/O Virtualization (SR-IOV)\n"); + if (!config_fetch(d, where + PCI_IOV_CAP, 0x3c)) + return; + + l = get_conf_long(d, where + PCI_IOV_CAP); + printf("\t\tIOVCap:\tMigration%c, Interrupt Message Number: %03x\n", + FLAG(l, PCI_IOV_CAP_VFM), PCI_IOV_CAP_IMN(l)); + w = get_conf_word(d, where + PCI_IOV_CTRL); + printf("\t\tIOVCtl:\tEnable%c Migration%c Interrupt%c MSE%c ARIHierarchy%c\n", + FLAG(w, PCI_IOV_CTRL_VFE), FLAG(w, PCI_IOV_CTRL_VFME), + FLAG(w, PCI_IOV_CTRL_VFMIE), FLAG(w, PCI_IOV_CTRL_MSE), + FLAG(w, PCI_IOV_CTRL_ARI)); + w = get_conf_word(d, where + PCI_IOV_STATUS); + printf("\t\tIOVSta:\tMigration%c\n", FLAG(w, PCI_IOV_STATUS_MS)); + w = get_conf_word(d, where + PCI_IOV_INITIALVF); + printf("\t\tInitial VFs: %d, ", w); + w = get_conf_word(d, where + PCI_IOV_TOTALVF); + printf("Total VFs: %d, ", w); + w = get_conf_word(d, where + PCI_IOV_NUMVF); + printf("Number of VFs: %d, ", w); + b = get_conf_byte(d, where + PCI_IOV_FDL); + printf("Function Dependency Link: %02x\n", b); + w = get_conf_word(d, where + PCI_IOV_OFFSET); + printf("\t\tVF offset: %d, ", w); + w = get_conf_word(d, where + PCI_IOV_STRIDE); + printf("stride: %d, ", w); + w = get_conf_word(d, where + PCI_IOV_DID); + printf("Device ID: %04x\n", w); + l = get_conf_long(d, where + PCI_IOV_SUPPS); + printf("\t\tSupported Page Size: %08x, ", l); + l = get_conf_long(d, where + PCI_IOV_SYSPS); + printf("System Page Size: %08x\n", l); + printf("\t\tVF Migration: offset: %08x, BIR: %x\n", PCI_IOV_MSA_OFFSET(l), + PCI_IOV_MSA_BIR(l)); +} + static void show_ext_caps(struct device *d) { @@ -1591,7 +1705,16 @@ show_ext_caps(struct device *d) printf("Vendor Specific Information \n"); break; case PCI_EXT_CAP_ID_ACS: - printf("Access Controls \n"); + cap_acs(d, where); + break; + case PCI_EXT_CAP_ID_ARI: + cap_ari(d, where); + break; + case PCI_EXT_CAP_ID_ATS: + cap_ats(d, where); + break; + case PCI_EXT_CAP_ID_SRIOV: + cap_sriov(d, where); break; default: printf("#%02x\n", id); @@ -1913,7 +2036,7 @@ show_bases(struct device *d, int cnt) word cmd = get_conf_word(d, PCI_COMMAND); int i; - for(i=0; ibase_addr[i]; pciaddr_t len = (p->known_fields & PCI_FILL_SIZES) ? p->size[i] : 0; @@ -2155,7 +2278,7 @@ show_htype2(struct device *d) get_conf_byte(d, PCI_CB_CARD_BUS), get_conf_byte(d, PCI_CB_SUBORDINATE_BUS), get_conf_byte(d, PCI_CB_LATENCY_TIMER)); - for(i=0; i<2; i++) + for (i=0; i<2; i++) { int p = 8*i; u32 base = get_conf_long(d, PCI_CB_MEMORY_BASE_0 + p); @@ -2165,7 +2288,7 @@ show_htype2(struct device *d) (cmd & PCI_COMMAND_MEMORY) ? "" : " [disabled]", (brc & (PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 << i)) ? " (prefetchable)" : ""); } - for(i=0; i<2; i++) + for (i=0; i<2; i++) { int p = 8*i; u32 base = get_conf_long(d, PCI_CB_IO_BASE_0 + p); @@ -2220,8 +2343,6 @@ show_verbose(struct device *d) byte max_lat, min_gnt; byte int_pin = get_conf_byte(d, PCI_INTERRUPT_PIN); unsigned int irq = p->irq; - word subsys_v, subsys_d; - char ssnamebuf[256]; show_terse(d); @@ -2248,13 +2369,6 @@ show_verbose(struct device *d) return; } - get_subid(d, &subsys_v, &subsys_d); - if (subsys_v && subsys_v != 0xffff) - printf("\tSubsystem: %s\n", - pci_lookup_name(pacc, ssnamebuf, sizeof(ssnamebuf), - PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE, - p->vendor_id, p->device_id, subsys_v, subsys_d)); - if (verbose > 1) { printf("\tControl: I/O%c Mem%c BusMaster%c SpecCycle%c MemWINV%c VGASnoop%c ParErr%c Stepping%c SERR%c FastB2B%c DisINTx%c\n", @@ -2369,7 +2483,7 @@ show_hex_dump(struct device *d) cnt = 4096; } - for(i=0; inext) + for (d=first_dev; d; d=d->next) show_device(d); } @@ -2504,7 +2618,7 @@ find_bus(struct bridge *b, unsigned int domain, unsigned int n) { struct bus *bus; - for(bus=b->first_bus; bus; bus=bus->sibling) + for (bus=b->first_bus; bus; bus=bus->sibling) if (bus->domain == domain && bus->number == n) break; return bus; @@ -2532,7 +2646,7 @@ insert_dev(struct device *d, struct bridge *b) if (! (bus = find_bus(b, p->domain, p->bus))) { struct bridge *c; - for(c=b->child; c; c=c->next) + for (c=b->child; c; c=c->next) if (c->domain == p->domain && c->secondary <= p->bus && p->bus <= c->subordinate) { insert_dev(d, c); @@ -2558,7 +2672,7 @@ grow_tree(void) /* Build list of bridges */ last_br = &host_bridge.chain; - for(d=first_dev; d; d=d->next) + for (d=first_dev; d; d=d->next) { word class = d->dev->device_class; byte ht = get_conf_byte(d, PCI_HEADER_TYPE) & 0x7f; @@ -2590,11 +2704,11 @@ grow_tree(void) /* Create a bridge tree */ - for(b=&host_bridge; b; b=b->chain) + for (b=&host_bridge; b; b=b->chain) { struct bridge *c, *best; best = NULL; - for(c=&host_bridge; c; c=c->chain) + for (c=&host_bridge; c; c=c->chain) if (c != b && (c == &host_bridge || b->domain == c->domain) && b->primary >= c->secondary && b->primary <= c->subordinate && (!best || best->subordinate - best->primary > c->subordinate - c->primary)) @@ -2608,13 +2722,13 @@ grow_tree(void) /* Insert secondary bus for each bridge */ - for(b=&host_bridge; b; b=b->chain) + for (b=&host_bridge; b; b=b->chain) if (!find_bus(b, b->domain, b->secondary)) new_bus(b, b->domain, b->secondary); /* Create bus structs and link devices */ - for(d=first_dev; d;) + for (d=first_dev; d;) { d2 = d->next; insert_dev(d, &host_bridge); @@ -2628,7 +2742,7 @@ print_it(char *line, char *p) *p++ = '\n'; *p = 0; fputs(line, stdout); - for(p=line; *p; p++) + for (p=line; *p; p++) if (*p == '+' || *p == '|') *p = '|'; else @@ -2645,7 +2759,7 @@ show_tree_dev(struct device *d, char *line, char *p) char namebuf[256]; p += sprintf(p, "%02x.%x", q->dev, q->func); - for(b=&host_bridge; b; b=b->chain) + for (b=&host_bridge; b; b=b->chain) if (b->br_dev == d) { if (b->secondary == b->subordinate) @@ -2774,11 +2888,11 @@ do_map_bus(int bus) if (verbose) printf("Mapping bus %02x\n", bus); - for(dev = 0; dev < 32; dev++) + for (dev = 0; dev < 32; dev++) if (filter.slot < 0 || filter.slot == dev) { int func_limit = 1; - for(func = 0; func < func_limit; func++) + for (func = 0; func < func_limit; func++) if (filter.func < 0 || filter.func == func) { /* XXX: Bus mapping supports only domain 0 */ @@ -2820,7 +2934,7 @@ do_map_bridges(int bus, int min, int max) struct bus_bridge *b; bi->guestbook = 1; - for(b=bi->bridges; b; b=b->next) + for (b=bi->bridges; b; b=b->next) { if (bus_info[b->first].guestbook) b->bug = 1; @@ -2840,10 +2954,10 @@ map_bridges(void) int i; printf("\nSummary of buses:\n\n"); - for(i=0; i<256; i++) + for (i=0; i<256; i++) if (bus_info[i].exists && !bus_info[i].guestbook) do_map_bridges(i, 0, 255); - for(i=0; i<256; i++) + for (i=0; i<256; i++) { struct bus_info *bi = bus_info + i; struct bus_bridge *b = bi->via; @@ -2858,7 +2972,7 @@ map_bridges(void) else printf("Secondary host bus (?)\n"); } - for(b=bi->bridges; b; b=b->next) + for (b=bi->bridges; b; b=b->next) { printf("\t%02x.%d Bridge to %02x-%02x", b->dev, b->func, b->first, b->last); switch (b->bug) @@ -2888,7 +3002,7 @@ map_the_bus(void) else { int bus; - for(bus=0; bus<256; bus++) + for (bus=0; bus<256; bus++) do_map_bus(bus); } map_bridges();