HOWTO - EciAdsl with coldplug/hotplug

Author: Patrizio Bassi, aka Hetfield

Contact: www.blight.tk

Date: 29 June 2005
Revision: 1.0


This document was written in order to help people to use their adsl usb modems without having lots of limitations (compared to windows drivers).

Before you go ahead please check:
1) you have last EciAdsl driver installed, your modem is supported and fully configured. Assumption: you are actually connected to Internet via EciAdsl drivers, without troubles. For any troubles check the wonderful howtos and FAQs in the EciAdsl website.
2) you have hotplug/coldplug installed and added as startup service. Please refer to Hotplug homepage or your distro's guide, the hotplug man page or search web to have it functional and working.

Let's start.

I'm using the Gentoo standard configuration: I'm pretty sure other distros have the same or similar paths, but it won't be a problem.

I'm using load-firm, which is a simple eciadsl-start edited file, it only provides the USB modules load (if needed), the USB file system to load (if needed too) and firmware loading. Nothing more.

Now chmod +x load-firm and place it somewhere, for example in /usr/bin/load-firm

You can easily test it, just unplug your modem and start load-firm script, check that modem leds turn on (it depends on your modem of course..).

Now it's time to configure hotplug.
Enter in /etc/hotplug/usb directory, where you should find some default scripts.
You need to do this: when you plug your modem (or modem is detected via coldplug..it's the same) hotplug should call your /usr/bin/load-firm script.

Add a new file, called for example adslfw.usermap and write this line into:
personal_script 0x0003 0x0547 0x2131 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

Notice other not-0 values: do not consider 0x0003, but only 0x0547 and 0x2131, pid/vid of my modem (Zyxel Prestige 630-41) before EciAdsl drivers usage.
Find your modem right pid/vid in the EciAdsl modems pages and write there.

personal_script is the file hotplug will call when it detects your modem.
You can place /usr/bin/load-firm or a more complex script.
This is mine, but you can add what you want:

#!/bin/sh
if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
    killall pppd > /dev/null 2>&1
    killall -9 eciadsl-pppoeci > /dev/null 2>&1
    killall -9 eciadsl-synch > /dev/null 2>&1
    /usr/bin/scripts/load-firm > /dev/null 2>&1
fi

Checkpoint

You have added a script that only load firmware and so change the pid/vid values.
When you change the pid/vid values of a device, it's like having a completly new device attached, because USB controller will assign a different logical number.

So, after firmware loading, for hotplug it's like having a new device plugged, with new ids.
So now your modem is rightly detected as a Globespan device and you can connect.

You only need to add another hotplug event like before.

So, add a new file, for example adsl.usermap and write this line into:
anotherpersonalscript 0x0003 0x0915 0x8000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

The 0x0915 and 0x8000 values are the values after eci driver firmware load.
Find your adsl modem new values in the EciAdsl modems pages, as before.

anotherpersonalscript can be simply eciadsl-start or the old startmodem script.
The eciadsl-start script will immediatly detect that firmware is already loaded and will start sync.
If you want, you can delete the firmware load pass from script, but there will be no difference.

I've a more this start script, but you can use stardard one.

#!/bin/sh
if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
    killall pppd > /dev/null 2>&1
    killall eciadsl-pppoeci > /dev/null 2>&1
    killall -9 eciadsl-synch > /dev/null 2>&1
    eciadsl-stop > /dev/null 2>&1
    eciadsl-start > /dev/null 2>&1
    exit 0
fi

if [ "$ACTION" = "remove" -a "$TYPE" = "usb" ]; then
    sh /etc/ppp/ip-down
fi

You can download all files I used here, in the eciadsl_hotplug.tar.gz package

Now, unplug your modem, restart hotplug service and replug the device.
It should work!

For any question or troubles you can contact me on my personal website www.blight.tk or write me an email