aboutsummaryrefslogtreecommitdiff
path: root/examples/sg_sat_smart_rd_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sg_sat_smart_rd_data.c')
-rw-r--r--examples/sg_sat_smart_rd_data.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/examples/sg_sat_smart_rd_data.c b/examples/sg_sat_smart_rd_data.c
index a5122baf..dcf4b41e 100644
--- a/examples/sg_sat_smart_rd_data.c
+++ b/examples/sg_sat_smart_rd_data.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Douglas Gilbert.
+ * Copyright (c) 2006-2007 Douglas Gilbert.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@
#define SAT_ATA_PASS_THROUGH16 0x85
#define SAT_ATA_PASS_THROUGH16_LEN 16
-#define SAT_STATUS_RETURN_DESC 9 /* ATA status return (sense) descriptor */
+#define SAT_ATA_RETURN_DESC 9 /* ATA Return (sense) Descriptor */
#define ATA_SMART 0xb0
#define ATA_SMART_READ_DATA 0xd0
@@ -57,7 +57,7 @@
#define EBUFF_SZ 256
-static char * version_str = "1.01 20061014";
+static char * version_str = "1.02 20070130";
int main(int argc, char * argv[])
{
@@ -84,6 +84,8 @@ int main(int argc, char * argv[])
++verbose;
else if (0 == strcmp(argv[k], "-vv"))
verbose += 2;
+ else if (0 == strcmp(argv[k], "-vvv"))
+ verbose += 3;
else if (0 == strcmp(argv[k], "-V")) {
fprintf(stderr, "version: %s\n", version_str);
exit(0);
@@ -157,12 +159,14 @@ int main(int argc, char * argv[])
break;
case SG_LIB_CAT_RECOVERED:
ucp = sg_scsi_sense_desc_find(sense_buffer, sizeof(sense_buffer),
- SAT_STATUS_RETURN_DESC);
- if (NULL == ucp)
+ SAT_ATA_RETURN_DESC);
+ if (NULL == ucp) {
+ if (verbose > 1)
+ printf("ATA Return Descriptor expected in sense but not "
+ "found\n");
sg_chk_n_print3("ATA_16 command error", &io_hdr, 1);
- else if (verbose)
- sg_chk_n_print3("ATA status return descriptor",
- &io_hdr, 1);
+ } else if (verbose)
+ sg_chk_n_print3("ATA Return Descriptor", &io_hdr, 1);
if (ucp && ucp[3])
printf("error=0x%x, status=0x%x\n", ucp[3], ucp[13]);
else