From owner-svn-src-head@FreeBSD.ORG Thu Nov 13 21:49:07 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9EE9106564A; Thu, 13 Nov 2008 21:49:07 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2A998FC1B; Thu, 13 Nov 2008 21:49:07 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mADLn7Mw070195; Thu, 13 Nov 2008 21:49:07 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mADLn7ox070194; Thu, 13 Nov 2008 21:49:07 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200811132149.mADLn7ox070194@svn.freebsd.org> From: Nick Hibma Date: Thu, 13 Nov 2008 21:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184943 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 21:49:08 -0000 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) };