3
TESTS_PATH="`dirname \"$0\"`"
4
TESTS_PATH="`( cd \"$TESTS_PATH\" && pwd )`"
7
PCILIB_PATH=$TESTS_PATH/..
8
LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/pci $*
12
PCILIB_PATH=$TESTS_PATH/..
13
LD_LIBRARY_PATH="$PCILIB_PATH" $PCILIB_PATH/apps/compare_to_value $*
16
#size=`expr 1024 "*" 1024`
17
size=`expr 1024 "*" 1`
21
/root/pcitool/tests/ipecamera/frame.sh &> /dev/null
27
pci -r dma1 -s 16777216 --multipacket -o /dev/null &> /dev/null
29
pci -r dma1 -s 1024 -o /dev/null | grep -i "Error (62)" &> /dev/null
31
echo "There is data on dma..."
40
print_iters=`expr 2 + 1024 '*' 100 / $size`
42
read_size=`expr $multiplier '*' $size`
49
if [ $wait -gt 0 ]; then
53
pci -w dma1 -s $size "*0x$i"
54
rm -f /tmp/camera-test.out
55
pci -r dma1 --wait --multipacket -s $read_size -o /tmp/camera-test.out -t 1000000 &> /dev/null
56
if [ $wait -gt 0 ]; then
58
while [ $wrdone -eq 0 ]; do
59
# pci --list-dma-engines
60
pci --list-dma-engines | grep "DMA1 S2C" | grep "SD" #&> /dev/null
66
res=`compare /tmp/camera-test.out $read_size "$i" 6 2 6`
68
err_cnt=`echo $res | cut -f 1 -d ' '`
69
if [ "$err_cnt" -ne 0 ]; then
70
pci -r dma1 --wait --multipacket -o /tmp/camera-test.out -t 1000000 &> /dev/null
71
cp /tmp/camera-test.out /tmp/camera-test.out.$err_num
72
err_num=$(($err_num + 1))
74
byte_cnt=`echo $res | cut -f 3 -d ' '`
75
send=$(($send + $byte_cnt * 4))
76
errors=$(($errors + $err_cnt * 4))
78
failed=$(($failed + 1))
82
if [ $i -eq $print_iters ]; then
83
echo "Data send: $send bytes, Errors: $errors bytes, Failed exchanges: $failed"