git: 8e76bae0b72e - main - cxgbe(4): Keep link configuration compatible with really old firmwares.

From: Navdeep Parhar <np_at_FreeBSD.org>
Date: Mon, 15 Nov 2021 18:19:01 UTC
The branch main has been updated by np:

URL: https://cgit.FreeBSD.org/src/commit/?id=8e76bae0b72e53da80c48ba138b1cfd712724df4

commit 8e76bae0b72e53da80c48ba138b1cfd712724df4
Author:     Navdeep Parhar <np@FreeBSD.org>
AuthorDate: 2021-11-11 00:10:41 +0000
Commit:     Navdeep Parhar <np@FreeBSD.org>
CommitDate: 2021-11-15 18:18:04 +0000

    cxgbe(4): Keep link configuration compatible with really old firmwares.
    
    MFC after:      1 week
    Sponsored by:   Chelsio Communications
---
 sys/dev/cxgbe/common/t4_hw.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index d6f85a1fcd34..e2b55dc71eba 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -3959,6 +3959,14 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port,
 			if (lc->requested_fec & FEC_MODULE)
 				fec |= fec_to_fwcap(lc->fec_hint);
 		}
+
+		/*
+		 * This is for compatibility with old firmwares. The original
+		 * way to request NO_FEC was to not set any of the FEC bits. New
+		 * firmwares understand this too.
+		 */
+		if (fec == FW_PORT_CAP32_FEC_NO_FEC)
+			fec = 0;
 	}
 
 	/* Force AN on for BT cards. */