Skip to content

Commit

Permalink
sfc: Add 40G link capability decoding
Browse files Browse the repository at this point in the history
Needed to select 40G mode on a 10G/40G capable card.

Signed-off-by: Shradha Shah <sshah@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Edward Cree authored and David S. Miller committed Jul 15, 2014
1 parent 3b06a00 commit ac331e9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/net/ethernet/sfc/mcdi_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,21 @@ static u32 mcdi_to_ethtool_cap(u32 media, u32 cap)
result |= SUPPORTED_1000baseKX_Full;
if (cap & (1 << MC_CMD_PHY_CAP_10000FDX_LBN))
result |= SUPPORTED_10000baseKX4_Full;
if (cap & (1 << MC_CMD_PHY_CAP_40000FDX_LBN))
result |= SUPPORTED_40000baseKR4_Full;
break;

case MC_CMD_MEDIA_XFP:
case MC_CMD_MEDIA_SFP_PLUS:
result |= SUPPORTED_FIBRE;
break;

case MC_CMD_MEDIA_QSFP_PLUS:
result |= SUPPORTED_FIBRE;
if (cap & (1 << MC_CMD_PHY_CAP_40000FDX_LBN))
result |= SUPPORTED_40000baseCR4_Full;
break;

case MC_CMD_MEDIA_BASE_T:
result |= SUPPORTED_TP;
if (cap & (1 << MC_CMD_PHY_CAP_10HDX_LBN))
Expand Down Expand Up @@ -237,6 +245,8 @@ static u32 ethtool_to_mcdi_cap(u32 cap)
result |= (1 << MC_CMD_PHY_CAP_1000FDX_LBN);
if (cap & (SUPPORTED_10000baseT_Full | SUPPORTED_10000baseKX4_Full))
result |= (1 << MC_CMD_PHY_CAP_10000FDX_LBN);
if (cap & (SUPPORTED_40000baseCR4_Full | SUPPORTED_40000baseKR4_Full))
result |= (1 << MC_CMD_PHY_CAP_40000FDX_LBN);
if (cap & SUPPORTED_Pause)
result |= (1 << MC_CMD_PHY_CAP_PAUSE_LBN);
if (cap & SUPPORTED_Asym_Pause)
Expand Down Expand Up @@ -285,6 +295,7 @@ static u32 mcdi_to_ethtool_media(u32 media)

case MC_CMD_MEDIA_XFP:
case MC_CMD_MEDIA_SFP_PLUS:
case MC_CMD_MEDIA_QSFP_PLUS:
return PORT_FIBRE;

case MC_CMD_MEDIA_BASE_T:
Expand Down

0 comments on commit ac331e9

Please sign in to comment.