From 43b462df88322b896ee3499a16b408d27757469c Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 28 Sep 1998 18:01:43 +0000 Subject: [PATCH] Insert the FDDI control bytes in pdq_ifstart before we load the dmamap and dmasync the data. Fix pdq_os_receive_pdu to use PDQ_OS_HDR_OFFSET instead of PDQ_RX_FC_OFFSET. --- sys/dev/ic/pdq.c | 6 +----- sys/dev/ic/pdq_ifsubr.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/sys/dev/ic/pdq.c b/sys/dev/ic/pdq.c index a1503271de7b..935b2c536487 100644 --- a/sys/dev/ic/pdq.c +++ b/sys/dev/ic/pdq.c @@ -1,4 +1,4 @@ -/* $NetBSD: pdq.c,v 1.22 1998/09/28 17:13:54 matt Exp $ */ +/* $NetBSD: pdq.c,v 1.23 1998/09/28 18:01:43 matt Exp $ */ /*- * Copyright (c) 1995,1996 Matt Thomas @@ -916,10 +916,6 @@ pdq_queue_transmit_data( dbp->pdqdb_transmits[producer] = tx->tx_hdrdesc; PDQ_OS_DESC_PRESYNC(pdq, &dbp->pdqdb_transmits[producer], sizeof(pdq_txdesc_t)); PDQ_ADVANCE(producer, 1, PDQ_RING_MASK(dbp->pdqdb_transmits)); - } else { - PDQ_OS_DATABUF_PTR(pdu)[0] = PDQ_FDDI_PH0; - PDQ_OS_DATABUF_PTR(pdu)[1] = PDQ_FDDI_PH1; - PDQ_OS_DATABUF_PTR(pdu)[2] = PDQ_FDDI_PH2; } #if defined(PDQ_BUS_DMA) diff --git a/sys/dev/ic/pdq_ifsubr.c b/sys/dev/ic/pdq_ifsubr.c index 1843665489e3..7d703660f903 100644 --- a/sys/dev/ic/pdq_ifsubr.c +++ b/sys/dev/ic/pdq_ifsubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: pdq_ifsubr.c,v 1.23 1998/09/28 17:13:55 matt Exp $ */ +/* $NetBSD: pdq_ifsubr.c,v 1.24 1998/09/28 18:01:44 matt Exp $ */ /*- * Copyright (c) 1995, 1996 Matt Thomas @@ -195,6 +195,11 @@ pdq_ifstart( #if defined(PDQ_BUS_DMA) && !defined(PDQ_BUS_DMA_NOTX) if ((m->m_flags & M_HASTXDMAMAP) == 0) { bus_dmamap_t map; + if (PDQ_OS_HDR_OFFSET != PDQ_RX_FC_OFFSET) { + m->m_data[0] = PDQ_FDDI_PH0; + m->m_data[1] = PDQ_FDDI_PH1; + m->m_data[2] = PDQ_FDDI_PH2; + } if (!bus_dmamap_create(sc->sc_dmatag, m->m_pkthdr.len, 255, m->m_pkthdr.len, 0, BUS_DMA_NOWAIT, &map)) { if (!bus_dmamap_load_mbuf(sc->sc_dmatag, map, m, BUS_DMA_NOWAIT)) { @@ -207,6 +212,12 @@ pdq_ifstart( if ((m->m_flags & M_HASTXDMAMAP) == 0) break; } +#else + if (PDQ_OS_HDR_OFFSET != PDQ_RX_FC_OFFSET) { + m->m_data[0] = PDQ_FDDI_PH0; + m->m_data[1] = PDQ_FDDI_PH1; + m->m_data[2] = PDQ_FDDI_PH2; + } #endif if (pdq_queue_transmit_data(sc->sc_pdq, m) == PDQ_FALSE) @@ -234,11 +245,11 @@ pdq_os_receive_pdu( #if defined(PDQ_BUS_DMA) { /* - * Even though the first mbuf start at the frame control octet, - * the dmamap PDQ_RX_FC_OFFSET octets earlier. Any additional + * Even though the first mbuf start at the first fddi header octet, + * the dmamap starts PDQ_OS_HDR_OFFSET octets earlier. Any additional * mbufs will start normally. */ - int offset = PDQ_RX_FC_OFFSET; + int offset = PDQ_OS_HDR_OFFSET; struct mbuf *m0; for (m0 = m; m0 != NULL; m0 = m0->m_next, offset = 0) { pdq_os_databuf_sync(sc, m0, offset, m0->m_len, BUS_DMASYNC_POSTREAD);