net: hns3: add get/set pause parameters support for imp-controlled PHYs
authorGuangbin Huang <huangguangbin2@huawei.com>
Fri, 12 Mar 2021 08:50:14 +0000 (16:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Mar 2021 22:11:28 +0000 (14:11 -0800)
commit57a8f46b1bd3f5f43b06f48aab7c1f7ca0936be3
treec962729679ad62059ca69eb85eb927a64e7b2c1c
parentf5f2b3e4dcc0e944dc33b522df84576679fbd8eb
net: hns3: add get/set pause parameters support for imp-controlled PHYs

When the imp-controlled PHYs feature is enabled, phydev is NULL.
In this case, the autoneg is always off when user uses ethtool -a
command to get pause parameters because  hclge_get_pauseparam()
uses phydev to check whether device is TP port. To fit this new
feature, use media type to check whether device is TP port.

And when user set pause parameters, these parameters need to
always set to mac, no matter whether autoneg is off.

Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c