Linux Modems

This article appeared in print in Micro Mart issue 828, December 2004.

Installing a modem in Linux can be a bit hit and miss. This is because the manufacturers of internal and USB modems often don't release their drivers as open source or free software, which prevents the Linux distributions from including them meaning that you have to install them manually. The best option is to get an external serial or Ethernet device which will work with nearly no configuration at all. But what if you're already got an internal or USB modem? Let's take a look at how you can identify which chipset your modem uses and where you can find the appropriate driver.

Identifying the chipset

A PCI modem Identifying the chipset is normally the hardest part. Although you may know who manufactured the modem, you don't know who manufactured the chipset the modem uses and this is the information you need to be able to find the driver.

If you have a PCI (or on-board) modem, run the lspci command from a console to get a list of the PCI devices in your computer. You will get one line of output for each device in the system, one of which should refer to your modem. The line you're looking for should start Modem: and look something like the following:

0000:00:1f.6 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 01)

Once you've found this line, you need to extract the information you need to help locate the driver. The information you need is the chipset manufacturer, in the example above its Intel, and the name of the chipset, in this case 82801DB ICH4. If your modem doesn't seem to be listed, ensure it is correctly inserted into the machine and if you dual boot, check if Windows can see and identify it. If you still can't identify it, you may wish to try the scanModem tool available at linmodems.technion.ac.il. This is best suited to experienced users, but most people should be okay if they follow the instructions provided.

USB ADSL modem If you have a USB modem, you need to get a list of USB devices by issuing the command cat /proc/bus/usb/devices from a console. If this file doesn't exist, USB may not be configured on your system - see your distribution manual/documentation for instructions. This command should give you several blocks of text, one for each USB device connected to the system. You need to find the block which refers to your USB modem. Here's a typical block of output:

T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=06b9 ProdID=4061 Rev= 0.00
S: Manufacturer=ALCATEL
S: Product=Speed Touch USB
S: SerialNumber=0090D013AAB8
C:* #Ifs= 3 Cfg#= 1 Atr=80 MxPwr=500mA

The lines which are important are those starting with S: as these contain the human-readable name of each device. In the example above, the S: lines show that this device is an Alcatel Speed Touch USB modem. This is the information you need to help you find the driver.

Finding the driver

Google is a good place to find drivers Now that you know which chipset your modem uses, it's time to see if a driver is available for it. Your starting point should not actually be the website of who you believe manufactured the chipset, but Google. While the manufacturer may or may not offer a driver, it's possible that there are also other drivers available which may be better. If you are using a laptop or pre-built system, you may also wish to try searching for the make and model of your system and Linux. The next step is to evaluate the results Google has given you. One thing you must try to avoid is drivers which are old; look for a release date on the page and forget about anything more than a year old as it's unlikely to work with a current Linux install. If you find a driver which provides different packages for different Linux distributions, you should not try to use a driver meant for a different distribution to the one you are running. Search results which are particularly useful are pages by people who have the same modem as you and have written about how they configured it - they usually even provide you with a link to the driver. You may be left with several potential drivers to try, in which case I suggest you go through them until you find one that works. You are unlikely to cause permanent damage to your computer by loading the wrong driver, but you could well cause it to crash. Always make sure you close down any applications you are running before trying to load a driver for the first time to avoid file corruption if the computer does crash.

If Google didn't return anything useful, you may be out of luck. At this point it may be worth trying the website of who you think made the chipset and the manufacturer of your computer or laptop. If you still come back empty-handed there is unfortunately nothing more you can do.

Installing the driver

Some drivers will be provided as an installable package specific to your distribution, in which case the installation should be straightforward. Your first step should always be to read any documentation on the driver's website or included with the package. All drivers should provide step-by-step instructions for installing them and doing any post-install configuration which may be required.
Generally speaking, if you have downloaded a driver package with a .rpm extension, you can install it with the command rpm -i packagename.rpm.

If you have downloaded a file with a .tar.gz extension, you will probably have to compile the driver yourself - but don't let this put you off. Compiling a driver may sound complicated, but it usually requires only a few commands. Your first task is to open a console and ensure that you are logged in as root. If the file has a .tar.gz extension, you need to decompress it with the command tar -xzf filename.tar.gz. Now take a look in the newly created directory for documentation - there is usually a file called README or INSTALL. Most drivers provide step-by-step instructions and installation is simply a case of following them. You will however need to ensure that you have the kernel source package for your distribution installed; check your distribution's manual/documentation for instructions.

As long as you've installed the correct driver for your modem and followed all the instructions, that's it! You will probably need to configure your distribution to use the modem and enter your ISP details - this varies depending on your distribution, so again you'll need to consult your distribution's manual/documentation for instructions.

Getting help

Nobody is pretending that configuring your PCI or USB modem is easy, so don't be afraid to ask for help. If you're having trouble identifying your modem's chipset, you can seek assistance from your local Linux users group - see www.lug.org.uk for a list. Also, don't forget that the Micro Mart forum has a Linux Mart section with lots of people willing to help. If you're having trouble installing or configuring the driver, make sure you have read any documentation provided and take a look on the driver's website to see if there is a mailing list or technical support e-mail address.