From 252086533f8af0736c2a4987cd70a44366837ec1 Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Thu, 22 Feb 2018 07:00:28 +0000 Subject: 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 --- src/sg_timestamp.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/sg_timestamp.c') 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); -- cgit v1.2.3