Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b7c33b2 authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Jens Axboe
Browse files

nvme.h: add Write Zeroes definitions



Add the command structure, optional command set support (ONCS) bit and
a new error code for the Write Zeroes command.

Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent a6f0788e
Loading
Loading
Loading
Loading
+20 −0
Original line number Original line Diff line number Diff line
@@ -237,6 +237,7 @@ enum {
	NVME_CTRL_ONCS_COMPARE			= 1 << 0,
	NVME_CTRL_ONCS_COMPARE			= 1 << 0,
	NVME_CTRL_ONCS_WRITE_UNCORRECTABLE	= 1 << 1,
	NVME_CTRL_ONCS_WRITE_UNCORRECTABLE	= 1 << 1,
	NVME_CTRL_ONCS_DSM			= 1 << 2,
	NVME_CTRL_ONCS_DSM			= 1 << 2,
	NVME_CTRL_ONCS_WRITE_ZEROES		= 1 << 3,
	NVME_CTRL_VWC_PRESENT			= 1 << 0,
	NVME_CTRL_VWC_PRESENT			= 1 << 0,
};
};


@@ -543,6 +544,23 @@ struct nvme_dsm_range {
	__le64			slba;
	__le64			slba;
};
};


struct nvme_write_zeroes_cmd {
	__u8			opcode;
	__u8			flags;
	__u16			command_id;
	__le32			nsid;
	__u64			rsvd2;
	__le64			metadata;
	union nvme_data_ptr	dptr;
	__le64			slba;
	__le16			length;
	__le16			control;
	__le32			dsmgmt;
	__le32			reftag;
	__le16			apptag;
	__le16			appmask;
};

/* Admin commands */
/* Admin commands */


enum nvme_admin_opcode {
enum nvme_admin_opcode {
@@ -839,6 +857,7 @@ struct nvme_command {
		struct nvme_download_firmware dlfw;
		struct nvme_download_firmware dlfw;
		struct nvme_format_cmd format;
		struct nvme_format_cmd format;
		struct nvme_dsm_cmd dsm;
		struct nvme_dsm_cmd dsm;
		struct nvme_write_zeroes_cmd write_zeroes;
		struct nvme_abort_cmd abort;
		struct nvme_abort_cmd abort;
		struct nvme_get_log_page_command get_log_page;
		struct nvme_get_log_page_command get_log_page;
		struct nvmf_common_command fabrics;
		struct nvmf_common_command fabrics;
@@ -918,6 +937,7 @@ enum {
	NVME_SC_BAD_ATTRIBUTES		= 0x180,
	NVME_SC_BAD_ATTRIBUTES		= 0x180,
	NVME_SC_INVALID_PI		= 0x181,
	NVME_SC_INVALID_PI		= 0x181,
	NVME_SC_READ_ONLY		= 0x182,
	NVME_SC_READ_ONLY		= 0x182,
	NVME_SC_ONCS_NOT_SUPPORTED	= 0x183,


	/*
	/*
	 * I/O Command Set Specific - Fabrics commands:
	 * I/O Command Set Specific - Fabrics commands: