提交 fe723dff 编写于 作者: M Manish Awasthi 提交者: David S. Miller

liquidio: fix wrong information about link modes reported to ethtool

Information reported to ethtool about link modes is wrong for 25G NIC.  Fix
it by checking for presence of 25G NIC, checking the link speed reported by
NIC firmware, and then assigning proper values to the
ethtool_link_ksettings struct.
Signed-off-by: NManish Awasthi <manish.awasthi@cavium.com>
Signed-off-by: NFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 513d2d01
...@@ -213,17 +213,23 @@ static int lio_get_link_ksettings(struct net_device *netdev, ...@@ -213,17 +213,23 @@ static int lio_get_link_ksettings(struct net_device *netdev,
struct lio *lio = GET_LIO(netdev); struct lio *lio = GET_LIO(netdev);
struct octeon_device *oct = lio->oct_dev; struct octeon_device *oct = lio->oct_dev;
struct oct_link_info *linfo; struct oct_link_info *linfo;
u32 supported, advertising; u32 supported = 0, advertising = 0;
linfo = &lio->linfo; linfo = &lio->linfo;
if (linfo->link.s.if_mode == INTERFACE_MODE_XAUI || if (linfo->link.s.if_mode == INTERFACE_MODE_XAUI ||
linfo->link.s.if_mode == INTERFACE_MODE_RXAUI || linfo->link.s.if_mode == INTERFACE_MODE_RXAUI ||
linfo->link.s.if_mode == INTERFACE_MODE_XLAUI ||
linfo->link.s.if_mode == INTERFACE_MODE_XFI) { linfo->link.s.if_mode == INTERFACE_MODE_XFI) {
ecmd->base.port = PORT_FIBRE; ecmd->base.port = PORT_FIBRE;
supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE |
SUPPORTED_Pause); if (linfo->link.s.speed == SPEED_10000) {
advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_Pause); supported = SUPPORTED_10000baseT_Full;
advertising = ADVERTISED_10000baseT_Full;
}
supported |= SUPPORTED_FIBRE | SUPPORTED_Pause;
advertising |= ADVERTISED_Pause;
ethtool_convert_legacy_u32_to_link_mode( ethtool_convert_legacy_u32_to_link_mode(
ecmd->link_modes.supported, supported); ecmd->link_modes.supported, supported);
ethtool_convert_legacy_u32_to_link_mode( ethtool_convert_legacy_u32_to_link_mode(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册