Date: Wed, 31 Mar 2010 00:19:39 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r205944 - head/sys/dev/cxgb Message-ID: <201003310019.o2V0Jd7l038296@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Wed Mar 31 00:19:39 2010 New Revision: 205944 URL: http://svn.freebsd.org/changeset/base/205944 Log: Refresh the firmware version immediately after it is upgraded (or downgraded). MFC after: 3 days Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Tue Mar 30 23:15:06 2010 (r205943) +++ head/sys/dev/cxgb/cxgb_main.c Wed Mar 31 00:19:39 2010 (r205944) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003310019.o2V0Jd7l038296>