diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 28160b194957..f2329694a6f4 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -378,17 +378,25 @@ upgrade_fw(adapter_t *sc) { const struct firmware *fw; int status; + u32 vers; if ((fw = firmware_get(FW_FNAME)) == NULL) { device_printf(sc->dev, "Could not find firmware image %s\n", FW_FNAME); return (ENOENT); } else - device_printf(sc->dev, "updating firmware on card\n"); + device_printf(sc->dev, "installing firmware on card\n"); status = t3_load_fw(sc, (const uint8_t *)fw->data, fw->datasize); - device_printf(sc->dev, "firmware update returned %s %d\n", - status == 0 ? "success" : "fail", status); - + if (status != 0) { + device_printf(sc->dev, "failed to install firmware: %d\n", + status); + } else { + t3_get_fw_version(sc, &vers); + snprintf(&sc->fw_version[0], sizeof(sc->fw_version), "%d.%d.%d", + G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers), + G_FW_VERSION_MICRO(vers)); + } + firmware_put(fw, FIRMWARE_UNLOAD); return (status);