diff options
Diffstat (limited to 'xpp/utils/xpp_fxloader')
-rw-r--r-- | xpp/utils/xpp_fxloader | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/xpp/utils/xpp_fxloader b/xpp/utils/xpp_fxloader index ca29fd2..f584266 100644 --- a/xpp/utils/xpp_fxloader +++ b/xpp/utils/xpp_fxloader @@ -23,6 +23,20 @@ # 1. Copy this file and the file xpp_fxloader.usermap to /etc/hotplug/usb/ # 2. tail -f /var/log/messages... # +# +# Suggested udev configuration: I used the following file as +# /etc/udev/rules.d/z60_zaptel.rules : +# +# BUS!="usb", ACTION!="add", GOTO="zaptel_usb_add_end" +# +# SYSFS{idVendor}=="04b4", SYSFS{idProduct}=="8613", \ +# RUN+="/etc/hotplug/usb/xpp_fxloader udev $sysfs{idVendor}/$sysfs{idProduct}/" +# SYSFS{idVendor}=="e4e4", SYSFS{idProduct}=="1130", \ +# RUN+="/etc/hotplug/usb/xpp_fxloader udev $sysfs{idVendor}/$sysfs{idProduct}/" +# SYSFS{idVendor}=="e4e4", SYSFS{idProduct}=="1131", \ +# RUN+="/etc/hotplug/usb/xpp_fxloader udev $sysfs{idVendor}/$sysfs{idProduct}/" +# +# LABEL="zaptel_usb_add_end" # # Written by Tzafrir Cohen <tzafrir.cohen@xorcom.com> # Copyright (C) 2006, Xorcom @@ -125,16 +139,38 @@ load_fpga() { ## # to run manually, pass the parameter 'xppdetect' -if [ "$1" = 'xppdetect' ]; then - echo "--------- FIRMWARE LOADING" +case "$1" in +udev) + # the following emulate hotplug's environment from udev's environment: + DEVICE=`echo $DEVNAME | sed -e 's|^/dev/|/proc/|'` + PRODUCT="$2" + # skip on to the rest of the script. Don't exit. + ;; +xppdetect|load|usb) + echo "--------- FIRMWARE LOADING: ($1)" + load_fw 04b4 8613 USB_8613.hex load_fw e4e4 1130 USB_1130.hex - load_fpga e4e4 1131 FPGA_FXS.hex + if [ "$1" != 'usb' ] + then + load_fpga e4e4 1131 FPGA_FXS.hex + fi sleep 3 # Let it stabilize echo "--------- FIRMWARE IS LOADED" - exit $? -fi + exit 0 + ;; +help) + echo "$0: Astribank firmware loading script." + echo "Usage: " + echo "$0 load : manual firmware loading." + echo "$0 usb : manual firmware loading: USB firmware only." + echo "$0 help : this text." + echo "" + echo "('xppdetect' is an alias of 'load')" + exit 0 + ;; +esac ######################### ## |