# SpeedTouch USB HOWTO
using Benoit Papillault's GPL drivers

Authors :
Sylvain Trias bozo@nobodix.org
Edouard Gomez ed.gomez@free.fr
Bernard Brandl brandl@tuxfamily.org
Benoit Papillault benoit.papillault@free.fr
Last Modifications : May, the 12th 2004

## Table Of Contents

1. Introduction
2. Requirements
3. Installation/Configuration
   1. Your kernel
   2. Benoit's drivers
   3. pppd
4. Launching the connection
5. Where to find (more) help ?

## Introduction

This document will guide you through the installation of Benoit Papillaut's GPL driver for the SpeedTouch USB and SpeedTouch 330 modems made by Thomson (formerly Alcatel) on GNU/Linux.

### Requirements:

- GPL drivers
- Thomson's microcode for the modem
- A kernel with usb support (2.4.x kernels are a good choice but 2.2.x kernels work too)
- pppd

##### Download GPL drivers

Download the latest version from sourceforge project's »» Homepage ««

##### Download Thomson's Modem firmware

What you need to download is the modem's microcode provided with Thomson's drivers. You have two possibilities:

It can be found in the form of two files:

- A mgmt.o file found in the GNU/Linux package
- A alcaudsl.sys file found in the WindowsTM package

(If your modem is already running under windows, you can avoid downloading it by taking the file in c:\windows\system).

Warning:

Just download Thomson's drivers and uncompress them. Do NOT install them. You only need them for the microcode (ie a piece of software loaded into the modem at initialization)

##### A note about linux kernels

Benoit's drivers work very well with 2.4.x series, but it is possible to make them run under 2.2.18 and highers as they use USB code from 2.4.x kernels.

If you're not at ease with kernel compilation, don't be happy worry and pray. Recent distros are likely to provide an operationnal kernel (Mandrake 8.x/RH 7.x/Debian Potato/Woody/Sid for example). Nevertheless, it is preferable to build your own kernel for many reasons that could not be explain in this document. Another good reason to do so is that you can apply a patch on a kernel module, preventing a bug when your connection is restarted.

As a conclusion :

> If you choose to build a new kernel try to pick a recent one: USB support is getting better with versions.

NB : Avoid 2.4.5 like the plague as it keeps swapping and trashing all the time

##### pppd version

pppd should work from 2.3.11 version (this was the elder version we had for testing)

NB : If you have a 2.4.x Linux kernel, you must use a 2.4.x pppd (2.2 kernels run fine with both 2.3.x and 2.4.x pppd daemons).

## Installation/Configuration :

This is a two step job:

- Kernel configuration
- pppd Configuration

### Kernel Configuration

To allow Benoit's drivers to work, your kernel has to have a few options enabled. Configure it with your everyday options and carefully add the following ones:

#### USB support

Your kernel obviously has to support USB to run Alcatel Speedtouch.

Depending on your USB controller (chipset on motherboard/pci card), you'll have to choose between two modules: UHCI or OHCI
Without explaining the whole thing, these are two USB incompatible standards.
This is why you have to know which chipset is yours.

To determine which to use :
`# lspci -v | grep USB`

You should obtain something like :

`usb-ohci : CMD technologies Inc|USB0670B
usb-uhci : USB Controller: Intel Corporation 82371AB PIIX4 USB (rev 01) (prog-if 00 [UHCI])`

If your chipset uses OHCI standard, you'll have to pick usb-ohci (surprising !).
If, on the contrary, it uses UHCI standard you'll have to choose between usb-uhci or uhci. They should work both, but in case you have problems setting usb support with a module, pick the other one, and pray !

##### Options to allow usb support :

> `
> <M>/<*> Support for USB (CONFIG_USB)
> <*> Preliminary USB device filesystem (CONFIG_USB_DEVICEFS)
> <M> UHCI (Intel PIIX4, VIA, ...) support (CONFIG_USB_UHCI)
> <M> UHCI Alternate Driver (JE) support (CONFIG_USB_UHCI_ALT)
> <M> OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support (CONFIG_USB_OHCI)`

#### PPP support

You'll need ppp support in your kernel. If needed compile these parts:

> `
> <M> PPP (point-to-point protocol) support (CONFIG_PPP)
> <M> PPP support for sync tty ports (CONFIG_PPP_SYNC_TTY)`

#### HDLC support

This part is more sensible. If you want to allow proper reconnection, you'll have to patch this module.
Take it easy, you'll find the patch in the drivers' tarball and the command line to run is simple :
`# cd /usr/src/linux
# patch -p1 --dry-run < /path/to/drivers/n_hdlc.c.diff (watchout: two - before dry-run ! )`

If you don't get error message, type the real command to currently patch the kernel sources
`#patch -p1 < /path/to/drivers/n_hdlc.c.diff`

NB: Kernels >= 2.4.18 include our n_hdlc patch so you have not to apply the patch anymore

You can continue, now :

> `Character devices --->
> [*] Non-standard serial port support
> <M> HDLC line discipline support
> [*]Unix98 PTY support`

### Installing the drivers

This installation is straightforward uncompress the drivers'tarball by typing :
`# tar xvzf speedtouch-xxx.tar.gz`

cd into the new directory and type :
`# ./configure && make`

If everything ran fine su root and finish the install by typing :
`# make install`

Greetings, the drivers should now be installed
NB: check your path if you can't run modem_run, as it is copied in /usr/local/sbin

### Creation of the PPP devices

Cd into your /dev directory :
`# cd /dev`

Check ppp devices existence doing :
`# ls *ppp*`

If the ls command gives you an output go to the next step, else create all ppp devices typing :
`# ./MAKEDEV ppp`

### pppd configuration

Check your pppd version by typing :
`# pppd --version.`

Drivers are tested with pppd 2.4.0 and 2.4.1. They also run fine with older versions, per example pppd 2.3.11 shiped with the Potato Debian GNU/Linux.

To configure pppd, you'll have to edit 4 files.

#### 1st file :

You should have an /etc/ppp/options file, edit it and keep these 4 lines in it (comment all extra lines with a #)

`------------------ /etc/ppp/options Beginning -------------
noauth
usepeerdns
lock
noipdefault
------------------ /etc/ppp/options End ------------------`

#### 2nd file

Create /etc/ppp/peers/adsl : `
# mkdir /etc/ppp/peers
# touch /etc/ppp/peers/adsl`

Copy and paste what follows (without the "---" ;) )

`-------------------/etc/ppp/peers/adsl Beginning------------
#
# This file could be rename but its place is under /etc/ppp/peers
# To connect to Internet using this configuration file
# pppd call adsl updetach, where "adsl" stands for the name of this file
#
debug
kdebug 1
noipdefault
defaultroute
pty "/usr/local/sbin/pppoa3 -m 1 -c -vpi 8 -vci 35"
sync
user "your_login_here"
noauth
noaccomp
nopcomp
noccp
novj
holdoff 4
persist
maxfail 25
usepeerdns
------------------/etc/ppp/peers/adsl EOF------------------`

If for an unknown reason pppoa3 failed, you can still try the old pppoa2 daemon. You should change the pty "/usr/local/sbin/pppoa3 -m 1 -c -vpi 8 -vci 35" line by pty "/usr/local/sbin/pppoa2 -vpi 8 -vci 35"
For more details about pppoa2/3, type "man pppoa3, man pppoa2".

Don't forget to adapt the vpi and vci values in the line :
pty "/usr/local/sbin/pppoa2 -vpi 8 -vci 35"

##### Note about the VCI/VPI pair [ if you are hurry go to the next section ;^) ] :

As your connection goes through ATM, 2 new parameters appear :

> - VPI : Virtual Path ID
> - VCI : Virtual Circuit ID

What are their function ?

That's a good question. They are used to identify your Virtual Path Connection (VP) and your Virtual Circuit Connection (VC).
They simplify the network management, minimizing connection delays. They allow cell commutation too.

An ATM network looks like this :

    VC--------|----|-------------|----|--------
    VC--------| VP |             | VP |--------
    VC--------|----| Transmition |----|--------
                   |    Path     |
    VC--------|----|             |----|--------
    VC--------| VP |             | VP |--------
    VC--------|----|-------------|----|--------

#### 3rd file :

2 protocols can be used by providers to identify their users: CHAP or PAP.
Depending on your provider, edit /etc/ppp/chap-secrets or /etc/ppp/pap-secrets.

These fields look like this :

`-------------------/etc/ppp/chap-secrets Begining--------------
# client server secret IP addresses
"your_login_here" "*" "your_password_here" "*"
-------------------/etc/ppp/chap-secrets End-------------------`

If you don't know what protocol is used by your provider, you can fill in both files, it won't hurt.

#### 4th file :

Edit /etc/modules.conf (or /etc/conf.modules if your system is a bit old) and add the following lines :

`alias char-major-108 ppp_generic
alias /dev/ppp ppp_generic
alias tty-ldisc-3 ppp_async
alias tty-ldisc-13 n_hdlc
alias tty-ldisc-14 ppp_synctty
alias ppp-compress-21 bsd_comp
alias ppp-compress-24 ppp_deflate
alias ppp-compress-26 ppp_deflate`

Some entries are useless, but once again they won't hurt !

### Launching the connection

You'll have to :

- Load modem's microcode
- Start pppd

NB: to launch the connection, it is almost mandatory to be logged as root.

#### Verifications

Check if all modules are loaded (if you didn't compile them directly into the kernel) : `
# modprobe ppp_generic
# modprobe ppp_synctty
# modprobe n_hdlc`

Then, check that usbdevfs is mounted : `
# modprobe usbcore
# mount none /proc/bus/usb -t usbdevfs
# modprobe usb-uhci or usb-ohci or uhci`

##### Load the firmware

To load the microcode into the modem, simply type : `
# modem_run -f /path/to/mgmt.o
or
# modem_run -f /path/to/alcaudsl.sys`

##### Launch pppd

Type (and pray) : `
# pppd call adsl updetach`

Wait for a few seconds (20) and check if the link is up by typing : `
# ifconfig ppp0`

You should have a description of the interface.
If not, well it's time to look for help (and so to read the next part of this howto).

## Where to find (more) Help ?

### The MAN pages

You should first look at the man pages, developers write them because they can give you usefull informations :-)
man pppoa2, man pppoa3, man modem_run can give you the information you're looking for.

### User mailing list

If you are searching for help from other users like you (Benoit is also on this mailing list, so it's useless to send an email to the list AND to him). This mailing list is for you, you can discuss anything that's related to the SpeedTouch USB modem (off topic are : Windows , NAT configuration, DNS setup, ...). Both French and English are accepted, but not HTML.

First of all, read the archive of this mailing list before subscribing. Your problem may already have a solution.
To subscribe to the list, send an email to speedtouch-request@ml.free.fr with subscribe as the subject.

### IRC

If your prefer to get a direct help or would like to discuss design of the driver, there is a channel for you. It is sometimes very active and sometimes it seems every one is sleeping. Be aware that French & English are mixed. `
Serveur : irc.freenode.net
Channel : #speedtouch
Known nicknames :
benoit : Benoit PAPILLAULT
francois : François ROGLER
GomGom : Edouard GOMEZ`

Benoit PAPILLAUT's Driver homepage