summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sis.c
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2002-08-07 16:08:54 +0000
committerluigi <luigi@FreeBSD.org>2002-08-07 16:08:54 +0000
commit2573e2eec1684106b501be3367ecd8f50679ee50 (patch)
tree7ffccac5199fb61c181ac1c72a3bd7a4e5bfb89b /sys/pci/if_sis.c
parent3b1b4edbda15bfa01c809139deb203e053d02728 (diff)
downloadFreeBSD-src-2573e2eec1684106b501be3367ecd8f50679ee50.zip
FreeBSD-src-2573e2eec1684106b501be3367ecd8f50679ee50.tar.gz
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
Diffstat (limited to 'sys/pci/if_sis.c')
-rw-r--r--sys/pci/if_sis.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 3803218..d958866 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;
OpenPOWER on IntegriCloud