PCI Adapter and Linux

ksvj

Member
Joined
Aug 30, 2005
Messages
13
Reaction score
0
Has anybody sucessfully used the PCI Adapter with Linux (IpCop specifically)?

I'm planning on getting one and using it in an IpCop box. I'm using the Novatel MERLIN U630 datacard.
 
I've got an Addonics ADPCICB2 PCMCIA/CARBUS to PCI Adapter that I'm trying to use under SuSE 9.3 Pro (32bit), and it detects the card and my 3G Novatel (merlin 630) card, but picks up the diagnostic port rather than the dialling port.

Haven't found out how to change that yet. Not sure if I can.
 
Hey cyberbob,

Might seem like a "dof" question - but how do you know it is the diag. port ?

Laterz !

cyberbob said:
I've got an Addonics ADPCICB2 PCMCIA/CARBUS to PCI Adapter that I'm trying to use under SuSE 9.3 Pro (32bit), and it detects the card and my 3G Novatel (merlin 630) card, but picks up the diagnostic port rather than the dialling port.

Haven't found out how to change that yet. Not sure if I can.
 
Hi ksvj

I have just completed a very simmilar setup last night using the Novatel card, Elan PCI adaptor and smoothwall (ipCop is a fork of smoothwall so your experience should be simmilar)

This is not for faint of heart however and will involve compiling a new kernel for the ipCop box as well as compiling the PCMCIA tools.

If you want to go ahead I can post step by step instructions, and if some one has some web space they are willing to offer I can post the config files and other stuff I used to get this working

Regards
Warren
 
well, becuase it's write only and I can't dial out with it ... so assume it is the diag port. on my laptop under SuSE it detects the "other" port and works just fine :p
 
hhhhmmmm /me does some digging

cyberbob said:
well, becuase it's write only and I can't dial out with it ... so assume it is the diag port. on my laptop under SuSE it detects the "other" port and works just fine :p
 
Warren, I sent you a private messaging containing details regarding where you can post the config files ect.

Thanks!
 
Novatel Card + PCI Adaptor + Smoothwall Part 1

Ok here is how to get the Novatel Card, Elan PCI Adaptor combination working with Smoothwall Express 2 (You should be able to do this with IpCop as well)

Smoothwall does not have out the box support for PCMCIA devices so we are going to have to add it and getting the Elan PCI Adaptor work with a kernel other than 2.6.10+ is a pain. I am assuming you have at least some experience compiling a custom linux kernel or other packages from source

You should read this post about compiling a 2.6 kernel for smoothwall, though I have repeated most of the info here.

http://community.smoothwall.org/forum/viewtopic.php?t=5277

What you will need:

2.6.10+ Kernel source
pcmcia_cs source package from http://pcmcia-cs.sourceforge.net
A working development environment on a linux box to compile the above (you can compile the kernel on your smoothwall box but will need to install the development tools on smoothwall box. It is easier and quicker to compile on another linux box)
Smoothwall Express 2 + Updates (obviously)
A lot of time

Step 1: Install PCI Adaptor and smoothwall.

Install the PCI adaptor in your smoothwall box but do not insert the Novatel card just yet
Install smoothwall and configure as appropriate. Do not bother configuring the modem just yet.
Check that everything works

Step 2: Compile the 2.6.10+ kernel


Get the smoothwall-kernel-2.6.4.config from the post mentioned above

Copy over smoothwall-kernel-2.6.4.config to the 2.6.10 source directory (rename to .config).

Run
Code:
# make oldconfig
to update it (I just picked the default answer to any other questions).

Run
Code:
# make xconfig
and select the following:


General Setup - Support for hot-pluggable devices
Bus Options - PCCARD (PCMCIA/CardBus) support

16-bit PCMCIA support (Module)
CardBus yenta-compatible bridge support (Module)
Character devices - Serial drivers - 8250/16550 PCMCIA device support (Module)
Run
Code:
# make
to complie the kernel.

Edit the Makefile and set INSTALL_PATH and INSTALL_MOD_PATH to something, eg /tmp, so it doesn't mess with the host.
Then
Code:
# mkdir $INSTALL_PATH/boot
# mkdir $INSTALL_MOD_PATH/lib/modules
If you create these as root make sure you give other users write access to these dirs
Code:
# chmod -R ugoa+rw /tmp/boot
# chmod -R ugoa+rw /tmp/lib

:eek: DO NOT RUN THE FOLLOWING AS ROOT OR IT WILL CHANGE YOUR lilo.conf FILE

Run
Code:
# make modules_install 
# make install
Don't worry about the errors you get. (You will need to give the user you run this as write permission to the source tree)

Check everything is present in $INSTALL_PATH. If there is nothing in $INSTALL_PATH you have done something wrong (forgot to give write permission to others on the source tree??)

Boot should contain vmlinuz-2.6.10 and System.map-2.6.10.
Check /tmp/lib/modules/2.6.10/kernel/drivers/pcmcia you should have pcmcia.ko and yenta_socket.ko
Check /tmp/lib/modules/2.6.10/kernel/drivers/serial you should have serial_cs.ko
If you dont have these modules you probably set the options wrong in the kernel configuration
Step 3: Compile the pcmcia_cs package
Follow the instructions with the pcmcia_cs package to compile it BUT DO NOT INSTALL IT by running make install​

Step 4: Update the module tools on the smoothwall box
The module tools need to be updated (depmod, insmod, lsmod, modprobe, rmmod).

Rename the existing versions to .old:
Code:
# mv depmod depmod.old 
# mv insmod insmod.old
# mv lsmod lsmod.old
# mv modprobe modprobe.old
# mv rmmod rmmod.old

The .old versions can't be symlinks, so to work with the multicall binary use hard links:

Code:
# rm lsmod modprobe rmmod 
# ln insmod.old lsmod.old 
# ln insmod.old modprobe.old 
# ln insmod.old rmmod.old
Copy over the new versions (I used the ones from the poster of the 2.6 kernel mod mentioned above). They should have names like depmod-25

Set it to use the new versions:
Code:
# ln -s depmod-25 depmod 
# ln -s insmod-25 insmod 
# ln -s lsmod-25 lsmod 
# ln -s modprobe-25 modprobe 
# ln -s rmmod-25 rmmod
Check the new versions are able to call the .old versions so a 2.4
kernel will still work.
Code:
# depmod -Av 
# modprobe -r usbcore    (or some other module) 
# modprobe usbcore 
# lsmod
Reboot your smoothwall box and check it still works with the 2.4 kernel

Step 5: Copy your new kernel to the smoothwall box

Copy everything in $INSTALL_PATH over to smoothwall:
Code:
# cd $INSTALL_PATH 
# tar cvzf smoothie26.tgz  boot/* lib/* 
# scp -P 222 smoothie26.tgz root@smoothie:/tmp
And extract it on the smoothwall box:
Code:
# cd /tmp 
# tar xvzf smoothie26.tgz -C /
Add an an entry to smoothwalls /etc/lilo.conf, I used:
Code:
image=/boot/vmlinuz-2.6.10 
        label=2610
And run "lilo" to install it.

Reboot. Pick the new kernel at the prompt and cross fingers.

Hopefully everything still works.

Run "uname -a" to convince yourself its actually a 2.6 kernel.

Make the 2.6 kernel default.
Edit /etc/lilo.conf, and change the "default=" line to point at the label of your new kernel, "2610" for the above example. Then run "lilo" to update the boot loader.

Notes:
The following modules aren't part of the standard kernel:
ip_conntrack_mms
ip_nat_mms
ip_conntrack_h323
ip_nat_h323
ip_conntrack_quake3
ip_nat_quake3.

I haven't added them so it gives an error on bootup. If you need nat for these protocols you will have figure out how to add them
Step 6: Check that the PCI Adaptor is recognised

Code:
# modprobe yenta_socket
Check the kernel messages you should have the following:
Code:
PCI: Enabling device 0000:00:0a.0 (0000 -> 0002)
Yenta: CardBus bridge found at 0000:00:0a.0 [0000:0000]
Yenta: Enabling burst memory read transactions
Yenta: Using CSCINT to route CSC interrupts to PCI
Yenta: Routing CardBus interrupts to PCI
Yenta TI: socket 0000:00:0a.0, mfunc 0x00000000, devctl 0x46
Yenta TI: socket 0000:00:0a.0 probing PCI interrupt failed, trying to fix
Yenta TI: socket 0000:00:0a.0 falling back to parallel PCI interrupts
Yenta TI: socket 0000:00:0a.0 parallel PCI interrupts ok
Yenta: ISA IRQ mask 0x0000, PCI irq 9
Socket status: 30000010
Code:
# lsmod
You should have:
Code:
yenta_socket           16928  1
pcmcia                 15968  3
Code:
#rmmod yenta_socket
#rmmod pcmcia
Step 7: Install the pcmcia_cs tools:

Code:
# cd<path to source>/pcmcia-cs-3.2.7/cardmgr
edit Makefile and add the following at the top after the line “include ...”
Code:
PREFIX = /tmp
export PREFIX
Code:
# make install
you should now have a /tmp/sbin directory with the following cardctl cardmgr ide_info ifport ifuser pcic_probe pcinitrd

Code:
# cd <path to source>/pcmcia-cs-3.2.7/etc
edit Makefile and add the following at the top after the line “include ...”
Code:
PREFIX = /tmp
export PREFIX
Code:
# make install
You should now have a /tmp/etc directory with rc.d and pcmcia directories
copy the whole lot over to the smoothwall box
Code:
# cd $INSTALL_PATH 
# tar cvzf pcmcia_cs.tgz  etc/* sbin/* 
# scp -P 222 pcmcia_cs.tgz root@smoothie:/tmp
extract on the smoothwall box
Code:
# cd /tmp 
# tar xvzf pcmcia_cs.tgz -C /
edit the /etc/rc.d/rc.pcmcia script and find
Code:
# Slackware startup options go right here:
# Should be either i82365 or tcic
PCIC=
change this to
Code:
PCIC=yenta_socket

NOT SURE IF YOU NEED TO DO THIS WITH NEW VERSION OF pcmcia_cs.
The pcmcia driver name has changed since my version of pcmcia_cs (3.2.7) edit the script and replace every instance of "pcmcia_core" with "pcmcia"​
Step 8: Make sure the pcmcia tools work

Code:
# /etc/rc.d/rc.pcmcia start
Starting PCMCIA services: cardmgr[18830]: watching 1 socket
done.
Step 9: Check the Novatel card works

Insert your 3g card into the adaptor. You should here 2 beeps
Code:
#dmesg
....
cs: IO port probe 0x0c00-0x0cff: clean.
cs: IO port probe 0x0800-0x08ff: clean.
cs: IO port probe 0x0100-0x04ff: excluding 0x378-0x37f 0x4d0-0x4d7
cs: IO port probe 0x0a00-0x0aff: clean.
ttyS2 at I/O 0x3e8 (irq = 9) is a 16550A
Code:
#lsmod
serial_cs               7352  1
yenta_socket           16928  1
pcmcia                 15968  3 serial_cs

grab the test_modem script from the debug_tools directory in the pcmcia_cs source tree and copy to the tmp directory on the smoothwall box. Run the test_modem script and you should get a result showing some details of the novatel card.
Step 10: Get pcmcia_cs to start at boot

edit /etc/rc.d/rc.sysinit and find the following:
Code:
echo "Starting syslogd"
/sbin/syslogd -m 0
echo "Starting klogd"
/sbin/klogd
add the following after this:
Code:
echo "Starting PCMCIA"
./etc/rc.d/rc.pcmcia start
 
Last edited:
Novatel Card + PCI Adaptor + Smoothwall Part 2

Step 11: Get connected

edit /etc/ppp/dialer and find the lines:
Code:
my $com = "/usr/sbin/chat -v                                            \
        TIMEOUT                 3                                       \
        ABORT                   '\\nBUSY\\r'    
....

and change to:
Code:
my $com = "/usr/sbin/chat -v                                            \
        TIMEOUT                 3                                       \
        ABORT                   '\\nBUSY\\r'                            \
        ABORT                   '\\nNO ANSWER\\r'                       \
        ABORT                   '\\nRINGING\\r\\n\\r\\nRINGING\\r'      \
        ABORT                   '\\nNO CARRIER\\r'                      \
        ABORT                   '\\nNO DIALTONE\\r'                     \
        ''                      '$modemsettings{'INIT'}'                \
        OK                      '$modemsettings{'HANGUP'}'              \
        OK                      '$speaker'                              \
        TIMEOUT                 '$modemsettings{'TIMEOUT'}'             \
        OK                      'ATE0V1&D2&C1S0=0+IFC=2,2'              \
        OK                      'AT+COPS=0,0,\"Vodacom-SA\",2'          \
        OK                      'AT+CGDCONT=1,\"IP\",\"internet\"'      \
        OK                      'AT+CGEQMIN=1,4,64,384,64,384'          \
        OK                      'AT+CGEQREQ=1,4,64,384,64,384'          \
        OK                      '${dial}${telephone}'                   \
        CONNECT                 '${btfudge}'                            ";

Thanks to Tazz_Tux and his excellent 3G Linux HOWTO for the AT commands

On the smoothwall web administration in Networking - PPP Settings:
Create a new profile

select the interface corresponding to the COM port the kernel configured when you inserted your card (it should be ttyS0 = COM1, ttyS1=COM2 etc but did not seem to work for me)

set the computer to modem rate as high as possible

Fill in the Numer as *99***1#

Set any of the other settings you want appropriatly (for example mine is set to connect on startup)

Under Authentication fill in any user name and password you want (V3G does not use this to connect)

edit /var/smoothwall/ppp/settings and check that COMPORT= is set correctly if not set it to the correct com port

start another ssh session to your smoothwall box and run
Code:
# tail -f /var/log/messages

in your first session run
Code:
./etc/ppp/ppp-on
Watch the log messages in second session and make sure it connects OK

try pinging smtp.vodacom.co.za or another host.

I had the issue mentioned in the Linux HOWTO where the throughput on the card was very slow. This is fixed by editing the /etc/ppp/ppp-on script.
Find the lines
Code:
sub domodemdial
{
and add the following directly afterwards
Code:
system('setserial -a /dev/ttyS2 spd_warp low_latency');

Well that's it reboot your smoothwall box, check that it connects on startup and try surfing from another machine on your network

Please PM me any updates or changes that need to be made. Some of this may be wrong as I wrote it mostly from memory.

ISSUES:

Apparently VPN does not work with the 2.6 Kernel, I dont use it myself so I have not tried it out.

If you install the smoothwall updates it WILL overwrite your carefully edited config files, startup scripts and lilo.conf. I installed ALL the updates manually (not through the web interface) one after the other without rebooting, by copying them to the smoothwall box untaring them and ./setup to install then inserted my changes back in to all the config files. I dont know a way around this yet.​

TODO:
Post my config files, scripts and modutils​
 
Hey IC,

I would think so - from what I can remember, the ELAN's are only in the newer kernels. Can't IPCop run 2.6 ?

Laterz !!!

ic said:
I've spent the better part of the evening trying to get the Elan PIII PCMCIA PCI Adapter card to work with IPCop v1.4.10, and has gotten majorly confused/sidetracked with yenta_socket and i82365...

Anyways, for the benefit of anyone else going this route, it looks like you still have to compile a kernel for IPCop v1.4.10 which has kernel version 2.4.31 - according to the info here...

PS: The info on the Elan CD I have is [not surprisingly] outdated...
 
Ic,

Try my instructions further up this thread, they were written for smoothwall, but should work for IpCop. This gets you a working 2.6 Kernel. It is possible to use the 2.4 kernel, but (and I am talking about smoothwall) you still need to recompile the kernel and the pcmcia_cs tools as you need to disable the kernel PCMCIA.
 
Top
Sign up to the MyBroadband newsletter
X