diff options
| author | martin <martin@NetBSD.org> | 2022-07-20 18:48:41 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2022-07-20 18:48:41 +0000 |
| commit | b56d49ecfda394a6c342b31d86f5a6cd7b14a9e1 (patch) | |
| tree | d73f5727a227f4126f1320add5c769e433016fca /sys/dev | |
| parent | fb88e504d4b7990b6dd1c3f24f2a4cfbcb915dd1 (diff) | |
When we init the hardware's rx/tx ring configuration we need to
adjust our internal state, as this implicitly resets the current
descriptor pointer.
Previously "ifconfig eqos0 down; ifconfig eqos0 up" made the interface
non-functional.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/dwc_eqos.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/ic/dwc_eqos.c b/sys/dev/ic/dwc_eqos.c index c28a7a826d7..609cd814414 100644 --- a/sys/dev/ic/dwc_eqos.c +++ b/sys/dev/ic/dwc_eqos.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwc_eqos.c,v 1.6 2022/04/16 23:20:47 jmcneill Exp $ */ +/* $NetBSD: dwc_eqos.c,v 1.7 2022/07/20 18:48:41 martin Exp $ */ /*- * Copyright (c) 2022 Jared McNeill <jmcneill@invisible.ca> @@ -33,7 +33,7 @@ #include "opt_net_mpsafe.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.6 2022/04/16 23:20:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc_eqos.c,v 1.7 2022/07/20 18:48:41 martin Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -510,7 +510,13 @@ eqos_reset(struct eqos_softc *sc) static void eqos_init_rings(struct eqos_softc *sc, int qid) { - sc->sc_tx.queued = 0; + /* + * We reset the rings paddr, this implicitly resets + * the hardwares current descriptor pointer. + * Adjust our internal state accordingly. + */ + sc->sc_tx.cur = sc->sc_tx.next = sc->sc_tx.queued = 0; + sc->sc_rx.cur = sc->sc_rx.next = sc->sc_rx.queued = 0; WR4(sc, GMAC_DMA_CHAN0_TX_BASE_ADDR_HI, (uint32_t)(sc->sc_tx.desc_ring_paddr >> 32)); |
