Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 161adb04 authored by sudarsana.kalluru@cavium.com's avatar sudarsana.kalluru@cavium.com Committed by David S. Miller
Browse files

qede: Fix possible misconfiguration of advertised autoneg value.



Fail the configuration of advertised speed-autoneg value if the config
update is not supported.

Signed-off-by: default avatarSudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34f9199c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -493,6 +493,11 @@ static int qede_set_link_ksettings(struct net_device *dev,
	params.override_flags |= QED_LINK_OVERRIDE_SPEED_ADV_SPEEDS;
	params.override_flags |= QED_LINK_OVERRIDE_SPEED_AUTONEG;
	if (base->autoneg == AUTONEG_ENABLE) {
		if (!(current_link.supported_caps & QED_LM_Autoneg_BIT)) {
			DP_INFO(edev, "Auto negotiation is not supported\n");
			return -EOPNOTSUPP;
		}

		params.autoneg = true;
		params.forced_speed = 0;
		QEDE_ETHTOOL_TO_DRV_CAPS(params.adv_speeds, cmd, advertising)