diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2008-11-13 21:49:07 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2008-11-13 21:49:07 +0000 |
commit | cbf9e0a3f94f230c45edb13092f4b4b0ae60342a (patch) | |
tree | b63fd1efca077f0b6f0d22b18a4cad9923c07a04 /sys/dev | |
parent | 1e9b4258a44bacd94b90d45ae7448a50a1bd3d1c (diff) | |
download | FreeBSD-src-cbf9e0a3f94f230c45edb13092f4b4b0ae60342a.zip FreeBSD-src-cbf9e0a3f94f230c45edb13092f4b4b0ae60342a.tar.gz |
Hide the attach message. This needs to be done in the probe as well, as
the softc is reset a few times during probing.
Print 'changing to modem mode' messages if booting verbose to show the
reason for the time delay. Note: Some devices (Huawei for one) take 20
seconds to appear on the USB bus).
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/u3g.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sys/dev/usb/u3g.c b/sys/dev/usb/u3g.c index a57b3ca..87e39bb 100644 --- a/sys/dev/usb/u3g.c +++ b/sys/dev/usb/u3g.c @@ -566,8 +566,15 @@ u3gstub_match(device_t self) * storage device the device has not yet changed appearance. */ id = usbd_get_interface_descriptor(uaa->iface); - if (id && id->bInterfaceNumber == 0 && id->bInterfaceClass == UICLASS_MASS) + if (id && id->bInterfaceNumber == 0 + && id->bInterfaceClass == UICLASS_MASS) { +#ifndef U3G_DEBUG + if (!bootverbose) + device_quiet(self); +#endif + return UMATCH_VENDOR_PRODUCT; + } } return UMATCH_NONE; @@ -580,8 +587,9 @@ u3gstub_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); const struct u3g_dev_type_s *u3g_dev_type; int i; + #ifndef U3G_DEBUG - if (!bootverbose) // hide the stub attachment + if (!bootverbose) device_quiet(self); #endif @@ -593,18 +601,27 @@ u3gstub_attach(device_t self) u3g_dev_type = u3g_lookup(uaa->vendor, uaa->product); if (u3g_dev_type->flags&U3GFL_HUAWEI_INIT) { - DPRINTF("changing Huawei modem to modem mode\n"); + if (bootverbose) + device_printf(sc->sc_dev, + "changing Huawei modem to modem mode\n"); if (!u3gstub_huawei_init(sc, uaa)) return ENXIO; } else if (u3g_dev_type->flags&U3GFL_SCSI_EJECT) { - DPRINTF("sending CD eject command to change to modem mode\n"); + if (bootverbose) + device_printf(sc->sc_dev, "sending CD eject command to " + "change to modem mode\n"); if (!u3gstub_scsi_eject(sc, uaa)) return ENXIO; } else if (u3g_dev_type->flags&U3GFL_SIERRA_INIT) { - DPRINTF("changing Sierra modem to modem mode\n"); + if (bootverbose) + device_printf(sc->sc_dev, + "changing Sierra modem to modem mode\n"); if (!u3gstub_sierra_init(sc, uaa)) return ENXIO; } else if (u3g_dev_type->flags&U3GFL_STUB_WAIT) { + if (bootverbose) + device_printf(sc->sc_dev, "waiting for modem to change " + "to modem mode\n"); /* nop */ } @@ -637,7 +654,7 @@ static device_method_t u3gstub_methods[] = { }; static driver_t u3gstub_driver = { - "u3gstub", + "u3g", u3gstub_methods, sizeof (struct u3gstub_softc) }; |