{
    "content": [
        {
            "type": "text",
            "text": "# sg_sat_phy_event (man)\n\n## NAME\n\nsgsatphyevent  - use ATA READ LOG EXT via a SAT pass-through to fetch SATA phy event coun‐ ters\n\n## SYNOPSIS\n\nsgsatphyevent [--ckcond] [--extend] [--help] [--hex] [--ignore]  [--len={16|12}]  [--raw]\n[--reset] [--verbose] [--version] DEVICE\n\n## DESCRIPTION\n\nThis utility sends an ATA READ LOG EXT with the log page (\"address\") set to 11h to DEVICE and\noutputs the response. Log page 11h is defined in the SATA 2.5 standard and contains phy event\ncounters. Rather than send this command directly to the DEVICE, are sent via a SCSI transport\nwhich is assumed to contain a SCSI to ATA Translation (SAT) Layer (SATL). The SATL may be  in\nan operating system driver, in host bus adapter firmware or in some external enclosure.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (10 subsections)\n- **NOTES**\n- **EXIT STATUS**\n- **AUTHOR**\n- **REPORTING BUGS**\n- **COPYRIGHT**\n- **SEE ALSO** (1 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "sg_sat_phy_event",
        "section": "",
        "mode": "man",
        "summary": "sgsatphyevent  - use ATA READ LOG EXT via a SAT pass-through to fetch SATA phy event coun‐ ters",
        "synopsis": "sgsatphyevent [--ckcond] [--extend] [--help] [--hex] [--ignore]  [--len={16|12}]  [--raw]\n[--reset] [--verbose] [--version] DEVICE",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-c",
                "long": "--ck",
                "arg": null,
                "description": "sets the CKCOND bit in the ATA PASS-THROUGH SCSI cdb. The default setting is clear (i.e. 0). When set the SATL should yield a sense buffer containing a ATA Result de‐ scriptor irrespective of whether the command succeeded or failed. When clear the SATL should only yield a sense buffer containing a ATA Result descriptor if the command failed."
            },
            {
                "flag": "-e",
                "long": "--extend",
                "arg": null,
                "description": "sets the EXTEND bit in the ATA PASS-THROUGH SCSI cdb. The default setting is clear (i.e. 0). When set a 48 bit LBA command is sent to the device. This option has no ef‐ fect when --len=12."
            },
            {
                "flag": "-h",
                "long": "--help",
                "arg": null,
                "description": "outputs the usage message summarizing command line options then exits. Ignores DEVICE if given."
            },
            {
                "flag": "-H",
                "long": "--hex",
                "arg": null,
                "description": "outputs the ATA READ LOG EXT response in hex. The default action (i.e. without any '-H' options) is to output the response in hex, grouped in 16 bit words (i.e. the ATA standard's preference). When given once, the response is output in ASCII hex bytes (i.e. the SCSI standard's preference). When given twice (i.e. '-HH') the output is in hex, grouped in 16 bit words, the same as the default but without a header."
            },
            {
                "flag": "-i",
                "long": "--ignore",
                "arg": null,
                "description": "usually the phy counter identifier names are decoded. When this option is given, the numeric value of the identifier is output, the vendor flag, the data length (in bytes) and the corresponding value."
            },
            {
                "flag": "-l",
                "long": "--len",
                "arg": null,
                "description": "this is the length of the SCSI cdb used for the ATA PASS-THROUGH commands. The argu‐ ment can either be 16 or 12. The default is 16. The larger cdb size is needed for 48 bit LBA addressing of ATA devices. On the other hand some SCSI transports cannot con‐ vey SCSI commands longer than 12 bytes."
            },
            {
                "flag": "-r",
                "long": "--raw",
                "arg": null,
                "description": "output the ATA READ LOG EXT response in binary. The output should be piped to a file or another utility when this option is used. The binary is sent to stdout, and errors are sent to stderr."
            },
            {
                "flag": "-R",
                "long": "--reset",
                "arg": null,
                "description": "reset the counters after the current values are returned, decoded and displayed."
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "increases the level or verbosity."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "print out version string"
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "sgsatreadgplog",
                "section": "sg3utils",
                "url": "https://www.chedong.com/phpMan.php/man/sgsatreadgplog/sg3utils/json"
            },
            {
                "name": "smprepphyerrlog",
                "section": "smputils",
                "url": "https://www.chedong.com/phpMan.php/man/smprepphyerrlog/smputils/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-c --ck",
                        "lines": 6,
                        "flag": "-c",
                        "long": "--ck"
                    },
                    {
                        "name": "-e --extend",
                        "lines": 4,
                        "flag": "-e",
                        "long": "--extend"
                    },
                    {
                        "name": "-h --help",
                        "lines": 3,
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-H --hex",
                        "lines": 6,
                        "flag": "-H",
                        "long": "--hex"
                    },
                    {
                        "name": "-i --ignore",
                        "lines": 4,
                        "flag": "-i",
                        "long": "--ignore"
                    },
                    {
                        "name": "-l --len",
                        "lines": 5,
                        "flag": "-l",
                        "long": "--len"
                    },
                    {
                        "name": "-r --raw",
                        "lines": 4,
                        "flag": "-r",
                        "long": "--raw"
                    },
                    {
                        "name": "-R --reset",
                        "lines": 2,
                        "flag": "-R",
                        "long": "--reset"
                    },
                    {
                        "name": "-v --verbose",
                        "lines": 2,
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "lines": 2,
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "EXIT STATUS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 1,
                "subsections": [
                    {
                        "name": "parm),hdparm(hdparm)",
                        "lines": 1
                    }
                ]
            }
        ],
        "sections": {
            "NAME": {
                "content": "sgsatphyevent  - use ATA READ LOG EXT via a SAT pass-through to fetch SATA phy event coun‐\nters\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "sgsatphyevent [--ckcond] [--extend] [--help] [--hex] [--ignore]  [--len={16|12}]  [--raw]\n[--reset] [--verbose] [--version] DEVICE\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This utility sends an ATA READ LOG EXT with the log page (\"address\") set to 11h to DEVICE and\noutputs the response. Log page 11h is defined in the SATA 2.5 standard and contains phy event\ncounters. Rather than send this command directly to the DEVICE, are sent via a SCSI transport\nwhich is assumed to contain a SCSI to ATA Translation (SAT) Layer (SATL). The SATL may be  in\nan operating system driver, in host bus adapter firmware or in some external enclosure.\n\nThe  SAT standard (SAT ANSI INCITS 431-2007, prior draft: sat-r09.pdf at www.t10.org) defines\ntwo SCSI \"ATA PASS-THROUGH\" commands: one using a 16 byte \"cdb\" and the other with a 12  byte\ncdb.  This utility defaults to using the 16 byte cdb variant. SAT-2 is also a standard: SAT-2\nANSI INCITS 465-2010 and the draft prior to that is  sat2r09.pdf  .  The  SAT-3  project  has\nstarted and the most recent draft is sat3r01.pdf .\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "Arguments to long options are mandatory for short options as well.\n",
                "subsections": [
                    {
                        "name": "-c --ck",
                        "content": "sets  the  CKCOND  bit in the ATA PASS-THROUGH SCSI cdb. The default setting is clear\n(i.e. 0). When set the SATL should yield a sense buffer containing a  ATA  Result  de‐\nscriptor  irrespective of whether the command succeeded or failed. When clear the SATL\nshould only yield a sense buffer containing a ATA Result  descriptor  if  the  command\nfailed.\n",
                        "flag": "-c",
                        "long": "--ck"
                    },
                    {
                        "name": "-e --extend",
                        "content": "sets  the  EXTEND  bit  in the ATA PASS-THROUGH SCSI cdb. The default setting is clear\n(i.e. 0). When set a 48 bit LBA command is sent to the device. This option has no  ef‐\nfect when --len=12.\n",
                        "flag": "-e",
                        "long": "--extend"
                    },
                    {
                        "name": "-h --help",
                        "content": "outputs  the usage message summarizing command line options then exits. Ignores DEVICE\nif given.\n",
                        "flag": "-h",
                        "long": "--help"
                    },
                    {
                        "name": "-H --hex",
                        "content": "outputs the ATA READ LOG EXT response in hex. The default  action  (i.e.  without  any\n'-H'  options) is to output the response in hex, grouped in 16 bit words (i.e. the ATA\nstandard's preference).  When given once, the response is output in  ASCII  hex  bytes\n(i.e.  the SCSI standard's preference). When given twice (i.e. '-HH') the output is in\nhex, grouped in 16 bit words, the same as the default but without a header.\n",
                        "flag": "-H",
                        "long": "--hex"
                    },
                    {
                        "name": "-i --ignore",
                        "content": "usually the phy counter identifier names are decoded. When this option is  given,  the\nnumeric value of the identifier is output, the vendor flag, the data length (in bytes)\nand the corresponding value.\n",
                        "flag": "-i",
                        "long": "--ignore"
                    },
                    {
                        "name": "-l --len",
                        "content": "this is the length of the SCSI cdb used for the ATA PASS-THROUGH commands.  The  argu‐\nment  can  either be 16 or 12. The default is 16. The larger cdb size is needed for 48\nbit LBA addressing of ATA devices. On the other hand some SCSI transports cannot  con‐\nvey SCSI commands longer than 12 bytes.\n",
                        "flag": "-l",
                        "long": "--len"
                    },
                    {
                        "name": "-r --raw",
                        "content": "output  the  ATA READ LOG EXT response in binary. The output should be piped to a file\nor another utility when this option is used.  The binary is sent to stdout, and errors\nare sent to stderr.\n",
                        "flag": "-r",
                        "long": "--raw"
                    },
                    {
                        "name": "-R --reset",
                        "content": "reset the counters after the current values are returned, decoded and displayed.\n",
                        "flag": "-R",
                        "long": "--reset"
                    },
                    {
                        "name": "-v --verbose",
                        "content": "increases the level or verbosity.\n",
                        "flag": "-v",
                        "long": "--verbose"
                    },
                    {
                        "name": "-V --version",
                        "content": "print out version string\n",
                        "flag": "-V",
                        "long": "--version"
                    }
                ]
            },
            "NOTES": {
                "content": "The  SCSI  ATA  PASS-THROUGH  (12) command's opcode is 0xa1 and it clashes with the MMC set's\nBLANK command used by cd/dvd writers. So a SATL in front of an ATAPI  device  that  uses  MMC\n(i.e.  has peripheral device type 5) probably should treat opcode 0xa1 as a BLANK command and\nsend it through to the cd/dvd drive. The ATA PASS-THROUGH (16) command's opcode  (0x85)  does\nnot clash with anything so it is a better choice.\n\nIn  the 2.4 series of Linux kernels the DEVICE must be a SCSI generic (sg) device. In the 2.6\nseries block devices (e.g. disks and ATAPI DVDs) can also be specified. For  example  \"sginq\n/dev/sda\"  will  work in the 2.6 series kernels. From lk 2.6.6 other SCSI \"char\" device names\nmay be used as well (e.g. \"/dev/st0m\"). Prior to lk 2.6.29 USB  mass  storage  limited  sense\ndata to 18 bytes which made the --ckcond option yield strange (truncated) results.\n",
                "subsections": []
            },
            "EXIT STATUS": {
                "content": "The exit status of sgsatidentify is 0 when it is successful. Otherwise see the sg3utils(8)\nman page.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Written by Douglas Gilbert\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "Report bugs to <dgilbert at interlog dot com>.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright © 2006-2020 Douglas Gilbert\nThis software is distributed under a FreeBSD license. There is NO warranty; not even for MER‐\nCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "sgsatidentify,sgsatreadgplog(sg3utils),       smprepphyerrlog(smputils),sdparm(sd‐‐",
                "subsections": [
                    {
                        "name": "parm),hdparm(hdparm)",
                        "content": "sg3utils-1.46                                July 2020                          SGSATPHYEVENT(8)"
                    }
                ]
            }
        }
    }
}