aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2009-10-18 17:11:16 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2009-10-18 17:11:16 +0000
commit635dc3f7ffc279095d5e971d785578849c72db95 (patch)
treee27cab1973784c0d03b9a35b6b9e93760f6dca5a
parent6b95af36e0d50e7d05e77eeba88198f0b34e652f (diff)
downloadsrc-635dc3f7ffc279095d5e971d785578849c72db95.tar.gz
src-635dc3f7ffc279095d5e971d785578849c72db95.zip
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
Notes
Notes: svn path=/head/; revision=198211
-rw-r--r--sys/dev/gem/if_gem_pci.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/gem/if_gem_pci.c b/sys/dev/gem/if_gem_pci.c
index 05be3236ca7e..051dbcc5bfbd 100644
--- a/sys/dev/gem/if_gem_pci.c
+++ b/sys/dev/gem/if_gem_pci.c
@@ -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");