Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Oct 2008 03:06:47 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184243 - head/sys/pci
Message-ID:  <200810250306.m9P36l58008770@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Sat Oct 25 03:06:47 2008
New Revision: 184243
URL: http://svn.freebsd.org/changeset/base/184243

Log:
  After sending stop command to MAC, give hardware chance to drain
  active DMA operation.

Modified:
  head/sys/pci/if_rl.c

Modified: head/sys/pci/if_rl.c
==============================================================================
--- head/sys/pci/if_rl.c	Sat Oct 25 02:52:06 2008	(r184242)
+++ head/sys/pci/if_rl.c	Sat Oct 25 03:06:47 2008	(r184243)
@@ -1834,6 +1834,14 @@ rl_stop(struct rl_softc *sc)
 
 	CSR_WRITE_1(sc, RL_COMMAND, 0x00);
 	CSR_WRITE_2(sc, RL_IMR, 0x0000);
+	for (i = 0; i < RL_TIMEOUT; i++) {
+		DELAY(10);
+		if ((CSR_READ_1(sc, RL_COMMAND) &
+		    (RL_CMD_RX_ENB | RL_CMD_TX_ENB)) == 0)
+			break;
+	}
+	if (i == RL_TIMEOUT)
+		device_printf(sc->rl_dev, "Unable to stop Tx/Rx MAC\n");
 
 	/*
 	 * Free the TX list buffers.



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