1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Work around a quirk with the G5 Xserve, which has a fake GMAC controller

with an all-zero MAC address. In this case, don't attach.

Discussed with:	marius
This commit is contained in:
Nathan Whitehorn 2009-10-18 17:11:16 +00:00
parent 6b95af36e0
commit 635dc3f7ff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=198211

View File

@ -295,6 +295,16 @@ gem_pci_attach(device_t dev)
GEM_PCI_ROM_OFFSET + j + PCI_VPDRES_LARGE_SIZE + PCI_VPD_SIZE,
sc->sc_enaddr, ETHER_ADDR_LEN);
#endif
/*
* The Xserve G5 has a fake GMAC with an all-zero MAC address.
* Check for this, and don't attach in this case.
*/
for (i = 0; i < ETHER_ADDR_LEN && sc->sc_enaddr[i] == 0; i++) {}
if (i == ETHER_ADDR_LEN) {
device_printf(dev, "invalid MAC address\n");
goto fail;
}
if (gem_attach(sc) != 0) {
device_printf(dev, "could not be attached\n");