Commit 49509bdd authored by Jiawen Wu's avatar Jiawen Wu Committed by Duanqiang Wen
Browse files

net: wangxun: add ethtool_ops for msglevel

mainline inclusion
from mainline-v6.8-rc1
commit b746dc6bdde5a9a03309f208733a08665d4a0cb4
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I93QRU
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b746dc6bdde5a9a03309f208733a08665d4a0cb4



---------------------------------------------------------

Add support to get and set msglevel for driver txgbe and ngbe.

Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e95cc634
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -348,3 +348,19 @@ int wx_set_coalesce(struct net_device *netdev,
	return 0;
}
EXPORT_SYMBOL(wx_set_coalesce);

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 −0
Original line number Diff line number Diff line
@@ -34,4 +34,6 @@ int wx_set_coalesce(struct net_device *netdev,
		    struct ethtool_coalesce *ec,
		    struct kernel_ethtool_coalesce *kernel_coal,
		    struct netlink_ext_ack *extack);
u32 wx_get_msglevel(struct net_device *netdev);
void wx_set_msglevel(struct net_device *netdev, u32 data);
#endif /* _WX_ETHTOOL_H_ */
+2 −0
Original line number Diff line number Diff line
@@ -113,6 +113,8 @@ static const struct ethtool_ops ngbe_ethtool_ops = {
	.set_ringparam		= ngbe_set_ringparam,
	.get_coalesce		= wx_get_coalesce,
	.set_coalesce		= wx_set_coalesce,
	.get_msglevel		= wx_get_msglevel,
	.set_msglevel		= wx_set_msglevel,
};

void ngbe_set_ethtool_ops(struct net_device *netdev)
+2 −0
Original line number Diff line number Diff line
@@ -77,6 +77,8 @@ static const struct ethtool_ops txgbe_ethtool_ops = {
	.set_ringparam		= txgbe_set_ringparam,
	.get_coalesce		= wx_get_coalesce,
	.set_coalesce		= wx_set_coalesce,
	.get_msglevel		= wx_get_msglevel,
	.set_msglevel		= wx_set_msglevel,
};

void txgbe_set_ethtool_ops(struct net_device *netdev)