summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-04-13 12:39:53 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-04-13 12:39:53 +0000
commit63bb3d1cac6b75460139dcf98031bc133a85eb77 (patch)
treec944161d681aa2e2a9d3eace5c5c01d246912c45 /sys/dev
parentf599afd5d6701311fc3b92a83f6a6e00b893d87c (diff)
implement the namespace identify structure
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/nvmereg.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/sys/dev/ic/nvmereg.h b/sys/dev/ic/nvmereg.h
index 7d50fbd2ff1..abab2302fe2 100644
--- a/sys/dev/ic/nvmereg.h
+++ b/sys/dev/ic/nvmereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvmereg.h,v 1.7 2016/04/13 12:36:35 dlg Exp $ */
+/* $OpenBSD: nvmereg.h,v 1.8 2016/04/13 12:39:52 dlg Exp $ */
/*
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
@@ -287,3 +287,37 @@ struct nvm_identify_controller {
u_int8_t _reserved8[1024];
} __packed __aligned(8);
+
+struct nvm_namespace_format {
+ u_int16_t ms; /* Metadata Size */
+ u_int8_t lbads; /* LBA Data Size */
+ u_int8_t rp; /* Relative Performance */
+} __packed __aligned(4);
+
+struct nvm_identify_namespace {
+ u_int64_t nsze; /* Namespace Size */
+
+ u_int64_t ncap; /* Namespace Capacity */
+
+ u_int64_t nuse; /* Namespace Utilization */
+
+ u_int8_t nsfeat; /* Namespace Features */
+ u_int8_t nlbaf; /* Number of LBA Formats */
+ u_int8_t flbas; /* Formatted LBA Size */
+#define NVME_ID_NS_FLBAS(_f) ((_f) & 0x0f)
+#define NVME_ID_NS_FLBAS_MD 0x10
+ u_int8_t mc; /* Metadata Capabilities */
+ u_int8_t dpc; /* End-to-end Data Protection
+ Capabilities */
+ u_int8_t dps; /* End-to-end Data Protection
+ Type Settings */
+
+ u_int8_t _reserved1[98];
+
+ struct nvm_namespace_format
+ lbaf[16]; /* LBA Format Support */
+
+ u_int8_t _reserved2[192];
+
+ u_int8_t vs[3712];
+} __packed __aligned(8);