• Home
Name Date Size #Lines LOC

..--

READMED03-May-20243.6 KiB9578

descriptor_sense.hexD03-May-2024713 3121

fixed_sense.hexD03-May-2024175 64

forwarded_sense.hexD03-May-2024296 1712

get_elem_status.hexD03-May-20242.3 KiB5249

get_lba_status.hexD03-May-202496 158

inq_standard.hexD03-May-20241 KiB2421

logs_last_n.hexD03-May-20241.2 KiB4236

nvme_dev_self_test.hexD03-May-2024806 2118

nvme_identify_ctl.hexD03-May-20241.2 KiB2825

nvme_read_ctl.hexD03-May-20241.8 KiB4037

nvme_read_oob_ctl.hexD03-May-20242.3 KiB4845

nvme_write_ctl.hexD03-May-20241.8 KiB3936

opcodes.hexD03-May-20241.3 KiB2827

ref_sense.hexD03-May-2024305 86

rep_density.hexD03-May-2024834 1917

rep_density_media.hexD03-May-2024596 1412

rep_density_media_typem.hexD03-May-2024620 1412

rep_density_typem.hexD03-May-20241.4 KiB3230

rep_realms.hexD03-May-20241.3 KiB3628

rep_zdomains.hexD03-May-20241.1 KiB3024

rep_zones.hexD03-May-20241.7 KiB4035

ses_areca_all.hexD03-May-20248.5 KiB196184

vpd_bdce.hexD03-May-2024660 1915

vpd_consistuents.hexD03-May-20241 KiB4839

vpd_cpr.hexD03-May-2024571 1917

vpd_dev_id.hexD03-May-2024296 108

vpd_di_all.hexD03-May-20241.1 KiB5239

vpd_fp.hexD03-May-2024744 3228

vpd_lbpro.hexD03-May-2024122 86

vpd_lbpv.hexD03-May-2024303 108

vpd_ref.hexD03-May-2024256 108

vpd_sbl.hexD03-May-2024336 119

vpd_sdeb.hexD03-May-20243.8 KiB10087

vpd_sfs.hexD03-May-2024114 86

vpd_tpc.hexD03-May-2024525 4436

vpd_zbdc.hexD03-May-2024687 3021

vpd_zbdc.rawD03-May-202464

z_act_query.hexD03-May-20241.2 KiB2924

README

1        Hex data for various sg3_utils utilities
2        ========================================
3
4The files in this folder contain hexadecimal data (in ASCII) and associated
5comments (prefixed with the hash mark symbol: '#' ). Files containing
6hexadecimal data have the extension ".hex". There is at least one file
7containing binary data and it has the extension ".raw".
8
9The utility that each hex file is associated with can be determined in most
10case by prepending "sg_" to these filenames. Then go to the 'src' folder (a
11sibling folder to this one) and look for a match or partial match on
12the name.
13
14For example:
15    vpd_dev_id.hex
16after prepending 'sg_' becomes:
17    sg_vpd_dev_id.hex
18which is a partial match on the sg_vpd utility.
19The remaining 'dev_id.hex' is meant to suggest the 'device identifier'
20VPD page which is a mandatory VPD page for SCSI devices..
21
22Assuming sg3_utils is installed, it can be tested like this:
23    sg_vpd --inhex=<folder_holding_sg3_utils>/inhex/vpd_dev_id.hex
24
25And should output this:
26
27Device Identification VPD page:
28  Addressed logical unit:
29    designator type: NAA,  code set: Binary
30      0x5000c5003011cb2b
31  Target port:
32    designator type: NAA,  code set: Binary
33     transport: Serial Attached SCSI Protocol (SPL-4)
34      0x5000c5003011cb29
35    designator type: Relative target port,  code set: Binary
36     transport: Serial Attached SCSI Protocol (SPL-4)
37      Relative target port: 0x1
38  Target device that contains addressed lu:
39    designator type: NAA,  code set: Binary
40     transport: Serial Attached SCSI Protocol (SPL-4)
41      0x5000c5003011cb28
42    designator type: SCSI name string,  code set: UTF-8
43      SCSI name string:
44      naa.5000C5003011CB28
45
46Not all the hex files follow the "prepend sg_" pattern. Those hex files
47starting with 'nvme_' are examples of invoking NVMe commands with the
48sg_raw utility.
49
50Binary <--> Hexadecimal
51-----------------------
52The vpd_zbdc.raw file is binary and was created by:
53    sg_decode_sense --inhex=vpd_zbdc.hex --nodecode --write=vpd_zbdc.raw
54as an example of converting a file in ASCII hexadecimal byte oriented
55format to binary.
56
57Turning binary output into hexadecimal can be done several ways. For
58viewing in byte oriented ASCII hex these Unix commands can be used:
59    od -t x1 vpd_zbdc.raw
60    hexdump -C vpd_zbdc.raw
61
62Each line starting with a "input offset" which is a running count of
63bytes, starting at zero. The hexdump examples shows an ASCII rendering
64of those 16 bytes to the right of each line. The sg_decode_sense utility
65may also be used:
66    sg_decode_sense --binary=vpd_zbdc.raw -H
67    sg_decode_sense --binary=vpd_zbdc.raw -HH
68
69The second form of sg_decode_sense appends an ASCII rendering of the 16
70bytes to the right of each line.
71
72When ASCII hexadecimal is being used as input to a utility in this
73package, the "input offset" at the start of each line (and the optional
74ASCII rendering to the right of each line) must not be given.
75That can be done with hexdump:
76   hexdump -An -C -v vpd_zbdc.raw
77           ^^^
78That is a syntax error, there is no 'A' option <<<<<<<< check
79
80And the sg_decode_sense utility can do it with (with the --nodecode option):
81   sg_decode_sense -N --binary=vpd_zbdc.raw -HHH
82That will print suitable lines of hexadecimal (16 bytes per line) to the
83console (stdout) To go the other way (i.e. hexadecimal to binary):
84   sg_decode_sense -N --inhex=vpd_zbdc.hex --write=vpd_zbdc.bin
85
86
87Conclusion
88----------
89Users are encouraged to send the author any ASCII hex files for utilities
90that support --inhex and don't have hex data already. Special cases are
91also welcome. They help the author test this code.
92
93Douglas Gilbert
9418th July 2022
95