From owner-freebsd-hardware@FreeBSD.ORG Mon Oct 27 13:32:13 2008 Return-Path: Delivered-To: hardware@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D79B106566C for ; Mon, 27 Oct 2008 13:32:13 +0000 (UTC) (envelope-from spamd@stu.cn.ua) Received: from stu.cn.ua (stalker.stu.cn.ua [195.69.76.130]) by mx1.freebsd.org (Postfix) with ESMTP id 3373A8FC08 for ; Mon, 27 Oct 2008 13:32:11 +0000 (UTC) (envelope-from spamd@stu.cn.ua) Received: from stu.cn.ua (localhost [127.0.0.1]) by stu.cn.ua (Postfix) with ESMTP id 2281A247477; Sun, 26 Oct 2008 00:49:25 +0300 (EEST) Received: by stu.cn.ua (Postfix, from userid 58) id 084ED247429; Sun, 26 Oct 2008 00:49:25 +0300 (EEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on stalker.stu.cn.ua X-Spam-Level: X-Spam-Status: No, score=-106.6 required=4.5 tests=BAYES_00, RCVD_IN_DNSWL_MED, SPF_PASS,USER_IN_WHITELIST autolearn=ham version=3.2.5 Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by stu.cn.ua (Postfix) with ESMTP id 1A03F247382 for ; Sun, 26 Oct 2008 00:49:19 +0300 (EEST) Received: from hub.freebsd.org (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id A5567157A43; Sat, 25 Oct 2008 21:48:20 +0000 (UTC) (envelope-from owner-freebsd-current@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 784B6106576E; Sat, 25 Oct 2008 21:48:17 +0000 (UTC) (envelope-from owner-freebsd-current@freebsd.org) Delivered-To: current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB66F106569C; Sat, 25 Oct 2008 21:48:01 +0000 (UTC) (envelope-from mcdouga9@egr.msu.edu) Received: from mx.egr.msu.edu (surfnturf.egr.msu.edu [35.9.37.164]) by mx1.freebsd.org (Postfix) with ESMTP id 703A98FC17; Sat, 25 Oct 2008 21:48:01 +0000 (UTC) (envelope-from mcdouga9@egr.msu.edu) Received: from localhost (localhost [127.0.0.1]) by mx.egr.msu.edu (Postfix) with ESMTP id B01D371F463; Sat, 25 Oct 2008 17:29:36 -0400 (EDT) X-Virus-Scanned: amavisd-new at egr.msu.edu Received: from mx.egr.msu.edu ([127.0.0.1]) by localhost (surfnturf.egr.msu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OgoeYrlfpFne; Sat, 25 Oct 2008 17:29:36 -0400 (EDT) Received: from localhost (daemon.egr.msu.edu [35.9.44.65]) by mx.egr.msu.edu (Postfix) with ESMTP id 396E471F45E; Sat, 25 Oct 2008 17:29:36 -0400 (EDT) Received: by localhost (Postfix, from userid 21281) id 23D4057F; Sat, 25 Oct 2008 17:29:36 -0400 (EDT) Date: Sat, 25 Oct 2008 17:29:36 -0400 From: Adam McDougall To: Nick Hibma Message-ID: <20081025212935.GV61867@egr.msu.edu> References: <200810092344.10388.nick@van-laarhoven.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810092344.10388.nick@van-laarhoven.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Sender: owner-freebsd-current@freebsd.org Errors-To: owner-freebsd-current@freebsd.org X-Virus-Scanned: ClamAV using ClamSMTP on stalker.stu.cn.ua Cc: FreeBSD Hardware Mailing list , FreeBSD CURRENT Mailing List , Andrea Guzzo Subject: Re: Request for testers: Option 3G cards, also Sierra, Huawei and Novatel X-BeenThere: freebsd-hardware@freebsd.org List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2008 13:32:13 -0000 Seems to work fine with my Novatel V740 (EVDO from Verizon) Expresscard. I'm using the latest version with the bufsize patch and I'm glad I no longer have to hack in a patch to get relatively fast speeds through it (just got 140kB/sec in a test which is just over 1Mbit/sec). On Thu, Oct 09, 2008 at 11:44:09PM +0200, Nick Hibma wrote: Just now I have committed a driver for Option and Huawei cards previously supported by the ubsa driver. More information is in the commit message. I am looking for people who would be able to provide more information after testing with the 3G cards branded by: OEM: Merlin Huawei Option Sierra Novatel Qualcomm Rebranded: Dell Vodafone Note: The driver can be copied across to FreeBSD 7-STABLE if you copy the sys/modules/u3g directory and sys/dev/usb/u3g.c and sys/dev/usb/usbdevs files from HEAD and _move_ the ID from ubsa to u3g. More information can be found on http://people.freebsd.org/~n_hibma/u3g.html Thanks, Nick ---------- Forwarded Message ---------- Subject: svn commit: r183735 - in head: share/man/man4 sys/conf sys/dev/usb sys/i386/conf sys/modules sys/modules/u3g Date: Thu October 9 2008 From: Nick Hibma To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Author: n_hibma Date: Thu Oct 9 21:25:01 2008 New Revision: 183735 URL: http://svn.freebsd.org/changeset/base/183735 Log: Say hello to the u3g driver, implementing support for 3G modems. This was located in the ubsa driver, but should be moved into a separate driver: - 3G modems provide multiple serial ports to allow AT commands while the PPP connection is up. - 3G modems do not provide baud rate or other serial port settings. - Huawei cards need specific initialisation. - ubsa is for Belkin adapters, an Linuxy choice for another device like 3G. Speeds achieved here with a weak signal at best is ~40kb/s (UMTS). No spooky STALLED messages as well. Next: Move over all entries for Sierra and Novatel cards once I have found testers, and implemented serial port enumeration for Sierra (or rather have Andrea Guzzo do it). They list all endpoints in 1 iface instead of 4 ifaces. Submitted by: aguzzo@anywi.com MFC after: 3 weeks Added: head/share/man/man4/u3g.4 (contents, props changed) head/sys/dev/usb/u3g.c (contents, props changed) head/sys/modules/u3g/ head/sys/modules/u3g/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/dev/usb/ubsa.c head/sys/dev/usb/usbdevs head/sys/i386/conf/GENERIC head/sys/modules/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Oct 9 20:51:25 2008 (r183734) +++ head/share/man/man4/Makefile Thu Oct 9 21:25:01 2008 (r183735) @@ -384,6 +384,7 @@ MAN= aac.4 \ twe.4 \ tx.4 \ txp.4 \ + u3g.4 \ uark.4 \ uart.4 \ ubsa.4 \ Added: head/share/man/man4/u3g.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/u3g.4 Thu Oct 9 21:25:01 2008 (r183735) @@ -0,0 +1,100 @@ +.\" +.\" Copyright (c) 2008 AnyWi Technologies +.\" All rights reserved. +.\" +.\" This code is derived from uark.c +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 7, 2008 +.Dt U3G 4 +.Os +.Sh NAME +.Nm u3g +.Nd USB support for 3G datacards +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device u3g" +.Cd "device ucom" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +u3g_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the multiple USB-to-serial interfaces exposed by +many 3G usb/pccard modems. +.Pp +The device is accessed through the +.Xr ucom 4 +driver which makes it behave like a +.Xr tty 4 . +.Sh HARDWARE +The +.Nm +driver supports the following adapters: +.Pp +.Bl -bullet -compact +.It +Option Globetrotter 3G Fusion (only 3G part, not WLAN) +.It +Option Globetrotter 3G Fusion Quad (only 3G part, not WLAN) +.It +Option Globetrotter 3G Quad +.It +Option Globetrotter 3G +.It +Vodafone Mobile Connect Card 3G +.It +Huawei E220 (E270?) +.It +Huawei Mobile +.El +.Pp +The supported 3G cards provide the necessary modem port for ppp, +pppd, or mpd connections as well as extra ports (depending on the specific +device) to provide other functions (diagnostic port, SIM toolkit port) +.Sh SEE ALSO +.Xr tty 4 , +.Xr ucom 4 , +.Xr usb 4 , +.Xr ubsa 4 +.Sh HISTORY +The +.Nm +driver +appeared in +.Fx 7.0 . +The +.Xr ubsa 4 +manual page was modified for +.Nm +by +.An Andrea Guzzo Aq aguzzo@anywi.com +in September 2008. +.Sh AUTHORS +The +.Nm +driver was written by +.An Andrea Guzzo Aq aguzzo@anywi.com . +Hardware for testing provided by AnyWi Technologies, Leiden, NL. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/conf/NOTES Thu Oct 9 21:25:01 2008 (r183735) @@ -2416,6 +2416,8 @@ device uscanner # # USB serial support device ucom +# USB support for 3G modem cards by Option, Huawei and Sierra +device u3g # USB support for Technologies ARK3116 based serial adapters device uark # USB support for Belkin F5U103 and compatible serial adapters @@ -2441,7 +2443,6 @@ device aue # ASIX Electronics AX88172 USB 2.0 ethernet driver. Used in the # LinkSys USB200M and various other adapters. - device axe # Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/conf/files Thu Oct 9 21:25:01 2008 (r183735) @@ -1327,6 +1327,7 @@ dev/usb/ohci_pci.c optional ohci pci dev/usb/sl811hs.c optional slhci dev/usb/slhci_pccard.c optional slhci pccard dev/usb/uark.c optional uark +dev/usb/u3g.c optional u3g dev/usb/ubsa.c optional ubsa dev/usb/ubser.c optional ubser dev/usb/ucom.c optional ucom Added: head/sys/dev/usb/u3g.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/u3g.c Thu Oct 9 21:25:01 2008 (r183735) @@ -0,0 +1,330 @@ +/* + * Copyright (c) 2008 AnyWi Technologies + * Author: Andrea Guzzo + * * based on uark.c 1.1 2006/08/14 08:30:22 jsg * + * * parts from ubsa.c 183348 2008-09-25 12:00:56Z phk * + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "usbdevs.h" + +#ifdef U3G_DEBUG +#define DPRINTFN(n, x) do { if (u3gdebug > (n)) printf x; } while (0) +int u3gtebug = 0; +#else +#define DPRINTFN(n, x) +#endif +#define DPRINTF(x) DPRINTFN(0, x) + +#define U3GBUFSZ 1024 +#define U3G_MAXPORTS 4 + +struct u3g_softc { + struct ucom_softc sc_ucom[U3G_MAXPORTS];; + device_t sc_dev; + usbd_device_handle sc_udev; + u_char sc_msr; + u_char sc_lsr; + u_char numports; + + usbd_interface_handle sc_intr_iface; /* interrupt interface */ +#ifdef U3G_DEBUG + int sc_intr_number; /* interrupt number */ + usbd_pipe_handle sc_intr_pipe; /* interrupt pipe */ + u_char *sc_intr_buf; /* interrupt buffer */ +#endif + int sc_isize; +}; + +struct ucom_callback u3g_callback = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +}; + +static const struct usb_devno u3g_devs[] = { + /* OEM: Option */ + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3G }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GQUAD }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAX36 }, + { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, + /* OEM: Huawei */ + { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, + { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220 }, + + { 0, 0 } +}; + +#ifdef U3G_DEBUG +static void +u3g_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status) +{ + struct u3g_softc *sc = (struct u3g_softc *)priv; + device_printf(sc->sc_dev, "INTERRUPT CALLBACK\n"); +} +#endif + +static int +u3g_huawei_reinit(usbd_device_handle dev) +{ + /* The Huawei device presents itself as a umass device with Windows + * drivers on it. After installation of the driver, it reinits into a + * 3G serial device. + */ + usb_device_request_t req; + usb_config_descriptor_t *cdesc; + + /* Get the config descriptor */ + cdesc = usbd_get_config_descriptor(dev); + if (cdesc == NULL) + return (UMATCH_NONE); + + /* One iface means umass mode, more than 1 (4 usually) means 3G mode */ + if (cdesc->bNumInterface > 1) + return (UMATCH_VENDOR_PRODUCT); + + req.bmRequestType = UT_WRITE_DEVICE; + req.bRequest = UR_SET_FEATURE; + USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); + USETW(req.wIndex, UHF_PORT_SUSPEND); + USETW(req.wLength, 0); + + (void) usbd_do_request(dev, &req, 0); + + return UMATCH_NONE; /* mismatch; it will be gone and reappear */ +} + +static int +u3g_match(device_t self) +{ + struct usb_attach_arg *uaa = device_get_ivars(self); + + if (uaa->iface != NULL) + return (UMATCH_NONE); + + if (uaa->vendor == USB_VENDOR_HUAWEI) + return u3g_huawei_reinit(uaa->device); + + if (usb_lookup(u3g_devs, uaa->vendor, uaa->product)) + return UMATCH_VENDOR_PRODUCT; + + return UMATCH_NONE; +} + +static int +u3g_attach(device_t self) +{ + struct u3g_softc *sc = device_get_softc(self); + struct usb_attach_arg *uaa = device_get_ivars(self); + usbd_device_handle dev = uaa->device; + usbd_interface_handle iface; + usb_interface_descriptor_t *id; + usb_endpoint_descriptor_t *ed; + usbd_status error; + int i, n; + usb_config_descriptor_t *cdesc; + struct ucom_softc *ucom = NULL; + char devnamefmt[32]; + + sc->sc_dev = self; +#ifdef DEBUG + sc->sc_intr_number = -1; + sc->sc_intr_pipe = NULL; +#endif + /* Move the device into the configured state. */ + error = usbd_set_config_index(dev, 1, 1); + if (error) { + device_printf(self, "failed to set configuration: %s\n", + usbd_errstr(error)); + goto bad; + } + + /* get the config descriptor */ + cdesc = usbd_get_config_descriptor(dev); + + if (cdesc == NULL) { + device_printf(self, "failed to get configuration descriptor\n"); + goto bad; + } + + sc->sc_udev = dev; + sc->numports = (cdesc->bNumInterface <= U3G_MAXPORTS)?cdesc->bNumInterface:U3G_MAXPORTS; + for ( i = 0; i < sc->numports; i++ ) { + ucom = &sc->sc_ucom[i]; + + ucom->sc_dev = self; + ucom->sc_udev = dev; + error = usbd_device2interface_handle(dev, i, &iface); + if (error) { + device_printf(ucom->sc_dev, + "failed to get interface, err=%s\n", + usbd_errstr(error)); + ucom->sc_dying = 1; + goto bad; + } + id = usbd_get_interface_descriptor(iface); + ucom->sc_iface = iface; + + ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1; + for (n = 0; n < id->bNumEndpoints; n++) { + ed = usbd_interface2endpoint_descriptor(iface, n); + if (ed == NULL) { + device_printf(ucom->sc_dev, + "could not read endpoint descriptor\n"); + goto bad; + } + if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN && + UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) + ucom->sc_bulkin_no = ed->bEndpointAddress; + else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT && + UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) + ucom->sc_bulkout_no = ed->bEndpointAddress; + } + if (ucom->sc_bulkin_no == -1 || ucom->sc_bulkout_no == -1) { + device_printf(ucom->sc_dev, "missing endpoint\n"); + goto bad; + } + ucom->sc_parent = sc; + ucom->sc_ibufsize = U3GBUFSZ; + ucom->sc_obufsize = U3GBUFSZ; + ucom->sc_ibufsizepad = U3GBUFSZ; + ucom->sc_opkthdrlen = 0; + + ucom->sc_callback = &u3g_callback; + + sprintf(devnamefmt,"U%d.%%d", device_get_unit(self)); + DPRINTF(("u3g: in=0x%x out=0x%x, devname=%s\n", + ucom->sc_bulkin_no, ucom->sc_bulkout_no, devnamefmt)); +#if __FreeBSD_version < 800000 + ucom_attach_tty(ucom, TS_CALLOUT, devnamefmt, i); +#else + ucom_attach_tty(ucom, devnamefmt, i); +#endif + } +#ifdef U3G_DEBUG + if (sc->sc_intr_number != -1 && sc->sc_intr_pipe == NULL) { + sc->sc_intr_buf = malloc(sc->sc_isize, M_USBDEV, M_WAITOK); + error = usbd_open_pipe_intr(sc->sc_intr_iface, + sc->sc_intr_number, + USBD_SHORT_XFER_OK, + &sc->sc_intr_pipe, + sc, + sc->sc_intr_buf, + sc->sc_isize, + u3g_intr, + 100); + if (error) { + device_printf(self, + "cannot open interrupt pipe (addr %d)\n", + sc->sc_intr_number); + goto bad; + } + } +#endif + device_printf(self, "configured %d serial ports (/dev/cuaU%d.X)", + sc->numports, device_get_unit(self)); + + return 0; + +bad: + DPRINTF(("u3g_attach: ATTACH ERROR\n")); + ucom->sc_dying = 1; + return ENXIO; +} + +static int +u3g_detach(device_t self) +{ + struct u3g_softc *sc = device_get_softc(self); + int rv = 0; + int i; + + DPRINTF(("u3g_detach: sc=%p\n", sc)); + + for (i = 0; i < sc->numports; i++) { + if(sc->sc_ucom[i].sc_udev) { + sc->sc_ucom[i].sc_dying = 1; + rv = ucom_detach(&sc->sc_ucom[i]); + if(rv != 0) { + device_printf(self, "Can't deallocat port %d", i); + return rv; + } + } + } + +#ifdef U3G_DEBUG + if (sc->sc_intr_pipe != NULL) { + int err = usbd_abort_pipe(sc->sc_intr_pipe); + if (err) + device_printf(self, + "abort interrupt pipe failed: %s\n", + usbd_errstr(err)); + err = usbd_close_pipe(sc->sc_intr_pipe); + if (err) + device_printf(self, + "close interrupt pipe failed: %s\n", + usbd_errstr(err)); + free(sc->sc_intr_buf, M_USBDEV); + sc->sc_intr_pipe = NULL; + } +#endif + + return 0; +} + +static device_method_t u3g_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, u3g_match), + DEVMETHOD(device_attach, u3g_attach), + DEVMETHOD(device_detach, u3g_detach), + + { 0, 0 } +}; + +static driver_t u3g_driver = { + "ucom", + u3g_methods, + sizeof (struct u3g_softc) +}; + +DRIVER_MODULE(u3g, uhub, u3g_driver, ucom_devclass, usbd_driver_load, 0); +MODULE_DEPEND(u3g, usb, 1, 1, 1); +MODULE_DEPEND(u3g, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); Modified: head/sys/dev/usb/ubsa.c ============================================================================== --- head/sys/dev/usb/ubsa.c Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/dev/usb/ubsa.c Thu Oct 9 21:25:01 2008 (r183735) @@ -161,8 +161,6 @@ SYSCTL_INT(_hw_usb_ubsa, OID_AUTO, debug struct ubsa_softc { struct ucom_softc sc_ucom; - int sc_huawei; - int sc_iface_number; /* interface number */ usbd_interface_handle sc_intr_iface; /* interrupt interface */ @@ -228,24 +226,11 @@ static const struct ubsa_product { { USB_VENDOR_GOHUBS, USB_PRODUCT_GOHUBS_GOCOM232 }, /* Peracom */ { USB_VENDOR_PERACOM, USB_PRODUCT_PERACOM_SERIAL1 }, - /* Dell version of the Novatel 740 */ - { USB_VENDOR_DELL, USB_PRODUCT_DELL_U740 }, - /* Option Vodafone MC3G */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_VODAFONEMC3G }, - /* Option GlobeTrotter 3G */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3G }, - /* Option GlobeTrotter 3G QUAD */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GQUAD }, - /* Option GlobeTrotter 3G+ */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GT3GPLUS }, - /* Option GlobeTrotter Max 3.6 */ - { USB_VENDOR_OPTION, USB_PRODUCT_OPTION_GTMAX36 }, - /* Huawei Mobile */ - { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_MOBILE }, - { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E270 }, + /* Merlin */ { USB_VENDOR_MERLIN, USB_PRODUCT_MERLIN_V620 }, /* Qualcomm, Inc. ZTE CDMA */ { USB_VENDOR_QUALCOMMINC, USB_PRODUCT_QUALCOMMINC_CDMA_MSM }, + /* Novatel */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_CDMA_MODEM }, /* Novatel Wireless Merlin ES620 */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_ES620 }, @@ -256,6 +241,8 @@ static const struct ubsa_product { /* Novatel Wireless Merlin U740 */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740 }, { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U740_2 }, + /* Dell version of the Novatel 740 */ + { USB_VENDOR_DELL, USB_PRODUCT_DELL_U740 }, /* Novatel Wireless Merlin U950D */ { USB_VENDOR_NOVATEL, USB_PRODUCT_NOVATEL_U950D }, /* Novatel Wireless Merlin V620 */ @@ -341,52 +328,6 @@ MODULE_DEPEND(ubsa, usb, 1, 1, 1); MODULE_DEPEND(ubsa, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER); MODULE_VERSION(ubsa, UBSA_MODVER); -/* - * Huawei Exxx radio devices have a built in flash disk which is their - * default power up configuration. This allows the device to carry its - * own installation software. - * - * Instead of following the USB spec, and create multiple configuration - * descriptors for this, the devices expects the driver to send - * UF_DEVICE_REMOTE_WAKEUP to endpoint 2 to reset the device, so it - * reprobes, now with the radio exposed. - */ - -static usbd_status -ubsa_huawei(device_t self, struct usb_attach_arg *uaa) { - usb_device_request_t req; usbd_device_handle dev; - usb_config_descriptor_t *cdesc; - - if (self == NULL) - return (UMATCH_NONE); - if (uaa == NULL) - return (UMATCH_NONE); - dev = uaa->device; - if (dev == NULL) - return (UMATCH_NONE); - /* get the config descriptor */ - cdesc = usbd_get_config_descriptor(dev); - if (cdesc == NULL) - return (UMATCH_NONE); - - if (cdesc->bNumInterface > 1) - return (0); - - /* Bend it like Beckham */ - device_printf(self, "Kicking Huawei device into radio mode\n"); - memset(&req, 0, sizeof req); - req.bmRequestType = UT_WRITE_DEVICE; - req.bRequest = UR_SET_FEATURE; - USETW(req.wValue, UF_DEVICE_REMOTE_WAKEUP); - USETW(req.wIndex, 2); - USETW(req.wLength, 0); - - /* We get error return, but it works */ - (void)usbd_do_request(dev, &req, 0); - return (UMATCH_NONE); -} - - static int ubsa_match(device_t self) { @@ -399,9 +340,6 @@ ubsa_match(device_t self) for (i = 0; ubsa_products[i].vendor != 0; i++) { if (ubsa_products[i].vendor == uaa->vendor && ubsa_products[i].product == uaa->product) { - if (uaa->vendor == USB_VENDOR_HUAWEI && - ubsa_huawei(self, uaa)) - break; return (UMATCH_VENDOR_PRODUCT); } } @@ -424,9 +362,6 @@ ubsa_attach(device_t self) dev = uaa->device; ucom = &sc->sc_ucom; - if (uaa->vendor == USB_VENDOR_HUAWEI) - sc->sc_huawei = 1; - /* * initialize rts, dtr variables to something * different from boolean 0, 1 @@ -575,8 +510,6 @@ ubsa_request(struct ubsa_softc *sc, u_in usbd_status err; /* The huawei Exxx devices support none of these tricks */ - if (sc->sc_huawei) - return (0); req.bmRequestType = UT_WRITE_VENDOR_DEVICE; req.bRequest = request; USETW(req.wValue, value); Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/dev/usb/usbdevs Thu Oct 9 21:25:01 2008 (r183735) @@ -1434,7 +1434,7 @@ product HTC SMARTPHONE 0x0a51 SmartPhon /* HUAWEI products */ product HUAWEI MOBILE 0x1001 Huawei Mobile -product HUAWEI E270 0x1003 Huawei HSPA modem +product HUAWEI E220 0x1003 Huawei HSDPA modem /* HUAWEI 3com products */ product HUAWEI3COM WUB320G 0x0009 Aolynk WUB320g Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/i386/conf/GENERIC Thu Oct 9 21:25:01 2008 (r183735) @@ -304,6 +304,7 @@ device urio # Diamond Rio 500 MP3 play device uscanner # Scanners # USB Serial devices device ucom # Generic com ttys +device u3g # USB-based 3G modems (Option, Huawei, Sierra) device uark # Technologies ARK3116 based serial adapters device ubsa # Belkin F5U103 and compatible serial adapters device uftdi # For FTDI usb serial adapters Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Oct 9 20:51:25 2008 (r183734) +++ head/sys/modules/Makefile Thu Oct 9 21:25:01 2008 (r183735) @@ -269,6 +269,7 @@ SUBDIR= ${_3dfx} \ twe \ tx \ txp \ + u3g \ uark \ uart \ ubsa \ Added: head/sys/modules/u3g/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/u3g/Makefile Thu Oct 9 21:25:01 2008 (r183735) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/usb + +KMOD= u3g +SRCS= u3g.c ucomvar.h opt_usb.h device_if.h bus_if.h usbdevs.h + +.include _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" ------------------------------------------------------- _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"