Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270256

[PATCH 05/13] lightnvm: expose mccap in identify command

From Matias Bjørling <m@bjorling.me>
Newsgroups linux.kernel
Subject [PATCH 05/13] lightnvm: expose mccap in identify command
Date 2015-11-16 15:50 +0100
Message-ID <qvtgu-6H-29@gated-at.bofh.it> (permalink)
References <qvt6N-8uH-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The mccap field is required for I/O command option support. It defines the
following flash access modes:

 * SLC mode
 * Erase/Program Suspension
 * Scramble On/Off
 * Encryption

It is slotted in between mpos and cpar, changing the offset for
cpar as well.

Signed-off-by: Matias Bjørling <m@bjorling.me>
---
 drivers/nvme/host/lightnvm.c | 4 +++-
 include/linux/lightnvm.h     | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 60687ed..52b311c 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -169,8 +169,9 @@ struct nvme_nvm_id_group {
 	__le32			tbet;
 	__le32			tbem;
 	__le32			mpos;
+	__le32			mccap;
 	__le16			cpar;
-	__u8			reserved[910];
+	__u8			reserved[906];
 } __packed;
 
 struct nvme_nvm_addr_format {
@@ -265,6 +266,7 @@ static int init_grps(struct nvm_id *nvm_id, struct nvme_nvm_id *nvme_nvm_id)
 		dst->tbet = le32_to_cpu(src->tbet);
 		dst->tbem = le32_to_cpu(src->tbem);
 		dst->mpos = le32_to_cpu(src->mpos);
+		dst->mccap = le32_to_cpu(src->mccap);
 
 		dst->cpar = le16_to_cpu(src->cpar);
 	}
diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
index 9b3dc1b..2572856 100644
--- a/include/linux/lightnvm.h
+++ b/include/linux/lightnvm.h
@@ -74,6 +74,7 @@ struct nvm_id_group {
 	u32	tbet;
 	u32	tbem;
 	u32	mpos;
+	u32	mccap;
 	u16	cpar;
 	u8	res[913];
 } __packed;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/13] lightnvm updates for 4.4-rc2 Matias Bjørling <m@bjorling.me> - 2015-11-16 15:40 +0100
  [PATCH 01/13] MAINTAINERS: Add linux-block list to LightNVM for patches Matias Bjørling <m@bjorling.me> - 2015-11-16 15:40 +0100
  [PATCH 02/13] lightnvm: change max_phys_sect to uint Matias Bjørling <m@bjorling.me> - 2015-11-16 15:50 +0100
  [PATCH 05/13] lightnvm: expose mccap in identify command Matias Bjørling <m@bjorling.me> - 2015-11-16 15:50 +0100
  [PATCH 03/13] lightnvm: update bad block table format Matias Bjørling <m@bjorling.me> - 2015-11-16 15:50 +0100
  [PATCH 04/13] lightnvm: update alignments for identify command Matias Bjørling <m@bjorling.me> - 2015-11-16 15:50 +0100
  [PATCH 06/13] lightnvm: remove unused attrs in nvm_id structs Matias Bjørling <m@bjorling.me> - 2015-11-16 15:50 +0100
  Re: [PATCH 00/13] lightnvm updates for 4.4-rc2 Jens Axboe <axboe@fb.com> - 2015-11-16 23:30 +0100

csiph-web