Speedtouch Links

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

The Linux Kernel Speedtouch Driver on Gentoo

Kernel Compiling

First we need to get the required options compiled into the kernel. This is explained quite well in the Gentoo Handbook.(here) I'm going to assume that you (and Google) know how to build a kernel that supports all the other hardware you have. On this page I will just discuss the options you need to enable to get the Speedtouch kernel driver working.

You should compile a 2.6.10 kernel (or later) so it will be able to load the firmware without the assistance of modem_run.

Modules?

When you configure the kernel, with many options you get the choice to compile the feature into the kernel or build it as a loadable module. If you're preparing a distribution like Mandrake or SuSE then modules make a lot of sense as they allow you to compile a small kernel that has many modules available that can be dynamically loaded so the kernel can adjust to whatever hardware it's installed on.
But you're not compiling a kernel to run on any machine. You're compiling a kernel to run on your own computer. If you need a feature, compile it into the kernel. If you don't need it, don't waste time compiling the module. Modules can cause problems, particularly if you use udev.

UHCI or OHCI?

You need to know what sort of USB controller you have. If you have pciutils installed, lspci should tell you.

/usr/sbin/lspci | grep USB

If not, try and find out which one you have from Google.

If it mentions EHCI as well as UHCI or OHCI then you can enable support for EHCI too. But the main thing is to 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

Using Genkernel

Genkernel is mostly functional nowadays, and so I tend to use it. If you have previously compiled a kernel with genkernel, and you use udev, then you should be able to execute the following. If you use devfs, then change as appropriate.

genkernel --menuconfig --udev all

This will use the configuration from your last successful kernel build (or the default one if this is your first go with this particular kernel version), and then run make menuconfig. At time of writing, if you just emerge gentoo-sources, then you should get the kernel version 2.6.11-r9. Which is easily enough to support the firmware loading. You will need to enable the following options:-

Make sure you say yes to save the new kernel config when you exit, genkernel will then compile the kernel and initrd and copy them into /boot. You might need to edit Grub's grub.conf to point to your new kernel (and initrd).

Linux-ATM

The PPP ebuild pulls in linux-atm as long as you have atm in your USE variable, so edit /etc/make.conf, or alternatively add it to /etc/portage/package.use like this.

echo 'net-dialup/ppp atm' >> /etc/portage/package.use

PPP-2.4.3

You should have already made sure to USE atm in the previous section so now we just need to emerge ppp. You may want to run with the -pv flags first, in case you would like to USE some other things, like ipv6 for example, once you are ready, install the packages with :-

emerge net-dialup/ppp

Hotplug

You should check that you have hotplug installed :-

emerge -s sys-apps/hotplug

It should say you have an installed version under the sys-apps/hotplug section. If not, install it with :-

emerge sys-apps/hotplug

The Firmware

Download a copy of the firmware-extractor.
If you have a copy of the firmware that you know works with your modem, stick with that, otherwise

If you're not sure what revision your modem is, use the command

grep -B 1 "THOMSON
ALCATEL" /proc/bus/usb/devices

At the end of the first line it should say Rev= X.00
Where X is the version of the modem you have.

Put a copy of your firmware next to the firmware-extractor.tar.gz and rename it mgmt.o

tar xzf firmware-extractor.tar.gz &&
cd firmware-extractor &&
cp ../mgmt.o mgmt.o &&
./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

FIRMWARE_DIR, the place where hotplug keeps it's firmware, is defined in the script /etc/hotplug/firmware.agent
The default is /lib/firmware, you can check if the speedtch-{1,2}.bin files are there with the command

ls /lib/firmware

It is probably worth rebooting at this point, and seeing if your new kernel and firmware work. You can execute the command below to check your kernel messages, and you should get similar output to that below :-

dmesg |grep 'speedt\|DSL'
usbcore: registered new driver speedtch
usb 1-1: found stage 1 firmware speedtch-1.bin
usb 1-1: found stage 2 firmware speedtch-2.bin
ADSL line is synchronising
DSL line goes up
ADSL line is up (2272 Kib/s down | 288 Kib/s up)

Secrets

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 @bt, 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 is 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

### You may need to uncomment these
### options to connect with some ISP's.
### They disable compression.

# noaccomp
# nobsdcomp
# nodeflate
# nopcomp
# noccp
# novj

### 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 on the last line for the VP/VC values for your country/isp. In Britain it's 0.38, for example

See if it works by executing :-

/usr/sbin/pppd call speedtch

It should connect you to the internet, you can disconnect again by sending the pppd process a TERM signal. If you have more than one pppd process, you should be sure to shut down the right one. So if your modem came up as device pppN then you should send the TERM signal to the PID found in the file /var/run/pppN.pid. e.g. if you are using ppp0, execute :-

kill -TERM `cat /var/run/ppp0.pid`

Tidying Up

To make all this happen at boot, move aside the default, and create an /etc/conf.d/net.ppp0 (or perhaps net.ppp{1,2} depending on your existing setup)

cd /etc/conf.d
mv net.ppp0 net.ppp0.orig
echo 'PEER="speedtch"' > net.ppp0

Next we need to add ppp0 to the startup scripts, execute :-

rc-update add net.ppp0 default

Now, change the permissions on /etc/ppp/{chap-secrets,pap-secrets,peers/speedtch} Open a root shell and copy this into it

chmod 600 /etc/ppp/{chap-secrets,pap-secrets,peers/speedtch}

When you reboot it should connect you to the internet.
Please report any problems to the mailing list


PPPoE

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

cc -o br2684ctl brctl-010226.c -latm
su

Enter roots password and copy it somewhere. I would be inclined to copy it to /usr/local/sbin/ to avoid mixing it up with system installed files, but with portage it shouldn't matter too much.

mkdir -p /usr/local/sbin
cp br2684ctl /usr/local/sbin/

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

### You may need to uncomment these
### options to connect with some ISP's.
### They disable compression.

# noaccomp
# nobsdcomp
# nodeflate
# nopcomp
# noccp
# novj

### 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.

Next we'll make sure it works. Change VP.VC for the VPI/VCI numbers for your country/ISP. For example in South Africa it's 8.35. And execute the following

br2684ctl -b -c 0 -a VP.VC &&
sleep 5 &&
ifconfig nas0 192.168.0.1 netmask 255.255.255.0 &&
sleep 10 &&
/usr/sbin/pppd call speedtch

It should connect you to the internet, you can disconnect again by sending the pppd process a TERM signal. If you have more than one pppd process, you should be sure to shut down the right one. So if your modem came up as device pppN then you should send the TERM signal to the PID found in the file /var/run/pppN.pid. e.g. if you are using ppp0, execute :-

kill -TERM `cat /var/run/ppp0.pid`

Tidying Up

Getting gentoo to start pppd at boot is easy, but there is no provision for running the bridging util. Rather than hacking the net.pppN script, which will only cause problems when the gentoo scripts update, I thought it better to create a new startup script to do that. Need to ensure it runs before the ppp device is brought up, this can be done with the before command in the script.

Copy and paste this into a text editor then save it as /etc/init.d/br2684ctl

#!/sbin/runscript
# Simple script to start and stop the br2684ctl utility
# By Dunc Lockwood 11/6/2005

depend() {
need hotplug
need net
before net.ppp0
}

start() {
ebegin "Starting br2684ctl for PPPoE"
/usr/local/sbin/br2684ctl -b -c 0 -a VP.VC &&
sleep 5 &&
/sbin/ifconfig nas0 192.168.0.1 netmask 255.255.255.0 &&
sleep 10
eend $?
}

stop() {
ebegin "Stopping br2684ctl"
/bin/killall -KILL br2684ctl
eend $?
}

Again change VP.VC for the VPI/VCI numbers for your country/ISP. For example in South Africa it's 8.35

Next, configure your ppp device. Move aside the default, and create an /etc/conf.d/net.ppp0 (or perhaps net.ppp{1,2} depending on your existing setup)

cd /etc/conf.d
mv net.ppp0 net.ppp0.orig
echo 'PEER="speedtch"' > net.ppp0

Next we need to add ppp0 and br2684 to the startup scripts, execute :-

rc-update add net.ppp0 default
rc-update add br2684ctl default

Now, change the permissions on /etc/ppp/{chap-secrets,pap-secrets,peers/speedtch}
Open a root shell and copy this into it

chmod 600 /etc/ppp/{chap-secrets,pap-secrets,peers/speedtch}

When you reboot it should connect you to the internet.
Please report any problems to the mailing list