Date: Thu, 13 Nov 2008 21:49:07 +0000 (UTC) From: Nick Hibma <n_hibma@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184943 - head/sys/dev/usb Message-ID: <200811132149.mADLn7ox070194@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: n_hibma Date: Thu Nov 13 21:49:07 2008 New Revision: 184943 URL: http://svn.freebsd.org/changeset/base/184943 Log: 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). Modified: head/sys/dev/usb/u3g.c Modified: head/sys/dev/usb/u3g.c ============================================================================== --- head/sys/dev/usb/u3g.c Thu Nov 13 21:46:19 2008 (r184942) +++ head/sys/dev/usb/u3g.c Thu Nov 13 21:49:07 2008 (r184943) @@ -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) };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811132149.mADLn7ox070194>