Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: enable SerDes RX stats for Topaz
Browse files Browse the repository at this point in the history
Commit 0df9528 ("mv88e6xxx: Add serdes Rx statistics") added
support for RX statistics on SerDes ports for Peridot.

This same implementation is also valid for Topaz, but was not enabled
at the time.

We need to use the generic .serdes_get_lane() method instead of the
Peridot specific one in the stats methods so that on Topaz the proper
one is used.

Signed-off-by: Marek Behún <kabel@kernel.org>
Fixes: 0df9528 ("mv88e6xxx: Add serdes Rx statistics")
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marek Behún authored and David S. Miller committed Jul 1, 2021
1 parent c07fff3 commit a03b98d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -3623,6 +3623,9 @@ static const struct mv88e6xxx_ops mv88e6141_ops = {
.serdes_irq_enable = mv88e6390_serdes_irq_enable,
.serdes_irq_status = mv88e6390_serdes_irq_status,
.gpio_ops = &mv88e6352_gpio_ops,
.serdes_get_sset_count = mv88e6390_serdes_get_sset_count,
.serdes_get_strings = mv88e6390_serdes_get_strings,
.serdes_get_stats = mv88e6390_serdes_get_stats,
.phylink_validate = mv88e6341_phylink_validate,
};

Expand Down Expand Up @@ -4429,6 +4432,9 @@ static const struct mv88e6xxx_ops mv88e6341_ops = {
.gpio_ops = &mv88e6352_gpio_ops,
.avb_ops = &mv88e6390_avb_ops,
.ptp_ops = &mv88e6352_ptp_ops,
.serdes_get_sset_count = mv88e6390_serdes_get_sset_count,
.serdes_get_strings = mv88e6390_serdes_get_strings,
.serdes_get_stats = mv88e6390_serdes_get_stats,
.phylink_validate = mv88e6341_phylink_validate,
};

Expand Down
6 changes: 3 additions & 3 deletions drivers/net/dsa/mv88e6xxx/serdes.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ static struct mv88e6390_serdes_hw_stat mv88e6390_serdes_hw_stats[] = {

int mv88e6390_serdes_get_sset_count(struct mv88e6xxx_chip *chip, int port)
{
if (mv88e6390_serdes_get_lane(chip, port) < 0)
if (mv88e6xxx_serdes_get_lane(chip, port) < 0)
return 0;

return ARRAY_SIZE(mv88e6390_serdes_hw_stats);
Expand All @@ -734,7 +734,7 @@ int mv88e6390_serdes_get_strings(struct mv88e6xxx_chip *chip,
struct mv88e6390_serdes_hw_stat *stat;
int i;

if (mv88e6390_serdes_get_lane(chip, port) < 0)
if (mv88e6xxx_serdes_get_lane(chip, port) < 0)
return 0;

for (i = 0; i < ARRAY_SIZE(mv88e6390_serdes_hw_stats); i++) {
Expand Down Expand Up @@ -770,7 +770,7 @@ int mv88e6390_serdes_get_stats(struct mv88e6xxx_chip *chip, int port,
int lane;
int i;

lane = mv88e6390_serdes_get_lane(chip, port);
lane = mv88e6xxx_serdes_get_lane(chip, port);
if (lane < 0)
return 0;

Expand Down

0 comments on commit a03b98d

Please sign in to comment.