diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1380,7 +1380,6 @@ uint32_t cap_lo; uint32_t cap_hi; uint32_t to, vs, pmrcap; - uint8_t mpsmin; int status, timeout_period; ctrlr->dev = dev; @@ -1432,8 +1431,8 @@ ctrlr->dstrd = NVME_CAP_HI_DSTRD(cap_hi) + 2; - mpsmin = NVME_CAP_HI_MPSMIN(cap_hi); - ctrlr->min_page_size = 1 << (12 + mpsmin); + ctrlr->mps = NVME_CAP_HI_MPSMIN(cap_hi); + ctrlr->page_size = 1 << (NVME_MPS_SHIFT + ctrlr->mps); /* Get ready timeout value from controller, in units of 500ms. */ to = NVME_CAP_LO_TO(cap_lo) + 1; diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -288,8 +288,9 @@ uint32_t cap_lo; uint32_t cap_hi; - /** minimum page size supported by this controller in bytes */ - uint32_t min_page_size; + /** Page size and log2(page_size) - 12 that we're currently using */ + uint32_t page_size; + uint32_t mps; /** interrupt coalescing time period (in microseconds) */ uint32_t int_coal_time;