aboutsummaryrefslogtreecommitdiff
path: root/src/sg_timestamp.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-02-22 07:00:28 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-02-22 07:00:28 +0000
commit252086533f8af0736c2a4987cd70a44366837ec1 (patch)
tree1f9245e247673fdb6ebea13b9aa559e1f869d78c /src/sg_timestamp.c
parent39ea1b548f21c006c311ace897b221b100bfa88d (diff)
downloadsg3_utils-252086533f8af0736c2a4987cd70a44366837ec1.tar.gz
sg_lib: add sg_if_can2stdout(); use uint8_t instead of unsigned char; Windows pass-through work
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@754 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_timestamp.c')
-rw-r--r--src/sg_timestamp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/sg_timestamp.c b/src/sg_timestamp.c
index 9dd5bc22..17105976 100644
--- a/src/sg_timestamp.c
+++ b/src/sg_timestamp.c
@@ -20,6 +20,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
#include "sg_lib.h"
#include "sg_lib_data.h"
#include "sg_pt.h"
@@ -34,7 +35,7 @@
* to the given SCSI device. Based on spc5r07.pdf .
*/
-static const char * version_str = "1.06 20180210";
+static const char * version_str = "1.07 20180219";
#define REP_TIMESTAMP_CMDLEN 12
#define SET_TIMESTAMP_CMDLEN 12
@@ -125,9 +126,9 @@ sg_ll_rep_timestamp(int sg_fd, void * resp, int mx_resp_len, int * residp,
bool noisy, int verbose)
{
int k, ret, res, sense_cat;
- unsigned char rt_cdb[REP_TIMESTAMP_CMDLEN] =
+ uint8_t rt_cdb[REP_TIMESTAMP_CMDLEN] =
{SG_MAINTENANCE_IN, REP_TIMESTAMP_SA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- unsigned char sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
sg_put_unaligned_be32((uint32_t)mx_resp_len, rt_cdb + 6);
@@ -145,7 +146,7 @@ sg_ll_rep_timestamp(int sg_fd, void * resp, int mx_resp_len, int * residp,
}
set_scsi_pt_cdb(ptvp, rt_cdb, sizeof(rt_cdb));
set_scsi_pt_sense(ptvp, sense_b, sizeof(sense_b));
- set_scsi_pt_data_in(ptvp, (unsigned char *)resp, mx_resp_len);
+ set_scsi_pt_data_in(ptvp, (uint8_t *)resp, mx_resp_len);
res = do_scsi_pt(ptvp, sg_fd, DEF_PT_TIMEOUT, verbose);
ret = sg_cmds_process_resp(ptvp, "report timestamp", res, mx_resp_len,
sense_b, noisy, verbose, &sense_cat);
@@ -183,10 +184,10 @@ sg_ll_set_timestamp(int sg_fd, void * paramp, int param_len, bool noisy,
int verbose)
{
int k, ret, res, sense_cat;
- unsigned char st_cdb[SET_TIMESTAMP_CMDLEN] =
+ uint8_t st_cdb[SET_TIMESTAMP_CMDLEN] =
{SG_MAINTENANCE_OUT, SET_TIMESTAMP_SA, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0};
- unsigned char sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
sg_put_unaligned_be32(param_len, st_cdb + 6);
@@ -208,7 +209,7 @@ sg_ll_set_timestamp(int sg_fd, void * paramp, int param_len, bool noisy,
}
set_scsi_pt_cdb(ptvp, st_cdb, sizeof(st_cdb));
set_scsi_pt_sense(ptvp, sense_b, sizeof(sense_b));
- set_scsi_pt_data_out(ptvp, (unsigned char *)paramp, param_len);
+ set_scsi_pt_data_out(ptvp, (uint8_t *)paramp, param_len);
res = do_scsi_pt(ptvp, sg_fd, DEF_PT_TIMEOUT, verbose);
ret = sg_cmds_process_resp(ptvp, "set timestamp", res, SG_NO_DATA_IN,
sense_b, noisy, verbose, &sense_cat);