From: thib Date: Mon, 7 Jul 2008 12:53:43 +0000 (+0000) Subject: Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() when X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=63bef9edfac0c7f0cdbfb135d6f79f18b033f2aa;p=openbsd Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() when we want too load an mbuf; remove a printf that fires in case we can't load the mbuf (We do error handling and recovery). ok brad@, dlg@ --- diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 99230029dc9..82aac88ac85 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.77 2007/05/04 12:12:53 art Exp $ */ +/* $OpenBSD: if_sis.c,v 1.78 2008/07/07 12:53:43 thib Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. @@ -1258,12 +1258,12 @@ sis_newbuf(struct sis_softc *sc, struct sis_desc *c, struct mbuf *m) m_new->m_data = m_new->m_ext.ext_buf; } - if (bus_dmamap_load(sc->sc_dmat, sc->sc_rx_sparemap, - mtod(m_new, caddr_t), MCLBYTES, NULL, BUS_DMA_NOWAIT) != 0) { - printf("%s: rx load failed\n", sc->sc_dev.dv_xname); + if (bus_dmamap_load_mbuf(sc->sc_dmat, sc->sc_rx_sparemap, m_new, + BUS_DMA_NOWAIT)) { m_freem(m_new); return (ENOBUFS); } + map = c->map; c->map = sc->sc_rx_sparemap; sc->sc_rx_sparemap = map;