Module Name: src Committed By: christos Date: Sun Feb 23 15:29:12 UTC 2014
Modified Files: src/sys/dev/ic: arn5008.c arn9003.c athn.c Log Message: use aprint. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/arn5008.c src/sys/dev/ic/arn9003.c cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/athn.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/arn5008.c diff -u src/sys/dev/ic/arn5008.c:1.5 src/sys/dev/ic/arn5008.c:1.6 --- src/sys/dev/ic/arn5008.c:1.5 Tue Oct 22 09:04:25 2013 +++ src/sys/dev/ic/arn5008.c Sun Feb 23 10:29:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: arn5008.c,v 1.5 2013/10/22 13:04:25 skrll Exp $ */ +/* $NetBSD: arn5008.c,v 1.6 2014/02/23 15:29:11 christos Exp $ */ /* $OpenBSD: ar5008.c,v 1.21 2012/08/25 12:14:31 kettenis Exp $ */ /*- @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.5 2013/10/22 13:04:25 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.6 2014/02/23 15:29:11 christos Exp $"); #include <sys/param.h> #include <sys/sockio.h> @@ -210,7 +210,7 @@ ar5008_attach(struct athn_softc *sc) /* Read entire ROM content in memory. */ if ((error = ar5008_read_rom(sc)) != 0) { - printf("%s: could not read ROM\n", device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, "could not read ROM\n"); return error; } @@ -221,8 +221,8 @@ ar5008_attach(struct athn_softc *sc) eep_ver = (base->version >> 12) & 0xf; sc->sc_eep_rev = (base->version & 0xfff); if (eep_ver != AR_EEP_VER || sc->sc_eep_rev == 0) { - printf("%s: unsupported ROM version %d.%d\n", - device_xname(sc->sc_dev), eep_ver, sc->sc_eep_rev); + aprint_error_dev(sc->sc_dev, "unsupported ROM version %d.%d\n", + eep_ver, sc->sc_eep_rev); return EINVAL; } @@ -330,8 +330,7 @@ ar5008_read_rom(struct athn_softc *sc) sum ^= *eep; } if (sum != 0xffff) { - printf("%s: bad ROM checksum 0x%04x\n", - device_xname(sc->sc_dev), sum); + aprint_error_dev(sc->sc_dev, "bad ROM checksum 0x%04x\n", sum); return EIO; } if (need_swap) @@ -532,8 +531,8 @@ ar5008_tx_alloc(struct athn_softc *sc) AR5008_MAX_SCATTER, ATHN_TXBUFSZ, 0, BUS_DMA_NOWAIT, &bf->bf_map); if (error != 0) { - printf("%s: could not create Tx buf DMA map\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + "could not create Tx buf DMA map\n"); goto fail; } @@ -620,8 +619,8 @@ ar5008_rx_alloc(struct athn_softc *sc) ATHN_RXBUFSZ, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &bf->bf_map); if (error != 0) { - printf("%s: could not create Rx buf DMA map\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + " could not create Rx buf DMA map\n"); goto fail; } /* @@ -630,8 +629,8 @@ ar5008_rx_alloc(struct athn_softc *sc) */ bf->bf_m = MCLGETI(NULL, M_DONTWAIT, NULL, ATHN_RXBUFSZ); if (bf->bf_m == NULL) { - printf("%s: could not allocate Rx mbuf\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + "could not allocate Rx mbuf\n"); error = ENOBUFS; goto fail; } @@ -640,8 +639,8 @@ ar5008_rx_alloc(struct athn_softc *sc) mtod(bf->bf_m, void *), ATHN_RXBUFSZ, NULL, BUS_DMA_NOWAIT | BUS_DMA_READ); if (error != 0) { - printf("%s: could not DMA map Rx buffer\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + "could not DMA map Rx buffer\n"); goto fail; } @@ -802,7 +801,7 @@ ar5008_rx_process(struct athn_softc *sc) bf = SIMPLEQ_FIRST(&rxq->head); if (__predict_false(bf == NULL)) { /* Should not happen. */ - printf("%s: Rx queue is empty!\n", device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, "Rx queue is empty!\n"); return ENOENT; } ds = bf->bf_desc; @@ -1393,8 +1392,8 @@ ar5008_tx(struct athn_softc *sc, struct BUS_DMA_NOWAIT | BUS_DMA_WRITE); if (__predict_false(error != 0)) { if (error != EFBIG) { - printf("%s: can't map mbuf (error %d)\n", - device_xname(sc->sc_dev), error); + aprint_error_dev(sc->sc_dev, + "can't map mbuf (error %d)\n", error); m_freem(m); return error; } @@ -1423,8 +1422,8 @@ ar5008_tx(struct athn_softc *sc, struct error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_map, m, BUS_DMA_NOWAIT | BUS_DMA_WRITE); if (error != 0) { - printf("%s: can't map mbuf (error %d)\n", - device_xname(sc->sc_dev), error); + aprint_error_dev(sc->sc_dev, + "can't map mbuf (error %d)\n", error); m_freem(m); return error; } Index: src/sys/dev/ic/arn9003.c diff -u src/sys/dev/ic/arn9003.c:1.5 src/sys/dev/ic/arn9003.c:1.6 --- src/sys/dev/ic/arn9003.c:1.5 Tue Oct 22 09:04:25 2013 +++ src/sys/dev/ic/arn9003.c Sun Feb 23 10:29:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: arn9003.c,v 1.5 2013/10/22 13:04:25 skrll Exp $ */ +/* $NetBSD: arn9003.c,v 1.6 2014/02/23 15:29:12 christos Exp $ */ /* $OpenBSD: ar9003.c,v 1.25 2012/10/20 09:53:32 stsp Exp $ */ /*- @@ -24,7 +24,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.5 2013/10/22 13:04:25 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.6 2014/02/23 15:29:12 christos Exp $"); #include <sys/param.h> #include <sys/sockio.h> @@ -228,12 +228,12 @@ ar9003_attach(struct athn_softc *sc) /* Determine ROM type and location. */ if ((error = ar9003_find_rom(sc)) != 0) { - printf("%s: could not find ROM\n", device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, "could not find ROM\n"); return error; } /* Read entire ROM content in memory. */ if ((error = ar9003_read_rom(sc)) != 0) { - printf("%s: could not read ROM\n", device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, "could not read ROM\n"); return error; } @@ -694,8 +694,8 @@ ar9003_tx_alloc(struct athn_softc *sc) AR9003_MAX_SCATTER, ATHN_TXBUFSZ, 0, BUS_DMA_NOWAIT, &bf->bf_map); if (error != 0) { - printf("%s: could not create Tx buf DMA map\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + "could not create Tx buf DMA map\n"); goto fail; } @@ -766,8 +766,8 @@ ar9003_rx_alloc(struct athn_softc *sc, i ATHN_RXBUFSZ, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &bf->bf_map); if (error != 0) { - printf("%s: could not create Rx buf DMA map\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + "could not create Rx buf DMA map\n"); goto fail; } /* @@ -775,8 +775,8 @@ ar9003_rx_alloc(struct athn_softc *sc, i */ bf->bf_m = MCLGETI(NULL, M_DONTWAIT, NULL, ATHN_RXBUFSZ); if (bf->bf_m == NULL) { - printf("%s: could not allocate Rx mbuf\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + "could not allocate Rx mbuf\n"); error = ENOBUFS; goto fail; } @@ -785,8 +785,8 @@ ar9003_rx_alloc(struct athn_softc *sc, i mtod(bf->bf_m, void *), ATHN_RXBUFSZ, NULL, BUS_DMA_NOWAIT); if (error != 0) { - printf("%s: could not DMA map Rx buffer\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + "could not DMA map Rx buffer\n"); goto fail; } @@ -953,7 +953,7 @@ ar9003_rx_process(struct athn_softc *sc, bf = SIMPLEQ_FIRST(&rxq->head); if (__predict_false(bf == NULL)) { /* Should not happen. */ - printf("%s: Rx queue is empty!\n", device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, "Rx queue is empty!\n"); return ENOENT; } bus_dmamap_sync(sc->sc_dmat, bf->bf_map, 0, ATHN_RXBUFSZ, @@ -1548,8 +1548,8 @@ ar9003_tx(struct athn_softc *sc, struct BUS_DMA_NOWAIT | BUS_DMA_WRITE); if (__predict_false(error != 0)) { if (error != EFBIG) { - printf("%s: can't map mbuf (error %d)\n", - device_xname(sc->sc_dev), error); + aprint_error_dev(sc->sc_dev, + "can't map mbuf (error %d)\n", error); m_freem(m); return error; } @@ -1578,8 +1578,8 @@ ar9003_tx(struct athn_softc *sc, struct error = bus_dmamap_load_mbuf(sc->sc_dmat, bf->bf_map, m, BUS_DMA_NOWAIT | BUS_DMA_WRITE); if (error != 0) { - printf("%s: can't map mbuf (error %d)\n", - device_xname(sc->sc_dev), error); + aprint_error_dev(sc->sc_dev, + "can't map mbuf (error %d)\n", error); m_freem(m); return error; } Index: src/sys/dev/ic/athn.c diff -u src/sys/dev/ic/athn.c:1.7 src/sys/dev/ic/athn.c:1.8 --- src/sys/dev/ic/athn.c:1.7 Thu Oct 17 17:24:24 2013 +++ src/sys/dev/ic/athn.c Sun Feb 23 10:29:12 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: athn.c,v 1.7 2013/10/17 21:24:24 christos Exp $ */ +/* $NetBSD: athn.c,v 1.8 2014/02/23 15:29:12 christos Exp $ */ /* $OpenBSD: athn.c,v 1.75 2013/01/14 09:50:31 jsing Exp $ */ /*- @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.7 2013/10/17 21:24:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.8 2014/02/23 15:29:12 christos Exp $"); #ifndef _MODULE #include "athn_usb.h" /* for NATHN_USB */ @@ -234,15 +234,16 @@ athn_attach(struct athn_softc *sc) ((sc->sc_rxchainmask >> 0) & 1); if (AR_SINGLE_CHIP(sc)) { - aprint_normal(": Atheros %s\n", athn_get_mac_name(sc)); + aprint_normal_dev(sc->sc_dev, + "Atheros %s\n", athn_get_mac_name(sc)); aprint_verbose_dev(sc->sc_dev, "rev %d (%dT%dR), ROM rev %d, address %s\n", sc->sc_mac_rev, sc->sc_ntxchains, sc->sc_nrxchains, sc->sc_eep_rev, ether_sprintf(ic->ic_myaddr)); - } - else { - aprint_normal(": Atheros %s, RF %s\n", athn_get_mac_name(sc), + } else { + aprint_normal_dev(sc->sc_dev, + "Atheros %s, RF %s\n", athn_get_mac_name(sc), athn_get_rf_name(sc)); aprint_verbose_dev(sc->sc_dev, "rev %d (%dT%dR), ROM rev %d, address %s\n", @@ -2824,8 +2825,8 @@ athn_init(struct ifnet *ifp) /* avoid recursion in athn_resume */ if (!pmf_device_subtree_resume(sc->sc_dev, &sc->sc_qual) || !device_is_active(sc->sc_dev)) { - printf("%s: failed to power up device\n", - device_xname(sc->sc_dev)); + aprint_error_dev(sc->sc_dev, + "failed to power up device\n"); return 0; } ifp->if_flags = flags;