|
@@ -575,6 +575,7 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
|
|
|
struct ethtool_link_ksettings *cmd)
|
|
|
{
|
|
|
struct hnae3_handle *h = hns3_get_handle(netdev);
|
|
|
+ u32 flowctrl_adv = 0;
|
|
|
u32 supported_caps;
|
|
|
u32 advertised_caps;
|
|
|
u8 media_type = HNAE3_MEDIA_TYPE_UNKNOWN;
|
|
@@ -650,6 +651,8 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
|
|
|
if (!cmd->base.autoneg)
|
|
|
advertised_caps &= ~HNS3_LM_AUTONEG_BIT;
|
|
|
|
|
|
+ advertised_caps &= ~HNS3_LM_PAUSE_BIT;
|
|
|
+
|
|
|
/* now, map driver link modes to ethtool link modes */
|
|
|
hns3_driv_to_eth_caps(supported_caps, cmd, false);
|
|
|
hns3_driv_to_eth_caps(advertised_caps, cmd, true);
|
|
@@ -662,6 +665,18 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
|
|
|
/* 4.mdio_support */
|
|
|
cmd->base.mdio_support = ETH_MDIO_SUPPORTS_C22;
|
|
|
|
|
|
+ /* 5.get flow control setttings */
|
|
|
+ if (h->ae_algo->ops->get_flowctrl_adv)
|
|
|
+ h->ae_algo->ops->get_flowctrl_adv(h, &flowctrl_adv);
|
|
|
+
|
|
|
+ if (flowctrl_adv & ADVERTISED_Pause)
|
|
|
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
|
|
|
+ Pause);
|
|
|
+
|
|
|
+ if (flowctrl_adv & ADVERTISED_Asym_Pause)
|
|
|
+ ethtool_link_ksettings_add_link_mode(cmd, advertising,
|
|
|
+ Asym_Pause);
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|