Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Manipulate the Tx desc pointer as 2 32-bit values...



details:   https://anonhg.NetBSD.org/src/rev/833f29357d65
branches:  trunk
changeset: 516172:833f29357d65
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Oct 18 03:33:33 2001 +0000

description:
Manipulate the Tx desc pointer as 2 32-bit values, just as
we do with the Rx desc pointer, both for consistency, and
for platforms which don't have bus_space_*_8().

diffstat:

 sys/dev/ic/gem.c    |  21 +++++++++++----------
 sys/dev/ic/gemreg.h |   5 +++--
 2 files changed, 14 insertions(+), 12 deletions(-)

diffs (61 lines):

diff -r 49e46ba10b30 -r 833f29357d65 sys/dev/ic/gem.c
--- a/sys/dev/ic/gem.c  Thu Oct 18 03:16:20 2001 +0000
+++ b/sys/dev/ic/gem.c  Thu Oct 18 03:33:33 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gem.c,v 1.3 2001/10/01 23:55:00 eeh Exp $ */
+/*     $NetBSD: gem.c,v 1.4 2001/10/18 03:33:33 thorpej Exp $ */
 
 /*
  * 
@@ -746,13 +746,12 @@
        gem_setladrf(sc);
 
        /* step 6 & 7. Program Descriptor Ring Base Addresses */
-       bus_space_write_8(t, h, GEM_TX_RING_PTR,
-               GEM_CDTXADDR(sc, 0));
-       /* Yeeech.  The following has endianness issues. */
-       bus_space_write_4(t, h, GEM_RX_RING_PTR_HI,
-               (((uint64_t)GEM_CDRXADDR(sc, 0))>>32));
-       bus_space_write_4(t, h, GEM_RX_RING_PTR_LO,
-               GEM_CDRXADDR(sc, 0));
+       /* NOTE: we use only 32-bit DMA addresses here. */
+       bus_space_write_4(t, h, GEM_TX_RING_PTR_HI, 0);
+       bus_space_write_4(t, h, GEM_TX_RING_PTR_LO, GEM_CDTXADDR(sc, 0));
+
+       bus_space_write_4(t, h, GEM_RX_RING_PTR_HI, 0);
+       bus_space_write_4(t, h, GEM_RX_RING_PTR_LO, GEM_CDRXADDR(sc, 0));
 
        /* step 8. Global Configuration & Interrupt Mask */
        bus_space_write_4(t, h, GEM_INTMASK,
@@ -1257,8 +1256,10 @@
                "GEM_TX_DATA_PTR %llx "
                "GEM_TX_COMPLETION %x\n",
                bus_space_read_4(sc->sc_bustag, sc->sc_h, GEM_TX_STATE_MACHINE),
-               (long long)bus_space_read_8(sc->sc_bustag, sc->sc_h,
-                       GEM_TX_DATA_PTR),
+               ((long long) bus_space_read_4(sc->sc_bustag, sc->sc_h,
+                       GEM_TX_DATA_PTR_HI) << 32) |
+                            bus_space_read_4(sc->sc_bustag, sc->sc_h,
+                       GEM_TX_DATA_PTR_LO),
                bus_space_read_4(sc->sc_bustag, sc->sc_h, GEM_TX_COMPLETION)));
 
        gem_start(ifp);
diff -r 49e46ba10b30 -r 833f29357d65 sys/dev/ic/gemreg.h
--- a/sys/dev/ic/gemreg.h       Thu Oct 18 03:16:20 2001 +0000
+++ b/sys/dev/ic/gemreg.h       Thu Oct 18 03:33:33 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gemreg.h,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
+/*     $NetBSD: gemreg.h,v 1.2 2001/10/18 03:33:33 thorpej Exp $ */
 
 /*
  * 
@@ -111,7 +111,8 @@
 /* GEM TX DMA registers */
 #define        GEM_TX_KICK             0x2000          /* Write last valid desc + 1 */
 #define        GEM_TX_CONFIG           0x2004
-#define        GEM_TX_RING_PTR         0x2008          /* 64-bits */
+#define        GEM_TX_RING_PTR_LO      0x2008
+#define        GEM_TX_RING_PTR_HI      0x200c
 
 #define        GEM_TX_FIFO_WR_PTR      0x2014          /* FIFO write pointer */
 #define        GEM_TX_FIFO_SDWR_PTR    0x2018          /* FIFO shadow write pointer */



Home | Main Index | Thread Index | Old Index