summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2013-06-05 20:57:52 +0000
committernp <np@FreeBSD.org>2013-06-05 20:57:52 +0000
commit13da9567532584b7c710a77be8cdb7160b6f2b8d (patch)
treee7be2533f26d0563d5dc6013dd97b12c24cd24dd /sys/dev
parent077e1ba486f8b0d260d447854bfb494b94dfcb8b (diff)
downloadFreeBSD-src-13da9567532584b7c710a77be8cdb7160b6f2b8d.zip
FreeBSD-src-13da9567532584b7c710a77be8cdb7160b6f2b8d.tar.gz
cxgbe(4): Never install a firmware if hw.cxgbe.fw_install is 0.
MFC after: 1 week
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cxgbe/t4_main.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 3120c51..e3836ce 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -1912,18 +1912,15 @@ fw_compatible(const struct fw_hdr *hdr1, const struct fw_hdr *hdr2)
}
/*
- * The firmware in the KLD is usable and can be installed. But should it be?
- * This routine explains itself in detail if it indicates the KLD firmware
- * should be installed.
+ * The firmware in the KLD is usable, but should it be installed? This routine
+ * explains itself in detail if it indicates the KLD firmware should be
+ * installed.
*/
static int
should_install_kld_fw(struct adapter *sc, int card_fw_usable, int k, int c)
{
const char *reason;
- KASSERT(t4_fw_install != 0, ("%s: Can't install; shouldn't be asked "
- "to evaluate if install is a good idea.", __func__));
-
if (!card_fw_usable) {
reason = "incompatible or unusable";
goto install;
@@ -1942,6 +1939,16 @@ should_install_kld_fw(struct adapter *sc, int card_fw_usable, int k, int c)
return (0);
install:
+ if (t4_fw_install == 0) {
+ device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, "
+ "but the driver is prohibited from installing a different "
+ "firmware on the card.\n",
+ G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
+ G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason);
+
+ return (0);
+ }
+
device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, "
"installing firmware %u.%u.%u.%u on card.\n",
G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c),
@@ -2028,15 +2035,13 @@ prep_firmware(struct adapter *sc)
}
if (card_fw_usable && card_fw->fw_ver == drv_fw->fw_ver &&
- (!kld_fw_usable || kld_fw->fw_ver == drv_fw->fw_ver ||
- t4_fw_install == 0)) {
+ (!kld_fw_usable || kld_fw->fw_ver == drv_fw->fw_ver)) {
/*
* Common case: the firmware on the card is an exact match and
* the KLD is an exact match too, or the KLD is
- * absent/incompatible, or we're prohibited from using it. Note
- * that t4_fw_install = 2 is ignored here -- use cxgbetool
- * loadfw if you want to reinstall the same firmware as the one
- * on the card.
+ * absent/incompatible. Note that t4_fw_install = 2 is ignored
+ * here -- use cxgbetool loadfw if you want to reinstall the
+ * same firmware as the one on the card.
*/
} else if (kld_fw_usable && state == DEV_STATE_UNINIT &&
should_install_kld_fw(sc, card_fw_usable, be32toh(kld_fw->fw_ver),
OpenPOWER on IntegriCloud