Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Check existence of the default 10baseT media for ...



details:   https://anonhg.NetBSD.org/src/rev/7c268473fe92
branches:  trunk
changeset: 537930:7c268473fe92
user:      minoura <minoura%NetBSD.org@localhost>
date:      Tue Oct 08 15:05:35 2002 +0000

description:
Check existence of the default 10baseT media for 21140.
If one does not exist, fall back to the first.

diffstat:

 sys/dev/ic/tulip.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 9a8dd2fd8fa5 -r 7c268473fe92 sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c        Tue Oct 08 14:50:57 2002 +0000
+++ b/sys/dev/ic/tulip.c        Tue Oct 08 15:05:35 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulip.c,v 1.120 2002/09/27 15:37:19 provos Exp $       */
+/*     $NetBSD: tulip.c,v 1.121 2002/10/08 15:05:35 minoura 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.120 2002/09/27 15:37:19 provos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.121 2002/10/08 15:05:35 minoura Exp $");
 
 #include "bpfilter.h"
 
@@ -4976,6 +4976,15 @@
                case TULIP_CHIP_21140A:
                        /* XXX should come from SROM */
                        defmedia = IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, 0);
+                       if (ifmedia_match(&sc->sc_mii.mii_media, defmedia,
+                               sc->sc_mii.mii_media.ifm_mask) == NULL) {
+                               /*
+                                * There is not a 10baseT media.
+                                * Fall back to the first found one.
+                                */
+                               ife = TAILQ_FIRST(&sc->sc_mii.mii_media.ifm_list);
+                               defmedia = ife->ifm_media;
+                       }
                        break;
 
                case TULIP_CHIP_21142:



Home | Main Index | Thread Index | Old Index