FreeBSD driver for Option HSDPA modem

Newer HSDPA/UMTS/3G devices (USB dongles) from Option comes with a “packet interface” and requires a special driver, older cards should work just fine with ubsa(4), u3g(4) or any similar serial-over-USB driver.

The driver should support the following devices

  • Option GlobeSurfer iCON 7.2 (2.4.6Hd firmware)
  • Option iCON 225
  • Option iCON 505
  • Option GlobeSurfer iCON HSUPA (Unverified)
  • Option iCON 401 (Unverified)
  • Option GlobeTrotter HSUPA (Unverified)
  • Option GMT382 (embedded module) (Unverified)


If you have any of the devices marked as unverified, please test and report. Thanks.

Contact me if you have any other Option device, particularly of interest are the following devices; iCON 031, iCON 210, iCON 315, iCON 322, iCON 401, iCON 431, iCON 451, iCON 452.

Note that the driver currently doesn’t recognize other devices, although most newer Option HSDPA devices should work. More devices IDs will be added as devices are found. If you own any newer Option device that appears as a USB device, please report back with the device ID.

Note: iCON 7.2 devices with older firmwares are supported by ubsa(4) if you add the correct device ID, or by the new u3g driver available in 8-CURRENT. You have the old firmware the device ID of the mass storage device is 0×05C6 and changes when you switch the device.

Note: This is NOT for cards based on the Nozomi chipset.

Download

FreeBSD 8
uhso-20091122.tar.gz

FreeBSD 8 Connection utility (beta)
uhsoctl-beta-20090812.tar.gz

FreeBSD 7 Driver
hso-20081023.tar.gz

FreeBSD 7 Connection utility
hsoctl-20081023.tar.gz

option-iconf.conf for devd (automatic mode switching)
option-iconf.conf

FreeBSD ports

The FreeBSD 7 driver can be installed through FreeBSD ports. It’s available in comms/hso-kmod

> cd /usr/ports/comms/hso-kmod
> make install

Please see hsoctl(1) for instructions on how to connect to your provider.

Manual install

A simple make should do the trick. If the build would fail for some reason, make sure you have the latest tarball and that the usbdev patch was applied properly. If it still fails, send me a mail with the (whole) error message together with which FreeBSD version you are using.

The following is only required for FreeBSD 7

These devices are so-called ZeroCD devices that when plugged in appears as a mass storage device with windows drivers. To get the HSDPA interface the device needs to be switched, this can be done automatically with camcontrol and devd. The umass(4) driver must be present in the kernel or loaded as a module for this to work.

Add the following to a file called option.conf and place it in /etc/devd/ (create the directory if it doesn’t exits) then restart devd with /etc/rc.d/devd restart

Make sure you replace the product id (0×6911) with the one your device has, you should be able to get it with usbdevs -v

attach 100 {
match "device-name" "umass[0-9]+";
match "vendor"  "0x0af0";
match "product" "0x6911";
match "devclass" "0x00";
action "sleep 1; /sbin/camcontrol cmd `/sbin/camcontrol devlist | /usr/bin/grep ZCOPTION |
/usr/bin/awk '{match($11, /pass[0-9]+/); print substr($11, RSTART, RLENGTH) }'`
-c '01 00 00 00 00 00' -i 1 i1 > /dev/null";
};

Note that this is optional, you can always switch the device manually using camcontrol or with a program called usb_modeswith.

Using the driver

Load the kernel module and plug in your device

> kldload uhso.ko

The following is only required for FreeBSD 7

If you have not installed the automatic mode switcher you need to switch your device, this can be done with for example camcontrol.

> camcontrol devlist
<ZCOPTION HSDPA Modem 3.00>        at scbus8 target 0 lun 0 (pass1,cd1)

The WWAN device is at cd1 (ZCOPTION, ZeroCd Option)

> camcontrol cmd cd1 -c "01 00 00 00 00 00" -i 1 i1

If the driver identifies your device you should see something like this

hso0: <Option N.V. Globetrotter HSDPA Modem, class 255/255, rev 1.10/0.00, addr 2> on uhub0
hso0: Ethernet address: 40:0c:e3:69:11:00

And a new network interface should have appeared

> ifconfig
hso0: flags=882<BROADCAST,NOARP,SIMPLEX> metric 0 mtu 1500
ether 40:0c:e3:69:11:00

In addition to this several TTY devices should have been created (usually 3) called /dev/cuaHSO0.{0-2}

Connection with the uhsoctl connection utility

The uhsoctl connection utility automatically creates and maintains a connection.
It will automatically set IP-address and default route, and update/etc/resolv.conf with the correct nameservers.

It can run both in background and in foreground mode. The execution syntax is hsoctl [options] interface, the following options are recognized (most of with are optional).

-a APN – Access point name
-p PIN – Specify device PIN.
-u username
-k password
-c PDP context ID
-r path – Path to resolv.conf (use /dev/null to disable)
-f path – Specify serial port device to use
-n – Do not fork into background (run in foreground)
-b – Fork into background directly (without waiting for a connection)
-d – Disconnect

Foreground example

Hitting CTRL-C will close the connection.

> uhsoctl -n -a bredband.tre.se -p 1234 uhso0
Searching for network (UMTS)
Registered to "3" (UMTS)
Connected to "3" (bredband.tre.se), carrier UMTS
IP address: 78.156.206.64, Nameservers: 80.251.192.244, 80.251.192.245
Status: connected (UMTS), signal: -87 dBm
^C
>

Background example

> uhsoctl -a bredband.tre.se -p 1234 uhso0
Searching for network (UMTS)
Registered to "3" (UMTS)
Connected to "3" (bredband.tre.se), carrier UMTS
IP address: 78.156.206.64, Nameservers: 80.251.192.244, 80.251.192.245
>
> uhsoctl -d uhso0
Disconnecting uhso0
>

Manual connection

Look up the serial ports

# sysctl dev.uhso
dev.uhso.0.netif: uhso0
dev.uhso.0.type: Network/Serial
dev.uhso.0.ports: 2
dev.uhso.0.port.control.tty: cuaU0.0
dev.uhso.0.port.control.desc: Control
dev.uhso.0.port.application.tty: cuaU0.1
dev.uhso.0.port.application.desc: Application
...
dev.uhso.1.type: Serial
dev.uhso.1.ports: 1
dev.uhso.1.port.diagnostic.tty: cuaU1
dev.uhso.1.port.diagnostic.desc: Diagnostic

Open /dev/cuaU0.0 (or cuaU0.1, any control or application port) in a terminal application, for example minicom. Issue the following commands to establish a connection.

AT+CPIN="1234" # Your PIN
OK

AT+CGDCONT=1,,"bredband.tre.se"
OK

AT_OWANCALL=1,1,1
OK

AT_OWANDATA=1
_OWANDATA: 1, 95.209.79.126, 0.0.0.0, 80.251.201.177, 80.251.201.178, 0.0.0.0, 0.0.0.0, 72000

Configure the interface and set a default route

# ifconfig uhso0 95.209.79.126
# route add default -interface uhso0

Manual connection – FreeBSD 7

Open /dev/cuaHSO0.0 (or cuaHSO0.1) with a terminal program (for example minicom), baud rate doesn’t matter.

If your SIM card requires a PIN

AT+CPIN?
+CPIN: SIM PIN
AT+CPIN="1234"
OK
AT+CPIN?
+CPIN: READY

Next, configure the APN (you should have the details from your provider), you only need to do this once (or when you change APN).

AT+CGDCONT=1,,"bredband.tre.se"
OK

If a username and password is required, it can be specified with

AT$QCPDPP=1,1,"pass","user"

To create the connection, type

AT_OWANCALL=1,1,0

The LED on your device will stop blinking and get a steady shine when you’re connected.
Now, to get the IP info type

AT_OWANDATA=1
_OWANDATA: 1, 79.138.181.171, 0.0.0.0, 80.251.192.244, 80.251.192.245, 0.0.0.0, 0.0.0.0, 72000

The first address is your ip-address, the third and the fourth are your name servers. Now simply configure the network interface with this information as any other network connection.

> ifconfig hso0 79.138.181.171/32
> route add default -interface hso0
> echo "nameserver 80.251.192.244" >> /etc/resolv.conf
> echo "nameserver 80.251.192.245" >> /etc/resolv.conf

Your connection should be ready now

> ping ping.sunet.se
PING ping.sunet.se (192.36.125.18): 56 data bytes
64 bytes from 192.36.125.18: icmp_seq=0 ttl=251 time=131.873 ms
64 bytes from 192.36.125.18: icmp_seq=1 ttl=251 time=130.545 ms
^C
--- ping.sunet.se ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 130.545/131.209/131.873/0.664 ms

The connection can be closed with the following command

AT_OWANCALL=1,0,0

Comments are closed.