netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: igc: return error for link autoneg=off
@ 2024-06-24  9:53 Íñigo Huguet
  2024-06-24 10:23 ` Íñigo Huguet
  0 siblings, 1 reply; 2+ messages in thread
From: Íñigo Huguet @ 2024-06-24  9:53 UTC (permalink / raw)
  To: jesse.brandeburg, anthony.l.nguyen
  Cc: davem, edumazet, kuba, pabeni, intel-wired-lan, netdev,
	Íñigo Huguet

The driver doesn't support force mode for the link settings. However, if
the user request it, it's just ignored and success is returned. Return
ENOTSUPP instead.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
---
 drivers/net/ethernet/intel/igc/igc_ethtool.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c
index 93bce729be76..b7b32344d074 100644
--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c
+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c
@@ -1832,6 +1832,12 @@ igc_ethtool_set_link_ksettings(struct net_device *netdev,
 		}
 	}
 
+	/* The driver does not support force mode yet */
+	if (cmd->base.autoneg == AUTONEG_DISABLE) {
+		netdev_err(dev, "Force mode currently not supported\n");
+		return -EOPNOTSUPP;
+	}
+
 	while (test_and_set_bit(__IGC_RESETTING, &adapter->state))
 		usleep_range(1000, 2000);
 
@@ -1844,14 +1850,10 @@ igc_ethtool_set_link_ksettings(struct net_device *netdev,
 	if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 2500baseT_Full))
 		advertising |= ADVERTISE_2500_FULL;
 
-	if (cmd->base.autoneg == AUTONEG_ENABLE) {
-		hw->mac.autoneg = 1;
-		hw->phy.autoneg_advertised = advertising;
-		if (adapter->fc_autoneg)
-			hw->fc.requested_mode = igc_fc_default;
-	} else {
-		netdev_info(dev, "Force mode currently not supported\n");
-	}
+	hw->mac.autoneg = 1;
+	hw->phy.autoneg_advertised = advertising;
+	if (adapter->fc_autoneg)
+		hw->fc.requested_mode = igc_fc_default;
 
 	/* MDI-X => 2; MDI => 1; Auto => 3 */
 	if (cmd->base.eth_tp_mdix_ctrl) {
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-24 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24  9:53 [PATCH net-next] net: igc: return error for link autoneg=off Íñigo Huguet
2024-06-24 10:23 ` Íñigo Huguet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).