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

Remove quotes

This commit is contained in:
Alex Forencich 2019-11-17 12:51:13 -08:00
parent ee532a2472
commit a77effe885
4 changed files with 12 additions and 12 deletions

View File

@ -30,12 +30,12 @@ cmd=$(setpci -s $port COMMAND)
echo "Command:" $cmd echo "Command:" $cmd
# clear SERR bit in command register # clear SERR bit in command register
setpci -s $port COMMAND=$(printf "%04x" $(("0x$cmd" & ~0x0100))) setpci -s $port COMMAND=$(printf "%04x" $((0x$cmd & ~0x0100)))
ctrl=$(setpci -s $port CAP_EXP+8.w) ctrl=$(setpci -s $port CAP_EXP+8.w)
echo "Device control:" $ctrl echo "Device control:" $ctrl
# clear fatal error reporting enable bit in device control register # clear fatal error reporting enable bit in device control register
setpci -s $port CAP_EXP+8.w=$(printf "%04x" $(("0x$ctrl" & ~0x0004))) setpci -s $port CAP_EXP+8.w=$(printf "%04x" $((0x$ctrl & ~0x0004)))

View File

@ -30,7 +30,7 @@ if (($en > 0)); then
echo "Device control:" $ctrl echo "Device control:" $ctrl
setpci -s $dev CAP_EXP+8.w=$(printf "%04x" $(("0x$ctrl" | 0x0100))) setpci -s $dev CAP_EXP+8.w=$(printf "%04x" $((0x$ctrl | 0x0100)))
else else
@ -38,7 +38,7 @@ else
echo "Device control:" $ctrl echo "Device control:" $ctrl
setpci -s $dev CAP_EXP+8.w=$(printf "%04x" $(("0x$ctrl" & ~0x0100))) setpci -s $dev CAP_EXP+8.w=$(printf "%04x" $((0x$ctrl & ~0x0100)))
fi fi

View File

@ -33,7 +33,7 @@ bc=$(setpci -s $port BRIDGE_CONTROL)
echo "Bridge control:" $bc echo "Bridge control:" $bc
setpci -s $port BRIDGE_CONTROL=$(printf "%04x" $(("0x$bc" | 0x40))) setpci -s $port BRIDGE_CONTROL=$(printf "%04x" $((0x$bc | 0x40)))
sleep 0.01 sleep 0.01
setpci -s $port BRIDGE_CONTROL=$bc setpci -s $port BRIDGE_CONTROL=$bc
sleep 0.5 sleep 0.5

View File

@ -18,7 +18,7 @@ if [ ! -e "/sys/bus/pci/devices/$dev" ]; then
fi fi
pciec=$(setpci -s $dev CAP_EXP+02.W) pciec=$(setpci -s $dev CAP_EXP+02.W)
pt=$((("0x$pciec" & 0xF0) >> 4)) pt=$(((0x$pciec & 0xF0) >> 4))
port=$(basename $(dirname $(readlink "/sys/bus/pci/devices/$dev"))) port=$(basename $(dirname $(readlink "/sys/bus/pci/devices/$dev")))
@ -29,12 +29,12 @@ fi
lc=$(setpci -s $dev CAP_EXP+0c.L) lc=$(setpci -s $dev CAP_EXP+0c.L)
ls=$(setpci -s $dev CAP_EXP+12.W) ls=$(setpci -s $dev CAP_EXP+12.W)
max_speed=$(("0x$lc" & 0xF)) max_speed=$((0x$lc & 0xF))
echo "Link capabilities:" $lc echo "Link capabilities:" $lc
echo "Max link speed:" $max_speed echo "Max link speed:" $max_speed
echo "Link status:" $ls echo "Link status:" $ls
echo "Current link speed:" $(("0x$ls" & 0xF)) echo "Current link speed:" $((0x$ls & 0xF))
if [ -z "$speed" ]; then if [ -z "$speed" ]; then
speed=$max_speed speed=$max_speed
@ -49,9 +49,9 @@ echo "Configuring $dev..."
lc2=$(setpci -s $dev CAP_EXP+30.L) lc2=$(setpci -s $dev CAP_EXP+30.L)
echo "Original link control 2:" $lc2 echo "Original link control 2:" $lc2
echo "Original link target speed:" $(("0x$lc2" & 0xF)) echo "Original link target speed:" $((0x$lc2 & 0xF))
lc2n=$(printf "%08x" $((("0x$lc2" & 0xFFFFFFF0) | $speed))) lc2n=$(printf "%08x" $(((0x$lc2 & 0xFFFFFFF0) | $speed)))
echo "New target link speed:" $speed echo "New target link speed:" $speed
echo "New link control 2:" $lc2n echo "New link control 2:" $lc2n
@ -64,7 +64,7 @@ lc=$(setpci -s $dev CAP_EXP+10.L)
echo "Original link control:" $lc echo "Original link control:" $lc
lcn=$(printf "%08x" $(("0x$lc" | 0x20))) lcn=$(printf "%08x" $((0x$lc | 0x20)))
echo "New link control:" $lcn echo "New link control:" $lcn
@ -75,4 +75,4 @@ sleep 0.1
ls=$(setpci -s $dev CAP_EXP+12.W) ls=$(setpci -s $dev CAP_EXP+12.W)
echo "Link status:" $ls echo "Link status:" $ls
echo "Current link speed:" $(("0x$ls" & 0xF)) echo "Current link speed:" $((0x$ls & 0xF))