1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-20 15:43:16 +00:00

cxgbe(4): Refuse to install T5 firmwares on a T4 card (and vice versa).

MFC after:	1 week
This commit is contained in:
Navdeep Parhar 2013-04-18 22:54:41 +00:00
parent 2c5b403e2d
commit 3cc7ae06fd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249629

View File

@ -1136,6 +1136,13 @@ int t4_load_fw(struct adapter *adap, const u8 *fw_data, unsigned int size)
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]);