nvme: Add NVMEF helper macro as the inverse of NVMEV

This macro accepts a field name and a value for the field and
constructs the shifted field value.

Reviewed by:	chuck
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D43604
This commit is contained in:
John Baldwin 2024-01-29 11:00:57 -08:00
parent c85b3903d1
commit 3a477a9b70

View file

@ -610,6 +610,9 @@ enum nvme_critical_warning_state {
/* Helper macro to extract value from x */
#define NVMEV(name, x) (((x) >> name##_SHIFT) & name##_MASK)
/* Helper macro to construct a field value */
#define NVMEF(name, x) (((x) & name##_MASK) << name##_SHIFT)
/* CC register SHN field values */
enum shn_value {
NVME_SHN_NORMAL = 0x1,