]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: hns3: fix port capbility updating issue
authorJian Shen <shenjian15@huawei.com>
Thu, 4 Jul 2019 14:04:22 +0000 (22:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:10:44 +0000 (09:10 +0200)
[ Upstream commit 49b1255603de5183c5e377200be3b3afe0dcdb86 ]

Currently, the driver queries the media port information, and
updates the port capability periodically. But it sets an error
mac->speed_type value, which stops update port capability.

Fixes: 88d10bd6f730 ("net: hns3: add support for multiple media type")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index bab04d2d674aaf7c2181fe43810bf44fb96f2d6d..f2bffc05e902383f523fb3d680e324b0d1abbddf 100644 (file)
@@ -2592,6 +2592,7 @@ static int hclge_get_sfp_info(struct hclge_dev *hdev, struct hclge_mac *mac)
                mac->speed_ability = le32_to_cpu(resp->speed_ability);
                mac->autoneg = resp->autoneg;
                mac->support_autoneg = resp->autoneg_ability;
+               mac->speed_type = QUERY_ACTIVE_SPEED;
                if (!resp->active_fec)
                        mac->fec_mode = 0;
                else