b-lux HOWTO/embedding Linux on network devices

|||| Contact us |||| Search : Google


b-lux HOWTO: DSL modems on Linux -B

Using low-cost ADSL modems on SuSE/kernel2.6 Linux with kernel-mode drivers

Higher-speed connection to the Internet is becoming increasingly important. A large chunk of this so-called 'broad-band' Internet usage is done via ADSL (asynchronous digital subscriber line) through a 'PC' and with an ADSL modem. Two types of ADSL modems are currently popular for use with 'the PC'. These are: Of the former type a popular USB-ADSL-modem is the Speedtouch330 modem. It was considered here using a user-space modem-driver in a howto for Kernel2,4 a few months ago. This type of modem with a kernel-mode driver will be considered later in this piece. Of the latter type, there are many marques but many (if not most) low-cost ones have the Conexant/ARM (access-runner) ADSL silicon-chip. Cards of this type are considered next.

top



Part 1: Using SuSE Linux/Kernel2.6 with Conexant-PCI-based ADSL modem cards

From about SuSE8.1, a typical PCI-Conexant ADSL modem is recognised as a network-card device in SuSE YAST as shown in the next figure.


Figure 1: Example of YAST/Network device utility showing the Conexant ADSL modem.

However this is as far as it goes. Many attempts were made to use this type of ADSL modem in SuSE9.0 (Kernel-2.4.22) but either the available driver source-code did not compile, or if a binary was available the kernel refused to load it. Thankfully others have been attempting to use these modems in modern Linux distributions and their efforts have made this 'how-to' possible. The following relies heavily on the work of Patrick Mackinley and Chris Malcolm.

CnxADSL/PCIcard//SuSE/kernel2.6: Resources used:

This test used SuSE9.2, downloaded programs for the conexant-chipset based modem and an aging 'pc-machine'. The 'pc'-machine had the following components: The programs used were: (The latter two of the above were from Chris Malcolm's website and have been patched for Fedora3 but with minor modifications work with SuSE Linux/Kernel2.6.x

top

<> CnxADSL/PCIcard//SuSE/kernel2.6: The procedure

A: CnxADSL/PCIcard//SuSE/kernel2.6: Assembling a functional computing-machine

A pc-machine with Conexant-chipset-PCI-ADSL card was installed with SuSE 9.2 (though in principle a SuSE-box with modern 2.6 kernel would do) and with the following programs:

B: CnxADSL/PCIcard//SuSE/kernel2.6: New kernel configuration/building/installation

A new kernel was built. For those not familiar with kernel compiling/installation, please consult a suitable book or search for help from the Internet. The following is a very brief guide on what (in this instance) was done:

B1: The kernel tree was cleaned (with make mrproper) with then configured with the following:
DISABLED 'use register argument' in under Processor type and features
ENABLED 'atm (asynchronous transfer mode )' under Device drivers/Networking support/Networking options
ENABLED 'ppp' and 'ppp-over-atm' under Device drivers/Networking options
B2: The Makefile is then edited to give the kernel modules directory a name, and the kernel was then compiled with the make command. (This took quite some time as the memory was small, and no disk swapping was allowed.)

B3: The kernel, kernel modules and initial-ram-disk (initrd) can then be made and installed as follows:
cp arch/i386/boot/bzImage /boot/kernelName
make modules
make modules_install
mkinitrd -k (/boot/kernelName) -i (/boot/initrdName) (which conveniently can be named after the kernel modules directory specified in the Makefile).
B4: The boot-loader is installed: The lilo boot-loader was used with entries for the kernelName, initrdName and a boot-name. Installation is complete by command /sbin/lilo. ( The grub boot-loader was not used as hand-editing of /etc/grub.conf in SuSE is not straight-forward.)

top

C: CnxADSL/PCIcard//SuSE/kernel2.6: Booting of machine with new kernel

D: CnxADSL/PCIcard//SuSE/kernel2.6: Installation of the modem-driver/related programs

It was perplexing if as per Chris Malcolm's and Patrick Mackinley's work the linux-atm program was needed. This is because the linux-atm libraries were installed as described above. However In SuSE9.2 the header file /usr/include/atm.h is missing. This is needed by the Conexant-ADSL-device driver (next section) so it was decided to install it. It is hoped that this will be un-necessary in future versions. The procedure for installing linux-atm and the Conexant-ADSL modem driver are taken from Chris-Malcolm and is as follows:

D1: CnxADSL/PCIcard//SuSE/kernel2.6: The linux-atm installation

1) cd /usr/include
2) mv linux linux_orig
3) ln -s /usr/src/linux/include/linux linux
4) cd /usr/src
5) tar xzvf linux-atm-2.4.1-patched.tar.gz
6) cd linux-atm-2.4.1-patched
7) ./configure --prefix=/usr
8) make (There are many warnings but the code normally compiles! )
9) make install

D2: CnxADSL/PCIcard//SuSE/kernel2.6: The modem device driver installation

1)cd /usr/src
2)tar -xzvf CnxADSL-6.1.2.007-PIM-2.6-1.1-patched.tar.gz
3)edit the Makefile line 9 to read INITSCRIPTDIR=/etc/init.d
4)cd CnxADSL-6.1.2.007-PIM-2.6-1.1-patched
5)make
6)make install
7)/sbin/depmod -a
Now the modem is installed, the next step is to try and use it. To do so the ppp options file and ppp authentication files need configuration. These can be done as follows:

top

E: CnxADSL/PCIcard//SuSE/kernel2.6: Configuration of the ppp options file

The file /etc/ppp/options is needed and SuSE-Linux has an exceptionally large /etc/ppp/options file. The procedure adopted was to move this with mv /etc/ppp/options /etc/ppp/optionsBAK and create a new file. An example new-file had the following lines:
passive
defaultroute
usepeerdns
noauth
name "user-name@isp"
user "user-name@isp"
plugin /usr/lib/pppd/2.4.2/pppoatm.so
vpi.vci
Some typical values vpi and vci for regions/isp using ppp-over-ATM are in the following list:
Austria 8 48
France,Belgium,Spain/Retvision, Sweden,USA 8 35
Spain/Telefonica 8 32
Netherlands 8 48
Britain 0 38
Poland,Portugal 0 35
Finland 0 100
Germany,Hungary 1 32
Qatar/Qtel 8 35
Bahrain/Batelco 8 35
New Zealand 0 100

F: CnxADSL/PCIcard//SuSE/kernel2.6: Configuring the ppp secrets files (for login to the ISP)

The files /etc/ppp/chap-secrets and /etc/ppp/pap-secrets are edited as:
#inbound connections
# client hostname password IP addresses
'user-name@isp' '*''password'
noting each entry is after a tab.

G: CnxADSL/PCIcard//SuSE/kernel2.6: Optional DNS configuration

This involves backing-up the /etc/resolv.conf file and making a symbolic link to the temporary one the ISP sends with the connection. This is normally done as follows:
mv /etc/resolv/conf /etc/resolvBAK
ln -s /etc/ppp/resolv.conf /etc/resolv.conf

H: CnxADSL/PCIcard//SuSE/kernel2.6: Testing the ADSL-Internet connection:

The adsl connection is tested by typing /etc/init.d/cnxadslctl start. However this commonly took over 30 seconds to establish. Currently it is not known if this is a feature of the isp or the loading of the kernel module. A hunch it is the latter but time was not available to investigate. A valid ppp connection can be tested with the ifconfig command. An example follows:


Figure 2: Example of establishing a connection with the Conexant-based PCI ADSL modem on a SuSE/Kernel2.6-based-PC-machine.


The connection can be started at boot-time by adding the above lines /etc/init.d/cnxadslctl start at the end of the script file /etc/init.d/boot.local. A connection can be closed by the command /etc/init.d/cnxadsl stop. An example is shown in the next figure.


Figure 3: Example of closing the ADSL ppp connection on a SuSE/Kernel2.6-based pc-machine with a Conexant-based PCI ADSL modem.


I: CnxADSL/PCIcard//SuSE/kernel2.6: Conclusion

Connection to the Internet in SuSE92 and Conexant/ARM pci-ADSL modem cards works. However the time to establish-connection was long. This is most-likely because the driver needs tweaking and time was not available for such a nicety. (This was just a proof-of-operation test.) It is hoped that future versions of SuSE-Linux will allow smooth operation of these types of ADSL modems.

J: CnxADSL/PCIcard//SuSE/kernel2.6 Note added Feb 2005

As of kernel version 2.6.10 conexant chpipset drivers are no longer working because of in-kernel PCI API changes as pointed out at Patrick Mackinley's page http://patrick.spacesurfer.com/linux_conexant_pci_adsl.html. Denis Karpov (denis dot karpov at gmail dot com) has provided a patch against Patrick's sources, which fixes the problem. This patch has not been tested here but it is reported to fix other problems too. The patch is available at: http://tetzu0.homeip.net/code/CnxADSL-6.1.2.007-PIM-2.6-1.1.patch-2.6.10.bz2

top



Part 2: Using SuSE/kernel2.6 with the Thomson Speedtouch330 USB- ADSL modem

The Speedtouch 330 USB ADSL modem made by Alcatel/Thomson is sold as compatible for usage with computers running Windows, Linux and MacOS. A previous 'how-to' here described the installation of a user-space driver with SuSE90 (kernel 2.4.22) for this modem. The modem is recognised (even to its serial number) when booted on machines with recent and current versions of SuSE. Also a typical kernel configuration shows that there is a device-driver kernel-module available for this modem. However the newer Speedtouch330/rev4 modems do not work as the relevant micro-code is needed. This was the case for SuSE9.0 and SuSE9.1 described in the previous 'how-to'. Thankfully as of kernel 2.6.10 there is now support at kernel level for loading the required microcode for this type of modem. This is due to work of D Woodhouse and D Sands. This 'how-to' relies heavily on that reported on the 'Sourceforge-linux-usb website' for using the Speedtouch330 modem with Fedora3 .

SpeedtouchADSL/v4//SuSE/kernel2.6: Resources used

This test used an older VIA-EPIA ITX-based 'pc-machine' with the following components: Additionally it had a Speedtouch330 (silver-colour(rev4)) ADSL modem. Programs for the Speedtouch modem were downloaded from the Thomson and Speedtouch-USB websites. Also SuSE9.2 is shipped with kernel2.6.8 and the required kernel 2.6.10 was fetched from kernel.org.

SpeedtouchADSL/v4//SuSE/kernel2.6: Installation and configuration procedure

A:SpeedtouchADSL/v4//SuSE/kernel2.6: Assembling a functional computing-machine

As with the Conexant-chipset-PCI-ADSL card described above a 'pc-machine' was installed with SuSE 9.2 and with the following programs:

B: SpeedtouchADSL/v4//SuSE/kernel2.6: New kernel configuration and building

A kernel (based on downloaded 2.6.10 or newer) was required. The kernel was configured with the following features:
ENABLED Support for hot-pluggable devices under General setup
ENABLED Hotplug firmware loading support under /Device Drivers/Generic Driver Options
The next figure shows typical graphics generated by the make menuconfig command for kernel configuration.



Figure 4: Typical kernel configuration for KERNELS 2.6.10 or newer to enable hotplug firwware loading.

The kernel was built and installed as described for the machine with the Conexant -based ADSL modem above. Examples of initrd building and boot-loader installation are shown in two graphics respectively in the next figure.



Figure 5: Typical initrd installation (top) and boot-loader installation (bottom) post kernel building in SuSE Linux.

C: SpeedtouchADSL/v4//SuSE/kernel2.6: Booting of machine with the new kernel

The freshly-compiled kernel (2.6.10/or newer) with hotplug-firmware-loading enabled was booted. The boot process reported the warning: "The ioctl TIOCGDEV is not known by the kernel." A search was made of the files /var/log/boot.msg, /var/log/messages. /var/log/warn but these files did not show the warning or its meaning. Also time was not available to delve deeper and in any case this was a 'proof-of-working installation' which hopefully will be unnecessary by the next SuSE release!

D1: SpeedtouchADSL/v4//SuSE/kernel2.6: Building the modem-microcode extractor

A directory in this instance /usr/src/speeedtchFW was created. The modem micro-code previously downloaded from the Speedtouch web-site was placed in this directory. The firmware extractor source-files firmware.c firmware.h, crc.c and crc.h, also previously downloaded from speedtouch-linux-usb-sourceforge website went into this directory also. In the same directory ( /usr/src/speeedtchFW ) the firmware extractor executable file was made with the following command

gcc -o firmware firmware.c -DSTANDALONE_EXTRACTER

An example is shown in the next figure:


Figure 6: Example of compiling the 'firmware extractor' for speetouch330 modem.

D2: SpeedtouchADSL/v4//SuSE/kernel2.6: 'Installing the modem-microcode'

In this instance (for a revision 4 modem) the file Speedtouch330_firmware_3.012.zip was used. The needed firmware was extracted as follows:
The procedure is shown in the next figure:


Figure 7: Example of using the 'firmware extractor' for Speedtouch330 modem.

The extraction yielded two binary files speedtch-1.bin and speedch-2.bin in the ~/speedtchFW directory. These are copied to the hotplug-firmware loader directory. On SuSE this is /usr/lib/hotplug/firmware. (The list of directories used are in the script file /etc/hotplug/firmware.agent. This is shown in the next figure.)


Figure 8: The contents of /etc/hotplug/firmware.agent showing location of firmware files.

D3: SpeedtouchADSL/v4//SuSE/kernel2.6: Creation of a ppp/peers file

For this test the ppp options file were moved (by mv /etc/ppp/options /etc/ppp/optionsBAK ). A peers file (called /etc/ppp/peers/speedtch is created with the following lines:
lcp-echo-interval 10
lcp-echo-failure 3
noipdefault
defaultroute
#nb put your username and isp in the following line
user "user-name@isp"
noauth
noaccomp
nopcomp
noccp
novj
holdoff 4
persist
maxfail 25
updetach
usepeerdns
#nb pppOE users put plugin pppOE for the next line
plugin pppoatm.so
#nb instead of 0.00* put your vpi.vci (if you are using pppOATM) (pppOE users put nas0)
0.00
(nb the above can (as root) be cut and pasted in a text editor (for example vi).) *The table for some pppOATM users is given above:

D4: SpeedtouchADSL/v4//SuSE/kernel2.6: Editing ppp/secrets files for user-isp authentication

see above:

D5: SpeedtouchADSL/v4//SuSE/kernel2.6: Optional DNS configuration

see above:

E:SpeedtouchADSL/v4//SuSE/kernel2.6: Testing the modem:Internet connection

The ADSL 'ppp-dialout' can be tested with the command pppd call speedtch. The next figure shows and instance of this. Connection was very rapid. A successful dial-out can also be verified with ifconfig (as superuser) for ppp0 as a network device. This is also shown in the next figure.


Figure 9: An example of connecting to an ISP using the Speedtouch330/rev4 ADSL modem and SuSE/kernel2.6.10(or newer)/and kernel-mode driver.

The connection can be stated at boot-time by adding the above lines pppd call speedtch at the end of the script file /etc/init.d/boot.local. Closing of the connection is by using the command killall pppd. An instance of this is shown in the next figure.


Figure 10: An example of connecting to an ISP using the Speedtouch330/rev4 ADSL modem and SuSE/kernel2.6.10(or newer)/and kernel-mode driver).

F: SpeedtouchADSL/v4//SuSE/kernel2.6: Conclusion

Internet connection via the Thomson/Alcatel Speedtouch330/rev4 modem using a kernel-mode driver in SuSE9.2 or newer with kernel 2.6.10/or newer is very rapid. Such setups have great potential for network-appliance applications. For the current tests, time was not available to investigate the boot warnings of the new kernel. It is hoped that by the next release of SuSE these will disappear.

top


page made: jan2005 updated Feb05


Contact Us:


Basis Volume Limited supplies network routers/firewalls some of which can be loaded with SuSE Linux the Speedtouch 330 modem or Conexant-based PCI card ADSL modems. For more information please browse the firm's website

Our training group here b-lux.net provides training courses on embedded Linux, Linux-networking and Linux-fundamentals. These courses include embedded network computing devices; part of which includes usage of modern ADSL modems, using modern Linux distributions and sometimes building specialist ones. The site is due for update and more modern courses are available than listed thereon. For more information please email us.

Copyright © b-linuxusergroup/basisvolumelimited 1999-2006: Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the gnu free documentation license is available at the URL: http://www.gnu.org/copyleft/fdl.html


1999/2006 by © b-linuxusergroup contact us regarding this website

eXTReMe Tracker