aboutsummaryrefslogtreecommitdiff
path: root/lib/sg_cmds_mmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sg_cmds_mmc.c')
-rw-r--r--lib/sg_cmds_mmc.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/sg_cmds_mmc.c b/lib/sg_cmds_mmc.c
index b80e988f..c1dabd74 100644
--- a/lib/sg_cmds_mmc.c
+++ b/lib/sg_cmds_mmc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008-2019 Douglas Gilbert.
+ * Copyright (c) 2008-2021 Douglas Gilbert.
* All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the BSD_LICENSE file.
@@ -60,7 +60,7 @@ sg_ll_set_cd_speed(int sg_fd, int rot_control, int drv_read_speed,
int drv_write_speed, bool noisy, int verbose)
{
static const char * const cdb_s = "set cd speed";
- int res, ret, k, sense_cat;
+ int res, ret, sense_cat;
uint8_t scsCmdBlk[SET_CD_SPEED_CMDLEN] = {SET_CD_SPEED_CMD, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0 ,0};
uint8_t sense_b[SENSE_BUFF_LEN];
@@ -71,6 +71,8 @@ sg_ll_set_cd_speed(int sg_fd, int rot_control, int drv_read_speed,
sg_put_unaligned_be16((uint16_t)drv_write_speed, scsCmdBlk + 4);
if (verbose) {
+ int k;
+
pr2ws(" %s cdb: ", cdb_s);
for (k = 0; k < SET_CD_SPEED_CMDLEN; ++k)
pr2ws("%02x ", scsCmdBlk[k]);
@@ -117,7 +119,7 @@ sg_ll_get_config(int sg_fd, int rt, int starting, void * resp,
int mx_resp_len, bool noisy, int verbose)
{
static const char * const cdb_s = "get configuration";
- int res, k, ret, sense_cat;
+ int res, ret, sense_cat;
uint8_t gcCmdBlk[GET_CONFIG_CMD_LEN] = {GET_CONFIG_CMD, 0, 0, 0,
0, 0, 0, 0, 0, 0};
uint8_t sense_b[SENSE_BUFF_LEN];
@@ -140,6 +142,8 @@ sg_ll_get_config(int sg_fd, int rt, int starting, void * resp,
sg_put_unaligned_be16((uint16_t)mx_resp_len, gcCmdBlk + 7);
if (verbose) {
+ int k;
+
pr2ws(" %s cdb: ", cdb_s);
for (k = 0; k < GET_CONFIG_CMD_LEN; ++k)
pr2ws("%02x ", gcCmdBlk[k]);
@@ -207,7 +211,7 @@ sg_ll_get_performance(int sg_fd, int data_type, unsigned int starting_lba,
int mx_resp_len, bool noisy, int verbose)
{
static const char * const cdb_s = "get performance";
- int res, k, ret, sense_cat;
+ int res, ret, sense_cat;
uint8_t gpCmdBlk[GET_PERFORMANCE_CMD_LEN] = {GET_PERFORMANCE_CMD, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
uint8_t sense_b[SENSE_BUFF_LEN];
@@ -231,6 +235,8 @@ sg_ll_get_performance(int sg_fd, int data_type, unsigned int starting_lba,
gpCmdBlk[10] = (uint8_t)ttype;
if (verbose) {
+ int k;
+
pr2ws(" %s cdb: ", cdb_s);
for (k = 0; k < GET_PERFORMANCE_CMD_LEN; ++k)
pr2ws("%02x ", gpCmdBlk[k]);
@@ -298,7 +304,7 @@ sg_ll_set_streaming(int sg_fd, int type, void * paramp, int param_len,
bool noisy, int verbose)
{
static const char * const cdb_s = "set streaming";
- int k, res, ret, sense_cat;
+ int res, ret, sense_cat;
uint8_t ssCmdBlk[SET_STREAMING_CMDLEN] =
{SET_STREAMING_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
uint8_t sense_b[SENSE_BUFF_LEN];
@@ -307,6 +313,8 @@ sg_ll_set_streaming(int sg_fd, int type, void * paramp, int param_len,
ssCmdBlk[8] = type;
sg_put_unaligned_be16((uint16_t)param_len, ssCmdBlk + 9);
if (verbose) {
+ int k;
+
pr2ws(" %s cdb: ", cdb_s);
for (k = 0; k < SET_STREAMING_CMDLEN; ++k)
pr2ws("%02x ", ssCmdBlk[k]);