Commit fcc4b105 authored by Maxime Chevallier's avatar Maxime Chevallier Committed by David S. Miller

net: ethtool: cable-test: Target the command to the requested PHY

Cable testing is a PHY-specific command. Instead of targeting the command
towards dev->phydev, use the request to pick the targeted PHY.
Signed-off-by: default avatarMaxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 345237db
...@@ -69,7 +69,7 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info) ...@@ -69,7 +69,7 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
return ret; return ret;
dev = req_info.dev; dev = req_info.dev;
if (!dev->phydev) { if (!req_info.phydev) {
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto out_dev_put; goto out_dev_put;
} }
...@@ -85,12 +85,12 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info) ...@@ -85,12 +85,12 @@ int ethnl_act_cable_test(struct sk_buff *skb, struct genl_info *info)
if (ret < 0) if (ret < 0)
goto out_rtnl; goto out_rtnl;
ret = ops->start_cable_test(dev->phydev, info->extack); ret = ops->start_cable_test(req_info.phydev, info->extack);
ethnl_ops_complete(dev); ethnl_ops_complete(dev);
if (!ret) if (!ret)
ethnl_cable_test_started(dev->phydev, ethnl_cable_test_started(req_info.phydev,
ETHTOOL_MSG_CABLE_TEST_NTF); ETHTOOL_MSG_CABLE_TEST_NTF);
out_rtnl: out_rtnl:
...@@ -321,7 +321,7 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info) ...@@ -321,7 +321,7 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info)
return ret; return ret;
dev = req_info.dev; dev = req_info.dev;
if (!dev->phydev) { if (!req_info.phydev) {
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
goto out_dev_put; goto out_dev_put;
} }
...@@ -342,12 +342,12 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info) ...@@ -342,12 +342,12 @@ int ethnl_act_cable_test_tdr(struct sk_buff *skb, struct genl_info *info)
if (ret < 0) if (ret < 0)
goto out_rtnl; goto out_rtnl;
ret = ops->start_cable_test_tdr(dev->phydev, info->extack, &cfg); ret = ops->start_cable_test_tdr(req_info.phydev, info->extack, &cfg);
ethnl_ops_complete(dev); ethnl_ops_complete(dev);
if (!ret) if (!ret)
ethnl_cable_test_started(dev->phydev, ethnl_cable_test_started(req_info.phydev,
ETHTOOL_MSG_CABLE_TEST_TDR_NTF); ETHTOOL_MSG_CABLE_TEST_TDR_NTF);
out_rtnl: out_rtnl:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment