Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2001 09:47:33 +0100
From:      Guido van Rooij <guido@gvr.org>
To:        Andy Sparrow <spadger@best.com>
Cc:        Najib Ninaba <najib_ninaba@yahoo.com>, Warner Losh <imp@harmony.village.org>, freebsd-mobile@FreeBSD.ORG, andy@CRWdog.demon.co.uk
Subject:   Re: pccard kernel config for OmniBook 500
Message-ID:  <20011128094733.B23373@gvr.gvr.org>
In-Reply-To: <20011127200613.4DCCE3E17@CRWdog.demon.co.uk>; from spadger@best.com on Tue, Nov 27, 2001 at 12:06:13PM -0800
References:  <guido@gvr.org> <20011127200613.4DCCE3E17@CRWdog.demon.co.uk>

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

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Nov 27, 2001 at 12:06:13PM -0800, Andy Sparrow wrote:
> Hmmm. On my 6000, sometimes the xl0 doesn't come back, and I need to suspend & 
> resume again to get a link light.
> 
> Quite often, it won't respond post-resume until I get an 'xl0: watchdog 
> timeout' message, and then the driver re-sets and it's fine. The link light 
> seems to be the clue here, although I'm sure I've seen it recover from "no 
> link light" after a driver reset too... :)
> 
> Infrequently, I need to reboot to get the NIC into a sane state (although 
> sound causes me to do this more often than the NIC).
> 
> Fairly often under heavy (network) load, the xl0 will get watchdog timeouts. 
> Other than that, it seems to work OK. The 'fxp0' in the 6100 works like a 
> champ, however...
> 

W.r.t suspend/resume probs: try the attached patch which is currently
under review.

-Guido

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch

Index: if_xl.c
===================================================================
RCS file: /scratch/cvsup/freebsd/CVS/src/sys/pci/if_xl.c,v
retrieving revision 1.72.2.8
diff -u -r1.72.2.8 if_xl.c
--- if_xl.c	2001/10/27 03:31:34	1.72.2.8
+++ if_xl.c	2001/11/27 15:42:46
@@ -220,6 +220,8 @@
 static void xl_stop		__P((struct xl_softc *));
 static void xl_watchdog		__P((struct ifnet *));
 static void xl_shutdown		__P((device_t));
+static int xl_suspend		__P((device_t));
+static int xl_resume		__P((device_t));
 static int xl_ifmedia_upd	__P((struct ifnet *));
 static void xl_ifmedia_sts	__P((struct ifnet *, struct ifmediareq *));
 
@@ -266,6 +268,8 @@
 	DEVMETHOD(device_attach,	xl_attach),
 	DEVMETHOD(device_detach,	xl_detach),
 	DEVMETHOD(device_shutdown,	xl_shutdown),
+	DEVMETHOD(device_suspend,	xl_suspend),
+	DEVMETHOD(device_resume,	xl_resume),
 
 	/* bus interface */
 	DEVMETHOD(bus_print_child,	bus_generic_print_child),
@@ -2516,6 +2520,7 @@
 		printf("xl%d: initialization failed: no "
 			"memory for rx buffers\n", sc->xl_unit);
 		xl_stop(sc);
+		splx(s);
 		return;
 	}
 
@@ -2961,4 +2966,37 @@
 	xl_stop(sc);
 
 	return;
+}
+
+static int xl_suspend(dev)
+	device_t		dev;
+{
+	struct xl_softc		*sc;
+
+	sc = device_get_softc(dev);
+
+	s = splimp();
+	xl_stop(sc);
+	splx(s);
+
+	return(0);
+}
+
+static int xl_resume(dev)
+	device_t		dev;
+{
+	struct xl_softc		*sc;
+	struct ifnet		*ifp;
+	int			s;
+
+	s = splimp();
+	sc = device_get_softc(dev);
+	ifp = &sc->arpcom.ac_if;
+
+	xl_reset(sc);
+	if (ifp->if_flags & IFF_UP)
+		xl_init(sc);
+
+	splx(s);
+	return(0);
 }

--GvXjxJ+pjyke8COw--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




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