Skip to content

Commit da84e3e

Browse files
NET:ETH:ALTERA: HSD 15017993528: Kernel panic observed during timestamping information dump
Co-authored-by: Narayan, Preetam <[email protected]>
1 parent da5cbcc commit da84e3e

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

drivers/net/ethernet/altera/intel_fpga_gts_ethtool.c

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/net_tstamp.h>
1717
#include <linux/netdevice.h>
1818
#include <linux/phy.h>
19+
#include <linux/sfp.h>
1920
#include <linux/phylink.h>
2021
#include "altera_eth_dma.h"
2122
#include "intel_fpga_eth_main.h"
@@ -93,7 +94,36 @@ static void gts_gstrings(struct net_device *dev, u32 stringset, u8 *buf)
9394
memcpy(buf, stat_gstrings, GTS_STATS_LEN * ETH_GSTRING_LEN);
9495
}
9596

96-
static void gts_fill_stats(struct net_device *dev, struct ethtool_stats *dummy,
97+
static int gts_get_module_info (struct net_device *dev,
98+
struct ethtool_modinfo *info)
99+
{
100+
intel_fpga_xtile_eth_private *priv = netdev_priv(dev);
101+
if (!priv)
102+
return -ENODEV;
103+
104+
if (!priv->phylink || !priv->dev || !priv->dev->sfp_bus) {
105+
return -ENODEV;
106+
}
107+
108+
return sfp_get_module_info(priv->dev->sfp_bus, info);
109+
}
110+
111+
static int gts_get_module_eeprom(struct net_device *dev,
112+
struct ethtool_eeprom *eeprom, u8 *data)
113+
{
114+
intel_fpga_xtile_eth_private *priv = netdev_priv(dev);
115+
if (!priv)
116+
return -ENODEV;
117+
118+
if (!priv->phylink || !priv->dev || !priv->dev->sfp_bus) {
119+
return -ENODEV;
120+
}
121+
122+
return sfp_get_module_eeprom(priv->dev->sfp_bus, eeprom, data);
123+
}
124+
125+
static void gts_fill_stats(struct net_device *dev,
126+
struct ethtool_stats *dummy,
97127
u64 *buf)
98128
{
99129
intel_fpga_xtile_eth_private *priv = netdev_priv(dev);
@@ -1598,6 +1628,8 @@ static int gts_get_ts_info(struct net_device *dev,
15981628
{
15991629
intel_fpga_xtile_eth_private *priv = netdev_priv(dev);
16001630

1631+
return -EOPNOTSUPP;
1632+
16011633
info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE |
16021634
SOF_TIMESTAMPING_RX_HARDWARE |
16031635
SOF_TIMESTAMPING_RAW_HARDWARE;
@@ -1657,6 +1689,9 @@ static const struct ethtool_ops gts_ethtool_ops = {
16571689
.get_ts_info = gts_get_ts_info,
16581690
.get_link_ksettings = gts_get_link_ksettings,
16591691
.set_link_ksettings = gts_set_link_ksettings,
1692+
.get_module_info = gts_get_module_info,
1693+
.get_module_eeprom = gts_get_module_eeprom,
1694+
16601695
};
16611696

16621697
void intel_fpga_gts_set_ethtool_ops(struct net_device *netdev)

0 commit comments

Comments
 (0)