From d5b39ad8327f723764eee38a50f32a33663dffc6 Mon Sep 17 00:00:00 2001 From: Steven Seungcheol Lee Date: Sat, 7 Dec 2024 13:38:52 +0900 Subject: [PATCH] types: Add enum for nvme_id_ctrl.trattr Add missing define for bit fields Signed-off-by: Steven Seungcheol Lee --- src/nvme/types.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/nvme/types.h b/src/nvme/types.h index 7d5c3e57..4625de9e 100644 --- a/src/nvme/types.h +++ b/src/nvme/types.h @@ -1404,8 +1404,8 @@ struct nvme_id_psd { * value supported in the Requested Memory Range Tracking * Granularity (RMRTG) field of the Track Memory Ranges data * structure. - * @trattr: Tracking Attributes indicates supported attributes for the - * Track Send command and Track Receive command. + * @trattr: Tracking Attributes indicates supported attributes for the Track Send + * command and Track Receive command. see &enum nvme_id_ctrl_trattr * @rsvd577: Reserved * @mcudmq: Maximum Controller User Data Migration Queues indicates the * maximum number of User Data Migration Queues supported by the @@ -2374,6 +2374,30 @@ enum nvme_id_ctrl_sgls { NVME_CTRL_SGLS_TPORT = 1 << 21, }; +/** + * enum nvme_id_ctrl_trattr - Tracking Attributes + * @NVME_CTRL_TRATTR_THMCS_SHIFT: Shift amount to get the Track Host Memory Changes Support + * from the &struct nvme_id_ctrl.trattr field. + * @NVME_CTRL_TRATTR_TUDCS_SHIFT: Shift amount to get the Track User Data Changes Support + * from the &struct nvme_id_ctrl.trattr field. + * @NVME_CTRL_TRATTR_MRTLL_SHIFT: Shift amount to get the Memory Range Tracking Length Limit + * from the &struct nvme_id_ctrl.trattr field. + * @NVME_CTRL_TRATTR_THMCS_MASK: Mask to get the Track Host Memory Changes Support + * from the &struct nvme_id_ctrl.trattr field. + * @NVME_CTRL_TRATTR_TUDCS_MASK: Mask to get the Track User Data Changes Support + * from the &struct nvme_id_ctrl.trattr field. + * @NVME_CTRL_TRATTR_MRTLL_MASK: Mask to get the Memory Range Tracking Length Limit + * from the &struct nvme_id_ctrl.trattr field. + */ +enum nvme_id_ctrl_trattr { + NVME_CTRL_TRATTR_THMCS_SHIFT = 0, + NVME_CTRL_TRATTR_TUDCS_SHIFT = 1, + NVME_CTRL_TRATTR_MRTLL_SHIFT = 2, + NVME_CTRL_TRATTR_THMCS_MASK = 0x1, + NVME_CTRL_TRATTR_TUDCS_MASK = 0x1, + NVME_CTRL_TRATTR_MRTLL_MASK = 0x1, +}; + /** * enum nvme_id_ctrl_fcatt - This field indicates attributes of the controller * that are specific to NVMe over Fabrics.