NetBSD Problem Report #33843

From buhrow@lothlorien.nfbcal.org  Wed Jun 28 06:43:29 2006
Return-Path: <buhrow@lothlorien.nfbcal.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 832AF63B937
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 28 Jun 2006 06:43:29 +0000 (UTC)
Message-Id: <200606280516.k5S5GNWe011002@lothlorien.nfbcal.org>
Date: Tue, 27 Jun 2006 22:16:23 -0700 (PDT)
From: Brian Buhrow <buhrow@lothlorien.nfbcal.org>
Reply-To: buhrow@lothlorien.nfbcal.org
To: gnats-bugs@NetBSD.org
Subject: Patches and howto for using the Qualcom/Kyocera EVDO card with NetBSD-3.0 and Verizon EVDO service
X-Send-Pr-Version: 3.95

>Number:         33843
>Category:       kern
>Synopsis:       Patches and documentation on how to use the Kyocera EVDO card under NetBSD-3.0
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 28 06:45:00 +0000 2006
>Last-Modified:  Sat Jul 01 21:17:40 +0000 2006
>Originator:     Brian Buhrow
>Release:        NetBSD 3.0_STABLE
>Organization:
	NFB of California
>Environment:


System: NetBSD nfbcal.org 3.0_STABLE NetBSD 3.0_STABLE (NFBNETBSD) #0: Tue Jan 31 14:45:08 PST 2006 buhrow@lothlorien.nfbcal.org:/usr/src/sys/arch/i386/compile/NFBNETBSD i386
Architecture: i386
Machine: i386
>Description:

	I wanted to document how to get the Qualcomm/Kyocera EVDO cards
working with NetBSD-3.0 and Verizon EVDO service, so that folks who might
be attempting to get this working might have an easier time of it.
	I've enclosed diffs showing what kernel changes need to be made to get
the kernel ready to use the card, as well as a shell archive of the ppp
files necessary to use the card.
	To use the shar archive, unload its contents into /etc/ppp by running
it through the shell while in the /etc/ppp directory.
Once you've done that, edit the vzw3g.info file, replacing the xxxxxxxxxx
with the phone number for your card's account.
	Once the kernel is ready to use the card, you'll know when you have a
ucom0 at a Qualcomm hub, run the following command as root.
#ppp file /etc/ppp/options.vzw3g
	If all went well, you'll have a blinking light on your EVDO card, and
yo'll be able to get out to the net.
To turn off the connection, use the command:
kill `cat /var/run/ppp0.pid`
as root.
	Note that there is a kernel bug, at least in NetBSD-3.0, where if you
extract the EVDO card after you've used it, even if you shut the connection
down, the machine will hang.  Other than that, it works great, is reliable,
and is a great way to put your laptop on the Net, any time, anywhere.  
	I hope folks find these patches and files useful.
-Brian

>How-To-Repeat:

>Fix:


Here is the relevantportion of the dmesg output for the Qualcomm/Kyocera
EVDO card.


ohci0 at cardbus0 dev 0 function 0: NEC USB Host Controller (rev. 0x43)
ohci0: interrupting at 11
ohci0: OHCI version 1.0
usb1 at ohci0: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 1 port with 1 removable, self powered
ohci1 at cardbus0 dev 0 function 1: NEC USB Host Controller (rev. 0x43)
ohci1: interrupting at 11
ohci1: OHCI version 1.0
usb2 at ohci1: USB revision 1.0
uhub2 at usb2
uhub2: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 1 port with 1 removable, self powered
ugensa0 at uhub1 port 1
ugensa0: Qualcomm, Incorporated Qualcomm CDMA Technologies MSM, rev 1.10/0.00, addr 2
ugensa0: unexpected endpoint
ucom0 at ugensa0 portno -887896676: portno -887896676, Generic Serial Device

Here are the lines I added to my config file to get the ugensa device
attached as a com port.
Note that you need a ppp pseudo device in your kernel to use this card.
The GENERIC kernel has 2 ppp pseudo devices in it, by default.


ugensa*	at uhub?	#Generic Serial Adapters
ucom*	at ugensa? portno ?	#Attach com ports to these guys

Here are the diffs for the /usr/src/sys/dev/usb/usbdevs
file.  Note that you'll have to patch this by hand because this diff is
taken from a much later revision of the usbdevs file than is present in any
version of the 3.x source tree.  Just put in the second and fourth additions in the
diff file.

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

===================================================================
RCS file: /ftp/cvs/cvsroot/src/sys/dev/usb/usbdevs,v
retrieving revision 1.423
retrieving revision 1.424
diff -u -p -r1.423 -r1.424
--- src/sys/dev/usb/usbdevs     2006/03/13 16:29:58     1.423
+++ src/sys/dev/usb/usbdevs     2006/03/25 14:12:19     1.424
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.423 2006/03/13 16:29:58 christos Exp $
+$NetBSD: usbdevs,v 1.424 2006/03/25 14:12:19 gdt Exp $

 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -385,6 +385,7 @@ vendor CHICONY2             0x0c45  Chicony Electron
 vendor SEALEVEL                0x0c52  Sealevel System
 vendor LUWEN           0x0c76  EasyDisk
 vendor ZCOM            0x0cde  Z-Com
+vendor QUALCOMM_K      0x0c88  Qualcomm Kyocera
 vendor TANGTOP         0x0d3d  Tangtop
 vendor SMC3            0x0d5c  Standard Microsystems
 vendor PEN             0x0d7d  Pen Drive
@@ -450,6 +451,7 @@ vendor ZINWELL              0x5a57  Zinwell
 vendor SITECOM         0x6189  Sitecom
 vendor INTEL           0x8086  Intel
 vendor HP2             0xf003  Hewlett Packard
+vendor USRP            0xfffe  GNU Radio USRP

 /*
  * List of known products.  Grouped by vendor.
@@ -1576,6 +1578,8 @@ product QTRONIX 980N              0x2011  Scorpion-98
 /* Qualcomm products */
 product QUALCOMM CDMA_MSM      0x6000  CDMA Technologies MSM phone

+product QUALCOMM_K CDMA_MSM_K  0x17da  Qualcomm Kyocera CDMA Technologies MSM
+
 /* Quickshot products */
 product QUICKSHOT STRIKEPAD    0x6238  USB StrikePad

@@ -1874,6 +1878,9 @@ product UNIACCESS PANACHE 0x0101  Panache
 /* U.S. Robotics products */
 product USR USR1120            0x00eb  USR1120 WLAN

+/* GNU Radio USRP */
+product USRP USRPv2            0x0002  USRP Revision 2
+
 /* VidzMedia products */
 product VIDZMEDIA MONSTERTV    0x4fb1  MonsterTV P2H


	After you patch the usbdevs file, be sure to run:
make -f Makefile.usbdevs 
in the /usr/src/sys/dev/usb directory.

	Here are the diffs for the /usr/src/sys/dev/usb/ugensa.c file.
I think this patch will work, but I did it by hand, in order not to get the
extraneous spaces from my web browser.  Just add the one ID line to the
match structure.  Hint: it's the last line which appears with a "+" at the
beginning of the line.  Take off the plus, align the characters with the
ones above it in the ugensa.c file, and you're done.

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

===================================================================
RCS file: /ftp/cvs/cvsroot/src/sys/dev/usb/ugensa.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- src/sys/dev/usb/ugensa.c    2005/12/11 12:24:01     1.4
+++ src/sys/dev/usb/ugensa.c    2006/03/25 14:15:45     1.5
@@ -1,4 +1,4 @@
-/*     $NetBSD: ugensa.c,v 1.4 2005/12/11 12:24:01 christos Exp $      */
+/*     $NetBSD: ugensa.c,v 1.5 2006/03/25 14:15:45 gdt Exp $   */

 /*
  * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
@@ -92,6 +92,7 @@ struct ucom_methods ugensa_methods = {

 static const struct usb_devno ugensa_devs[] = {
        { USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220 },
+       { USB_VENDOR_QUALCOMM_K, USB_PRODUCT_QUALCOMM_K_CDMA_MSM_K },
 };
 #define ugensa_lookup(v, p) usb_lookup(ugensa_devs, v, p)


	Finally, here is the shell archive file containing the files necessary
to get pppd working with this card.  These files should be placed in
/etc/ppp.
Run
sh /path/to/shell/archive
while in the /etc/ppp directory and while root to get these files properly
installed.
	Next, edit the vzw3g.info file and replace the 10 x's with the phone
number you use with the card.  
Now, you can run:
ppp file /etc/ppp/options.vzw3g
to bring up a network connection over this card.  

-Brian

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	dial.vzw3g
#	ip-up
#	options
#	options.vzw3g
#	vzw3g.info
#
echo x - dial.vzw3g
sed 's/^X//' >dial.vzw3g << 'END-of-dial.vzw3g'
X#!/bin/sh 
XPATH=/sbin:/usr/sbin:/etc:/etc/ppp:/etc ; export PATH
Xchat -v "" atdt#777 CONNECT
END-of-dial.vzw3g
echo x - ip-up
sed 's/^X//' >ip-up << 'END-of-ip-up'
X#!/bin/sh
XPATH=/bin:/usr/bin:/usr/pkg/bin:/sbin:/usr/sbin; export PATH
Xrm -f /tmp/ns.$$
Xecho -n "#Creaed by ip-up on " > /tmp/ns.$$
Xdate >> /tmp/ns.$$
X#Substitute your actual domain below.
Xecho "search domain.com" >> /tmp/ns.$$
Xcat /etc/ppp/resolv.conf >> /tmp/ns.$$
Xrm -f /etc/resolv.conf
Xcp -p /tmp/ns.$$ /etc/resolv.conf
Xchmod 644 /etc/resolv.conf
X#Optional setting of the time from a public stratum 1 ntp server
Xntpdate clock.via.net
Xexit 0
END-of-ip-up
echo x - options
sed 's/^X//' >options << 'END-of-options'
Xdebug
Xlcp-restart 10
Xipcp-restart 30
Xasyncmap 0005001
Xmru 1500
Xcrtscts
END-of-options
echo x - options.vzw3g
sed 's/^X//' >options.vzw3g << 'END-of-options.vzw3g'
Xconnect /etc/ppp/dial.vzw3g
Xdebug
Xusepeerdns
X+ua /etc/ppp/vzw3g.info
X/dev/ttyU0
X0.0.0.0:0.0.0.0
X230400
Xdefaultroute
END-of-options.vzw3g
echo x - vzw3g.info
sed 's/^X//' >vzw3g.info << 'END-of-vzw3g.info'
Xxxxxxxxxxx@vzw3g.com
Xvzw
X
END-of-vzw3g.info
exit

>Release-Note:

>Audit-Trail:
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/33843: Patches and howto for using the Qualcom/Kyocera EVDO
 card with NetBSD-3.0 and Verizon EVDO service
Date: Wed, 28 Jun 2006 06:17:46 -0700 (PDT)

 >  vendor HP2             0xf003  Hewlett Packard
 > +vendor USRP            0xfffe  GNU Radio USRP

 ...

 > @@ -1874,6 +1878,9 @@ product UNIACCESS PANACHE 0x0101  Panache
 >  /* U.S. Robotics products */
 >  product USR USR1120            0x00eb  USR1120 WLAN
 >  
 > +/* GNU Radio USRP */
 > +product USRP USRPv2            0x0002  USRP Revision 2
 > +

 Is this USRP relevant to this too?  (I am mostly curious as I am learning 
 about this.)


  Jeremy C. Reed

 echo '9,J8HD,fDGG8B@?:536FC5=8@I;C5?@H5B0D@5GBIELD54DL>@8L?:5GDEJ8LDG1' |\
 sed ss,s50EBsg | tr 0-M 'p.wBt SgiIlxmLhan:o,erDsduv/cyP'

From: buhrow@lothlorien.nfbcal.org (Brian Buhrow)
To: gnats-bugs@NetBSD.org, kern-bug-people@NetBSD.org,
	gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org
Cc: buhrow@lothlorien.nfbcal.org, reed@reedmedia.net
Subject: Re: kern/33843: Patches and howto for using the Qualcom/Kyocera EVDO card with NetBSD-3.0 and Verizon EVDO service
Date: Wed, 28 Jun 2006 11:02:20 -0700

 	Hello Jeremy.  No, only the QUALCOMM/KYOCERA lines are relevant.  I
 just didn't remove those other insertions from the diff.
 -Brian


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.