#! /bin/bash ring=-r0 card=-c0 SLV_HCM=17 echo "0x10001000" > scsnr.txt echo "0x10001000" >> scsnr.txt pc2tp -noaddr $card $ring -slv $SLV_HCM -gsa 0xf0f0 -gea 0xf0f2 -gb tmpscsn cat tmpscsn >> scsnr.txt scsnShift_T3=0 ROBTYPE=3A DBANK=0 if [ "$DBANK" == "1" ] ; then cpu0s=0xf000 cpu0e=0xf032 cpu1s=0xf040 cpu1e=0xf071 cpu2s=0xf080 cpu2e=0xf0B1 cpu3s=0xf0c0 cpu3e=0xf0Fb fi if [ "$DBANK" == "0" ] ; then cpu0s=0xc300 cpu0e=0xc332 cpu1s=0xc340 cpu1e=0xc371 cpu2s=0xc380 cpu2e=0xc3B1 cpu3s=0xc3c0 cpu3e=0xc3Fb fi # SCSN Slave list is automatically selected according to ROBTYPE SCSN_SLV_LIST="-" echo ROBTYPE = $ROBTYPE if [ "$ROBTYPE" == "1A" -o "$ROBTYPE" == "4A" ] ; then SCSN_SLV_LIST="$((10+$scsnShift)) $((11+$scsnShift)) $((12+$scsnShift)) $((13+$scsnShift)) $((9+$scsnShift)) $((16+$scsnShift)) $((15+$scsnShift)) $((14+$scsnShift)) $((8+$scsnShift)) $((6+$scsnShift)) $((7+$scsnShift)) $((1+$scsnShift)) $((5+$scsnShift)) $((4+$scsnShift)) $((3+$scsnShift)) $((2+$scsnShift))" fi if [ "$ROBTYPE" == "1B" -o "$ROBTYPE" == "2B" -o "$ROBTYPE" == "4B" ] ; then SCSN_SLV_LIST="$((11+$scsnShift)) $((12+$scsnShift)) $((13+$scsnShift)) $((14+$scsnShift)) $((10+$scsnShift)) $((17+$scsnShift)) $((16+$scsnShift)) $((15+$scsnShift)) $((9+$scsnShift)) $((7+$scsnShift)) $((8+$scsnShift)) $((2+$scsnShift)) $((6+$scsnShift)) $((5+$scsnShift)) $((4+$scsnShift)) $((3+$scsnShift))" fi if [ "$ROBTYPE" == "3A" ] ; then # SCSN_SLV_LIST="$((10+$scsnShift_T3)) $((11+$scsnShift_T3)) $((12+$scsnShift_T3)) SCSN_SLV_LIST="$((10+$scsnShift_T3)) $((11+$scsnShift_T3)) $((12+$scsnShift_T3)) $((13+$scsnShift_T3)) $((9+$scsnShift_T3)) $((16+$scsnShift_T3)) $((15+$scsnShift_T3)) $((14+$scsnShift_T3)) $((8+$scsnShift_T3)) $((6+$scsnShift_T3)) $((7+$scsnShift_T3)) $((1+$scsnShift_T3)) $((5+$scsnShift_T3)) $((4+$scsnShift_T3)) $((3+$scsnShift_T3)) $((2+$scsnShift_T3))" fi if [ "$ROBTYPE" == "3B" ] ; then SCSN_SLV_LIST="$((12+$scsnShift_T3)) $((13+$scsnShift_T3)) $((14+$scsnShift_T3)) $((15+$scsnShift_T3)) $((11+$scsnShift_T3)) $((18+$scsnShift_T3)) $((17+$scsnShift_T3)) $((16+$scsnShift_T3)) $((10+$scsnShift_T3)) $((8+$scsnShift_T3)) $((9+$scsnShift_T3)) $((3+$scsnShift_T3)) $((7+$scsnShift_T3)) $((6+$scsnShift_T3)) $((5+$scsnShift_T3)) $((4+$scsnShift_T3))" fi if [ "$SCSN_SLV_LIST" == "-" ] ; then echo ROBTYPE is quite bad. exit fi echo SCSN_SLV_LIST=$SCSN_SLV_LIST echo Scanning SCSN Slaves: \"$SCSN_SLV_LIST\" usleep 100 # For the new ROC header only #pc2tp -noaddr $card $ring -slv $SLV_HCM -gsa 0xf000 -gea 0xf000 -gb tmpscsn #cat tmpscsn >> scsnr.txt for SLV in $SCSN_SLV_LIST ; do echo Slave: $SLV pc2tp -noaddr $card $ring -slv $SLV -gsa $cpu0s -gea $cpu0e -gb tmpscsn cat tmpscsn >> scsnr.txt pc2tp -noaddr $card $ring -slv $SLV -gsa $cpu1s -gea $cpu1e -gb tmpscsn cat tmpscsn >> scsnr.txt pc2tp -noaddr $card $ring -slv $SLV -gsa $cpu2s -gea $cpu2e -gb tmpscsn cat tmpscsn >> scsnr.txt pc2tp -noaddr $card $ring -slv $SLV -gsa $cpu3s -gea $cpu3e -gb tmpscsn cat tmpscsn >> scsnr.txt done echo "0x00000000" >> scsnr.txt echo "0x00000000" >> scsnr.txt rm tmpscsn # check if the new data differs from the old diff -q scsnr.txt scs00000001.txt mv scsnr.txt scs00000001.txt