diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-07-10 18:15:00 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-07-10 18:15:00 +0000 |
commit | a46d7e0a6d703ef0680ffb2f8f068906febe8b6f (patch) | |
tree | a32a6940f051eb0c632fe16a6e68b54da54919d2 /sys/dev/pci/if_sis.c | |
parent | ea0cf594d6bc3f3dbf568830f31c21060c7f6bfc (diff) |
move a common statement out of if/else;
adjust the mbuf before loading it, with bus_dmamap_load_mbuf(),
that way we dont have to fiddle with ds_addr;
ok dlg@
Diffstat (limited to 'sys/dev/pci/if_sis.c')
-rw-r--r-- | sys/dev/pci/if_sis.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 82aac88ac85..685dc5c3970 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.78 2008/07/07 12:53:43 thib Exp $ */ +/* $OpenBSD: if_sis.c,v 1.79 2008/07/10 18:14:59 thib Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -1251,13 +1251,15 @@ sis_newbuf(struct sis_softc *sc, struct sis_desc *c, struct mbuf *m) m_freem(m_new); return (ENOBUFS); } - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; } else { m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; m_new->m_data = m_new->m_ext.ext_buf; } + m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; + + m_adj(m_new, sizeof(u_int64_t)); + if (bus_dmamap_load_mbuf(sc->sc_dmat, sc->sc_rx_sparemap, m_new, BUS_DMA_NOWAIT)) { m_freem(m_new); @@ -1271,10 +1273,8 @@ sis_newbuf(struct sis_softc *sc, struct sis_desc *c, struct mbuf *m) bus_dmamap_sync(sc->sc_dmat, c->map, 0, c->map->dm_mapsize, BUS_DMASYNC_PREREAD); - m_adj(m_new, sizeof(u_int64_t)); - c->sis_mbuf = m_new; - c->sis_ptr = c->map->dm_segs[0].ds_addr + sizeof(u_int64_t); + c->sis_ptr = c->map->dm_segs[0].ds_addr; c->sis_ctl = ETHER_MAX_DIX_LEN; bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap, |