summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2015-03-25 11:01:03 +0000
committerarybchik <arybchik@FreeBSD.org>2015-03-25 11:01:03 +0000
commit94a1f15204c91f1864cf52534d134139e740bf69 (patch)
tree8d0438893b2814fca6a09a5f4ee01ce02fac5fba
parent35a2333ab2476094267de9ee551127b6001b3a81 (diff)
downloadFreeBSD-src-94a1f15204c91f1864cf52534d134139e740bf69.zip
FreeBSD-src-94a1f15204c91f1864cf52534d134139e740bf69.tar.gz
MFC: 279096
sfxge: keep fw and driver view of autoneg parameters consistent Previously the driver's view was the expected outcome of any reconfiguration even if that reconfiguration failed. Submitted by: Ben Horgan Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
-rw-r--r--sys/dev/sfxge/common/efx_phy.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/dev/sfxge/common/efx_phy.c b/sys/dev/sfxge/common/efx_phy.c
index 0300e04..bb34ea7 100644
--- a/sys/dev/sfxge/common/efx_phy.c
+++ b/sys/dev/sfxge/common/efx_phy.c
@@ -427,6 +427,7 @@ efx_phy_adv_cap_set(
{
efx_port_t *epp = &(enp->en_port);
efx_phy_ops_t *epop = epp->ep_epop;
+ uint32_t old_mask;
int rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -440,6 +441,7 @@ efx_phy_adv_cap_set(
if (epp->ep_adv_cap_mask == mask)
goto done;
+ old_mask = epp->ep_adv_cap_mask;
epp->ep_adv_cap_mask = mask;
if ((rc = epop->epo_reconfigure(enp)) != 0)
@@ -450,6 +452,17 @@ done:
fail2:
EFSYS_PROBE(fail2);
+
+ epp->ep_adv_cap_mask = old_mask;
+ /* Reconfigure for robustness */
+ if (epop->epo_reconfigure(enp) != 0) {
+ /*
+ * We may have an inconsistent view of our advertised speed
+ * capabilities.
+ */
+ EFSYS_ASSERT(0);
+ }
+
fail1:
EFSYS_PROBE1(fail1, int, rc);
OpenPOWER on IntegriCloud