Prodigy44 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 19 Sep 2003 Posts: 231 Location: Nantes, France
|
Posted: Wed Oct 27, 2004 9:29 am Post subject: [eagle-usb] hotplug et modem sagem f@st 800 |
|
|
Bon alors voila j'utilise le modem sagem sur un 2.6.8.1-ck9 il fonctionne très bien mais hotplug ne lance pas automatiquement la synchronisation lorsque je branche le modem, je me suis inspiré de ce qu'il y avait dans l'ebuild 1.9.9, a savoir le fichier usb.usermap et le fichier eu_dsp, j'ai donc écrasé le fichier /etc/hotplug/usb.usermap (il était vide) et j'ai renommé et copié le fichier eu_dsp dans /etc/hotplug/usb/eagle-usb.
Contenu de usb.usermap
Code: | # eagle-usb: SAGEM F@st 800/908 (EL/E2/E2C)
eagle-usb 0x0003 0x1110 0x900f 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
eagle-usb 0x0003 0x1110 0x9021 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
eagle-usb 0x0003 0x1110 0x9023 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# eagle-usb: U.S. Robotics ADSL
eagle-usb 0x0003 0x0baf 0x00f1 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
eagle-usb 0x0003 0x0baf 0x00f9 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
eagle-usb 0x0003 0x0baf 0x00f5 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
eagle-usb 0x0003 0x0baf 0x00f7 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
|
contenu de /etc/hotplug/usb/eagle-usb
Code: | #!/bin/bash
# $Id: eu_dsp,v 1.10 2004/08/29 21:36:54 Tux Exp $
# Name: eu_dsp
# Goal: This script handles the ADI ADSL Modem USB driver after firmware
# uploading. It loads the DSP code as needed by the modem.
# It create a script /var/run/usb/%proc%bus%usb%002%005 in order
# for the ADSL connexion to be stopped and module to be unloaded.
# It should only be run by hotplug.
# Author: Tux
# Params (given by hotplug):
# $DEVICE ex: /proc/bus/usb/002/005
# $DEVPATH ex: /devices/pci0000:00/0000:00:02.0/usb1/1-2/1-2:1.2
# $REMOVER ex: /var/run/usb/%proc%bus%usb%001%006
# note: only kernels 2.5+ provide $DEVPATH
# note: some distribs like SuSE9.1 does not provide $REMOVER param
exit 123
# this script should only be called by hotplug (giving the $DEVICE param)
if [ -z "$DEVICE" ] ; then
logger "$NO_PARAM_MSG"
echo -e "$NO_PARAM_MSG"
exit
fi
# this script is called multiple times by hotplug, so we try to
# send DSP only one time
SEND_DSP=0
if [ -z $DEVPATH ] ; then
# kernel 2.4
SEND_DSP=1
else
# kernel 2.5+
LAST_CHARS=`echo $DEVPATH | sed -e "s/.*\-.[^:]*//1"`
if [ "x$LAST_CHARS" = "x:1.0" ] ; then
SEND_DSP=1
fi
fi
if [ $SEND_DSP == 1 ] ; then
if ! eaglestat | grep -q "$SEND_DSP_STR" ; then
SEND_DSP=0
fi
fi
if [ $SEND_DSP == 1 ] ; then
# small delay to prevent a bug
sleep 1s
# script called when the modem will be unplugged
mkdir -p /var/run/usb
if [ -z "$REMOVER" ] ; then
REMOVER="/var/run/usb/`echo $DEVICE | sed 's/\//%/g'`"
fi
echo "#!/bin/bash" > $REMOVER
echo "${SBIN_DIR}/fctStopAdsl" >> $REMOVER
echo "rmmod $MODULE_STR" >> $REMOVER
chmod u+x $REMOVER
# load DSP & options
eaglectrl -d 0>&1 1>&1 2>&1 | logger
fi
#***************************************************************************
# $Log: eu_dsp,v $
# Revision 1.10 2004/08/29 21:36:54 Tux
# - add a small delay to prevent a bug with "eaglectrl -d"
#
# Revision 1.9 2004/08/04 19:53:20 Tux
# - fix conflict between two vars named $SEND_DSP
# - use $MODULE_STR instead of "eagle-usb"
#
# Revision 1.8 2004/07/12 21:04:56 Tux
# - don't send DSP for pre-firmware device
#
# Revision 1.7 2004/07/02 23:18:34 Tux
# - slackware 10 support
#
# Revision 1.6 2004/06/23 20:39:30 Tux
# - add support for distribs which do not provide $REMOVER param (eg: SuSE9.1)
#
# Revision 1.5 2004/03/22 21:15:04 Tux
# $UNPLUGSCRIPT => $REMOVER
#
#***************************************************************************/
|
j'ai essayé ca aussi comme script pour hotplug
Code: | #!/bin/bash
/usr/sbin/eaglectrl -w -o -d /etc/eagle-usb/dsp/ -s 20
echo "Synchronisation du modem"
|
Mais ca ne marche pas :/ _________________ Apporter votre contribution au libre : http://fr.wikipedia.org |
|