aboutsummaryrefslogtreecommitdiff
path: root/src/sg_sat_identify.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2014-08-18 19:06:21 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2014-08-18 19:06:21 +0000
commitedb9b7023b9590d882ae7c9c09077b8a53c3814c (patch)
tree061e26767cd403094ab8c7229900672838eac66d /src/sg_sat_identify.c
parent1e9af690628dff9697e829190df57edcfa61b650 (diff)
downloadsg3_utils-edb9b7023b9590d882ae7c9c09077b8a53c3814c.tar.gz
sg_ses: fix problem with --index=sse (and ssc); sg_sat_*: mention t_type and multiple_count fields
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@599 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_sat_identify.c')
-rw-r--r--src/sg_sat_identify.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/sg_sat_identify.c b/src/sg_sat_identify.c
index e0daa535..885a382d 100644
--- a/src/sg_sat_identify.c
+++ b/src/sg_sat_identify.c
@@ -45,7 +45,7 @@
#define EBUFF_SZ 256
-static const char * version_str = "1.10 20140515";
+static const char * version_str = "1.11 20140816";
static struct option long_options[] = {
{"ck_cond", no_argument, 0, 'c'},
@@ -103,9 +103,12 @@ static int do_identify_dev(int sg_fd, int do_packet, int cdb_len,
int do_hex, int do_raw, int verbose)
{
int ok, j, res, ret;
+ /* Following for ATA READ/WRITE MULTIPLE (EXT) cmds, normally 0 */
+ int multiple_count = 0;
int protocol = 4; /* PIO data-in */
+ int t_type = 0; /* 0 -> 512 byte blocks, 1 -> device's LB size */
int t_dir = 1; /* 0 -> to device, 1 -> from device */
- int byte_block = 1; /* 0 -> bytes, 1 -> 512 byte blocks */
+ int byte_block = 1; /* 0 -> bytes, 1 -> 512 byte blocks (if t_type=0) */
int t_length = 2; /* 0 -> no data transferred, 2 -> sector count */
int resid = 0;
int got_ard = 0; /* got ATA result descriptor */
@@ -133,8 +136,8 @@ static int do_identify_dev(int sg_fd, int do_packet, int cdb_len,
aptCmdBlk[6] = 1; /* sector count */
aptCmdBlk[14] = (do_packet ? ATA_IDENTIFY_PACKET_DEVICE :
ATA_IDENTIFY_DEVICE);
- aptCmdBlk[1] = (protocol << 1) | extend;
- aptCmdBlk[2] = (ck_cond << 5) | (t_dir << 3) |
+ aptCmdBlk[1] = (multiple_count << 5) | (protocol << 1) | extend;
+ aptCmdBlk[2] = (ck_cond << 5) | (t_type << 4) | (t_dir << 3) |
(byte_block << 2) | t_length;
res = sg_ll_ata_pt(sg_fd, aptCmdBlk, cdb_len, DEF_TIMEOUT, inBuff,
NULL /* doutp */, ID_RESPONSE_LEN, sense_buffer,
@@ -145,8 +148,8 @@ static int do_identify_dev(int sg_fd, int do_packet, int cdb_len,
apt12CmdBlk[4] = 1; /* sector count */
apt12CmdBlk[9] = (do_packet ? ATA_IDENTIFY_PACKET_DEVICE :
ATA_IDENTIFY_DEVICE);
- apt12CmdBlk[1] = (protocol << 1);
- apt12CmdBlk[2] = (ck_cond << 5) | (t_dir << 3) |
+ apt12CmdBlk[1] = (multiple_count << 5) | (protocol << 1);
+ apt12CmdBlk[2] = (ck_cond << 5) | (t_type << 4) | (t_dir << 3) |
(byte_block << 2) | t_length;
res = sg_ll_ata_pt(sg_fd, apt12CmdBlk, cdb_len, DEF_TIMEOUT, inBuff,
NULL /* doutp */, ID_RESPONSE_LEN, sense_buffer,