summaryrefslogtreecommitdiff
path: root/include/linux/nvme.h
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2017-06-07 11:45:36 +0200
committerChristoph Hellwig <hch@lst.de>2017-06-15 14:30:23 +0200
commitc61d788b8b1fe57aaf03ac0b5c636c7388ebfd20 (patch)
tree7178fcb57f4438ed9bcdc66da3254fc4786711db /include/linux/nvme.h
parent430c7bef173e23c61981ca7d0279e3d3c7549b1a (diff)
downloadlwn-c61d788b8b1fe57aaf03ac0b5c636c7388ebfd20.tar.gz
lwn-c61d788b8b1fe57aaf03ac0b5c636c7388ebfd20.zip
nvmet: allow overriding the NVMe VS via configfs
Allow overriding the announced NVMe Version of a via configfs. This is particularly helpful when debugging new features for the host or target side without bumping the hard coded version (as the target might not be fully compliant to the announced version yet). Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Guan Junxiong <guanjunxiong@huawei.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/nvme.h')
-rw-r--r--include/linux/nvme.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index f2344aa923e8..acb484935603 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -1085,4 +1085,8 @@ struct nvme_completion {
#define NVME_VS(major, minor, tertiary) \
(((major) << 16) | ((minor) << 8) | (tertiary))
+#define NVME_MAJOR(ver) ((ver) >> 16)
+#define NVME_MINOR(ver) (((ver) >> 8) & 0xff)
+#define NVME_TERTIARY(ver) ((ver) & 0xff)
+
#endif /* _LINUX_NVME_H */