aboutsummaryrefslogtreecommitdiff
path: root/lib/sg_cmds_extra.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2013-12-18 20:49:19 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2013-12-18 20:49:19 +0000
commite66f316105e49a4682d09b3d45c622b4d8b76b36 (patch)
treee1414b73604f87f902d961d8fe58bc66b7b7af3c /lib/sg_cmds_extra.c
parent5b3bb8ae52354f2522e7ef9f5a4a13f3e958e200 (diff)
downloadsg3_utils-e66f316105e49a4682d09b3d45c622b4d8b76b36.tar.gz
sg_xcopy: cleam up comments
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@539 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'lib/sg_cmds_extra.c')
-rw-r--r--lib/sg_cmds_extra.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/sg_cmds_extra.c b/lib/sg_cmds_extra.c
index b617f004..d359b2e0 100644
--- a/lib/sg_cmds_extra.c
+++ b/lib/sg_cmds_extra.c
@@ -13,6 +13,7 @@
#include <inttypes.h>
#include "sg_lib.h"
+#include "sg_lib_data.h"
#include "sg_cmds_basic.h"
#include "sg_cmds_extra.h"
#include "sg_pt.h"
@@ -2213,20 +2214,6 @@ sg_ll_read_block_limits(int sg_fd, void * resp, int mx_resp_len,
return ret;
}
-/* If error or debug, want to know the service action */
-#define REC_COPY_RESULTS_NUM_SAS 9
-static const char * receive_copy_results_sas[REC_COPY_RESULTS_NUM_SAS] = {
- "status (LID1)",
- "data (LID1)",
- "unused [0x2]",
- "operating parameters",
- "failure details (LID1)",
- "status (LID4)",
- "data (LID4)",
- "ROD token information", /* this is different name */
- "Report all ROD tokens", /* this is different name */
-};
-
/* Invokes a SCSI RECEIVE COPY RESULTS command. Actually cover all current
* uses of opcode 0x84 (Third-party copy IN). Return of 0 -> success,
* SG_LIB_CAT_INVALID_OP -> Receive copy results not supported,
@@ -2242,14 +2229,9 @@ sg_ll_receive_copy_results(int sg_fd, int sa, int list_id, void * resp,
{RECEIVE_COPY_RESULTS_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
unsigned char sense_b[SENSE_BUFF_LEN];
struct sg_pt_base * ptvp;
- const char * old_opcode_name = "Receive copy results";
char b[64];
- if ((sa >= REC_COPY_RESULTS_NUM_SAS) || ( sa < 0))
- snprintf(b, sizeof(b), "%s [sa=0x%x]", old_opcode_name, sa);
- else
- snprintf(b, sizeof(b), "%s [sa: %s]", old_opcode_name,
- receive_copy_results_sas[sa]);
+ sg_get_opcode_sa_name(RECEIVE_COPY_RESULTS_CMD, sa, 0, (int)sizeof(b), b);
rcvcopyresCmdBlk[1] = (unsigned char)(sa & 0x1f);
if (sa <= 4) /* LID1 variants */
rcvcopyresCmdBlk[2] = (unsigned char)(list_id);