mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 00:39:48 +00:00
net: hns3: fix for getting auto-negotiation state in hclge_get_autoneg
[ Upstream commit27b5bf49f0
] When phy exists, we use the value of phydev.autoneg to represent the auto-negotiation state of hardware. Otherwise, we use the value of mac.autoneg to represent it. This patch fixes for getting a error value of auto-negotiation state in hclge_get_autoneg(). Fixes:46a3df9f97
("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f7b0ea2245
commit
fcb762cb4b
1 changed files with 4 additions and 0 deletions
|
@ -2092,6 +2092,10 @@ static int hclge_get_autoneg(struct hnae3_handle *handle)
|
|||
{
|
||||
struct hclge_vport *vport = hclge_get_vport(handle);
|
||||
struct hclge_dev *hdev = vport->back;
|
||||
struct phy_device *phydev = hdev->hw.mac.phydev;
|
||||
|
||||
if (phydev)
|
||||
return phydev->autoneg;
|
||||
|
||||
hclge_query_autoneg_result(hdev);
|
||||
|
||||
|
|
Loading…
Reference in a new issue