1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00
corundum/scripts/pcie_flr.sh

24 lines
348 B
Bash
Raw Normal View History

2019-07-15 12:33:35 -07:00
#!/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"