Subject: Sierra/AirPrime 5220 on 2.0 (Re: Verizon 1xevdo (Wireless Broadband
To: tech-kern@NetBSD.org, <tech-net@NetBSD.org>
From: Edward B. Dreger <eddy+public+spam@noc.everquick.net>
List: tech-kern
Date: 03/22/2005 14:37:33
RD> Date: Tue, 11 Jan 2005 12:17:41 -0500
RD> From: Roland Dowdeswell
[ snip body ]
Threaded to attribute Roland as the ugensa driver's author. I modified
his work to create a "turnkey" patch for 2.0 GENERIC_LAPTOP (see below
sig block). If this is your first time using a USB comm device, as it
was mine, note that /dev/ttyU* is what you seek.
If you need help with ppp config, try:
http://www.ka9q.net/5220.html
I've not heard of anyone porting the Windows management tools. Beyond
what pppstats can divulge, you're on your own.
Disclaimers:
* A USB guru I am not, but this patch seems to work for me.
* AFAIK, dmesg error about unexpected non-bulk endpoint is normal.
* I have no connection with ka9q.net; I'm just too lazy to make a
NetBSD-oriented page myself.
HTH,
Eddy
--
Everquick Internet - http://www.everquick.net/
A division of Brotsman & Dreger, Inc. - http://www.brotsman.com/
Bandwidth, consulting, e-commerce, hosting, and network building
Phone: +1 785 865 5885 Lawrence and [inter]national
Phone: +1 316 794 8922 Wichita
________________________________________________________________________
DO NOT send mail to the following addresses:
davidc@brics.com -*- jfconmaapaq@intc.net -*- sam@everquick.net
Sending mail to spambait addresses is a great way to get blocked.
Ditto for broken OOO autoresponders and foolish AV software backscatter.
========================================================================
--- sys.ORIG/arch/i386/conf/GENERIC_LAPTOP 2004-08-30 09:52:52.000000000 +0000
+++ sys/arch/i386/conf/GENERIC_LAPTOP 2005-03-22 14:03:42.000000000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC_LAPTOP,v 1.90.2.10 2004/08/30 09:52:52 tron Exp $
+# $NetBSD$
# From: NetBSD: GENERIC,v 1.414 2001/07/30 19:59:05 ad Exp
#
# GENERIC_LAPTOP -- GENERIC with cardbus and some USB devices enabled
@@ -594,7 +594,7 @@
uhci* at pci? dev ? function ? # Universal Host Controller (Intel)
# CardBus USB controllers
-#ohci* at cardbus? dev ? function ? # Open Host Controller
+ohci* at cardbus? dev ? function ? # Open Host Controller
# USB bus support
usb* at ehci?
@@ -679,6 +679,10 @@
# USB Generic driver
ugen* at uhub? port ?
+# USB Generic serial adapter
+ugensa* at uhub? port ?
+ucom* at ugensa?
+
# IrDA and Consumer Ir devices
--- sys.ORIG/dev/DEVNAMES 2004-08-30 09:46:47.000000000 +0000
+++ sys/dev/DEVNAMES 2005-03-22 14:03:47.000000000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: DEVNAMES,v 1.156.2.1 2004/08/30 09:46:47 tron Exp $
+# $NetBSD$
#
# This file contains all used device names and defined attributes in
# alphabetical order. New devices added to the system somewhere should first
@@ -1195,6 +1195,7 @@
udsbr MI
uftdi MI
ugen MI
+ugensa MI
uha MI
uhci MI
uhid MI
--- sys.ORIG/dev/pci/pcidevs 2004-11-12 06:27:37.000000000 +0000
+++ sys/dev/pci/pcidevs 2005-03-22 14:03:59.000000000 +0000
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.615.2.17 2004/11/12 06:27:37 jmc Exp $
+$NetBSD$
/*
* Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1846,7 +1846,8 @@
product LUCENT LTMODEM_045a 0x045a LTMODEM
product LUCENT OR3LP26 0x5400 Lucent ORCA FPGA w/32-bit PCI ASIC core
product LUCENT OR3TP12 0x5401 Lucent ORCA FPGA w/64-bit PCI ASIC core
-product LUCENT USBHC 0x5801 USB Host Controller
+product LUCENT USBHC 0x5801 USB Host Controller (1-port)
+product LUCENT USBHC2 0x5802 USB Host Controller (2-port)
product LUCENT FW322_323 0x5811 FW322/323 IEEE 1394 OHCI Controller
/* Macronix */
--- sys.ORIG/dev/pci/pcidevs.h 2004-11-12 06:28:22.000000000 +0000
+++ sys/dev/pci/pcidevs.h 2005-03-22 14:04:12.000000000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcidevs.h,v 1.615.2.17 2004/11/12 06:28:22 jmc Exp $ */
+/* $NetBSD$ */
/*
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
@@ -1854,6 +1854,7 @@
#define PCI_PRODUCT_LUCENT_OR3LP26 0x5400 /* Lucent ORCA FPGA w/32-bit PCI ASIC core */
#define PCI_PRODUCT_LUCENT_OR3TP12 0x5401 /* Lucent ORCA FPGA w/64-bit PCI ASIC core */
#define PCI_PRODUCT_LUCENT_USBHC 0x5801 /* USB Host Controller */
+#define PCI_PRODUCT_LUCENT_USBHC2 0x5802 /* USB Host Controller */
#define PCI_PRODUCT_LUCENT_FW322_323 0x5811 /* FW322/323 IEEE 1394 OHCI Controller */
/* Macronix */
--- sys.ORIG/dev/pci/pcidevs_data.h 2004-11-12 06:28:29.000000000 +0000
+++ sys/dev/pci/pcidevs_data.h 2005-03-22 14:04:20.000000000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcidevs_data.h,v 1.613.2.17 2004/11/12 06:28:29 jmc Exp $ */
+/* $NetBSD$ */
/*
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
@@ -5995,7 +5995,13 @@
PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_USBHC,
0,
"Lucent Technologies",
- "USB Host Controller",
+ "USB Host Controller (1-port)",
+ },
+ {
+ PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_USBHC2,
+ 0,
+ "Lucent Technologies",
+ "USB Host Controller (2-port)",
},
{
PCI_VENDOR_LUCENT, PCI_PRODUCT_LUCENT_FW322_323,
--- sys.ORIG/dev/usb/FILES 2001-12-30 11:01:24.000000000 +0000
+++ sys/dev/usb/FILES 2005-03-21 18:14:32.000000000 +0000
@@ -31,6 +31,7 @@
uftdi.c USB FTDI serial driver
uftdireg.h and definitions for it
ugen.c generic driver that can handle access to any USB device
+ugensa.c generic serial adapter
uhci.c Host controller driver for UHCI
uhcireg.h Hardware definitions for UHCI
uhcivar.h API for uhci.c
--- sys.ORIG/dev/usb/files.usb 2003-10-08 20:58:00.000000000 +0000
+++ sys/dev/usb/files.usb 2005-03-22 14:04:29.000000000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.usb,v 1.52 2003/10/08 20:58:00 bouyer Exp $
+# $NetBSD$
#
# Config file and device description for machine-independent USB code.
# Included by ports that need it. Ports that use it must provide
@@ -180,6 +180,11 @@
# Serial drivers
+# Generic Serial Adapter
+device ugensa: ucombus
+attach ugensa at uhub
+file dev/usb/ugensa.c ugensa
+
# Modems
device umodem: ucombus
attach umodem at uhub
--- sys.ORIG/dev/usb/ugensa.c 1970-01-01 00:00:00.000000000 +0000
+++ sys/dev/usb/ugensa.c 2005-03-22 14:08:30.000000000 +0000
@@ -0,0 +1,249 @@
+/* $NetBSD$ */
+
+/*
+ * Copyright (c) 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Roland C. Dowdeswell <elric@netbsd.org>.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <sys/conf.h>
+#include <sys/tty.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbhid.h>
+
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+#include <dev/usb/usbdevs.h>
+
+#include <dev/usb/ucomvar.h>
+
+/* XXXebd: if you need debugging, you'll know enough to enable it :-) */
+#undef UGENSA_DEBUG
+
+#ifdef UGENSA_DEBUG
+#define DPRINTF(x) if (ugensadebug) printf x
+#define DPRINTFN(n,x) if (ugensadebug>(n)) printf x
+int ugensadebug = 100; /* XXXebd: if you need it, you probably needs lots */
+#else
+#define DPRINTF(x)
+#define DPRINTFN(n,x)
+#endif
+
+struct ugensa_softc {
+ USBBASEDEVICE sc_dev; /* base device */
+ usbd_device_handle sc_udev; /* device */
+ usbd_interface_handle sc_iface; /* interface */
+
+ device_ptr_t sc_subdev;
+ int sc_numcon;
+
+ u_char sc_dying;
+};
+
+struct ucom_methods ugensa_methods = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+};
+
+#define UGENSA_CONFIG_INDEX 0
+#define UGENSA_IFACE_INDEX 0
+#define UGENSA_BUFSIZE 1024
+
+static const struct usb_devno ugensa_devs[] = {
+ { USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220 },
+};
+#define ugensa_lookup(v, p) usb_lookup(ugensa_devs, v, p)
+
+USB_DECLARE_DRIVER(ugensa);
+
+USB_MATCH(ugensa)
+{
+ USB_MATCH_START(ugensa, uaa);
+
+ if (uaa->iface != NULL)
+ return (UMATCH_NONE);
+
+ DPRINTFN(20,("ugensa: vendor=0x%x, product=0x%x\n",
+ uaa->vendor, uaa->product));
+
+ return (ugensa_lookup(uaa->vendor, uaa->product) != NULL ?
+ UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
+}
+
+USB_ATTACH(ugensa)
+{
+ USB_ATTACH_START(ugensa, sc, uaa);
+ usbd_device_handle dev = uaa->device;
+ usbd_interface_handle iface;
+ usb_interface_descriptor_t *id;
+ usb_endpoint_descriptor_t *ed;
+ char devinfo[1024];
+ char *devname = USBDEVNAME(sc->sc_dev);
+ usbd_status err;
+ struct ucom_attach_args uca;
+ int i;
+
+ DPRINTFN(10,("\nugensa_attach: sc=%p\n", sc));
+
+ usbd_devinfo(dev, 0, devinfo);
+ USB_ATTACH_SETUP;
+ printf("%s: %s\n", devname, devinfo);
+
+ /* Move the device into the configured state. */
+ err = usbd_set_config_index(dev, UGENSA_CONFIG_INDEX, 1);
+ if (err) {
+ printf("\n%s: failed to set configuration, err=%s\n",
+ devname, usbd_errstr(err));
+ goto bad;
+ }
+
+ /* Get the interface. */
+ err = usbd_device2interface_handle(dev, UGENSA_IFACE_INDEX, &iface);
+ if (err) {
+ printf("\n%s: failed to get interface, err=%s\n",
+ devname, usbd_errstr(err));
+ goto bad;
+ }
+
+ sc->sc_udev = dev;
+ sc->sc_iface = iface;
+
+ /* Find the endpoints. */
+ uca.bulkin = uca.bulkout = -1;
+ id = usbd_get_interface_descriptor(iface);
+ for (i = 0; i < id->bNumEndpoints; i++) {
+ int addr, dir;
+ ed = usbd_interface2endpoint_descriptor(iface, i);
+ if (ed == NULL) {
+ printf("%s: could not read endpoint descriptor"
+ ": %s\n", devname, usbd_errstr(err));
+ goto bad;
+ }
+
+ addr = ed->bEndpointAddress;
+ dir = UE_GET_DIR(ed->bEndpointAddress);
+
+ if ((ed->bmAttributes & UE_XFERTYPE) != UE_BULK) {
+ printf("%s: non-bulk endpoint unexpected\n", devname);
+ continue;
+ }
+
+ if (dir == UE_DIR_IN) uca.bulkin = addr;
+ else if (dir == UE_DIR_OUT) uca.bulkout = addr;
+ else printf("%s: unexpected bulk endpoint direction\n",
+ devname);
+ }
+ if (uca.bulkin == -1) {
+ printf("%s: Could not find data bulk in\n",
+ USBDEVNAME(sc->sc_dev));
+ goto bad;
+ }
+ if (uca.bulkout == -1) {
+ printf("%s: Could not find data bulk out\n",
+ USBDEVNAME(sc->sc_dev));
+ goto bad;
+ }
+
+ uca.portno = UCOM_UNK_PORTNO;
+ uca.ibufsize = UGENSA_BUFSIZE;
+ uca.ibufsizepad = UGENSA_BUFSIZE;
+ uca.obufsize = UGENSA_BUFSIZE;
+ uca.opkthdrlen = 0;
+ uca.info = "Generic Serial Device";
+ uca.device = dev;
+ uca.iface = iface;
+ uca.methods = &ugensa_methods;
+ uca.arg = sc;
+
+ usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->sc_udev,
+ USBDEV(sc->sc_dev));
+
+ DPRINTF(("ugensa: in=0x%x out=0x%x\n", uca.bulkin, uca.bulkout));
+ sc->sc_subdev = config_found_sm(self, &uca, ucomprint, ucomsubmatch);
+
+ USB_ATTACH_SUCCESS_RETURN;
+
+bad:
+ DPRINTF(("ugensa_attach: ATTACH ERROR\n"));
+ sc->sc_dying = 1;
+ USB_ATTACH_ERROR_RETURN;
+}
+
+int
+ugensa_activate(device_ptr_t self, enum devact act)
+{
+ struct ugensa_softc *sc = (struct ugensa_softc *)self;
+ int rv = 0;
+
+ switch (act) {
+ case DVACT_ACTIVATE:
+ return (EOPNOTSUPP);
+ break;
+
+ case DVACT_DEACTIVATE:
+ sc->sc_dying = 1;
+ if (sc->sc_subdev)
+ rv = config_deactivate(sc->sc_subdev);
+ break;
+ }
+ return (rv);
+}
+
+USB_DETACH(ugensa)
+{
+ USB_DETACH_START(ugensa, sc);
+ int rv = 0;
+
+ DPRINTF(("ugensa_detach: sc=%p flags=%d\n", sc, flags));
+
+ sc->sc_dying = 1;
+
+ if (sc->sc_subdev != NULL)
+ rv = config_detach(sc->sc_subdev, flags);
+
+ usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
+ USBDEV(sc->sc_dev));
+
+ return (rv);
+}
--- sys.ORIG/dev/usb/usbdevs 2004-07-28 10:37:02.000000000 +0000
+++ sys/dev/usb/usbdevs 2005-03-22 14:04:45.000000000 +0000
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.371.2.3 2004/07/28 10:37:02 tron Exp $
+$NetBSD$
/*
* Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -360,6 +360,7 @@
vendor HAWKING 0x0e66 Hawking Technologies
vendor OTI 0x0ea0 Ours Technology Inc.
vendor PILOTECH 0x0eaf Pilotech
+vendor AIRPRIME 0x0f3d AirPrime Inc.
vendor QUALCOMM 0x1004 Qualcomm
vendor MOTOROLA 0x1063 Motorola
vendor CCYU 0x1065 CCYU Technology
@@ -486,6 +487,9 @@
product AGFA SNAPSCANE26 0x2097 SnapScan e26
product AGFA SNAPSCANE52 0x20fd SnapScan e52
+/* AirPrime products */
+product AIRPRIME PC5220 0x0112 CDMA Wireless PC Card
+
/* AKS products */
product AKS USBHASP 0x0001 USB-HASP 0.06
--- sys.ORIG/dev/usb/usbdevs.h 2004-07-28 10:38:26.000000000 +0000
+++ sys/dev/usb/usbdevs.h 2005-03-21 18:07:06.000000000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdevs.h,v 1.374.2.3 2004/07/28 10:38:26 tron Exp $ */
+/* $NetBSD$ */
/*
* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
@@ -367,6 +367,7 @@
#define USB_VENDOR_HAWKING 0x0e66 /* Hawking Technologies */
#define USB_VENDOR_OTI 0x0ea0 /* Ours Technology Inc. */
#define USB_VENDOR_PILOTECH 0x0eaf /* Pilotech */
+#define USB_VENDOR_AIRPRIME 0x0f3d /* AirPrime Inc. */
#define USB_VENDOR_QUALCOMM 0x1004 /* Qualcomm */
#define USB_VENDOR_MOTOROLA 0x1063 /* Motorola */
#define USB_VENDOR_CCYU 0x1065 /* CCYU Technology */
@@ -493,6 +494,9 @@
#define USB_PRODUCT_AGFA_SNAPSCANE26 0x2097 /* SnapScan e26 */
#define USB_PRODUCT_AGFA_SNAPSCANE52 0x20fd /* SnapScan e52 */
+/* AirPrime products */
+#define USB_PRODUCT_AIRPRIME_PC5220 0x0112 /* CDMA Wireless PC Card */
+
/* AKS products */
#define USB_PRODUCT_AKS_USBHASP 0x0001 /* USB-HASP 0.06 */
--- sys.ORIG/dev/usb/usbdevs_data.h 2004-07-28 10:38:26.000000000 +0000
+++ sys/dev/usb/usbdevs_data.h 2005-03-21 18:11:03.000000000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdevs_data.h,v 1.375.2.3 2004/07/28 10:38:26 tron Exp $ */
+/* $NetBSD$ */
/*
* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
@@ -388,6 +388,12 @@
"SnapScan e52",
},
{
+ USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220,
+ 0,
+ "AirPrime Inc.",
+ "CDMA Wireless PC Card",
+ },
+ {
USB_VENDOR_AKS, USB_PRODUCT_AKS_USBHASP,
0,
"Aladdin Knowledge Systems",
@@ -6694,6 +6700,12 @@
NULL,
},
{
+ USB_VENDOR_AIRPRIME, 0,
+ USB_KNOWNDEV_NOPROD,
+ "AirPrime Inc.",
+ NULL,
+ },
+ {
USB_VENDOR_QUALCOMM, 0,
USB_KNOWNDEV_NOPROD,
"Qualcomm",