Skip to content

Commit

Permalink
Merge branch 'sfc-support-FEC-configuration'
Browse files Browse the repository at this point in the history
Edward Cree says:

====================
sfc: support FEC configuration

Implements the ethtool get & set fecparam operations.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 14, 2018
2 parents e676d81 + 7f61e6c commit 815df9a
Show file tree
Hide file tree
Showing 4 changed files with 1,966 additions and 1,046 deletions.
32 changes: 32 additions & 0 deletions drivers/net/ethernet/sfc/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,36 @@ static int efx_ethtool_get_module_info(struct net_device *net_dev,
return ret;
}

static int efx_ethtool_get_fecparam(struct net_device *net_dev,
struct ethtool_fecparam *fecparam)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;

if (!efx->phy_op || !efx->phy_op->get_fecparam)
return -EOPNOTSUPP;
mutex_lock(&efx->mac_lock);
rc = efx->phy_op->get_fecparam(efx, fecparam);
mutex_unlock(&efx->mac_lock);

return rc;
}

static int efx_ethtool_set_fecparam(struct net_device *net_dev,
struct ethtool_fecparam *fecparam)
{
struct efx_nic *efx = netdev_priv(net_dev);
int rc;

if (!efx->phy_op || !efx->phy_op->get_fecparam)
return -EOPNOTSUPP;
mutex_lock(&efx->mac_lock);
rc = efx->phy_op->set_fecparam(efx, fecparam);
mutex_unlock(&efx->mac_lock);

return rc;
}

const struct ethtool_ops efx_ethtool_ops = {
.get_drvinfo = efx_ethtool_get_drvinfo,
.get_regs_len = efx_ethtool_get_regs_len,
Expand Down Expand Up @@ -1523,4 +1553,6 @@ const struct ethtool_ops efx_ethtool_ops = {
.get_module_eeprom = efx_ethtool_get_module_eeprom,
.get_link_ksettings = efx_ethtool_get_link_ksettings,
.set_link_ksettings = efx_ethtool_set_link_ksettings,
.get_fecparam = efx_ethtool_get_fecparam,
.set_fecparam = efx_ethtool_set_fecparam,
};
Loading

0 comments on commit 815df9a

Please sign in to comment.