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]);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to