summaryrefslogtreecommitdiffstats
path: root/usr.sbin/lsdev
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1994-11-02 23:27:36 +0000
committerse <se@FreeBSD.org>1994-11-02 23:27:36 +0000
commit9fc13e23e813ceca8c9c53e51d9b186ac50f5867 (patch)
tree7f65e10ae1a2eccf47cb9720374d144fe6002135 /usr.sbin/lsdev
parent4194c9242f3f8bae7045e06e5f70ee9729ad701a (diff)
downloadFreeBSD-src-9fc13e23e813ceca8c9c53e51d9b186ac50f5867.zip
FreeBSD-src-9fc13e23e813ceca8c9c53e51d9b186ac50f5867.tar.gz
Submitted by: Wolfgang Stanglmeier <wolf@dentaro.GUN.de>
Added PCI support code.
Diffstat (limited to 'usr.sbin/lsdev')
-rw-r--r--usr.sbin/lsdev/i386.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/usr.sbin/lsdev/i386.c b/usr.sbin/lsdev/i386.c
index 037efee..edc1cd8 100644
--- a/usr.sbin/lsdev/i386.c
+++ b/usr.sbin/lsdev/i386.c
@@ -46,7 +46,7 @@ printit:
}
break;
case MDDT_PCI:
- if(dc->dc_datalen >= PCI_EXTERNALLEN) {
+ if(dc->dc_datalen >= PCI_EXTERNAL_LEN) {
print_pci(dc);
} else {
goto printit;
@@ -155,17 +155,40 @@ print_eisa(struct devconf *dc)
static void
print_pci(struct devconf *dc)
{
- struct pci_device *pd = (struct pci_device *)dc->dc_data;
+ /*
+ ** PCI is capable of true autoconfiguration.
+ ** The pci_device structure isn't required at all.
+ **
+ ** You can retrieve the configuration info
+ ** from the configuration space.
+ */
+
+ struct pci_externalize_buffer *pd =
+ (struct pci_externalize_buffer *)dc->dc_data;
+
+ u_long data, pin, line;
+
+ printf("%s%d\tat pci%d:%d",
+ dc->dc_name, dc->dc_unit,
+ pd->peb_pci_info.pi_bus,
+ pd->peb_pci_info.pi_device);
/*
- * Unfortunately, the `pci_device' struct is completely
- * useless. We will have to develop a unique structure
- * for this task eventually, unless the existing one can
- * be made to serve.
- */
-
- printf("%s%d at %s%d", dc->dc_name, dc->dc_unit, dc->dc_pname,
- dc->dc_punit);
+ ** For now we show only the interrupt configuration,
+ ** because this may collide with other parts of the
+ ** configuration.
+ */
+
+ data = pd->peb_config[PCI_INTERRUPT_REG / 4];
+ pin = PCI_INTERRUPT_PIN_EXTRACT (data);
+ line = PCI_INTERRUPT_LINE_EXTRACT (data);
+
+ /*
+ ** You may of course display all the configuration registers.
+ ** Hint: The #defines are in <i386/pci/pcireg.h>
+ */
+
+ if (pin) printf (" # int %c irq %d", pin + ('a'-1), line);
}
static void
OpenPOWER on IntegriCloud