hw/nvme: use prinfo directly in nvme_check_prinfo and nvme_dif_check
commit2a132309e45dfce6dcae901388c05c3cc3cb8d73
authorKlaus Jensen <k.jensen@samsung.com>
Thu, 17 Jun 2021 19:06:52 +0000 (17 21:06 +0200)
committerKlaus Jensen <k.jensen@samsung.com>
Tue, 29 Jun 2021 05:16:25 +0000 (29 07:16 +0200)
tree7affa08177d0c5a2bfad9caf08078fe9d4703425
parent189a8bf7f64aff9c2e26a6e6f2adc654eb9bbe81
hw/nvme: use prinfo directly in nvme_check_prinfo and nvme_dif_check

The nvme_check_prinfo() and nvme_dif_check() functions operate on the
16 bit "control" member of the NvmeCmd. These functions do not otherwise
operate on an NvmeCmd or an NvmeRequest, so change them to expect the
actual 4 bit PRINFO field and add constants that work on this field as
well.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
hw/nvme/ctrl.c
hw/nvme/dif.c
hw/nvme/nvme.h
include/block/nvme.h