Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/rockchip fix a couple txq fencepost issues, fro...



details:   https://anonhg.NetBSD.org/src/rev/2deb6d9f003c
branches:  trunk
changeset: 335477:2deb6d9f003c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Jan 08 14:17:42 2015 +0000

description:
fix a couple txq fencepost issues, from FUKAUMI Naoki <fun%naobsd.org@localhost>

diffstat:

 sys/arch/arm/rockchip/rockchip_emac.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 07657b267661 -r 2deb6d9f003c sys/arch/arm/rockchip/rockchip_emac.c
--- a/sys/arch/arm/rockchip/rockchip_emac.c     Thu Jan 08 13:37:54 2015 +0000
+++ b/sys/arch/arm/rockchip/rockchip_emac.c     Thu Jan 08 14:17:42 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rockchip_emac.c,v 1.8 2015/01/08 13:37:54 jmcneill Exp $ */
+/* $NetBSD: rockchip_emac.c,v 1.9 2015/01/08 14:17:42 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_rkemac.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rockchip_emac.c,v 1.8 2015/01/08 13:37:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rockchip_emac.c,v 1.9 2015/01/08 14:17:42 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -701,7 +701,7 @@
        const u_int nbufs = map->dm_nsegs +
            ((m0->m_pkthdr.len < ETHER_MIN_LEN) ? 1 : 0);
 
-       if (sc->sc_txq.t_queued + nbufs >= RKEMAC_TX_RING_COUNT - 1) {
+       if (sc->sc_txq.t_queued + nbufs >= RKEMAC_TX_RING_COUNT) {
                bus_dmamap_unload(sc->sc_dmat, map);
                return ENOBUFS;
        }
@@ -758,7 +758,7 @@
        }
        bus_dmamap_sync(sc->sc_dmat, sc->sc_ring_dmamap,
            TX_DESC_OFFSET(start),
-           TX_DESC_OFFSET(RKEMAC_TX_RING_COUNT + 1) - TX_DESC_OFFSET(start),
+           TX_DESC_OFFSET(RKEMAC_TX_RING_COUNT) - TX_DESC_OFFSET(start),
            ops);
        bus_dmamap_sync(sc->sc_dmat, sc->sc_ring_dmamap,
            TX_DESC_OFFSET(0), TX_DESC_OFFSET(end) - TX_DESC_OFFSET(0), ops);



Home | Main Index | Thread Index | Old Index