Commit 24283ece authored by Guangbin Huang's avatar Guangbin Huang Committed by David S. Miller

net: hns3: fix port setting handle for fibre port

For hardware doesn't support use specified speed and duplex
to negotiate, it's unnecessary to check and modify the port
speed and duplex for fibre port when autoneg is on.

Fixes: 22f48e24 ("net: hns3: add autoneg and change speed support for fibre port")
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1a92497d
...@@ -726,6 +726,12 @@ static int hns3_check_ksettings_param(const struct net_device *netdev, ...@@ -726,6 +726,12 @@ static int hns3_check_ksettings_param(const struct net_device *netdev,
u8 duplex; u8 duplex;
int ret; int ret;
/* hw doesn't support use specified speed and duplex to negotiate,
* unnecessary to check them when autoneg on.
*/
if (cmd->base.autoneg)
return 0;
if (ops->get_ksettings_an_result) { if (ops->get_ksettings_an_result) {
ops->get_ksettings_an_result(handle, &autoneg, &speed, &duplex); ops->get_ksettings_an_result(handle, &autoneg, &speed, &duplex);
if (cmd->base.autoneg == autoneg && cmd->base.speed == speed && if (cmd->base.autoneg == autoneg && cmd->base.speed == speed &&
...@@ -787,6 +793,15 @@ static int hns3_set_link_ksettings(struct net_device *netdev, ...@@ -787,6 +793,15 @@ static int hns3_set_link_ksettings(struct net_device *netdev,
return ret; return ret;
} }
/* hw doesn't support use specified speed and duplex to negotiate,
* ignore them when autoneg on.
*/
if (cmd->base.autoneg) {
netdev_info(netdev,
"autoneg is on, ignore the speed and duplex\n");
return 0;
}
if (ops->cfg_mac_speed_dup_h) if (ops->cfg_mac_speed_dup_h)
ret = ops->cfg_mac_speed_dup_h(handle, cmd->base.speed, ret = ops->cfg_mac_speed_dup_h(handle, cmd->base.speed,
cmd->base.duplex); cmd->base.duplex);
......
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