| news - about me - my system - columns - blackbox styles - projects - licenses - the curse - contact | |||
|
Installing and using a Conexant/Rockwell winmodem (Linux drivers) |
|
||
|
path xlife columns 20021104 |
|||
Installing and using a Conexant/Rockwell winmodem (Linux drivers)Xlife column for November 3, 2002:Summary:
1 Introduction1.1 What is a winmodem/softmodem?A modem is a device that allows a computer to connect to the Internet through a telephone line. Usually, such a device holds all that it needs to know in order to function properly in the chips soldered on it's main circuit board. Such a "complete" modem is known as a "hardware" modem and it will usually work equally well no matter what operating system runs on the computer using it. In order to reduce costs, modem manufacturers also produce modems that do not include important functionality in their hardware. Instead, they provide that functionality as software drivers that must be installed on the computer to allow the modem to work at all. Such modems are cheaper and are called "softmodems". Nowadays, hardmodems are usually external modems (self-contained boxes), while softmodems are usually computer cards that must be mounted inside the computer in special slots (but that's not etched in stone, you can very well have external softmodems or internal hardmodems). The main problem of softmodems is that you depend on the manufacturer to release drivers for the operating system you want to use them on. And since most of them choose to only make drivers for Microsoft Windows systems, people using something else are left with a softmodem (a.k.a. "winmodem"): a useless piece of hardware. 1.2 What can be done about softmodems?Some manufacturers also release Linux drivers. They are not many, although their number increases steadily, and they may not support all Linux types (distros and kernels) or even all of their own modem models. Even if they do release Linux drivers, they do it in the form of closed source binaries, which they don't always bother to mantain actively, so they only work for a couple of distros or kernel versions. Given the rapid evolution of Linux software, those drivers soon become useless (see below the example of the Motorola SM56). Also consider that big modem manufacturers don't always produce modems! They also make chipsets, the central part of the modem, which third-party producers use and modify and incorporate in modems that often end up being different than the original brand name modems and will need modified drivers. Add to this the fact that, without the cooperation of the manufacturer, it's very hard to produce software for what essentially becomes a "black box" that nobody other than the maker knows how it works internally. Many people try to overcome this. They reverse-engineer working drivers, they use trial-and-error, they create wrappers. The results are many times less performant than the original drivers and/or lack functionality. 2 The elusive Conexant modemI started using a Conexant internal winmodem after I tried another two modems: one of them was another winmodem, the (in)famous Motorola SM56. This softmodem is very widespread and is used by many people under Windows. However, Motorola chose to release only closed source binaries for Linux. We're talking about a RPM package which works only under RedHat 7.1. Please note: not the kernel versions in that distro, but the kernels modified by RedHat specifically. Upgrade the kernel or the distro and you end up like me, with a completely useless SM56. My other modem is external. It is a no-name piece (there actually isn't _any_ brand or maker identification anywhere on it) that I got a long time ago in a swapping deal with a friend. To this day I still believe he got seriously suckered. I found out that it has a Rockwell chipset from the diagnostic AT commands, and from the FCC ID I tracked down the maker to some obscure factory in Taiwan -- just for fun. It works superbly, and well it should, since it is a hardware a.k.a. real modem. The problem lies in it's power transformer, which is huge and heavy, it buzzes out loud, it goes really hot really fast, and I have to plug it in and out of the power socket manually (imagine the horror -- the socket is under the table). The tranformer was hand-made, by the looks of it. Can't replace it either, the sick thing works at 300mA, which few regular commercial tranformers offer. Besides, I'm a chair potato. I don't like going under the table. So back to the swapping deals. I exchanged my SM56 with a friend who had a Conexant winmodem, because he only used it in Windows. He was happy, somehow his connection became more stable and a bit faster after this. Good for him. 2.1 Is it really a Conexant modem?Good point. Actually, we don't know if it's a Conexant chipset. It could be Rockwell. Conexant and Rockwell joined forces sometime ago. So I take a look at the board and notice the magical words "Conexant" and "HSFi" written on the main chipset. I also take a look at the output from lspci after I put the modem in the computer (lspci lists info about the PCI boards) and I get this: 00:06.0 Communication controller: CONEXANT: Unknown device 2f00 (rev 01) So it's a HSFi Conexant modem. You don't have to rely on the way I got this info alone, there are other more secure methods, we'll get there shortly. 3 Where to get the drivers?I went out on the web and found what seems to be the Conexant modem central, a joint effort of Conexant Systems Inc., MBSI, and various contributors. In other words, these guys offer the official Conexant drivers for Linux. Remember this site, it's extremely useful. (I'll be refering to it as "the MBSI site" in the rest of the document.) Update (2004-04-27): Linuxant, the company in charge of producing the Conexant drivers for Linux, has switched to offering the drivers for money since the writing of this column. Therefore, instead of the addresses above please use this one in the future. They still offer a free version limited to around 14 Kbps, so you can test before buying. They had a good reason to do this. I recommend people who want the latest drivers as well as supporting Linuxant to go buy the commercial version, it's not expensive. Please be warned that distributing the old (free and not limited) versions of the drivers is forbidden by the terms of the license. Do not host or redistribute such packages yourself and warn others who do that what they're doing is illegal. Being a Linux user doesn't mean we're an mass of unwashed thieves. 4 Correctly identifying the chipset modelIt's important to do this, because you need to know which driver package to download: HSF (softmodem) or HCF (controller-less modem). You also need to identify additional info that will allow the driver to work properly. You can rely on the numbers written on the board chipsets and on the lspci output (remember that 2f00 number?) Again, go to MBSI's "identify your modem" page, which teaches various ways to do that. One way is to look at the "Check Chipset for Correct Modem Information" pdf document. Alternatively, they also offer a nice little script called listmodem.sh, distributed in a package called listmodem_app_linux.tar.gz. Just run it and all the info you need about the modem magically appears. You get the device and vendor ID's, the sub-device and sub-vendor ID's, plus a pretty reliable guess about the modem type (HSF/HCF). For me this confirmed the Conexant/HSFi make. If the script fails to identify your modem, it will still offer the ID's. You can download the "List Modem Manufacturer Reference Table" pdf doc and look them up in the table there. However, once you match a main vendor/device pair you shouldn't need to worry about the sub-ID's; this is enough to choose the hsf- or hcf- package, which you must go download next. 5 Compiling the driversUnpack the drivers somewhere. Please note that you also need the kernel sources, namely those for the kernel you plan to use the drivers with. Apparently the clean kernel source may not be enough, I also had to do a "make dep" in it, while a friend had to go through with the full compilation process before he was able to make the hsflinux package compile. YMMV on this one. You may want to modify the config.mak file in the packege before anything else. I changed PREFIX so it pointed to /opt/hsflinux. This changes the install path from /usr/local, since I want to keep a clean system, not install every package on top of the other. You only need to issue the command make install (as root). This compiles the modules (if you have the proper kernel source), installs them and also the utils. Run depmod -a once, just in case. You should get a clean empty output with no warnings about module conflicts if you expect this to work. If you do get warnings please make sure you used the latest package from MBSI. If you took the opportunity to install the new kernel you just compiled, please reboot first so you start actually using it, and then install the drivers. 6 Configuring the driversNo need to panic if you already installed the drivers. Once installed, the package is able to reconfigure itself and recompile the modules without any need for the original package it came in. All you need to do is run the hsfconfig script which allows for many useful tasks. You may want to edit it first, because the smart thing redefines the PATH and thus fails to find many useful things on my system. Like its own companion scripts, which are now in /opt/hsflinux/sbin. I added that directory to the PATH, but the script couldn't care less. I really don't understand why they don't trust whatever PATH is set on people's systems. hsfconfig will offer a country to chose from, for dialing purposes. It offers some inf files to use (firmware for the modem), and it usually does a good job at guessing the modem type. If it doesn't, you are allowed to chose any of the inf files it came with. Or you can go further and manually input the device- and vendor-ID so it's sure to chose the right inf file. After this it will recompile the modules and install them, plus make appropriate changes to /etc/modules.conf and create /dev/ttySHSF0 and link /dev/modem to it. It also allows you to reconfigure only parts of the whole setup. Run hsfconfig --help for the rundown. The modules are loaded automatically whenever you attempt to use the modem, if you compiled your kernel with "Kernel module loader" (CONFIG_KMOD) under "Loadable module support". You can unload them with the hsfstop script included in the package. If you have to load them manually just rip the hsfstop script and make yourself a hsfstart variant.7 Using the modemPlease note that I use wvdial to dial into my ISP. You need wvdial and pppd installed on your system if you don't have them already. Most Linux distribution offer them. If you use other dialer, tough. I only use wvdial because it's the most reliable and flexible I've seen. With many other dialers I get silly errors and when you're busy testing a new modem like I did here the last thing you want are the dialer's silly errors to add to the pile. 7.1 Configuring wvdialYou need to specify your own modem and ISP specific settings in /etc/wvdial.conf. They are not the object of this column, so I'll assume you are familiar with the subject. If you're lucky, your modem could work already by now, just by using /dev/modem as your modem in wvdial.conf and running wvdial. I'm not lucky, and I had to spend a few hours trying all kinds of tricks to get it to work. Here's what I came up with: Specify which device points to your modem. You can also use /dev/modem,
since hsfconfig links that to the actual modem device: Modem = /dev/ttySHSF0 Usually modems only need ATZ as the init
string. The following is a trick-ATZ command, which I found in the Conexant+Rockwell-modem-HOWTO, and it helps
avoid the NO CARRIER error. While somewhat outdated, that document still
offered some nifty tricks. Reading HOWTO's pays, kids: Init1 = ATZX3 Running wvdialconf is also a good idea. It
tests /dev/modem and comes up with an init string of its own. It certainly
doesn't hurt to put that in as well: Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 The following trick turns on the modem speaker, so you can hear it
connecting. It is also recommended to turn up Phone In in your sound mixer.
It works the other way around too, just use zero values instead: Init3 = ATL1M1&W Next, enable report of line speed, error correction protocol and DTE
speed upon connecting. It's useful to see this, because the modem may report
a bogus CONNECT speed sometimes: Init4 = ATW1 If you constantly get a NO DIALTONE error, which happens with some modems
under these drivers, just disable waiting for dialtone: Init5 = ATX3 Again from the Conexant-Rockwell HOWTO, a second trick in case the modem
fails to detect the line carrier correctly (NO CARRIER). This replaces the
standard ATDT dial command. If you dial using pulse change DT to DP: Dial Command = ATX3DT Finally, I had to tell wvdial to not check for the carrier and just go on
and start pppd as soon as a connection is established. Given the rest of the
tricks above, most times this results in a working dial-up connection for
me: Carrier Check = no 8 Closing upI discovered that my modem doesn't have any sound chip whatsoever, not even audio jacks so I can plug something in. So I can't hear what it's doing when attempting to connect, which usually gives a good idea about what's going on. I used to take the phone handpiece off the hook (with mute on, of course), but listening to the modem and ISP sing together for half an hour will undoubtedly make you decide you've had enough. Just tell wvdial what to do in various cases (like busy tone) and just trust it. Well, not blindly. I have a little script which loops and displays the output from ifconfig and netstat -vat every couple of seconds, so I know whether and when the ppp0 interface actually makes an appearance. So now it works. It doesn't work 10 times out of 10, more like 7-9, but that can be my ISP, bad lines, bad luck or the modem fairy. Heck, the external hardware modem doesn't always connect, and I know that one's reliable. On Windows with the original drivers I don't get a good connection in 100% of the attempts. So just let it flow. It works, that's the main thing. Oh, and apparently the hsflinux drivers don't ensure fax functionality for some modems. Check their site to see if yours can. Mine can't. And I actually have to send and receive faxes every once in a while. Well, I'll just resort to the good old external modem in those cases. I cut back on trips under the table and that's good in my book. And check this out: FWIW, I now get anywhere between 45300 and 49600 in CONNECT speed, while the SM56 only reached 44000 tops, ever. Guess me and my latest swap buddy can both be happy this time. < Back to the top | Read other columns | Choose what column I should write next! > |
|||
|
Xlife ©2001-2008 Zuavra. All rights reserved. You are welcome to link to this site's text pages, but you must get explicit permission before you may reproduce or quote their contents. You may not link directly to binary files, such as images or tarballs. I do keep logs, you know, and offending sites will get their links redirected to shameful error messages. |
|||