diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-10-21 22:10:57 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-10-21 22:10:57 +0000 |
commit | 8fbbc4b0a9bdd43d5eb7fb5f54fed9e1456ff87d (patch) | |
tree | 1cd9f778fa364d52236504ba2dd8cd7cb5519a67 /sys | |
parent | 3a1daf896c40b23624423295c78629a1cfd97bb2 (diff) |
tidy up dmesg printing a bit, makes PCI hme only take 2 lines
per interface instead of 3.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/hme.c | 17 | ||||
-rw-r--r-- | sys/dev/pci/if_hme_pci.c | 22 | ||||
-rw-r--r-- | sys/dev/sbus/if_hme_sbus.c | 5 |
3 files changed, 19 insertions, 25 deletions
diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c index 6253bbf39da..e1c096d9298 100644 --- a/sys/dev/ic/hme.c +++ b/sys/dev/ic/hme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hme.c,v 1.38 2005/06/26 04:27:19 brad Exp $ */ +/* $OpenBSD: hme.c,v 1.39 2005/10/21 22:10:56 brad Exp $ */ /* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */ /*- @@ -160,7 +160,6 @@ hme_config(sc) /* Make sure the chip is stopped. */ hme_stop(sc); - for (i = 0; i < HME_TX_RING_SIZE; i++) { if (bus_dmamap_create(sc->sc_dmatag, MCLBYTES, 1, MCLBYTES, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, @@ -196,7 +195,7 @@ hme_config(sc) /* Allocate DMA buffer */ if ((error = bus_dmamem_alloc(dmatag, size, 2048, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) != 0) { - printf("%s: DMA buffer alloc error %d\n", + printf("\n%s: DMA buffer alloc error %d\n", sc->sc_dev.dv_xname, error); return; } @@ -204,7 +203,7 @@ hme_config(sc) /* Map DMA memory in CPU addressable space */ if ((error = bus_dmamem_map(dmatag, &seg, rseg, size, &sc->sc_rb.rb_membase, BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) { - printf("%s: DMA buffer map error %d\n", + printf("\n%s: DMA buffer map error %d\n", sc->sc_dev.dv_xname, error); bus_dmamap_unload(dmatag, sc->sc_dmamap); bus_dmamem_free(dmatag, &seg, rseg); @@ -213,7 +212,7 @@ hme_config(sc) if ((error = bus_dmamap_create(dmatag, size, 1, size, 0, BUS_DMA_NOWAIT, &sc->sc_dmamap)) != 0) { - printf("%s: DMA map create error %d\n", + printf("\n%s: DMA map create error %d\n", sc->sc_dev.dv_xname, error); return; } @@ -222,14 +221,14 @@ hme_config(sc) if ((error = bus_dmamap_load(dmatag, sc->sc_dmamap, sc->sc_rb.rb_membase, size, NULL, BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0) { - printf("%s: DMA buffer map load error %d\n", + printf("\n%s: DMA buffer map load error %d\n", sc->sc_dev.dv_xname, error); bus_dmamem_free(dmatag, &seg, rseg); return; } sc->sc_rb.rb_dmabase = sc->sc_dmamap->dm_segs[0].ds_addr; - printf(": address %s\n", ether_sprintf(sc->sc_enaddr)); + printf(", address %s\n", ether_sprintf(sc->sc_enaddr)); /* Initialize ifnet structure. */ strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, sizeof ifp->if_xname); @@ -885,10 +884,8 @@ hme_rint(sc) #endif #if NBPFILTER > 0 - if (ifp->if_bpf) { - m->m_pkthdr.len = m->m_len = len; + if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m); - } #endif ether_input_mbuf(ifp, m); diff --git a/sys/dev/pci/if_hme_pci.c b/sys/dev/pci/if_hme_pci.c index f6679db70cc..d70d04033ba 100644 --- a/sys/dev/pci/if_hme_pci.c +++ b/sys/dev/pci/if_hme_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_hme_pci.c,v 1.8 2003/02/14 21:05:12 henric Exp $ */ +/* $OpenBSD: if_hme_pci.c,v 1.9 2005/10/21 22:10:56 brad Exp $ */ /* $NetBSD: if_hme_pci.c,v 1.3 2000/12/28 22:59:13 sommerfeld Exp $ */ /* @@ -280,29 +280,25 @@ hmeattach_pci(parent, self, aux) sc->sc_burst = 16; /* XXX */ - /* - * call the main configure - */ - hme_config(sc); - if (pci_intr_map(pa, &intrhandle) != 0) { - printf("%s: couldn't map interrupt\n", - sc->sc_dev.dv_xname); + printf(": couldn't map interrupt\n"); return; /* bus_unmap ? */ } intrstr = pci_intr_string(pa->pa_pc, intrhandle); hsc->hsc_ih = pci_intr_establish(pa->pa_pc, intrhandle, IPL_NET, hme_intr, sc, self->dv_xname); if (hsc->hsc_ih != NULL) { - printf("%s: using %s for interrupt\n", - sc->sc_dev.dv_xname, - intrstr ? intrstr : "unknown interrupt"); + printf(": %s", intrstr ? intrstr : "unknown interrupt"); } else { - printf("%s: couldn't establish interrupt", - sc->sc_dev.dv_xname); + printf(": couldn't establish interrupt"); if (intrstr != NULL) printf(" at %s", intrstr); printf("\n"); return; /* bus_unmap ? */ } + + /* + * call the main configure + */ + hme_config(sc); } diff --git a/sys/dev/sbus/if_hme_sbus.c b/sys/dev/sbus/if_hme_sbus.c index 3ad7e09daeb..f7383ddabff 100644 --- a/sys/dev/sbus/if_hme_sbus.c +++ b/sys/dev/sbus/if_hme_sbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_hme_sbus.c,v 1.8 2005/04/01 18:09:52 brad Exp $ */ +/* $OpenBSD: if_hme_sbus.c,v 1.9 2005/10/21 22:10:56 brad Exp $ */ /* $NetBSD: if_hme_sbus.c,v 1.6 2001/02/28 14:52:48 mrg Exp $ */ /*- @@ -193,10 +193,11 @@ hmeattach_sbus(struct device *parent, struct device *self, void *aux) sc->sc_burst = 0; sc->sc_pci = 0; /* XXXXX should all be done in bus_dma. */ - hme_config(sc); /* Establish interrupt handler */ if (sa->sa_nintr != 0) (void)bus_intr_establish(sa->sa_bustag, sa->sa_pri, IPL_NET, 0, hme_intr, sc, self->dv_xname); + + hme_config(sc); } |