diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2016-07-14 04:00:45 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2016-07-14 04:00:45 +0000 |
| commit | fea989253ed8b48a330618c0627abb9b4a04cccd (patch) | |
| tree | 6236589963fe755610e0a307937db6dcf069352a /sys/dev/usb | |
| parent | afaa2112ba51f3fedc702c64c05dcea4f156c5c4 (diff) | |
- Use aprint*() instead of printf() in xxx_attach().
- Add missing aprint_naive("\n");
- KNF
Diffstat (limited to 'sys/dev/usb')
| -rw-r--r-- | sys/dev/usb/if_urndis.c | 34 | ||||
| -rw-r--r-- | sys/dev/usb/if_urtw.c | 25 |
2 files changed, 32 insertions, 27 deletions
diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c index 28621bf82af..70339dcb413 100644 --- a/sys/dev/usb/if_urndis.c +++ b/sys/dev/usb/if_urndis.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_urndis.c,v 1.12 2016/06/10 13:27:15 ozaki-r Exp $ */ +/* $NetBSD: if_urndis.c,v 1.13 2016/07/14 04:00:46 msaitoh Exp $ */ /* $OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */ /* @@ -21,7 +21,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.12 2016/06/10 13:27:15 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.13 2016/07/14 04:00:46 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -99,7 +99,8 @@ static uint32_t urndis_ctrl_halt(struct urndis_softc *); #endif static uint32_t urndis_ctrl_query(struct urndis_softc *, uint32_t, void *, size_t, void **, size_t *); -static uint32_t urndis_ctrl_set(struct urndis_softc *, uint32_t, void *, size_t); +static uint32_t urndis_ctrl_set(struct urndis_softc *, uint32_t, void *, + size_t); #if 0 static uint32_t urndis_ctrl_set_param(struct urndis_softc *, const char *, uint32_t, void *, size_t); @@ -108,7 +109,8 @@ static uint32_t urndis_ctrl_keepalive(struct urndis_softc *); #endif static int urndis_encap(struct urndis_softc *, struct mbuf *, int); -static void urndis_decap(struct urndis_softc *, struct urndis_chain *, uint32_t); +static void urndis_decap(struct urndis_softc *, struct urndis_chain *, + uint32_t); static int urndis_match(device_t, cfdata_t, void *); static void urndis_attach(device_t, device_t, void *); @@ -1385,7 +1387,7 @@ urndis_attach(device_t parent, device_t self, void *aux) } if (sc->sc_iface_data == NULL) { - printf("%s: no data interface\n", DEVNAME(sc)); + aprint_error("%s: no data interface\n", DEVNAME(sc)); return; } @@ -1395,8 +1397,8 @@ urndis_attach(device_t parent, device_t self, void *aux) for (j = 0; j < altcnt; j++) { if (usbd_set_interface(sc->sc_iface_data, j)) { - printf("%s: interface alternate setting %u failed\n", - DEVNAME(sc), j); + aprint_error("%s: interface alternate setting %u " + "failed\n", DEVNAME(sc), j); return; } /* Find endpoints. */ @@ -1406,8 +1408,8 @@ urndis_attach(device_t parent, device_t self, void *aux) ed = usbd_interface2endpoint_descriptor( sc->sc_iface_data, i); if (!ed) { - printf("%s: no descriptor for bulk endpoint " - "%u\n", DEVNAME(sc), i); + aprint_error("%s: no descriptor for bulk " + "endpoint %u\n", DEVNAME(sc), i); return; } if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && @@ -1431,9 +1433,9 @@ urndis_attach(device_t parent, device_t self, void *aux) } if (sc->sc_bulkin_no == -1) - printf("%s: could not find data bulk in\n", DEVNAME(sc)); + aprint_error("%s: could not find data bulk in\n", DEVNAME(sc)); if (sc->sc_bulkout_no == -1 ) - printf("%s: could not find data bulk out\n", DEVNAME(sc)); + aprint_error("%s: could not find data bulk out\n",DEVNAME(sc)); return; found: @@ -1458,7 +1460,8 @@ urndis_attach(device_t parent, device_t self, void *aux) if (urndis_ctrl_query(sc, OID_802_3_PERMANENT_ADDRESS, NULL, 0, &buf, &bufsz) != RNDIS_STATUS_SUCCESS) { - printf("%s: unable to get hardware address\n", DEVNAME(sc)); + aprint_error("%s: unable to get hardware address\n", + DEVNAME(sc)); urndis_stop(ifp); splx(s); return; @@ -1466,10 +1469,11 @@ urndis_attach(device_t parent, device_t self, void *aux) if (bufsz == ETHER_ADDR_LEN) { memcpy(eaddr, buf, ETHER_ADDR_LEN); - printf("%s: address %s\n", DEVNAME(sc), ether_sprintf(eaddr)); + aprint_normal("%s: address %s\n", DEVNAME(sc), + ether_sprintf(eaddr)); kmem_free(buf, bufsz); } else { - printf("%s: invalid address\n", DEVNAME(sc)); + aprint_error("%s: invalid address\n", DEVNAME(sc)); kmem_free(buf, bufsz); urndis_stop(ifp); splx(s); @@ -1482,7 +1486,7 @@ urndis_attach(device_t parent, device_t self, void *aux) filter = htole32(sc->sc_filter); if (urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, &filter, sizeof(filter)) != RNDIS_STATUS_SUCCESS) { - printf("%s: unable to set data filters\n", DEVNAME(sc)); + aprint_error("%s: unable to set data filters\n", DEVNAME(sc)); urndis_stop(ifp); splx(s); return; diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c index 4146b773de9..be68968879d 100644 --- a/sys/dev/usb/if_urtw.c +++ b/sys/dev/usb/if_urtw.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_urtw.c,v 1.10 2016/06/10 13:27:15 ozaki-r Exp $ */ +/* $NetBSD: if_urtw.c,v 1.11 2016/07/14 04:00:46 msaitoh Exp $ */ /* $OpenBSD: if_urtw.c,v 1.39 2011/07/03 15:47:17 matthew Exp $ */ /*- @@ -19,7 +19,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_urtw.c,v 1.10 2016/06/10 13:27:15 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urtw.c,v 1.11 2016/07/14 04:00:46 msaitoh Exp $"); #include <sys/param.h> #include <sys/sockio.h> @@ -611,7 +611,8 @@ urtw_attach(device_t parent, device_t self, void *aux) sc->sc_udev = uaa->uaa_device; sc->sc_hwrev = urtw_lookup(uaa->uaa_vendor, uaa->uaa_product)->rev; - printf(": "); + aprint_naive("\n"); + aprint_normal(": "); if (sc->sc_hwrev & URTW_HWREV_8187) { urtw_read32_m(sc, URTW_TX_CONF, &data); @@ -619,7 +620,7 @@ urtw_attach(device_t parent, device_t self, void *aux) switch (data) { case URTW_TX_HWREV_8187_D: sc->sc_hwrev |= URTW_HWREV_8187_D; - printf("RTL8187 rev D"); + aprint_normal("RTL8187 rev D"); break; case URTW_TX_HWREV_8187B_D: /* @@ -627,11 +628,11 @@ urtw_attach(device_t parent, device_t self, void *aux) * USB IDs of RTL8187. */ sc->sc_hwrev = URTW_HWREV_8187B | URTW_HWREV_8187B_B; - printf("RTL8187B rev B (early)"); + aprint_normal("RTL8187B rev B (early)"); break; default: sc->sc_hwrev |= URTW_HWREV_8187_B; - printf("RTL8187 rev 0x%02x", data >> 25); + aprint_normal("RTL8187 rev 0x%02x", data >> 25); break; } } else { @@ -640,19 +641,19 @@ urtw_attach(device_t parent, device_t self, void *aux) switch (data8) { case URTW_8187B_HWREV_8187B_B: sc->sc_hwrev |= URTW_HWREV_8187B_B; - printf("RTL8187B rev B"); + aprint_normal("RTL8187B rev B"); break; case URTW_8187B_HWREV_8187B_D: sc->sc_hwrev |= URTW_HWREV_8187B_D; - printf("RTL8187B rev D"); + aprint_normal("RTL8187B rev D"); break; case URTW_8187B_HWREV_8187B_E: sc->sc_hwrev |= URTW_HWREV_8187B_E; - printf("RTL8187B rev E"); + aprint_normal("RTL8187B rev E"); break; default: sc->sc_hwrev |= URTW_HWREV_8187B_B; - printf("RTL8187B rev 0x%02x", data8); + aprint_normal("RTL8187B rev 0x%02x", data8); break; } } @@ -748,13 +749,13 @@ urtw_attach(device_t parent, device_t self, void *aux) sc->sc_txtap.wt_ihdr.it_len = htole16(sc->sc_txtap_len); sc->sc_txtap.wt_ihdr.it_present = htole32(URTW_TX_RADIOTAP_PRESENT); - printf(", address %s\n", ether_sprintf(ic->ic_myaddr)); + aprint_normal(", address %s\n", ether_sprintf(ic->ic_myaddr)); ieee80211_announce(ic); return; fail: - printf(": %s failed!\n", __func__); + aprint_error(": %s failed!\n", __func__); sc->sc_dying = true; } |
