mirror of
https://github.com/corundum/corundum.git
synced 2025-01-30 08:32:52 +08:00
dcea219303
git-subtree-dir: fpga/lib/pcie git-subtree-mainline: 5ad725bd0ff04fe7fe7ab9983c0c3e64355e0dd2 git-subtree-split: 1d79a4375b42a8dad274b3e0a757f833400d556e
24 lines
348 B
Bash
Executable File
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"
|
|
|
|
|