diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2021-04-01 04:53:56 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2021-04-01 04:53:56 +0000 |
commit | 3eca65ae2a191c8a94138c4dea4286a9a9011ff0 (patch) | |
tree | 92d130fd2fdc246bf1a7b37c1f07a2426ce4a186 /inhex | |
parent | 02bb2aad7c96e908c56e7416290487a6afb80fba (diff) | |
download | sg3_utils-3eca65ae2a191c8a94138c4dea4286a9a9011ff0.tar.gz |
move some hex file from examples to inhex directory; add testing/sg_take_snap; remove no_waitq from testing
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@893 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'inhex')
-rw-r--r-- | inhex/forwarded_sense.hex | 16 | ||||
-rw-r--r-- | inhex/nvme_dev_self_test.hex | 20 | ||||
-rw-r--r-- | inhex/nvme_identify_ctl.hex | 27 | ||||
-rw-r--r-- | inhex/nvme_read_ctl.hex | 38 | ||||
-rw-r--r-- | inhex/nvme_write_ctl.hex | 38 | ||||
-rw-r--r-- | inhex/ref_sense.hex | 7 |
6 files changed, 146 insertions, 0 deletions
diff --git a/inhex/forwarded_sense.hex b/inhex/forwarded_sense.hex new file mode 100644 index 00000000..968eb2b9 --- /dev/null +++ b/inhex/forwarded_sense.hex @@ -0,0 +1,16 @@ +# Test forwarded sense data. Values are in hex. +# Invocation: 'sg_decode_sense -f forwarded_sense.hex' [dpg 20210330] + +# descriptor header +72 6 18 7 0 0 0 1c + +# Forwarded sense [len=12] +c a 1 2 +72 6 18 7 0 0 0 0 + +# Information [len=12] +0 a 80 0 11 22 33 44 55 66 77 88 + +# FRU [len=4] +3 2 0 + 99 diff --git a/inhex/nvme_dev_self_test.hex b/inhex/nvme_dev_self_test.hex new file mode 100644 index 00000000..1ef87c62 --- /dev/null +++ b/inhex/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/inhex/nvme_identify_ctl.hex b/inhex/nvme_identify_ctl.hex new file mode 100644 index 00000000..f22141e2 --- /dev/null +++ b/inhex/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. diff --git a/inhex/nvme_read_ctl.hex b/inhex/nvme_read_ctl.hex new file mode 100644 index 00000000..397072d8 --- /dev/null +++ b/inhex/nvme_read_ctl.hex @@ -0,0 +1,38 @@ +# 64 byte NVMe, Read command (a NVM command) that is suitable for: +# sg_raw --cmdfile=<this_file_name> --nvm --request=2048 <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 +# +# 512 byte logical block size is assumed. Read 4 blocks hence 2048bytes. +# The first LBA read is 0x12345 and the namespace is 1. If successful +# the four blocks will be read into the data-in buffer. Submission queu +# 0 is used (the same queue that Admin commands use). The NVM opcode for +# the Read command is 0x2 and appears in the first command byte. + +02 00 00 00 01 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 45 23 01 00 00 00 00 00 +03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + +# Notice NVMe uses its quirky "0's based" number of blocks so +# 03 appears at byte offset 48 to mean "read 4 blocks". +# +# A typical invocation in Linux and FreeBSD would look like this: +# sg_raw --cmdfile=nvme_read_ctl.hex --nvm -r 2048 +# --outfile=t.bin /dev/nvme0 +# +# Notice the '--nvm' option which is needed to distiguish a NVM +# command from an Admin command as Admin commands are the default +# in this utility. +# +# This utility (and most others in the package) aligns data-in and +# data-out buffers to the beginning of pages which are 4096 bytes +# long at a minimum. This is the way NVMe likes things as well. diff --git a/inhex/nvme_write_ctl.hex b/inhex/nvme_write_ctl.hex new file mode 100644 index 00000000..02b5a377 --- /dev/null +++ b/inhex/nvme_write_ctl.hex @@ -0,0 +1,38 @@ +# 64 byte NVMe, Write command (a NVM command) that is suitable for: +# sg_raw --cmdfile=<this_file_name> --nvm --request=2048 <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 +# +# 512 byte logical block size is assumed. Write 4 blocks hence 2048 bytes. +# The first LBA written is 0x12345 and the namespace is 1. If successful the +# four blocks will be written out of the data-out buffer. Submission queue +# is used (the same queue that Admin commands use). The NVM opcode for the +# Write command is 0x1 and appears in the first command byte. + +01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 fd ff ff ff ff ff ff ff +00 00 00 00 fd ff ff ff 45 23 01 00 00 00 00 00 +03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + +# Notice NVMe uses its quirky "0's based" number of blocks so +# 03 appears at byte offset 48 to mean "write 4 blocks". +# +# A typical invocation in Linux and FreeBSD would look like this: +# sg_raw --cmdfile=nvme_write_ctl.hex --nvm -s 2048 +# --infile=t.bin /dev/nvme0 +# +# Notice the '--nvm' option which is needed to distiguish a NVM +# command from an Admin command as Admin commands are the default +# in this utility. +# +# This utility (and most others in the package) aligns data-in and +# data-out buffers to the beginning of pages which are 4096 bytes +# long at a minimum. This is the way NVMe likes things as well. diff --git a/inhex/ref_sense.hex b/inhex/ref_sense.hex new file mode 100644 index 00000000..e6a6a374 --- /dev/null +++ b/inhex/ref_sense.hex @@ -0,0 +1,7 @@ +# Test User data segment referral sense data. Values are in hex. +# Invocation: 'sg_decode_sense -f ref_sense.hex' [dpg 20210330] + +72,0,0,0,0,0,0 38 +b,36,1,0 +0,0,0,2,11,11,11,11,22,22,22,22,55,55,55,55,66,66,66,66 1,0,0,7, 2,0,0,8 +0,0,0,1,77,77,77,77,77,77,77,77,88,88,88,88,88,88,88,88, 3,0,0,5 |