aboutsummaryrefslogtreecommitdiff
path: root/examples/sg__sat_phy_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sg__sat_phy_event.c')
-rw-r--r--examples/sg__sat_phy_event.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/sg__sat_phy_event.c b/examples/sg__sat_phy_event.c
index b21b3c90..e2dd2d01 100644
--- a/examples/sg__sat_phy_event.c
+++ b/examples/sg__sat_phy_event.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2007 Douglas Gilbert.
+ * Copyright (c) 2006-2016 Douglas Gilbert.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,7 +64,7 @@
#define EBUFF_SZ 256
-static const char * version_str = "1.00 20070507";
+static const char * version_str = "1.01 20160528";
static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
@@ -146,7 +146,7 @@ static void dStrRaw(const char* str, int len)
int main(int argc, char * argv[])
{
int sg_fd, c, k, j, ok, res, id, len, vendor;
- unsigned char aptCmdBlk[SAT_ATA_PASS_THROUGH16_LEN] =
+ unsigned char apt_cdb[SAT_ATA_PASS_THROUGH16_LEN] =
{SAT_ATA_PASS_THROUGH16, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0};
sg_io_hdr_t io_hdr;
@@ -235,29 +235,29 @@ int main(int argc, char * argv[])
/* Prepare SCSI ATA PASS-THROUGH COMMAND (16) command */
if (reset > 0)
- aptCmdBlk[4] = 1; /* features (7:0) */
- aptCmdBlk[6] = 1; /* sector count */
- aptCmdBlk[8] = SATA_PHY_EVENT_LPAGE; /* lba_low (7:0) */
- aptCmdBlk[14] = ATA_READ_LOG_EXT; /* command */
- aptCmdBlk[1] = (protocol << 1) | extend;
- aptCmdBlk[2] = (chk_cond << 5) | (t_dir << 3) |
- (byte_block << 2) | t_length;
+ apt_cdb[4] = 1; /* features (7:0) */
+ apt_cdb[6] = 1; /* sector count */
+ apt_cdb[8] = SATA_PHY_EVENT_LPAGE; /* lba_low (7:0) */
+ apt_cdb[14] = ATA_READ_LOG_EXT; /* command */
+ apt_cdb[1] = (protocol << 1) | extend;
+ apt_cdb[2] = (chk_cond << 5) | (t_dir << 3) | (byte_block << 2) |
+ t_length;
if (verbose) {
fprintf(stderr, " ata pass through(16) cdb: ");
for (k = 0; k < SAT_ATA_PASS_THROUGH16_LEN; ++k)
- fprintf(stderr, "%02x ", aptCmdBlk[k]);
+ fprintf(stderr, "%02x ", apt_cdb[k]);
fprintf(stderr, "\n");
}
memset(&io_hdr, 0, sizeof(sg_io_hdr_t));
io_hdr.interface_id = 'S';
- io_hdr.cmd_len = sizeof(aptCmdBlk);
+ io_hdr.cmd_len = sizeof(apt_cdb);
/* io_hdr.iovec_count = 0; */ /* memset takes care of this */
io_hdr.mx_sb_len = sizeof(sense_buffer);
io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
io_hdr.dxfer_len = READ_LOG_EXT_RESPONSE_LEN;
io_hdr.dxferp = inBuff;
- io_hdr.cmdp = aptCmdBlk;
+ io_hdr.cmdp = apt_cdb;
io_hdr.sbp = sense_buffer;
io_hdr.timeout = 20000; /* 20000 millisecs == 20 seconds */
/* io_hdr.flags = 0; */ /* take defaults: indirect IO, etc */