Pages

Monday, November 7, 2011

SmartPCI56(UCB1500) 56K Modem with Slackware

I got another Modem PCI card - again. This time something like this:

# lspci
...
00:09.0 Modem: Philips Semiconductors SmartPCI56(UCB1500) 56K Modem (rev 01)
...

After doing some research on the Internet I found out that the card should work with slmodem (just like the internal modem from my old Toshiba). So I downloaded and extracted the latest release:

# cd /usr/src
# wget http://linmodems.technion.ac.il/packages/smartlink/slmodem-2.9.11-20110321.tar.gz
...
# tar xfz slmodem-2.9.11-20110321.tar.gz
# cd slmodem-2.9.11-20110321

Then I compiled it:

# make
...
# make install
...

After the compilation finished I tried to load the driver and took a look at the logs:

# modprobe slamr
# dmesg
...
[  323.131435] slamr: module license 'Smart Link Ltd.' taints kernel.
[  323.131455] Disabling lock debugging due to kernel taint
[  323.182214] slamr: SmartLink AMRMO modem.
[  323.182260] slamr: device 1131:3400 is grabbed by another driver

Whoops - device is grabbed by another driver? Never had this issue before, lspci has given me some more information:

# lspci -vn
00:09.0 0703: 1131:3400 (rev 01) (prog-if 00 [Generic])
        Subsystem: 1131:3400
        Flags: bus master, medium devsel, latency 64, IRQ 11
        I/O ports at da00 [size=16]
        Capabilities: [80] Power Management version 1
        Kernel driver in use: serial
        Kernel modules: slamr

After doing some more research on the internet about this I found the hint: there is a driver called ungrab-winmodem which has to be loaded before slamr and that will free the device. Again, I download the software and extracted it:

# cd /usr/src
# wget http://linmodems.technion.ac.il/packages/smartlink/ungrab-winmodem-20090716.tar.gz
...
# tar xfz ungrab-winmodem-20090716.tar.gz
# cd ungrab-winmodem-20090716

Again I compiled it:

# make
...
# make install
...

Finally I unloaded the slamr driver and tried to get it to work with the ungrab-winmodem driver:

# rmmod slamr
# modprobe ungrab-winmodem
# modprobe slamr

A look at the logs:

# dmesg
...
[ 1913.669335] device 1131:3400 is grabbed by driver serial: try to release
[ 1920.208990] slamr: SmartLink AMRMO modem.
[ 1920.209191] slamr: probe 1131:3400 SL1500 card...
[ 1920.209226] slamr 0000:00:09.0: AMD756: dev [1131:3400], router PIRQ 2 get IRQ 11
[ 1920.209237] slamr 0000:00:09.0: found PCI INT A -> IRQ 11
[ 1920.213816] slamr: mc97 codec is SIL22
[ 1920.213891] slamr: slamr0 is SL1500 card.

Perfect! It seems that the device is ready again. I have just to start the slmodemd daemon again with my prior published script:

# vi /etc/rc.d/rc.slmodemd
#!/bin/bash

echo "Starting slmodemd:  slmodemd --country=GERMANY /dev/slamr0"

# stop slmodemd
if [[ `pgrep -x slmodemd` ]]; then
  kill -9 `pgrep -x slmodemd`
fi

# un/re-load module
if [[ `lsmod | grep slamr | awk 'BEGIN {FS=" "} {print $1}'` != "" ]]; then
  rmmod slamr
fi
modprobe ungrab-winmodem
modprobe slamr

# create devices
cd /dev
for dev in 0 1 2 3; do
  if [[ ! -c /dev/slamr$dev ]]; then
    mknod -m 600 /dev/slamr$dev c 242 $dev
  fi
done

# start slmodemd
(slmodemd --country=GERMANY /dev/slamr0 > /dev/null 2>&1) &

Make it executable and start it:

# chmod 755 /etc/rc.d/rc.slmodemd
# /etc/rc.d/rc.slmodemd

It will unload the slamr driver first (if necessary) and then load the ungrab-winmodem and slamr driver again, create all devices etc. At the end your modem will be available at /dev/ttySL0