From ffe4fbf0fd848294a6037f0f2ca590f132d54203 Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Wed, 7 Aug 2002 16:08:54 +0000 Subject: [PATCH] Use new interface for ether_input(). Remove some unnecessary assignments to mbuf fields in sis_newbuf(), the "length" fields are of no use while the mbuf is in the receive ring. MFC after: 3 days --- sys/pci/if_sis.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index 380321884f6f..d9588666f6a6 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -1253,16 +1253,13 @@ static int sis_newbuf(sc, c, m) return(ENOBUFS); } else m->m_data = m->m_ext.ext_buf; - m->m_len = m->m_pkthdr.len = MCLBYTES; - - m_adj(m, sizeof(u_int64_t)); c->sis_mbuf = m; c->sis_ctl = SIS_RXLEN; bus_dmamap_create(sc->sis_tag, 0, &c->sis_map); bus_dmamap_load(sc->sis_tag, c->sis_map, - mtod(m, void *), m->m_len, + mtod(m, void *), MCLBYTES, sis_dma_map_desc_ptr, c, 0); bus_dmamap_sync(sc->sis_tag, c->sis_map, BUS_DMASYNC_PREWRITE); @@ -1276,7 +1273,6 @@ static int sis_newbuf(sc, c, m) static void sis_rxeof(sc) struct sis_softc *sc; { - struct ether_header *eh; struct mbuf *m; struct ifnet *ifp; struct sis_desc *cur_rx; @@ -1331,10 +1327,9 @@ static void sis_rxeof(sc) * if the allocation fails, then use m_devget and leave the * existing buffer in the receive ring. */ - if (sis_newbuf(sc, cur_rx, NULL) == 0) { - m->m_pkthdr.rcvif = ifp; + if (sis_newbuf(sc, cur_rx, NULL) == 0) m->m_pkthdr.len = m->m_len = total_len; - } else + else #endif { struct mbuf *m0; @@ -1349,11 +1344,7 @@ static void sis_rxeof(sc) } ifp->if_ipackets++; - eh = mtod(m, struct ether_header *); - - /* Remove header from mbuf and pass it on. */ - m_adj(m, sizeof(struct ether_header)); - ether_input(ifp, eh, m); + ether_input(ifp, NULL, m); } sc->sis_cdata.sis_rx_prod = i;