On 2007-09-24, Steve Underwood <[email protected]> wrote:
> If you have a recent kernel, the USB FET tools should just work.
> However, some distros don't have hotplug set up properly. You may need
> something like a file called /etc/hotplug/usb/ti_usb_3410_5052 containing
NB, that shellscript is broken. The large conditional for the
if at the end isn't right. It needs to be changed to this:
if (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_3410` && scan $PRODUCT_ID
13328 62512 `cat $PARAM_PATH/product_3410`) ||
(scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_5052` && scan $PRODUCT_ID
20562 20818 20570 20575 `cat $PARAM_PATH/product_5052`)
Also, CONFIG_PATH is being set to be the path to the hub to
which the ez430 is connected. It needs to be the path of the
ez430, not the hub to which it's attached.
For example, the script is trying to write "2" to
/sys/devices/pci0000:00/0000:00:10.0/usb2/bConfigurationValue
(writing a "2" to that path from the shell prompt produces an error)
when it should be writing to
/sys/devices/pci0000:00/0000:00:10.0/usb2/2-1/bConfigurationValue
(writing a "2" to that path from the shell prompt makes it work)
> #!/bin/bash
> BOOT_CONFIG=1
> ACTIVE_CONFIG=2
>
> if [[ "$ACTION" != "add" ]]
> then
> exit
> fi
>
> CONFIG_PATH=/sys${DEVPATH%/?*}/bConfigurationValue
>
> if [[ 0`cat $CONFIG_PATH` -ne $BOOT_CONFIG ]]
> then
> exit
> fi
>
> PRODUCT=${PRODUCT%/?*} # delete version
> VENDOR_ID=`printf "%d" 0x${PRODUCT%/?*}`
> PRODUCT_ID=`printf "%d" 0x${PRODUCT#*?/}`
>
> PARAM_PATH=/sys/module/ti_usb_3410_5052/parameters
>
> function scan() {
> s=$1
> shift
> for i
> do
> if [[ $s -eq $i ]]
> then
> return 0
> fi
> done
> return 1
> }
>
> IFS=$IFS,
>
> if (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_3410` && scan
> $PRODUCT_ID 13328 62512 `cat $PARAM_PATH/product_3410`) ||
> (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_5052` && scan
> $PRODUCT_ID 20562 20818 20570 20575 `cat $PARAM_PATH/product_5052`)
> then
> echo $ACTIVE_CONFIG > $CONFIG_PATH
> fi
--
Grant Edwards grante Yow! As President I have
at to go vacuum my coin
visi.com collection!