summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Cree <ecree.xilinx@gmail.com>2022-07-20 19:29:30 +0100
committerDavid S. Miller <davem@davemloft.net>2022-07-22 12:50:06 +0100
commit5687eb3466a90a72d13f2aab20b4b801289dbda9 (patch)
tree295b82b4bf3c9b8b1c2641c257a34965574f9e75
parent08135eecd07fbf48e819bdf3ec2a7717e76346ee (diff)
downloadlinux-5687eb3466a90a72d13f2aab20b4b801289dbda9.tar.bz2
sfc: add basic ethtool ops to ef100 reps
Signed-off-by: Edward Cree <ecree.xilinx@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/sfc/ef100_rep.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef100_rep.c b/drivers/net/ethernet/sfc/ef100_rep.c
index f10c25d6f134..1121bf162b2f 100644
--- a/drivers/net/ethernet/sfc/ef100_rep.c
+++ b/drivers/net/ethernet/sfc/ef100_rep.c
@@ -12,6 +12,8 @@
#include "ef100_rep.h"
#include "ef100_nic.h"
+#define EFX_EF100_REP_DRIVER "efx_ef100_rep"
+
static int efx_ef100_rep_init_struct(struct efx_nic *efx, struct efx_rep *efv)
{
efv->parent = efx;
@@ -26,7 +28,31 @@ static int efx_ef100_rep_init_struct(struct efx_nic *efx, struct efx_rep *efv)
static const struct net_device_ops efx_ef100_rep_netdev_ops = {
};
+static void efx_ef100_rep_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *drvinfo)
+{
+ strscpy(drvinfo->driver, EFX_EF100_REP_DRIVER, sizeof(drvinfo->driver));
+}
+
+static u32 efx_ef100_rep_ethtool_get_msglevel(struct net_device *net_dev)
+{
+ struct efx_rep *efv = netdev_priv(net_dev);
+
+ return efv->msg_enable;
+}
+
+static void efx_ef100_rep_ethtool_set_msglevel(struct net_device *net_dev,
+ u32 msg_enable)
+{
+ struct efx_rep *efv = netdev_priv(net_dev);
+
+ efv->msg_enable = msg_enable;
+}
+
static const struct ethtool_ops efx_ef100_rep_ethtool_ops = {
+ .get_drvinfo = efx_ef100_rep_get_drvinfo,
+ .get_msglevel = efx_ef100_rep_ethtool_get_msglevel,
+ .set_msglevel = efx_ef100_rep_ethtool_set_msglevel,
};
static struct efx_rep *efx_ef100_rep_create_netdev(struct efx_nic *efx,