examples/nvme/identify: use nvme_ctrlr_cmd_get_log_page()

Change-Id: Ie7aea41cf3b2e986a5ebf309fda8c8d826fab652
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-01-15 13:11:28 -07:00
parent 6109cd0220
commit f752abd6fa

View File

@ -169,8 +169,6 @@ get_features(struct nvme_controller *ctrlr)
static int static int
get_health_log_page(struct nvme_controller *ctrlr) get_health_log_page(struct nvme_controller *ctrlr)
{ {
struct nvme_command cmd = {};
if (health_page == NULL) { if (health_page == NULL) {
health_page = rte_zmalloc("nvme health", sizeof(*health_page), 4096); health_page = rte_zmalloc("nvme health", sizeof(*health_page), 4096);
} }
@ -179,13 +177,13 @@ get_health_log_page(struct nvme_controller *ctrlr)
exit(1); exit(1);
} }
cmd.opc = NVME_OPC_GET_LOG_PAGE; if (nvme_ctrlr_cmd_get_log_page(ctrlr, NVME_LOG_HEALTH_INFORMATION, NVME_GLOBAL_NAMESPACE_TAG,
cmd.cdw10 = NVME_LOG_HEALTH_INFORMATION; health_page, sizeof(*health_page), get_log_page_completion, NULL)) {
cmd.cdw10 |= ((sizeof(*health_page) / 4) - 1) << 16; // number of dwords printf("nvme_ctrlr_cmd_get_log_page() failed\n");
cmd.nsid = NVME_GLOBAL_NAMESPACE_TAG; exit(1);
}
return nvme_ctrlr_cmd_admin_raw(ctrlr, &cmd, health_page, sizeof(*health_page), return 0;
get_log_page_completion, NULL);
} }
static void static void