bhyve nvme: Fix Active Firmware Info

Summary:
Currently Active Firmware Info is not initialized.

Fix is to initialize the Active Firmware Info to Slot 1.

Test Plan: Within FreeBSD/Linux guests, show the Firmware Logpage to confirm.

Reviewed By:	chuck
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D32658
This commit is contained in:
WanpengQian 2022-08-14 08:28:05 -07:00 committed by Chuck Tuffli
parent eae0210cdd
commit 3cae10048d

View File

@ -698,6 +698,11 @@ pci_nvme_init_logpages(struct pci_nvme_softc *sc)
sc->health_log.temperature = NVME_TEMPERATURE;
sc->health_log.available_spare = 100;
sc->health_log.available_spare_threshold = 10;
/* Set Active Firmware Info to slot 1 */
sc->fw_log.afi = (1 << NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT);
memcpy(&sc->fw_log.revision[0], sc->ctrldata.fr,
sizeof(sc->fw_log.revision[0]));
}
static void