From owner-svn-src-all@FreeBSD.ORG Mon Oct 13 20:38:33 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79C7D106569C; Mon, 13 Oct 2008 20:38:33 +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 67D088FC18; Mon, 13 Oct 2008 20:38:33 +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 m9DKcXqt085749; Mon, 13 Oct 2008 20:38:33 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 m9DKcXT2085748; Mon, 13 Oct 2008 20:38:33 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <200810132038.m9DKcXT2085748@svn.freebsd.org> From: Nick Hibma Date: Mon, 13 Oct 2008 20:38:33 +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: r183842 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2008 20:38:33 -0000 Author: n_hibma Date: Mon Oct 13 20:38:33 2008 New Revision: 183842 URL: http://svn.freebsd.org/changeset/base/183842 Log: - Only refuse to attach to the first interface on the Huawei cards as for example the Huawei Mobile has an SD card slot on the second interface. - Do not attach to Qualcomm and Novatel cards. If ignored these cards will switch to modem mode automatically it seems. - Reduce the priority on generic attachment to the appropriate level. Note: A better solution is to send an eject command straightaway, but that can be left till later. Modified: head/sys/dev/usb/umass.c Modified: head/sys/dev/usb/umass.c ============================================================================== --- head/sys/dev/usb/umass.c Mon Oct 13 20:24:03 2008 (r183841) +++ head/sys/dev/usb/umass.c Mon Oct 13 20:38:33 2008 (r183842) @@ -1177,12 +1177,28 @@ umass_match_proto(struct umass_softc *sc dd = usbd_get_device_descriptor(udev); - /* - * These are radio devices with auto-install flash disks for win/mac. - * We want the ubsa driver to kick them into shape instead. - */ - if (UGETW(dd->idVendor) == USB_VENDOR_HUAWEI) - return(UMATCH_NONE); + /* These are 3G modes (E220, Mobile, etc.) devices with auto-install + * flash disks for Windows/MacOSX through the first interface. + * We are assuming that these vendors will not produce mass storage + * devices. See the list of supported parts in u3g, if this happens to + * be a mistake in the future. + */ + if (UGETW(dd->idVendor) == USB_VENDOR_HUAWEI) { + /* The interface is reset in the u3g driver + * (u3g_huawei_reinit()). Allow generic attachment to the + * second interface though. Some Huawei devices contain an SD + * card slot. + */ + id = usbd_get_interface_descriptor(iface); + if (id == NULL || id->bInterfaceNumber == 0) + return UMATCH_NONE; + } else if (UGETW(dd->idVendor) == USB_VENDOR_QUALCOMMINC + || UGETW(dd->idVendor) == USB_VENDOR_NOVATEL) { + /* Device by these vendors will automatically reappear as a + * ucom device if ignored (or if sent an eject command). + */ + return UMATCH_NONE; + } /* An entry specifically for Y-E Data devices as they don't fit in the * device description table. @@ -1279,7 +1295,7 @@ umass_match_proto(struct umass_softc *sc return(UMATCH_NONE); } - return(UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO); + return(UMATCH_IFACECLASS_IFACESUBCLASS_IFACEPROTO); } static int @@ -1291,6 +1307,7 @@ umass_match(device_t self) sc->sc_dev = self; if (uaa->iface == NULL) return(UMATCH_NONE); + return(umass_match_proto(sc, uaa->iface, uaa->device)); }