Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jan 2013 16:09:04 +0100
From:      Marius Strobl <marius@alchemy.franken.de>
To:        Paul Keusemann <pkeusem@visi.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: Cas driver fails to load first time after boot.
Message-ID:  <20130124150904.GA27559@alchemy.franken.de>
In-Reply-To: <50FEFAB8.1070006@visi.com>
References:  <50FEFAB8.1070006@visi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--5vNYLRcllDrimb99
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Jan 22, 2013 at 02:46:48PM -0600, Paul Keusemann wrote:
> Hi,
> 
> I've got a Dell R200 which I'm trying to build into a gateway with a Sun 
> QGE (501-6738-10).  The cas driver fails to load the first time I try to 
> load it but succeeds the second time.  Is this a problem with the card, 
> the driver, my karma?

Wrong phase of the moon, apparently :)
The MII setup of these chips is a bit tricky and I'm not sure whether
I've hit all code paths during development of the driver. I certainly
didn't test with a 501-6738, these have been reported as working before,
though. It also doesn't make much sense that attaching the devices
succeeds on the second attempt. Could you please use a if_cas.ko built
with the attached patch and report the debug output for one of the
interfaces in both the working and the non-working case?

Marius


--5vNYLRcllDrimb99
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="if_cas.c.diff"

Index: if_cas.c
===================================================================
--- if_cas.c	(revision 245046)
+++ if_cas.c	(working copy)
@@ -332,6 +332,8 @@ cas_attach(struct cas_softc *sc)
 		 */
 		error = ENXIO;
 		v = CAS_READ_4(sc, CAS_MIF_CONF);
+device_printf(sc->sc_dev, "MIF=0x%x PCFG=0x%x\n", v,
+CAS_READ_4(sc, CAS_SATURN_PCFG));
 		if ((v & CAS_MIF_CONF_MDI1) != 0) {
 			v |= CAS_MIF_CONF_PHY_SELECT;
 			CAS_WRITE_4(sc, CAS_MIF_CONF, v);
@@ -347,6 +349,8 @@ cas_attach(struct cas_softc *sc)
 			error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp,
 			    cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK,
 			    MII_PHY_ANY, MII_OFFSET_ANY, MIIF_DOPAUSE);
+if (error == 0)
+device_printf(sc->sc_dev, "external PHY\n");
 		}
 		/*
 		 * Fall back on an internal PHY if no external PHY was found.
@@ -367,6 +371,8 @@ cas_attach(struct cas_softc *sc)
 			error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp,
 			    cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK,
 			    MII_PHY_ANY, MII_OFFSET_ANY, MIIF_DOPAUSE);
+if (error == 0)
+device_printf(sc->sc_dev, "internal PHY\n");
 		}
 	} else {
 		/*

--5vNYLRcllDrimb99--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130124150904.GA27559>