提交 93045d59 编写于 作者: C Chaitanya Kulkarni 提交者: Christoph Hellwig

nvme.h: add support for ns write protect definitions

Add various definitions from NVMe 1.3 TP 4005.
Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 8b92d0e3
...@@ -259,7 +259,7 @@ struct nvme_id_ctrl { ...@@ -259,7 +259,7 @@ struct nvme_id_ctrl {
__le16 awun; __le16 awun;
__le16 awupf; __le16 awupf;
__u8 nvscc; __u8 nvscc;
__u8 rsvd531; __u8 nwpc;
__le16 acwu; __le16 acwu;
__u8 rsvd534[2]; __u8 rsvd534[2];
__le32 sgls; __le32 sgls;
...@@ -320,7 +320,9 @@ struct nvme_id_ns { ...@@ -320,7 +320,9 @@ struct nvme_id_ns {
__u8 nvmcap[16]; __u8 nvmcap[16];
__u8 rsvd64[28]; __u8 rsvd64[28];
__le32 anagrpid; __le32 anagrpid;
__u8 rsvd96[8]; __u8 rsvd96[3];
__u8 nsattr;
__u8 rsvd100[4];
__u8 nguid[16]; __u8 nguid[16];
__u8 eui64[8]; __u8 eui64[8];
struct nvme_lbaf lbaf[16]; struct nvme_lbaf lbaf[16];
...@@ -794,6 +796,7 @@ enum { ...@@ -794,6 +796,7 @@ enum {
NVME_FEAT_HOST_ID = 0x81, NVME_FEAT_HOST_ID = 0x81,
NVME_FEAT_RESV_MASK = 0x82, NVME_FEAT_RESV_MASK = 0x82,
NVME_FEAT_RESV_PERSIST = 0x83, NVME_FEAT_RESV_PERSIST = 0x83,
NVME_FEAT_WRITE_PROTECT = 0x84,
NVME_LOG_ERROR = 0x01, NVME_LOG_ERROR = 0x01,
NVME_LOG_SMART = 0x02, NVME_LOG_SMART = 0x02,
NVME_LOG_FW_SLOT = 0x03, NVME_LOG_FW_SLOT = 0x03,
...@@ -807,6 +810,14 @@ enum { ...@@ -807,6 +810,14 @@ enum {
NVME_FWACT_ACTV = (2 << 3), NVME_FWACT_ACTV = (2 << 3),
}; };
/* NVMe Namespace Write Protect State */
enum {
NVME_NS_NO_WRITE_PROTECT = 0,
NVME_NS_WRITE_PROTECT,
NVME_NS_WRITE_PROTECT_POWER_CYCLE,
NVME_NS_WRITE_PROTECT_PERMANENT,
};
#define NVME_MAX_CHANGED_NAMESPACES 1024 #define NVME_MAX_CHANGED_NAMESPACES 1024
struct nvme_identify { struct nvme_identify {
...@@ -1153,6 +1164,8 @@ enum { ...@@ -1153,6 +1164,8 @@ enum {
NVME_SC_SGL_INVALID_OFFSET = 0x16, NVME_SC_SGL_INVALID_OFFSET = 0x16,
NVME_SC_SGL_INVALID_SUBTYPE = 0x17, NVME_SC_SGL_INVALID_SUBTYPE = 0x17,
NVME_SC_NS_WRITE_PROTECTED = 0x20,
NVME_SC_LBA_RANGE = 0x80, NVME_SC_LBA_RANGE = 0x80,
NVME_SC_CAP_EXCEEDED = 0x81, NVME_SC_CAP_EXCEEDED = 0x81,
NVME_SC_NS_NOT_READY = 0x82, NVME_SC_NS_NOT_READY = 0x82,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册