aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-02-19 05:55:24 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-02-19 05:55:24 +0000
commit39ea1b548f21c006c311ace897b221b100bfa88d (patch)
tree764ecee434b161b62c41182a6bc09ce950b85258 /examples
parent5bdce507b09d32f452a390c22cb98ae7f840c151 (diff)
downloadsg3_utils-39ea1b548f21c006c311ace897b221b100bfa88d.tar.gz
sg_raw: add --raw option (for CF in binary); sg_lib: add sg_get_nvme_opcode_name() and sg_is_aligned(); sg_vpd: fully implement Device Constituents vpage
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@753 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'examples')
-rw-r--r--examples/nvme_dev_self_test.hex20
-rw-r--r--examples/nvme_identify_ctl.hex27
2 files changed, 47 insertions, 0 deletions
diff --git a/examples/nvme_dev_self_test.hex b/examples/nvme_dev_self_test.hex
new file mode 100644
index 00000000..1ef87c62
--- /dev/null
+++ b/examples/nvme_dev_self_test.hex
@@ -0,0 +1,20 @@
+# 64 byte NVMe Device Self Test command (an Admin command) that is suitable
+# for:
+# sg_raw --cmdfile=<this_file_name> <nvme_device>
+#
+# There is no data-in or data-out associated with this command. This command
+# is optional so check the Identify controller command response to see if
+# it is supported.
+#
+# The following invocation will self test the controller and all its
+# namespaces (since nsid=0xffffffff) and does a "short" self test on each
+# one (since CDW10 is 0x1).
+
+14 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+# A typical invocation in Linux and FreeBSD would look like this:
+# sg_raw --cmdfile=nvme_dev_self_test.hex /dev/nvme0
+#
diff --git a/examples/nvme_identify_ctl.hex b/examples/nvme_identify_ctl.hex
new file mode 100644
index 00000000..f22141e2
--- /dev/null
+++ b/examples/nvme_identify_ctl.hex
@@ -0,0 +1,27 @@
+# 64 byte NVMe Identify controller command (an Admin command) that is
+# suitable for:
+# sg_raw --cmdfile=<this_file_name> --request=4096 <nvme_device>
+#
+# The address field (at byte offset 24, 8 bytes and little endian) gives
+# special meaning to the highest address pointers:
+# ffffffff fffffffe use address of data-in buffer
+# ffffffff fffffffd use address of data-out buffer
+#
+# The data length field (at byte offset 36, 4 bytes and little endian)
+# gives special meaning to the highest block counts:
+# fffffffe use byte length of data-in buffer
+# fffffffd use byte length of data-out buffer
+#
+# Since The Identify command reads data "in" from the device, then the
+# data-in buffer is appropriate.
+
+06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 fe ff ff ff ff ff ff ff
+00 00 00 00 fe ff ff ff 01 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+# A typical invocation in Linux and FreeBSD would look like this:
+# sg_raw --cmdfile=nvme_identify_ctl.hex -r 4k /dev/nvme0
+#
+# NVMe likes "4k" (4096 bytes) buffer size, preferably aligned to
+# a 4096 byte (or "page") boundary.