Module Name: src Committed By: christos Date: Wed Apr 20 20:15:03 UTC 2011
Modified Files: src/sys/dev/pci: if_lii.c Log Message: PR/41258: Elias Benali: Try to get the ethernet address from the BIOS before failing. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_lii.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_lii.c diff -u src/sys/dev/pci/if_lii.c:1.9 src/sys/dev/pci/if_lii.c:1.10 --- src/sys/dev/pci/if_lii.c:1.9 Mon Apr 5 03:20:26 2010 +++ src/sys/dev/pci/if_lii.c Wed Apr 20 16:15:03 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: if_lii.c,v 1.9 2010/04/05 07:20:26 joerg Exp $ */ +/* $NetBSD: if_lii.c,v 1.10 2011/04/20 20:15:03 christos Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.9 2010/04/05 07:20:26 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.10 2011/04/20 20:15:03 christos Exp $"); #include <sys/param.h> @@ -551,17 +551,18 @@ } if (found < 2) { - aprint_error_dev(sc->sc_dev, "error reading MAC address\n"); - return 1; - } - - addr0 = htole32(addr0); - addr1 = htole32(addr1); - - if ((addr0 == 0xffffff && (addr1 & 0xffff) == 0xffff) || - (addr0 == 0 && (addr1 & 0xffff) == 0)) { + /* Make sure we try the BIOS method before giving up */ addr0 = htole32(AT_READ_4(sc, ATL2_MAC_ADDR_0)); addr1 = htole32(AT_READ_4(sc, ATL2_MAC_ADDR_1)); + if ((addr0 == 0xffffff && (addr1 & 0xffff) == 0xffff) || + (addr0 == 0 && (addr1 & 0xffff) == 0)) { + aprint_error_dev(sc->sc_dev, + "error reading MAC address\n"); + return 1; + } + } else { + addr0 = htole32(addr0); + addr1 = htole32(addr1); } ea[0] = (addr1 & 0x0000ff00) >> 8;