Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jan 2011 23:47:11 +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: r217247 - head/sys/dev/re
Message-ID:  <201101102347.p0ANlBR1099355@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Mon Jan 10 23:47:11 2011
New Revision: 217247
URL: http://svn.freebsd.org/changeset/base/217247

Log:
  When driver is not running, do not send DUMP command to controller
  and just show old (cached) values. Controller will not respond to
  the command unless MAC is enabled so DUMP request for down
  interface caused request timeout.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==============================================================================
--- head/sys/dev/re/if_re.c	Mon Jan 10 23:28:46 2011	(r217246)
+++ head/sys/dev/re/if_re.c	Mon Jan 10 23:47:11 2011	(r217247)
@@ -3278,6 +3278,10 @@ re_sysctl_stats(SYSCTL_HANDLER_ARGS)
 	if (result == 1) {
 		sc = (struct rl_softc *)arg1;
 		RL_LOCK(sc);
+		if ((sc->rl_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
+			RL_UNLOCK(sc);
+			goto done;
+		}
 		bus_dmamap_sync(sc->rl_ldata.rl_stag,
 		    sc->rl_ldata.rl_smap, BUS_DMASYNC_PREREAD);
 		CSR_WRITE_4(sc, RL_DUMPSTATS_HI,
@@ -3301,6 +3305,7 @@ re_sysctl_stats(SYSCTL_HANDLER_ARGS)
 			    "DUMP statistics request timedout\n");
 			return (ETIMEDOUT);
 		}
+done:
 		stats = sc->rl_ldata.rl_stats;
 		printf("%s statistics:\n", device_get_nameunit(sc->rl_dev));
 		printf("Tx frames : %ju\n",



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