Skip to content

Commit

Permalink
net: wangxun: add ethtool_ops for msglevel
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiawen Wu authored and David S. Miller committed Jan 4, 2024
1 parent 937d46e commit b746dc6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/net/ethernet/wangxun/libwx/wx_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 2 additions & 0 deletions drivers/net/ethernet/wangxun/libwx/wx_ethtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */
2 changes: 2 additions & 0 deletions drivers/net/ethernet/wangxun/ngbe/ngbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/wangxun/txgbe/txgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b746dc6

Please sign in to comment.