diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-03-04 16:43:14 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-03-04 16:43:14 +0100 |
commit | 4c17aa5a10ffc232e7e4de45d8ab0b52cfc3010b (patch) | |
tree | dce4520f69b3124da7afa76c2bbe5fc1f08313f7 /tests | |
parent | 195c28f3074486165b6e0935362810f8a1fb9531 (diff) | |
download | pcitool-4c17aa5a10ffc232e7e4de45d8ab0b52cfc3010b.tar.gz pcitool-4c17aa5a10ffc232e7e4de45d8ab0b52cfc3010b.tar.bz2 pcitool-4c17aa5a10ffc232e7e4de45d8ab0b52cfc3010b.tar.xz pcitool-4c17aa5a10ffc232e7e4de45d8ab0b52cfc3010b.zip |
RPM generation
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/reload.sh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/reload.sh b/tests/reload.sh index 62c6e22..13a8c63 100755 --- a/tests/reload.sh +++ b/tests/reload.sh @@ -1,25 +1,26 @@ #! /bin/bash - -device=`lspci -n | grep -m 1 "10ee:" | awk '{print $1}'` -if [ -z "$device" ]; then +devdir=`ls -d /sys/bus/pci/devices/*/driver/module/drivers/pci:pciDriver` +if [ $? -ne 0 ]; then echo "Xilinx device doesn't exist, rescanning..." echo 1 > /sys/bus/pci/rescan exit else + device=`echo $devdir | head -n 1 | cut -c 27-33` echo "Xilinx is located at: " $device fi -echo "remove driver" -rmmod pciDriver echo "remove devices" echo 1 > /sys/bus/pci/devices/0000\:${device:0:2}\:${device:3:4}/remove sleep 1 echo "rescan" echo 1 > /sys/bus/pci/rescan sleep 1 +echo "remove driver" +rmmod pciDriver +sleep 1 echo "instantiate driver" modprobe pciDriver -# for devices with different ID -#echo "10ee 6028" > /sys/bus/pci/drivers/pciDriver/new_id -pci -i -#echo Enabling bus mastering on device $dev -#setpci -s $device 4.w=0x07 +sleep 1 +echo "set bus master dma" +dev=$device +echo Enabling bus mastering on device $dev +setpci -s $dev 4.w=0x07 |