diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2014-10-28 15:28:27 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2014-10-28 15:28:27 +0000 |
commit | 52f1deb80e4e6c14c8e75703695c32fc98590189 (patch) | |
tree | c7602371703fa514cd6676c3311842e3e93010c4 /src/sg_reset_wp.c | |
parent | d4fa3af08dabe55f9c21c7410699cdefd5afc0ab (diff) | |
download | sg3_utils-52f1deb80e4e6c14c8e75703695c32fc98590189.tar.gz |
sg_rep_zones: corrections, sync with zbc-r01c; sg_ses: --mask (ignore) defeats 2nd step of read-mask-modify-write
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@618 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_reset_wp.c')
-rw-r--r-- | src/sg_reset_wp.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/sg_reset_wp.c b/src/sg_reset_wp.c index 6ca532ce..ed3fd7bf 100644 --- a/src/sg_reset_wp.c +++ b/src/sg_reset_wp.c @@ -22,15 +22,16 @@ #include "sg_lib.h" #include "sg_pt.h" #include "sg_cmds_basic.h" +#include "sg_unaligned.h" /* A utility program originally written for the Linux OS SCSI subsystem. * * * This program issues the SCSI RESET WRITE POINTER command to the given SCSI - * device. + * device. Based on zbc-r01c.pdf . */ -static const char * version_str = "1.01 20140604"; +static const char * version_str = "1.02 20141028"; #define SERVICE_ACTION_OUT_16_CMD 0x9f #define SERVICE_ACTION_OUT_16_CMDLEN 16 @@ -103,15 +104,7 @@ sg_ll_reset_write_pointer(int sg_fd, uint64_t zid, int reset_all, int noisy, unsigned char sense_b[SENSE_BUFF_LEN]; struct sg_pt_base * ptvp; - /* assume zbc-r01a is wrong and that ZS LBA is an 8 byte field */ - rwpCmdBlk[2] = (zid >> 56) & 0xff; - rwpCmdBlk[3] = (zid >> 48) & 0xff; - rwpCmdBlk[4] = (zid >> 40) & 0xff; - rwpCmdBlk[5] = (zid >> 32) & 0xff; - rwpCmdBlk[6] = (zid >> 24) & 0xff; - rwpCmdBlk[7] = (zid >> 16) & 0xff; - rwpCmdBlk[8] = (zid >> 8) & 0xff; - rwpCmdBlk[9] = zid & 0xff; + sg_put_unaligned_be64(zid, rwpCmdBlk + 2); if (reset_all) rwpCmdBlk[14] = 0x1; if (verbose) { |