1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-30 08:32:52 +08:00
corundum/fpga/lib/pcie/scripts/pcie_flr.sh
Alex Forencich dcea219303 added pcie as a subproject
git-subtree-dir: fpga/lib/pcie
git-subtree-mainline: 5ad725bd0ff04fe7fe7ab9983c0c3e64355e0dd2
git-subtree-split: 1d79a4375b42a8dad274b3e0a757f833400d556e
2019-07-15 14:55:57 -07:00

24 lines
348 B
Bash
Executable File

#!/bin/bash
dev=$1
if [ -z "$dev" ]; then
echo "Error: no device specified"
exit 1
fi
if [ ! -e "/sys/bus/pci/devices/$dev" ]; then
dev="0000:$dev"
fi
if [ ! -e "/sys/bus/pci/devices/$dev" ]; then
echo "Error: device $dev not found"
exit 1
fi
echo "Resetting function $dev..."
echo 1 > "/sys/bus/pci/devices/$dev/reset"