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)
This commit is contained in:
imp 2002-11-27 06:41:28 +00:00
parent 7153bb5d55
commit 5a806bdbde
2 changed files with 10 additions and 0 deletions

View File

@ -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:

View File

@ -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