summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-09-11 03:22:03 +0000
committerimp <imp@FreeBSD.org>2005-09-11 03:22:03 +0000
commitc6e2bab51884180d0944c8488927b2eb8201ae8e (patch)
treef30b1661377ecef039d0472b160bcd200e45aa1a /sys
parent40b586fe5868f15b0e41fae384cf06c1375bf2d3 (diff)
downloadFreeBSD-src-c6e2bab51884180d0944c8488927b2eb8201ae8e.zip
FreeBSD-src-c6e2bab51884180d0944c8488927b2eb8201ae8e.tar.gz
Allow one to access the cached values for CMDREG, CACHELNSZ, MINGNT,
MAXLAT and LATTIMER. Improve error message when a bogus RID type is requested for a bar.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/pci.c29
-rw-r--r--sys/dev/pci/pcivar.h10
2 files changed, 33 insertions, 6 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index dfeb924..52fcdfe 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1521,6 +1521,21 @@ pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
case PCI_IVAR_FUNCTION:
*result = cfg->func;
break;
+ case PCI_IVAR_CMDREG:
+ *result = cfg->cmdreg;
+ break;
+ case PCI_IVAR_CACHELNSZ:
+ *result = cfg->cachelnsz;
+ break;
+ case PCI_IVAR_MINGNT:
+ *result = cfg->mingnt;
+ break;
+ case PCI_IVAR_MAXLAT:
+ *result = cfg->maxlat;
+ break;
+ case PCI_IVAR_LATTIMER:
+ *result = cfg->lattimer;
+ break;
default:
return (ENOENT);
}
@@ -1638,17 +1653,19 @@ pci_alloc_map(device_t dev, device_t child, int type, int *rid,
if (pci_maptype(testval) & PCI_MAPMEM) {
if (type != SYS_RES_MEMORY) {
if (bootverbose)
- device_printf(child,
- "rid %#x is memory, requested %d\n",
- *rid, type);
+ device_printf(dev,
+ "child %s requested type %d for rid %#x,"
+ " but the BAR says it is an memio\n",
+ device_get_nameunit(child), type, *rid);
goto out;
}
} else {
if (type != SYS_RES_IOPORT) {
if (bootverbose)
- device_printf(child,
- "rid %#x is ioport, requested %d\n",
- *rid, type);
+ device_printf(dev,
+ "child %s requested type %d for rid %#x,"
+ " but the BAR says it is an ioport\n",
+ device_get_nameunit(child), type, *rid);
goto out;
}
}
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index c90d659..ab22afd 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -192,6 +192,11 @@ enum pci_device_ivars {
PCI_IVAR_SLOT,
PCI_IVAR_FUNCTION,
PCI_IVAR_ETHADDR,
+ PCI_IVAR_CMDREG,
+ PCI_IVAR_CACHELNSZ,
+ PCI_IVAR_MINGNT,
+ PCI_IVAR_MAXLAT,
+ PCI_IVAR_LATTIMER,
};
/*
@@ -215,6 +220,11 @@ PCI_ACCESSOR(bus, BUS, uint8_t)
PCI_ACCESSOR(slot, SLOT, uint8_t)
PCI_ACCESSOR(function, FUNCTION, uint8_t)
PCI_ACCESSOR(ether, ETHADDR, uint8_t *)
+PCI_ACCESSOR(cmdreg, CMDREG, uint8_t)
+PCI_ACCESSOR(cachelnsz, CACHELNSZ, uint8_t)
+PCI_ACCESSOR(mingnt, MINGNT, uint8_t)
+PCI_ACCESSOR(maxlat, MAXLAT, uint8_t)
+PCI_ACCESSOR(lattimer, LATTIMER, uint8_t)
#undef PCI_ACCESSOR
OpenPOWER on IntegriCloud