Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Handle SROM quirk of tulip on Cobalt RAQ2. Fixes ...



details:   https://anonhg.NetBSD.org/src/rev/65207b612484
branches:  trunk
changeset: 551492:65207b612484
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Sep 07 10:45:11 2003 +0000

description:
Handle SROM quirk of tulip on Cobalt RAQ2. Fixes kern/20702.

diffstat:

 sys/dev/ic/tulip.c |  20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r 69249dd90488 -r 65207b612484 sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c        Sun Sep 07 10:09:07 2003 +0000
+++ b/sys/dev/ic/tulip.c        Sun Sep 07 10:45:11 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulip.c,v 1.122 2003/02/26 06:31:10 matt Exp $ */
+/*     $NetBSD: tulip.c,v 1.123 2003/09/07 10:45:11 tsutsui Exp $      */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.122 2003/02/26 06:31:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.123 2003/09/07 10:45:11 tsutsui Exp $");
 
 #include "bpfilter.h"
 
@@ -2440,14 +2440,22 @@
 
        if (memcmp(&sc->sc_srom[0], &sc->sc_srom[16], 8) != 0) {
                /*
+                * Cobalt Networks interfaces simply have the address
+                * in the first six bytes. The rest is zeroed out
+                * on some models, but others contain unknown data.
+                */
+               if (sc->sc_srom[0] == 0x00 &&
+                   sc->sc_srom[1] == 0x10 &&
+                   sc->sc_srom[2] == 0xe0) {
+                       memcpy(enaddr, sc->sc_srom, ETHER_ADDR_LEN);
+                       return (1);
+               }
+
+               /*
                 * Some vendors (e.g. ZNYX) don't use the standard
                 * DEC Address ROM format, but rather just have an
                 * Ethernet address in the first 6 bytes, maybe a
                 * 2 byte checksum, and then all 0xff's.
-                *
-                * On the other hand, Cobalt Networks interfaces
-                * simply have the address in the first six bytes
-                * with the rest zeroed out.
                 */
                for (i = 8; i < 32; i++) {
                        if (sc->sc_srom[i] != 0xff &&



Home | Main Index | Thread Index | Old Index