The TP-Link T2500G-10TS has a panel with 10 bicolor LEDs. Normally they blink in green for GE and yellow for 10/100 Mbit Ethernet.
The Leds are defined like this in the device-tree:
leds {
compatible = "gpio-leds";
led_sys: sys {
label = "t2500g-10ts:green:sys";
gpios = <&gpio0 148 GPIO_ACTIVE_HIGH>;
};
led_lan1ge: lan1ge {
label = "t2500g-10ts:green:lan1ge";
gpios = <&gpio0 118 GPIO_ACTIVE_HIGH>;
};
led_lan2ge: lan2ge {
label = "t2500g-10ts:green:lan2ge";
gpios = <&gpio0 119 GPIO_ACTIVE_HIGH>;
};
/* more leds not shown here */
led_lan9ge: lan9ge {
label = "t2500g-10ts:green:lan9ge";
gpios = <&gpio0 126 GPIO_ACTIVE_HIGH>;
};
led_lan10ge: lan10ge {
label = "t2500g-10ts:green:lan10ge";
gpios = <&gpio0 127 GPIO_ACTIVE_HIGH>;
};
led_lan1fe: lan1fe {
label = "t2500g-10ts:amber:lan1fe";
gpios = <&gpio0 150 GPIO_ACTIVE_HIGH>;
};
/* more leds not shown here */
led_lan10fe: lan10fe {
label = "t2500g-10ts:amber:lan10fe";
gpios = <&gpio0 159 GPIO_ACTIVE_HIGH>;
};
};
For GBit ethernet, the following shows the activity of the leds (/etc/board.d/01-leds):
#!/bin/sh
. /lib/functions/leds.sh
. /lib/functions/uci-defaults.sh
board=$(board_name)
boardname="${board##*,}"
board_config_update
case $board in
tp-link,t2500g-10ts)
ucidef_set_led_netdev "lan1ge" "LAN1 act" "$boardname:green:lan1ge" "lan1" "tx rx"
ucidef_set_led_netdev "lan2ge" "LAN2 act" "$boardname:green:lan2ge" "lan2" "tx rx"
ucidef_set_led_netdev "lan3ge" "LAN3 act" "$boardname:green:lan3ge" "lan3" "tx rx"
ucidef_set_led_netdev "lan4ge" "LAN4 act" "$boardname:green:lan4ge" "lan4" "tx rx"
ucidef_set_led_netdev "lan5ge" "LAN5 act" "$boardname:green:lan5ge" "lan5" "tx rx"
ucidef_set_led_netdev "lan6ge" "LAN6 act" "$boardname:green:lan6ge" "lan6" "tx rx"
ucidef_set_led_netdev "lan7ge" "LAN7 act" "$boardname:green:lan7ge" "lan7" "tx rx"
ucidef_set_led_netdev "lan8ge" "LAN8 act" "$boardname:green:lan8ge" "lan8" "tx rx"
ucidef_set_led_netdev "lan9ge" "LAN9 act" "$boardname:green:lan9ge" "lan9" "tx rx"
ucidef_set_led_netdev "lan10ge" "LAN10 act" "$boardname:green:lan10ge" "lan10" "tx rx"
;;
esac
board_config_flush
exit 0
Is there a possibility to distinguish between GBit activity and 100MBit activity and have the yellow leds show the 100MBit activity? Alternatively, is there a possibility to show in yellow a link state with less than GBit, so that the led would be yellow and blink green when there is activity?
Kobi