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)
{
}
}
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 ***/
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);
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",