mirror of
https://github.com/corundum/corundum.git
synced 2025-01-16 08:12:53 +08:00
Remove quotes
This commit is contained in:
parent
ee532a2472
commit
a77effe885
@ -30,12 +30,12 @@ cmd=$(setpci -s $port COMMAND)
|
||||
echo "Command:" $cmd
|
||||
|
||||
# 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)
|
||||
|
||||
echo "Device control:" $ctrl
|
||||
|
||||
# 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)))
|
||||
|
||||
|
@ -30,7 +30,7 @@ if (($en > 0)); then
|
||||
|
||||
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
|
||||
|
||||
@ -38,7 +38,7 @@ else
|
||||
|
||||
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
|
||||
|
||||
|
@ -33,7 +33,7 @@ bc=$(setpci -s $port BRIDGE_CONTROL)
|
||||
|
||||
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
|
||||
setpci -s $port BRIDGE_CONTROL=$bc
|
||||
sleep 0.5
|
||||
|
@ -18,7 +18,7 @@ if [ ! -e "/sys/bus/pci/devices/$dev" ]; then
|
||||
fi
|
||||
|
||||
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")))
|
||||
|
||||
@ -29,12 +29,12 @@ fi
|
||||
lc=$(setpci -s $dev CAP_EXP+0c.L)
|
||||
ls=$(setpci -s $dev CAP_EXP+12.W)
|
||||
|
||||
max_speed=$(("0x$lc" & 0xF))
|
||||
max_speed=$((0x$lc & 0xF))
|
||||
|
||||
echo "Link capabilities:" $lc
|
||||
echo "Max link speed:" $max_speed
|
||||
echo "Link status:" $ls
|
||||
echo "Current link speed:" $(("0x$ls" & 0xF))
|
||||
echo "Current link speed:" $((0x$ls & 0xF))
|
||||
|
||||
if [ -z "$speed" ]; then
|
||||
speed=$max_speed
|
||||
@ -49,9 +49,9 @@ echo "Configuring $dev..."
|
||||
lc2=$(setpci -s $dev CAP_EXP+30.L)
|
||||
|
||||
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 link control 2:" $lc2n
|
||||
@ -64,7 +64,7 @@ lc=$(setpci -s $dev CAP_EXP+10.L)
|
||||
|
||||
echo "Original link control:" $lc
|
||||
|
||||
lcn=$(printf "%08x" $(("0x$lc" | 0x20)))
|
||||
lcn=$(printf "%08x" $((0x$lc | 0x20)))
|
||||
|
||||
echo "New link control:" $lcn
|
||||
|
||||
@ -75,4 +75,4 @@ sleep 0.1
|
||||
ls=$(setpci -s $dev CAP_EXP+12.W)
|
||||
|
||||
echo "Link status:" $ls
|
||||
echo "Current link speed:" $(("0x$ls" & 0xF))
|
||||
echo "Current link speed:" $((0x$ls & 0xF))
|
||||
|
Loading…
x
Reference in New Issue
Block a user