Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/omap purge the transmit queue in cpsw_stop()



details:   https://anonhg.NetBSD.org/src/rev/0d22d919de74
branches:  trunk
changeset: 784173:0d22d919de74
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Jan 20 22:32:59 2013 +0000

description:
purge the transmit queue in cpsw_stop()

diffstat:

 sys/arch/arm/omap/if_cpsw.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r b5be9371a85b -r 0d22d919de74 sys/arch/arm/omap/if_cpsw.c
--- a/sys/arch/arm/omap/if_cpsw.c       Sun Jan 20 21:50:41 2013 +0000
+++ b/sys/arch/arm/omap/if_cpsw.c       Sun Jan 20 22:32:59 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cpsw.c,v 1.1 2013/01/03 21:13:26 jakllsch Exp $     */
+/*     $NetBSD: if_cpsw.c,v 1.2 2013/01/20 22:32:59 jakllsch Exp $     */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.1 2013/01/03 21:13:26 jakllsch Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.2 2013/01/20 22:32:59 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -958,6 +958,13 @@
        cpsw_write_4(sc, CPSW_CPDMA_SOFT_RESET, 1);
        while(cpsw_read_4(sc, CPSW_CPDMA_SOFT_RESET) & 1);
 
+       /* Release any queued transmit buffers. */
+       for (i = 0; i < CPSW_NTXDESCS; i++) {
+               bus_dmamap_unload(sc->sc_bdt, rdp->tx_dm[i]);
+               m_freem(rdp->tx_mb[i]);
+               rdp->tx_mb[i] = NULL;
+       }
+
        ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
        ifp->if_timer = 0;
 



Home | Main Index | Thread Index | Old Index