aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2002-11-27 06:41:28 +0000
committerWarner Losh <imp@FreeBSD.org>2002-11-27 06:41:28 +0000
commitba5fc4eed20d47aaf62804087bf259156678bef4 (patch)
treee27728d0d62643d537703709ce2f92ce251092fa /sys
parent0d16d021504a2249a49b620dfd328dd21ac2324d (diff)
downloadsrc-ba5fc4eed20d47aaf62804087bf259156678bef4.tar.gz
src-ba5fc4eed20d47aaf62804087bf259156678bef4.zip
Add a new cardbus specific ivar: PCI_IVAR_ETHADDR. Some pci-like
buses support querying the MAC address in a standard-for-that-bus way. The base pci bus returns NULL for this IVAR always. Submitted by: sam Approved by: re (blanket for NEWCARD)
Notes
Notes: svn path=/head/; revision=107300
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/pci.c8
-rw-r--r--sys/dev/pci/pcivar.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 3b2daab0b0a0..2c5e7a4f9ef3 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1121,6 +1121,13 @@ pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
cfg = &dinfo->cfg;
switch (which) {
+ case PCI_IVAR_ETHADDR:
+ /*
+ * The generic accessor doesn't deal with failure, so
+ * we set the return value, then return an error.
+ */
+ *((u_int8_t **) result) = NULL;
+ return (EINVAL);
case PCI_IVAR_SUBVENDOR:
*result = cfg->subvendor;
break;
@@ -1179,6 +1186,7 @@ pci_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
cfg = &dinfo->cfg;
switch (which) {
+ case PCI_IVAR_ETHADDR:
case PCI_IVAR_SUBVENDOR:
case PCI_IVAR_SUBDEVICE:
case PCI_IVAR_VENDOR:
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index 2b15c4d08aba..45df9e4f58c2 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -177,6 +177,7 @@ enum pci_device_ivars {
PCI_IVAR_BUS,
PCI_IVAR_SLOT,
PCI_IVAR_FUNCTION,
+ PCI_IVAR_ETHADDR,
};
/*
@@ -199,6 +200,7 @@ PCI_ACCESSOR(irq, IRQ, u_int8_t)
PCI_ACCESSOR(bus, BUS, u_int8_t)
PCI_ACCESSOR(slot, SLOT, u_int8_t)
PCI_ACCESSOR(function, FUNCTION, u_int8_t)
+PCI_ACCESSOR(ether, ETHADDR, u_int8_t *)
#undef PCI_ACCESSOR