Skip to content

Commit 815df9a

Browse files
committed
Merge branch 'sfc-support-FEC-configuration'
Edward Cree says: ==================== sfc: support FEC configuration Implements the ethtool get & set fecparam operations. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents e676d81 + 7f61e6c commit 815df9a

File tree

4 files changed

+1966
-1046
lines changed

4 files changed

+1966
-1046
lines changed

drivers/net/ethernet/sfc/ethtool.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,6 +1488,36 @@ static int efx_ethtool_get_module_info(struct net_device *net_dev,
14881488
return ret;
14891489
}
14901490

1491+
static int efx_ethtool_get_fecparam(struct net_device *net_dev,
1492+
struct ethtool_fecparam *fecparam)
1493+
{
1494+
struct efx_nic *efx = netdev_priv(net_dev);
1495+
int rc;
1496+
1497+
if (!efx->phy_op || !efx->phy_op->get_fecparam)
1498+
return -EOPNOTSUPP;
1499+
mutex_lock(&efx->mac_lock);
1500+
rc = efx->phy_op->get_fecparam(efx, fecparam);
1501+
mutex_unlock(&efx->mac_lock);
1502+
1503+
return rc;
1504+
}
1505+
1506+
static int efx_ethtool_set_fecparam(struct net_device *net_dev,
1507+
struct ethtool_fecparam *fecparam)
1508+
{
1509+
struct efx_nic *efx = netdev_priv(net_dev);
1510+
int rc;
1511+
1512+
if (!efx->phy_op || !efx->phy_op->get_fecparam)
1513+
return -EOPNOTSUPP;
1514+
mutex_lock(&efx->mac_lock);
1515+
rc = efx->phy_op->set_fecparam(efx, fecparam);
1516+
mutex_unlock(&efx->mac_lock);
1517+
1518+
return rc;
1519+
}
1520+
14911521
const struct ethtool_ops efx_ethtool_ops = {
14921522
.get_drvinfo = efx_ethtool_get_drvinfo,
14931523
.get_regs_len = efx_ethtool_get_regs_len,
@@ -1523,4 +1553,6 @@ const struct ethtool_ops efx_ethtool_ops = {
15231553
.get_module_eeprom = efx_ethtool_get_module_eeprom,
15241554
.get_link_ksettings = efx_ethtool_get_link_ksettings,
15251555
.set_link_ksettings = efx_ethtool_set_link_ksettings,
1556+
.get_fecparam = efx_ethtool_get_fecparam,
1557+
.set_fecparam = efx_ethtool_set_fecparam,
15261558
};

0 commit comments

Comments
 (0)