Add a driver by Fredrik Lindberg for Option HSDPA USB devices. These differ

from standard 3G wireless units by supplying a raw IP/IPv6 endpoint rather than
using PPP over serial. uhsoctl(1) is used to initiate and close the WAN
connection.

Obtained from:	Fredrik Lindberg <fli@shapeshifter.se>
This commit is contained in:
Andrew Thompson 2010-01-13 03:16:31 +00:00
parent 651e41a42c
commit 941e286383
12 changed files with 3572 additions and 2 deletions

View File

@ -424,6 +424,7 @@ MAN= aac.4 \
ugen.4 \
uhci.4 \
uhid.4 \
uhso.4 \
uipaq.4 \
ukbd.4 \
ulpt.4 \

115
share/man/man4/uhso.4 Normal file
View File

@ -0,0 +1,115 @@
.\" Copyright (c) 2009 Fredrik Lindberg
.\" All rights reserved.
.\"
.\" 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.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
.\"
.\" $FreeBSD$
.\"
.Dd Aug 12, 2009
.Os
.Dt UHSO 4
.Sh NAME
.Nm hso
.Nd support for several HSxPA devices from Option N.V.
.Sh SYNOPSIS
The module can be loaded at boot time by placing the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
uhso_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides support for several HSxPA devices from Option N.V. that are
based on their packet interface.
Each device has a set of serial ports and a raw IP packet interface.
The serial ports of the device are accessed through the
.Xr ucom 4
driver which makes them behave like a
.Xr tty 4 .
The packet interface is exposed as a network interface.
.Pp
To establish a connection on the packet interface the use of the proprietary
AT commands
.Dq Li AT_OWANCALL
and
.Dq Li AT_OWANDATA
are required on any of the serial ports.
.Pp
The network interface must be configured manually using the data obtain from
these calls.
.Pp
Each device usually have at least two or more serial ports, their individual purpose
can be identified through
.Xr sysctl 8 .
.Sh HARDWARE
The
.Nm
driver supports at least the following cards
.Pp
.Bl -bullet -compact
.It
Option GlobeSurfer iCON 7.2 (new firmware)
.It
Option iCON 225
.El
.Pp
The device features a mass storage device referred to as
.Dq Zero-CD
which contains drivers for Microsoft Windows.
The driver automatically switches the device to modem mode.
.Sh EXAMPLES
Establishing a packet interface connection
.Bd -literal -offset indent
AT+CGDCONT=1,,"apn.provider"
AT_OWANCALL=1,1,1
OK
_OWANCALL=1,1
AT_OWANDATA=1
_OWANDATA: 1, 10.11.12.13, 0.0.0.0, 10.2.3.4, 10.2.3.5, \e
0.0.0.0, 0.0.0.0, 72000
.Ed
.Pp
Configuring the interface
.Bd -literal -offset indent
ifconfig uhso0 10.11.12.13 up
route add default -interface uhso0
echo "nameserver 10.2.3.4" > /etc/resolv.conf
echo "nameserver 10.2.3.5" >> /etc/resolv.conf
.Ed
.Pp
The connection can be terminated with
.Bd -literal -offset indent
AT_OWANCALL=1,0,1
.Ed
.Sh FILES
.Bl -tag -width "XXXXXX"
.It Pa /dev/cuaU?.?
.El
.Sh SEE ALSO
.Xr ucom 4 ,
.Xr usb 4
.Sh AUTHORS
The
.Nm
driver was written by
.An Fredrik Lindberg Aq fli@shapeshifter.se .

View File

@ -2652,6 +2652,9 @@ device rue
#
# Davicom DM9601E USB to fast ethernet. Supports the Corega FEther USB-TXC.
device udav
#
# HSxPA devices from Option N.V
device uhso
#
# Ralink Technology RT2501USB/RT2601USB wireless driver

View File

@ -1676,7 +1676,7 @@ dev/usb/usb_request.c optional usb
dev/usb/usb_transfer.c optional usb
dev/usb/usb_util.c optional usb
#
# USB ethernet drivers
# USB network drivers
#
dev/usb/net/if_aue.c optional aue
dev/usb/net/if_axe.c optional axe
@ -1687,6 +1687,7 @@ dev/usb/net/if_rue.c optional rue
dev/usb/net/if_udav.c optional udav
dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | rue | \
udav
dev/usb/net/uhso.c optional uhso
#
# USB WLAN drivers
#

1754
sys/dev/usb/net/uhso.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2100,6 +2100,17 @@ product OPTION E7061 0x7061 3G modem
product OPTION E7100 0x7100 3G modem
product OPTION GTM380 0x7201 3G modem
product OPTION GE40X 0x7601 Globetrotter HSUPA
product OPTION GSICON72 0x6911 GlobeSurfer iCON
product OPTION GSICONHSUPA 0x7251 Globetrotter HSUPA
product OPTION ICON401 0x7401 GlobeSurfer iCON 401
product OPTION GTHSUPA 0x7011 Globetrotter HSUPA
product OPTION GMT382 0x7501 Globetrotter HSUPA
product OPTION GE40X_1 0x7301 Globetrotter HSUPA
product OPTION GE40X_2 0x7361 Globetrotter HSUPA
product OPTION GE40X_3 0x7381 Globetrotter HSUPA
product OPTION ICONEDGE 0xc031 GlobeSurfer iCON EDGE
product OPTION MODHSXPA 0xd013 Globetrotter HSUPA
product OPTION ICON321 0xd031 Globetrotter HSUPA
/* OQO */
product OQO WIFI01 0x0002 model 01 WiFi interface

View File

@ -31,7 +31,7 @@ SUBDIR += rum uath upgt ural zyd ${_urtw}
SUBDIR += atp uhid ukbd ums udbp ufm
SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \
umct umodem umoscom uplcom uslcom uvisor uvscom
SUBDIR += uether aue axe cdce cue kue rue udav
SUBDIR += uether aue axe cdce cue kue rue udav uhso
SUBDIR += usfs umass urio
SUBDIR += quirk template

View File

@ -0,0 +1,37 @@
#
# $FreeBSD$
#
# Copyright (c) 2010 Andrew Thompson. All rights reserved.
#
# 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.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
#
S= ${.CURDIR}/../../..
.PATH: $S/dev/usb/net
KMOD= uhso
SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \
opt_inet.h \
uhso.c
.include <bsd.kmod.mk>

View File

@ -189,6 +189,7 @@ SUBDIR= ${_ac} \
tzsetup \
${_uathload} \
ugidfw \
${_uhsoctl} \
${_usbdevs} \
${_usbconfig} \
${_vidcontrol} \
@ -410,6 +411,7 @@ _crunch= crunch
.if ${MACHINE_ARCH} != "ia64"
_uathload= uathload
.endif
_uhsoctl= uhsoctl
#_usbdevs= usbdevs
_usbconfig= usbconfig
.endif

10
usr.sbin/uhsoctl/Makefile Normal file
View File

@ -0,0 +1,10 @@
# $FreeBSD$
PROG= uhsoctl
MAN= uhsoctl.1
WARNS= 1
DPADD= ${LIBUTIL}
LDADD= -lutil
.include <bsd.prog.mk>

104
usr.sbin/uhsoctl/uhsoctl.1 Normal file
View File

@ -0,0 +1,104 @@
.\" Copyright (c) 2008-2009 Fredrik Lindberg
.\" All rights reserved.
.\"
.\" 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.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
.\"
.\" $FreeBSD$
.\"
.Dd Aug 12, 2009
.Os
.Dt UHSOCTL 1
.Sh NAME
.Nm uhsoctl
.Nd connection utility for Option based devices
.Sh SYNOPSIS
.Nm
.Op Fl a Ar apn
.Op Fl c Ar cid
.Op Fl p Ar pin
.Op Fl u Ar username
.Op Fl k Ar password
.Op Fl r Ar path
.Op Fl f Ar path
.Op Fl b | n
.Ar interface
.Nm
.Fl d
.Ar interface
.Nm
.Fl h
.Sh DESCRIPTION
.Nm
is a small connection utility for Option N.V. devices that are based on Options
packet interface and uses proprietary AT_* calls to establish connections.
The utility (tries to) configure both default route and name servers
(/etc/resolv.conf).
.Pp
By default
.Nm
detaches from the terminal upon on a successful connection, a few command-line
options exists that allows this behavior to be changed.
.Pp
.Nm
attempts to find a usable controlling serial port based on the provided network
interface.
If this fails you might specify a serial port manually.
.Sh OPTIONS
.Bl -tag -width XXXX
.It Fl a Ar apn
Specify APN to connect to.
.It Fl c Ar cid
Specify CID (Context ID) to use, by default CID 1 is used.
If an APN has been configured once, it's enough to specify the CID used for
further accesses.
.It Fl p Ar pin
Specify SIM PIN.
.It Fl u Ar username
Specify username.
.It Fl k Ar password
Specify username.
.It Fl r Ar path
Path to resolv.conf, default /etc/resolv.conf.
Use /dev/null to disable updating of name servers.
.It Fl f Ar path
Explicitly set the serial port to use as controlling terminal.
Might be needed if the automatic detection fails.
.It Fl b
Fork into background directly, before a connection has been established.
.It Fl n
Never fork into background, run entirely in foreground.
.El
.Sh EXAMPLES
Connect to
.Dq Li apn.example.com
on interface
.Dq Li uhso0
and use PIN
.Dq 1234
to enable the SIM card.
.Dl "uhsoctl -a apn.example.com -p 1234 uhso0"
Disconnect from a previously established connection
.Dl "uhsoctl -d uhso0"
.Sh SEE ALSO
.Xr uhso 4

1532
usr.sbin/uhsoctl/uhsoctl.c Normal file

File diff suppressed because it is too large Load Diff