diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2016-05-28 20:14:47 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2016-05-28 20:14:47 +0000 |
commit | 2eb082b82dc3bb4413205a7a0994dae34ecd5db0 (patch) | |
tree | ca489ea53d4ff1a5690ca4357acfca8cd697f84b /examples/sg__sat_set_features.c | |
parent | eb96c6181e4436199a942054891420a07969f885 (diff) | |
download | sg3_utils-2eb082b82dc3bb4413205a7a0994dae34ecd5db0.tar.gz |
cdb naming clean up
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@709 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'examples/sg__sat_set_features.c')
-rw-r--r-- | examples/sg__sat_set_features.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/sg__sat_set_features.c b/examples/sg__sat_set_features.c index 9ea1ee0d..215d2351 100644 --- a/examples/sg__sat_set_features.c +++ b/examples/sg__sat_set_features.c @@ -58,7 +58,7 @@ #define EBUFF_SZ 256 -static char * version_str = "1.04 20160423"; +static char * version_str = "1.04 20160528"; static struct option long_options[] = { {"count", required_argument, 0, 'c'}, @@ -100,7 +100,7 @@ void usage() int main(int argc, char * argv[]) { int sg_fd, c, k; - 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; @@ -198,31 +198,31 @@ int main(int argc, char * argv[]) } /* Prepare ATA PASS-THROUGH COMMAND (16) command */ - aptCmdBlk[14] = ATA_SET_FEATURES; - aptCmdBlk[1] = (protocol << 1) | extend; - aptCmdBlk[2] = (chk_cond << 5) | (t_dir << 3) | - (byte_block << 2) | t_length; - aptCmdBlk[4] = feature; - aptCmdBlk[6] = count; - aptCmdBlk[8] = lba & 0xff; - aptCmdBlk[10] = (lba >> 8) & 0xff; - aptCmdBlk[12] = (lba >> 16) & 0xff; + apt_cdb[14] = ATA_SET_FEATURES; + apt_cdb[1] = (protocol << 1) | extend; + apt_cdb[2] = (chk_cond << 5) | (t_dir << 3) | (byte_block << 2) | + t_length; + apt_cdb[4] = feature; + apt_cdb[6] = count; + apt_cdb[8] = lba & 0xff; + apt_cdb[10] = (lba >> 8) & 0xff; + apt_cdb[12] = (lba >> 16) & 0xff; 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_NONE; io_hdr.dxfer_len = 0; io_hdr.dxferp = NULL; - 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 */ |