svn commit: r249629 - head/sys/dev/cxgbe/common

Navdeep Parhar np at FreeBSD.org
Thu Apr 18 22:54:42 UTC 2013


Author: np
Date: Thu Apr 18 22:54:41 2013
New Revision: 249629
URL: http://svnweb.freebsd.org/changeset/base/249629

Log:
  cxgbe(4): Refuse to install T5 firmwares on a T4 card (and vice versa).
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==============================================================================
--- head/sys/dev/cxgbe/common/t4_hw.c	Thu Apr 18 20:13:33 2013	(r249628)
+++ head/sys/dev/cxgbe/common/t4_hw.c	Thu Apr 18 22:54:41 2013	(r249629)
@@ -1136,6 +1136,13 @@ int t4_load_fw(struct adapter *adap, con
 		       FLASH_FW_MAX_SIZE);
 		return -EFBIG;
 	}
+	if ((is_t4(adap) && hdr->chip != FW_HDR_CHIP_T4) ||
+	    (is_t5(adap) && hdr->chip != FW_HDR_CHIP_T5)) {
+		CH_ERR(adap,
+		    "FW image (%d) is not suitable for this adapter (%d)\n",
+		    hdr->chip, chip_id(adap));
+		return -EINVAL;
+	}
 
 	for (csum = 0, i = 0; i < size / sizeof(csum); i++)
 		csum += ntohl(p[i]);


More information about the svn-src-head mailing list