From dfcdb2bc3c00d328233373dfcfa3803ca0726716 Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Fri, 24 Feb 2012 19:00:45 +0000 Subject: more sync with spc4r34 and sbc3r30 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@442 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- src/sg_persist.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src/sg_persist.c') diff --git a/src/sg_persist.c b/src/sg_persist.c index 8bc188e3..6f34f036 100644 --- a/src/sg_persist.c +++ b/src/sg_persist.c @@ -1,3 +1,13 @@ +/* A utility program originally written for the Linux OS SCSI subsystem. + * Copyright (C) 2004-2012 D. Gilbert + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program issues the SCSI PERSISTENT IN and OUT commands. + */ + #include #include #include @@ -16,18 +26,7 @@ #include "sg_cmds_basic.h" #include "sg_cmds_extra.h" -/* A utility program originally written for the Linux OS SCSI subsystem. -* Copyright (C) 2004-2012 D. Gilbert -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2, or (at your option) -* any later version. - - This program issues the SCSI PERSISTENT IN and OUT commands. - -*/ - -static char * version_str = "0.38 20120222"; +static char * version_str = "0.38 20120224"; #define PRIN_RKEY_SA 0x0 @@ -198,6 +197,10 @@ usage() "Performs a SCSI PERSISTENT RESERVE (IN or OUT) command\n"); } +/* If num_tids==0 then only one TransportID is assumed with len bytes in + * it. If num_tids>0 then that many TransportIDs is assumed, each in an + * element that is MX_TID_LEN bytes long (and the 'len' argument is + * ignored). */ static void decode_transport_id(const char * leadin, unsigned char * ucp, int len, int num_tids) @@ -302,6 +305,9 @@ decode_transport_id(const char * leadin, unsigned char * ucp, int len, } break; case TPROTO_NONE: + fprintf(stderr, "%s No specified protocol\n", leadin); + /* dStrHex((const char *)ucp, ((len > 24) ? 24 : len), -1); */ + break; default: fprintf(stderr, "%s unknown protocol id=0x%x " "format_code=%d\n", leadin, proto_id, format_code); -- cgit v1.2.3