Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm26/podulebus Disable media autoselection entirel...



details:   https://anonhg.NetBSD.org/src/rev/9c80405a3783
branches:  trunk
changeset: 500880:9c80405a3783
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Wed Dec 20 00:01:56 2000 +0000

description:
Disable media autoselection entirely, but use whatever medium the card was
found using (presumably having been set up by RISC OS) as the default.
NB that this doesn't seem to be right for the EtherLan 200.

diffstat:

 sys/arch/arm26/podulebus/if_eh.c |  22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diffs (84 lines):

diff -r 44a5ca53ab4e -r 9c80405a3783 sys/arch/arm26/podulebus/if_eh.c
--- a/sys/arch/arm26/podulebus/if_eh.c  Tue Dec 19 23:55:02 2000 +0000
+++ b/sys/arch/arm26/podulebus/if_eh.c  Wed Dec 20 00:01:56 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_eh.c,v 1.4 2000/12/18 00:46:47 bjh21 Exp $ */
+/* $NetBSD: if_eh.c,v 1.5 2000/12/20 00:01:56 bjh21 Exp $ */
 
 /*-
  * Copyright (c) 2000 Ben Harris
@@ -53,7 +53,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: if_eh.c,v 1.4 2000/12/18 00:46:47 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_eh.c,v 1.5 2000/12/20 00:01:56 bjh21 Exp $");
 
 #include <sys/systm.h>
 #include <sys/device.h>
@@ -157,14 +157,14 @@
 static int media_only2[] = { IFM_ETHER | IFM_10_2 };
 static int media_onlyt[] = { IFM_ETHER | IFM_10_T };
 static int media_2andt[] =
-    { IFM_ETHER | IFM_10_2, IFM_ETHER | IFM_10_T, IFM_ETHER | IFM_AUTO };
+    { IFM_ETHER | IFM_10_2, IFM_ETHER | IFM_10_T, /* IFM_ETHER | IFM_AUTO */ };
 static const struct {
        int nmedia;
        int *media;
 } media_switch[] = {
        { 1, media_only2 },
        { 1, media_onlyt },
-       { 3, media_2andt }
+       { 2, media_2andt }
 };
 
 static void
@@ -173,7 +173,7 @@
        struct podulebus_attach_args *pa = aux;
        struct eh_softc *sc = (struct eh_softc *)self;
        struct dp8390_softc *dsc = &sc->sc_dp;
-       int *media;
+       int *media, defmedia;
        int mediaset, nmedia;
        int i;
        char eatext[18];
@@ -250,6 +250,12 @@
 
        sc->sc_ctrl = 0x00;
 
+       if ((bus_space_read_1(sc->sc_ctl2t, sc->sc_ctl2h, 0) &
+           EH_CTRL2_10B2))
+               defmedia = IFM_ETHER | IFM_10_2;
+       else
+               defmedia = IFM_ETHER | IFM_10_T;
+
        if (!(sc->sc_flags & EHF_MAU))
                mediaset = eh_availmedia(sc);
        else
@@ -264,6 +270,10 @@
                break;
        case EH_MEDIA_2_T:
                printf(", combo 10base2/T");
+               if (defmedia == (IFM_ETHER | IFM_10_2))
+                       printf(" (using 10base2)");
+               else
+                       printf(" (using 10baseT)");
                break;
        }
        media = media_switch[mediaset].media;
@@ -758,6 +768,7 @@
        struct ifmedia *ifm = &dsc->sc_media;
 
        switch (IFM_SUBTYPE(ifm->ifm_cur->ifm_media)) {
+#if 0 /* Not currently working */
        case IFM_AUTO:
                /* Auto-media logic from Linux */
                sc->sc_ctrl |= EH_CTRL_MEDIA;
@@ -767,6 +778,7 @@
                    EH_CTRL_LINK)
                        break;
                /* FALLTHROUGH */
+#endif
        case IFM_10_2:
                sc->sc_ctrl &= ~EH_CTRL_MEDIA;
                bus_space_write_1(sc->sc_ctlt, sc->sc_ctlh, 0, sc->sc_ctrl);



Home | Main Index | Thread Index | Old Index