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:
parent
7153bb5d55
commit
5a806bdbde
@ -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:
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user