Skip to content

Commit 2170fef

Browse files
Charles-Antoine Couretdavem330
authored andcommitted
Marvell phy: add field to get errors from fiber link.
Add support for the fiber receiver error counter in the statistics. Rename the current counter which is for copper errors to phy_receive_errors_copper, so it is easy to distinguish copper from fiber. Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Charles-Antoine Couret <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6cfb3bc commit 2170fef

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/net/phy/marvell.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
#define ADVERTISE_PAUSE_ASYM_FIBER 0x100
152152

153153
#define REGISTER_LINK_STATUS 0x400
154+
#define NB_FIBER_STATS 1
154155

155156
MODULE_DESCRIPTION("Marvell PHY driver");
156157
MODULE_AUTHOR("Andy Fleming");
@@ -164,8 +165,9 @@ struct marvell_hw_stat {
164165
};
165166

166167
static struct marvell_hw_stat marvell_hw_stats[] = {
167-
{ "phy_receive_errors", 0, 21, 16},
168+
{ "phy_receive_errors_copper", 0, 21, 16},
168169
{ "phy_idle_errors", 0, 10, 8 },
170+
{ "phy_receive_errors_fiber", 1, 21, 16},
169171
};
170172

171173
struct marvell_priv {
@@ -1236,7 +1238,10 @@ static int m88e1318_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *w
12361238

12371239
static int marvell_get_sset_count(struct phy_device *phydev)
12381240
{
1239-
return ARRAY_SIZE(marvell_hw_stats);
1241+
if (phydev->supported & SUPPORTED_FIBRE)
1242+
return ARRAY_SIZE(marvell_hw_stats);
1243+
else
1244+
return ARRAY_SIZE(marvell_hw_stats) - NB_FIBER_STATS;
12401245
}
12411246

12421247
static void marvell_get_strings(struct phy_device *phydev, u8 *data)

0 commit comments

Comments
 (0)