Speedtouch Links

Home
Firmware Extractor
Fedora Core
Ubuntu
Mandriva
SuSE
Xbox and PS2 Masquerading
FAQ
Help (mailing list)
Tux riding the SpeedTouch
SourceForge Logo

The Linux Kernel Speedtouch Driver on Linux From Scratch

Modules?

In general, if you're compiling a kernel for yourself, you know what hardware it will be running on and you know what features you want it to support. If you want the kernel to be able to do something, compile that feature into the kernel. If you don't need a particular feature, don't waste time compiling the module.

However, sometimes modules have their uses. In particular, if the speedtouch driver is built into the kernel it may request the firmware from udev before the root filesystem has been mounted. To avoid this, compile the speedtouch driver as a module. If the module can be loaded the firmware should be available too.

The problem is a race condition, and it depends on your hardware. If it works for you with the speedtouch driver built into the kernel then go with that. But if you have problems loading the firmware, try recompiling the kernel with the speedtouch driver as a module and load the module from the bootscript.

UHCI or OHCI?

You need to know what sort of USB controller you have. Find out with lspci (part of pciutils - PCI Utilities in BLFS)

/usr/sbin/lspci | grep USB

Enable support for either UHCI or OHCI, not both.

You'll need to know if your ISP uses PPPoA or PPPoE. When you get to configuring PPP you'll need to know the VPI/VCI numbers for your country/ISP. Those details can be found on this table

make menuconfig

cd into the kernel source, make menuconfig and enable these options

When you've finished, save the .config file then execute make. When it's done copy arch/i386/boot/bzImage to /boot. If you compiled some modules you'll need to run make modules_install and copy the file System.map into the same folder as your kernel. Edit Grub's menu.lst to point to your new kernel.

cp arch/i386/boot/bzImage /boot &&
cp System.map /boot &&
make modules_install

Linux-ATM

Download a copy of linux-atm-2.4.1. You will need to patch it to compile it with recent (gcc-3.4 or later) versions of gcc. linux-atm-2.4.1-gcc-4.patch
Untar linux-atm, cd into it, patch it, configure and make it

tar xzf linux-atm-2.4.1.tar.gz &&
cd linux-atm-2.4.1 &&
patch -Np1 -i ../linux-atm-2.4.1-gcc-4.patch &&
./configure --prefix=/usr --sysconfdir=/etc &&
make &&
su

Enter roots password then

make install

PPP-2.4.4

You need to install pppd after libatm so that ppp builds the pppoatm.so plugin. Download a copy of PPP-2.4.4, untar ppp, cd into it, configure and make it

tar xzf ppp-2.4.4.tar.gz &&
cd ppp-2.4.4 &&
./configure --prefix=/usr &&
make &&
su

Enter roots password then

make install

The Firmware

If you have a copy of the firmware that you know works with your modem, stick with that. Most people will use the firmware in the SpeedTouch330_firmware_3012.zip.

If you're not sure what revision of modem you have, first, as root, mount usbfs on /proc/bus/usb

mount -t usbfs usbfs /proc/bus/usb

Now you should be able to find out what revision your modem is with this command

awk '/4061/ { print $5 }' /proc/bus/usb/devices

Since 2.6.10 the kernel has been able to load the firmware itself, but it need to be split into two parts first with the firmware-extractor. Untar the firmware-extractor.tar.gz and put a copy of your firmware in the firmware-extractor folder. Rename the firmware mgmt.o, then it's the usual configure, make, make install

./configure &&
make &&
su

That will split the firmware into speedtch-1.bin and speedtch-2.bin. To copy it into hotplugs firmware folder, enter roots password then

make install

That will copy speedtch-1.bin and speedtch-2.bin to /lib/firmware

Secrets

Become root and create the folder /etc/ppp/peers

mkdir -p /etc/ppp/peers

Now create a plain text file called either /etc/ppp/chap-secrets or /etc/ppp/pap-secrets with a text editor. If you don't know if your ISP uses chap or pap authentication put your a line like this in both files, it won't do any harm.

"username@isp" "*" "password"

username@isp should be the username your ISP knows you by. Usually (but not always) it has an @isp bit at the end (it might be @dsl.fs, for example). Change password for the password you chose when you set up your internet account. Don't miss out the spaces in the " "*" " bit.

If your ISP uses PPPoE skip down to the PPPoE section

PPPoA

Copy and paste this into a text editor then save it as /etc/ppp/peers/speedtch

noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin pppoatm.so
0.00

### If the firmware loads and pppd won't
### connect uncomment this option to make
### pppd be more verbose in the system log

# debug

### For more details (and more options)
### read man pppd

Change username@isp for the username your ISP knows you by and change the 0.00 for the VP/VC values for your country/ISP. In Britain it's 0.38, for example

Tidying Up

When you reboot the kernel will detect the hardware and get hotplug (or udev) to load the firmware. All that's left to do is to get pppd to call your ISP. This can be done with the command `pppd call speedtch'.
This bootscript will wait till the firmware has loaded then call pppd. As root open a text editor then copy, paste and save it as /etc/rc.d/init.d/dial

#!/bin/bash
### if you compiled the speedtouch driver as a
### module, uncomment this modprobe
#modprobe speedtch
count=0
while [[ $((count++)) -lt 40 ]]
do
  if dmesg | grep 'ADSL line is up'
  then
    pppd call speedtch
    exit 0
  fi
  sleep 1
done
echo "The SpeedTouch firmware did not load"

Now, make it executable, make a symbolic link pointing at it from /etc/rc.d/rc5.d (so it gets run on boot), change the permissions on the scripts you've put in /etc/ppp so that they're not world readable and make a symbolic link from /etc/resolv.conf pointing at /etc/ppp/resolv.conf. Open a root shell and copy this into it

chmod 744 /etc/rc.d/init.d/dial &&
ln -s ../init.d/dial /etc/rc.d/rc5.d/S96dial &&
chmod 600 /etc/ppp/{*secrets,peers/speedtch} &&
ln -sf ppp/resolv.conf /etc/resolv.conf

When you reboot into init 5 it should connect you to the web.
Please report any problems to the mailing list


PPPoE

For PPPoE over ATM things are a slightly different. You'll need a copy of the br2684ctl bridging utility. Compile it with the command

gcc -o br2684ctl brctl-010226.c -latm &&
su

Enter roots password and copy it to /usr/sbin

cp br2684ctl /usr/sbin

PPP

Copy and paste this into a text editor then save it as /etc/ppp/peers/speedtch

noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin rp-pppoe.so
nas0

### If the firmware loads and pppd won't
### connect uncomment this option to make
### pppd be more verbose in the system log

# debug

### For more details (and more options)
### read man pppd

Change username@isp for the username your ISP knows you by. Often (but not always) it has an @isp bit at the end.

Tidying Up

When you reboot the kernel will detect the hardware and get hotplug to load the firmware. You'll need to use the br2684ctl to create a bridging connection, configure it with iproute then get pppd to call your ISP. This can be done with a bootscript. As root open a text editor then copy and paste this and save it as /etc/rc.d/init.d/dial
Change VP.VC for the VPI/VCI numbers for your country/ISP. For example in Portugal it's 0.35

#!/bin/bash
### if you compiled the speedtouch driver as a
### module, uncomment this modprobe
#modprobe speedtch
count=0
while [[ $((count++)) -lt 40 ]]
do
  if dmesg | grep 'ADSL line is up'
  then
    br2684ctl -b -c 0 -a VP.VC
    sleep 2
    ip addr add 192.168.0.1/32 dev nas0
    ip link set nas0 up
    sleep 5
    pppd call speedtch
    exit 0
  fi
  sleep 1
done
echo "The SpeedTouch firmware did not load"

Now, make it executable, make a symbolic link pointing at it from /etc/rc.d/rc5.d so it gets run on boot, change the permissions on the scripts you've installed in /etc/ppp so that they're not world readable and make a symbolic link from /etc/resolv.conf pointing at /etc/ppp/resolv.conf. Open a root shell and copy this into it

chmod 744 /etc/rc.d/init.d/dial &&
ln -s ../init.d/dial /etc/rc.d/rc5.d/S96dial &&
chmod 600 /etc/ppp/{*secrets,peers/speedtch} &&
ln -sf ppp/resolv.conf /etc/resolv.conf

When you reboot into init 5 it should connect you to the web.
Please report any problems to the mailing list