mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
net: ethtool: create and export ethtool_dev_mm_supported()
Create a wrapper over __ethtool_dev_mm_supported() which also calls ethnl_ops_begin() and ethnl_ops_complete(). It can be used by other code layers, such as tc, to make sure that preemptible TCs are supported (this is true if an underlying MAC Merge layer exists). Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Ferenc Fejes <fejes@inf.elte.hu> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
85a4abed15
commit
d54151aa0f
@@ -249,3 +249,26 @@ bool __ethtool_dev_mm_supported(struct net_device *dev)
|
||||
|
||||
return !ret;
|
||||
}
|
||||
|
||||
bool ethtool_dev_mm_supported(struct net_device *dev)
|
||||
{
|
||||
const struct ethtool_ops *ops = dev->ethtool_ops;
|
||||
bool supported;
|
||||
int ret;
|
||||
|
||||
ASSERT_RTNL();
|
||||
|
||||
if (!ops)
|
||||
return false;
|
||||
|
||||
ret = ethnl_ops_begin(dev);
|
||||
if (ret < 0)
|
||||
return false;
|
||||
|
||||
supported = __ethtool_dev_mm_supported(dev);
|
||||
|
||||
ethnl_ops_complete(dev);
|
||||
|
||||
return supported;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ethtool_dev_mm_supported);
|
||||
|
Reference in New Issue
Block a user