Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Put the rx buf pointer into the softc directly.



details:   https://anonhg.NetBSD.org/src/rev/2b03b692a0fa
branches:  trunk
changeset: 503159:2b03b692a0fa
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Feb 02 03:51:51 2001 +0000

description:
Put the rx buf pointer into the softc directly.

diffstat:

 sys/dev/ic/rtl81x9.c    |  16 ++++++++--------
 sys/dev/ic/rtl81x9var.h |  12 +++++++-----
 2 files changed, 15 insertions(+), 13 deletions(-)

diffs (108 lines):

diff -r cf6ebd2cd6ba -r 2b03b692a0fa sys/dev/ic/rtl81x9.c
--- a/sys/dev/ic/rtl81x9.c      Fri Feb 02 03:35:24 2001 +0000
+++ b/sys/dev/ic/rtl81x9.c      Fri Feb 02 03:51:51 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl81x9.c,v 1.29 2001/02/01 04:45:17 thorpej Exp $     */
+/*     $NetBSD: rtl81x9.c,v 1.30 2001/02/02 03:51:51 thorpej Exp $     */
 
 /*
  * Copyright (c) 1997, 1998
@@ -668,7 +668,7 @@
        }
 
        if ((error = bus_dmamem_map(sc->sc_dmat, &sc->sc_dmaseg, sc->sc_dmanseg,
-           RTK_RXBUFLEN + 16, (caddr_t *)&sc->rtk_cdata.rtk_rx_buf,
+           RTK_RXBUFLEN + 16, (caddr_t *)&sc->rtk_rx_buf,
            BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) {
                printf("%s: can't map recv buffer, error = %d\n",
                       sc->sc_dev.dv_xname, error);
@@ -684,7 +684,7 @@
        }
 
        if ((error = bus_dmamap_load(sc->sc_dmat, sc->recv_dmamap,
-           sc->rtk_cdata.rtk_rx_buf, RTK_RXBUFLEN + 16,
+           sc->rtk_rx_buf, RTK_RXBUFLEN + 16,
            NULL, BUS_DMA_NOWAIT)) != 0) {
                printf("%s: can't load recv buffer DMA map, error = %d\n",
                       sc->sc_dev.dv_xname, error);
@@ -772,7 +772,7 @@
  fail_3:
        bus_dmamap_destroy(sc->sc_dmat, sc->recv_dmamap);
  fail_2:
-       bus_dmamem_unmap(sc->sc_dmat, (caddr_t)sc->rtk_cdata.rtk_rx_buf,
+       bus_dmamem_unmap(sc->sc_dmat, (caddr_t)sc->rtk_rx_buf,
            RTK_RXBUFLEN + 16);
  fail_1:
        bus_dmamem_free(sc->sc_dmat, &sc->sc_dmaseg, sc->sc_dmanseg);
@@ -862,7 +862,7 @@
                if (sc->snd_dmamap[i] != NULL)
                        bus_dmamap_destroy(sc->sc_dmat, sc->snd_dmamap[i]);
        bus_dmamap_destroy(sc->sc_dmat, sc->recv_dmamap);
-       bus_dmamem_unmap(sc->sc_dmat, (caddr_t)sc->rtk_cdata.rtk_rx_buf,
+       bus_dmamem_unmap(sc->sc_dmat, (caddr_t)sc->rtk_rx_buf,
            RTK_RXBUFLEN + 16);
        bus_dmamem_free(sc->sc_dmat, &sc->sc_dmaseg, sc->sc_dmanseg);
 
@@ -988,7 +988,7 @@
                max_bytes = limit - cur_rx;
 
        while((CSR_READ_1(sc, RTK_COMMAND) & RTK_CMD_EMPTY_RXBUF) == 0) {
-               rxbufpos = sc->rtk_cdata.rtk_rx_buf + cur_rx;
+               rxbufpos = sc->rtk_rx_buf + cur_rx;
                bus_dmamap_sync(sc->sc_dmat, sc->recv_dmamap, cur_rx,
                    RTK_RXSTAT_LEN, BUS_DMASYNC_POSTREAD);
                rxstat = le32toh(*(u_int32_t *)rxbufpos);
@@ -1052,7 +1052,7 @@
                 * of the Rx area, if necessary.
                 */
                cur_rx = (cur_rx + RTK_RXSTAT_LEN) % RTK_RXBUFLEN;
-               rxbufpos = sc->rtk_cdata.rtk_rx_buf + cur_rx;
+               rxbufpos = sc->rtk_rx_buf + cur_rx;
 
                /*
                 * Compute the number of bytes at which the packet
@@ -1108,7 +1108,7 @@
                        bus_dmamap_sync(sc->sc_dmat, sc->recv_dmamap,
                            cur_rx, wrap, BUS_DMASYNC_PREREAD);
                        cur_rx = 0;
-                       rxbufpos = sc->rtk_cdata.rtk_rx_buf;
+                       rxbufpos = sc->rtk_rx_buf;
                        total_len -= wrap;
                        dst += wrap;
                }
diff -r cf6ebd2cd6ba -r 2b03b692a0fa sys/dev/ic/rtl81x9var.h
--- a/sys/dev/ic/rtl81x9var.h   Fri Feb 02 03:35:24 2001 +0000
+++ b/sys/dev/ic/rtl81x9var.h   Fri Feb 02 03:51:51 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl81x9var.h,v 1.7 2000/12/05 11:11:49 tsutsui Exp $   */
+/*     $NetBSD: rtl81x9var.h,v 1.8 2001/02/02 03:51:51 thorpej Exp $   */
 
 /*
  * Copyright (c) 1997, 1998
@@ -38,8 +38,6 @@
 #define RTK_RXSTAT_LEN 4
 
 struct rtk_chain_data {
-       caddr_t                 rtk_rx_buf;
-
        struct mbuf             *rtk_tx_chain[RTK_TX_LIST_CNT];
        int                     last_tx;
        int                     cur_tx;
@@ -88,11 +86,15 @@
        bus_space_handle_t      rtk_bhandle;    /* bus space handle */
        bus_space_tag_t         rtk_btag;       /* bus space tag */
        int                     rtk_type;
-       struct rtk_chain_data   rtk_cdata;
        bus_dma_tag_t           sc_dmat;
        bus_dma_segment_t       sc_dmaseg;
        int                     sc_dmanseg;
-       bus_dmamap_t            recv_dmamap, snd_dmamap[RTK_TX_LIST_CNT];
+
+       bus_dmamap_t            recv_dmamap;
+       caddr_t                 rtk_rx_buf;
+
+       struct rtk_chain_data   rtk_cdata;
+       bus_dmamap_t            snd_dmamap[RTK_TX_LIST_CNT];
 
        int                     sc_flags;       /* misc flags */
        void    *sc_sdhook;                     /* shutdown hook */



Home | Main Index | Thread Index | Old Index