net: wangxun: add ethtool_ops for msglevel
authorJiawen Wu <jiawenwu@trustnetic.com>
Wed, 3 Jan 2024 02:08:54 +0000 (10:08 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Jan 2024 10:49:35 +0000 (10:49 +0000)
Add support to get and set msglevel for driver txgbe and ngbe.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
drivers/net/ethernet/wangxun/libwx/wx_ethtool.h
drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c
drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c

index 96f417aea8e43f741ebf9f3b42434710263e0a03..cc3bec42ed8e5327b737af77c2f07707e9a318fe 100644 (file)
@@ -405,3 +405,19 @@ int wx_set_channels(struct net_device *dev,
        return 0;
 }
 EXPORT_SYMBOL(wx_set_channels);
+
+u32 wx_get_msglevel(struct net_device *netdev)
+{
+       struct wx *wx = netdev_priv(netdev);
+
+       return wx->msg_enable;
+}
+EXPORT_SYMBOL(wx_get_msglevel);
+
+void wx_set_msglevel(struct net_device *netdev, u32 data)
+{
+       struct wx *wx = netdev_priv(netdev);
+
+       wx->msg_enable = data;
+}
+EXPORT_SYMBOL(wx_set_msglevel);
index ec4ad84c03b99a074a04dad4e352551a601d64f7..600c3b597d1a9072fad79d1a2461a3971fc48a79 100644 (file)
@@ -38,4 +38,6 @@ void wx_get_channels(struct net_device *dev,
                     struct ethtool_channels *ch);
 int wx_set_channels(struct net_device *dev,
                    struct ethtool_channels *ch);
+u32 wx_get_msglevel(struct net_device *netdev);
+void wx_set_msglevel(struct net_device *netdev, u32 data);
 #endif /* _WX_ETHTOOL_H_ */
index 348f3d8aca8bf356a4618750bac83c95b788a4bb..786a652ae64f310bce7a6e31f3a8805d1ba29054 100644 (file)
@@ -128,6 +128,8 @@ static const struct ethtool_ops ngbe_ethtool_ops = {
        .set_coalesce           = wx_set_coalesce,
        .get_channels           = wx_get_channels,
        .set_channels           = ngbe_set_channels,
+       .get_msglevel           = wx_get_msglevel,
+       .set_msglevel           = wx_set_msglevel,
 };
 
 void ngbe_set_ethtool_ops(struct net_device *netdev)
index 0f16c3fc02571e6173e589fd1d69fcb808f39e9a..db675512ce4dc6fcac47243b5c2f7f680df3dba9 100644 (file)
@@ -92,6 +92,8 @@ static const struct ethtool_ops txgbe_ethtool_ops = {
        .set_coalesce           = wx_set_coalesce,
        .get_channels           = wx_get_channels,
        .set_channels           = txgbe_set_channels,
+       .get_msglevel           = wx_get_msglevel,
+       .set_msglevel           = wx_set_msglevel,
 };
 
 void txgbe_set_ethtool_ops(struct net_device *netdev)