diff --git a/scripts/pcie_disable_fatal_err.sh b/scripts/pcie_disable_fatal_err.sh index 0bb0a7371..968cc71de 100755 --- a/scripts/pcie_disable_fatal_err.sh +++ b/scripts/pcie_disable_fatal_err.sh @@ -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))) diff --git a/scripts/pcie_ext_tag.sh b/scripts/pcie_ext_tag.sh index d7c8643e9..1fcf39e2a 100755 --- a/scripts/pcie_ext_tag.sh +++ b/scripts/pcie_ext_tag.sh @@ -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 diff --git a/scripts/pcie_hot_reset.sh b/scripts/pcie_hot_reset.sh index 28d478050..caf77b340 100755 --- a/scripts/pcie_hot_reset.sh +++ b/scripts/pcie_hot_reset.sh @@ -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 diff --git a/scripts/pcie_set_speed.sh b/scripts/pcie_set_speed.sh index 988dc6abc..5e0ef4b27 100755 --- a/scripts/pcie_set_speed.sh +++ b/scripts/pcie_set_speed.sh @@ -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))