Date: Thu, 1 Feb 2018 21:14:54 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328748 - stable/11/sbin/nvmecontrol Message-ID: <201802012114.w11LEsil079043@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Feb 1 21:14:54 2018 New Revision: 328748 URL: https://svnweb.freebsd.org/changeset/base/328748 Log: MFC r324978: Report only the valid slots in the firmware log page. Printing the entire log page is causing confusion over available slots. Report only those slots that are valid. In the case where the firmware download isn't supported, assume that only the first slot is valid (I have no hardware to test this assumption though) Modified: stable/11/sbin/nvmecontrol/logpage.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/nvmecontrol/logpage.c ============================================================================== --- stable/11/sbin/nvmecontrol/logpage.c Thu Feb 1 21:14:44 2018 (r328747) +++ stable/11/sbin/nvmecontrol/logpage.c Thu Feb 1 21:14:54 2018 (r328748) @@ -234,14 +234,19 @@ print_log_health(const struct nvme_controller_data *cd static void print_log_firmware(const struct nvme_controller_data *cdata __unused, void *buf, uint32_t size __unused) { - int i; + int i, slots; const char *status; struct nvme_firmware_page *fw = buf; printf("Firmware Slot Log\n"); printf("=================\n"); - for (i = 0; i < MAX_FW_SLOTS; i++) { + if (cdata->oacs.firmware == 0) + slots = 1; + else + slots = MIN(cdata->frmw.num_slots, MAX_FW_SLOTS); + + for (i = 0; i < slots; i++) { printf("Slot %d: ", i + 1); if (fw->afi.slot == i + 1) status = " Active";
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802012114.w11LEsil079043>