Work
Projects- 3D Printing Projects
- Amateur Radio
- Automotive Projects
- Electronics Projects
- Gaming Projects
- Homelab Projects
- Horticulture Projects
- Other Projects
- Project Projects
- Software Projects
- Tumblr (photography)
-
Work
ProjectsThis is an old revision of the document!
ethtool-full i2c-toolsBUS=$(for bus in /sys/bus/i2c/devices/i2c-*; do b=${bus##*-}; i2cdetect -y -r $b 2>/dev/null | grep -q " 50 " && i2cdetect -y -r $b 2>/dev/null | grep -q " 51 " && echo $b; done)echo $BUS and check there is a value before proceeding (you can also run the multiple SFP script below to verify the SFP vendor and S/N)for bus in /sys/bus/i2c/devices/i2c-*; do
b=${bus##*-}
if i2cdetect -y -r $b 2>/dev/null | grep -q " 50 " && i2cdetect -y -r $b 2>/dev/null | grep -q " 51 "; then
vendor=""
for reg in $(seq 20 35); do
vendor="$vendor$(printf "\\x$(i2cget -y $b 0x50 $reg | sed 's/0x//')")"
done
serial=""
for reg in $(seq 68 83); do
serial="$serial$(printf "\\x$(i2cget -y $b 0x50 $reg | sed 's/0x//')")"
done
echo "Bus: $b"
echo "├─▶ Vendor: $vendor"
echo "└─▶ S/N: $serial"
echo ""
fi
done
BUS=5 (replace 5 with the respective bus number)i2cset -y $BUS 0x50 0x06 0x00i2cset -y $BUS 0x50 0x0a 0x05i2cset -y $BUS 0x50 0x0c 0x1fi2cset -y $BUS 0x50 0x3f $(i2cdump -y -r 0-62 $BUS 0x50 b | awk 'NR>1 {for(i=2;i<=NF;i++) if($i~/^[0-9a-f]{2}$/) {cmd="printf \"%d\" 0x"$i; cmd|getline d; close(cmd); sum+=d}} END {printf "0x%02x", sum % 256}')ethtool -m [ethX] Supported link modes: 2500baseX/Full
1000baseX/Full
| Address | Field | Old Value | New Value | Reason |
|---|---|---|---|---|
0x06 | Ethernet Compliance | 0x02 | 0x00 | Disable 1000BASE-LX so Linux prefers 2500BASE-X |
0x0A | Extended Compliance | 0x00 | 0x05 | Declare 2500BASE-X support |
0x0C | Nominal Bit Rate | 0x0D | 0x1F | Set to 3100MBd (correct value for 2500BASE-X) |
0x3F | CC_BASE Checksum | (varies) | (recalculated by awk) | Sum of bytes 0x00–0x3E mod 256 |