nvme: Save cap_lo and cap_hi

Save the capabilities for the drive.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2022-03-29 16:59:05 -06:00
parent a70b5660f3
commit 6af6a52ee4
2 changed files with 6 additions and 2 deletions

View File

@ -1388,7 +1388,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
if (bus_get_domain(dev, &ctrlr->domain) != 0)
ctrlr->domain = 0;
cap_lo = nvme_mmio_read_4(ctrlr, cap_lo);
ctrlr->cap_lo = cap_lo = nvme_mmio_read_4(ctrlr, cap_lo);
if (bootverbose) {
device_printf(dev, "CapLo: 0x%08x: MQES %u%s%s%s%s, TO %u\n",
cap_lo, NVME_CAP_LO_MQES(cap_lo),
@ -1398,7 +1398,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev)
(NVME_CAP_LO_AMS(cap_lo) & 0x2) ? " VS" : "",
NVME_CAP_LO_TO(cap_lo));
}
cap_hi = nvme_mmio_read_4(ctrlr, cap_hi);
ctrlr->cap_hi = cap_hi = nvme_mmio_read_4(ctrlr, cap_hi);
if (bootverbose) {
device_printf(dev, "CapHi: 0x%08x: DSTRD %u%s, CSS %x%s, "
"MPSMIN %u, MPSMAX %u%s%s\n", cap_hi,

View File

@ -284,6 +284,10 @@ struct nvme_controller {
/** maximum i/o size in bytes */
uint32_t max_xfer_size;
/** LO and HI capacity mask */
uint32_t cap_lo;
uint32_t cap_hi;
/** minimum page size supported by this controller in bytes */
uint32_t min_page_size;