Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/target/linux/brcm63xx/base-files/etc/board.d/01_leds b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
- index 8d8a942..f638f41 100755
- --- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds
- +++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds
- @@ -38,12 +38,20 @@ fast2704v2)
- ucidef_set_led_usbdev "usb" "USB" "F@ST2704V2:green:usb" "1-1"
- ;;
- hg553)
- - ucidef_set_led_netdev "lan" "LAN" "HW553:blue:lan" "eth0"
- + ucidef_set_led_switch "lan" "LAN" "HW553:blue:lan" "switch0" "0x0f"
- ucidef_set_led_usbdev "usb1" "USB1" "HW553:red:hspa" "1-1"
- ucidef_set_led_usbdev "usb2" "USB2" "HW553:blue:hspa" "1-2"
- ;;
- hg556a_*)
- - ucidef_set_led_netdev "lan" "LAN" "HW556:red:dsl" "eth0"
- + ucidef_set_led_switch "lan" "LAN" "HW556:red:dsl" "switch0" "0x0f"
- + ucidef_set_led_switch "lan1green" "LAN1 (green)" "HW556:green:lan1" "switch0" "0x01" "0x04"
- + ucidef_set_led_switch "lan2green" "LAN2 (green)" "HW556:green:lan2" "switch0" "0x02" "0x04"
- + ucidef_set_led_switch "lan3green" "LAN3 (green)" "HW556:green:lan3" "switch0" "0x04" "0x04"
- + ucidef_set_led_switch "lan4green" "LAN4 (green)" "HW556:green:lan4" "switch0" "0x08" "0x04"
- + ucidef_set_led_switch "lan1red" "LAN1 (red)" "HW556:red:lan1" "switch0" "0x01" "0x02"
- + ucidef_set_led_switch "lan2red" "LAN2 (red)" "HW556:red:lan2" "switch0" "0x02" "0x02"
- + ucidef_set_led_switch "lan3red" "LAN3 (red)" "HW556:red:lan3" "switch0" "0x04" "0x02"
- + ucidef_set_led_switch "lan4red" "LAN4 (red)" "HW556:red:lan4" "switch0" "0x08" "0x02"
- ucidef_set_led_usbdev "usb" "USB" "HW556:red:hspa" "1-2"
- ;;
- hg622)
- diff --git a/target/linux/brcm63xx/config-4.4 b/target/linux/brcm63xx/config-4.4
- index fb448ad..a88028b 100644
- --- a/target/linux/brcm63xx/config-4.4
- +++ b/target/linux/brcm63xx/config-4.4
- @@ -19,6 +19,7 @@ CONFIG_SWCONFIG_B53_PHY_DRIVER=y
- CONFIG_SWCONFIG_B53_PHY_FIXUP=y
- CONFIG_SWCONFIG_B53_SPI_DRIVER=y
- # CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set
- +CONFIG_SWCONFIG_LEDS=y
- CONFIG_BCM6345_EXT_IRQ=y
- CONFIG_BCM6345_PERIPH_IRQ=y
- CONFIG_BCM63XX=y
- diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
- index b884010..fb9be37 100644
- --- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
- +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
- @@ -835,6 +835,28 @@ static int b53_port_set_link(struct switch_dev *sw_dev, int port,
- return switch_generic_set_link(sw_dev, port, link);
- }
- +static int
- +b53_get_port_stats(struct switch_dev *dev, int port,
- + struct switch_port_stats *stats)
- +{
- + struct b53_device *priv = sw_to_b53(dev);
- + u64 txoctets, rxoctets;
- +
- + if (!(BIT(port) & priv->enabled_ports))
- + return -EINVAL;
- +
- + if (is5365(priv) && port == 5)
- + port = 8;
- +
- + b53_read64(priv, B53_MIB_PAGE(port), 0x00, &txoctets);
- + b53_read64(priv, B53_MIB_PAGE(port), (is5365(priv) || is63xx(priv)) ? 0x44 : 0x50, &rxoctets);
- +
- + stats->rx_bytes = rxoctets;
- + stats->tx_bytes = txoctets;
- +
- + return 0;
- +}
- +
- static int b53_phy_read16(struct switch_dev *dev, int addr, u8 reg, u16 *value)
- {
- struct b53_device *priv = sw_to_b53(dev);
- @@ -1064,6 +1086,7 @@ static const struct switch_dev_ops b53_switch_ops_25 = {
- .reset_switch = b53_global_reset_switch,
- .get_port_link = b53_port_get_link,
- .set_port_link = b53_port_set_link,
- + .get_port_stats = b53_get_port_stats,
- .phy_read16 = b53_phy_read16,
- .phy_write16 = b53_phy_write16,
- };
- @@ -1090,6 +1113,7 @@ static const struct switch_dev_ops b53_switch_ops_65 = {
- .reset_switch = b53_global_reset_switch,
- .get_port_link = b53_port_get_link,
- .set_port_link = b53_port_set_link,
- + .get_port_stats = b53_get_port_stats,
- .phy_read16 = b53_phy_read16,
- .phy_write16 = b53_phy_write16,
- };
- @@ -1116,6 +1140,7 @@ static const struct switch_dev_ops b53_switch_ops = {
- .reset_switch = b53_global_reset_switch,
- .get_port_link = b53_port_get_link,
- .set_port_link = b53_port_set_link,
- + .get_port_stats = b53_get_port_stats,
- .phy_read16 = b53_phy_read16,
- .phy_write16 = b53_phy_write16,
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement