diff options
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r-- | sbin/camcontrol/camcontrol.c | 7 | ||||
-rw-r--r-- | sbin/camcontrol/camcontrol.h | 6 | ||||
-rw-r--r-- | sbin/camcontrol/fwdownload.c | 14 | ||||
-rw-r--r-- | sbin/camcontrol/modeedit.c | 2 |
4 files changed, 15 insertions, 14 deletions
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 362bedd..a3c7f05 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -5783,9 +5783,10 @@ bailout: #endif /* MINIMALISTIC */ void -usage(int verbose) +usage(int printlong) { - fprintf(verbose ? stdout : stderr, + + fprintf(printlong ? stdout : stderr, "usage: camcontrol <command> [device id][generic args][command args]\n" " camcontrol devlist [-v]\n" #ifndef MINIMALISTIC @@ -5834,7 +5835,7 @@ usage(int verbose) " camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); - if (!verbose) + if (!printlong) return; #ifndef MINIMALISTIC fprintf(stdout, diff --git a/sbin/camcontrol/camcontrol.h b/sbin/camcontrol/camcontrol.h index adc3243..616236a 100644 --- a/sbin/camcontrol/camcontrol.h +++ b/sbin/camcontrol/camcontrol.h @@ -40,8 +40,10 @@ struct get_hook int got; }; +extern int verbose; + int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout, + char *combinedopt, int printerrors, int retry_count, int timeout, const char */*type*/); void mode_sense(struct cam_device *device, int mode_page, int page_control, int dbd, int retry_count, int timeout, u_int8_t *data, @@ -58,5 +60,5 @@ char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); int get_confirmation(void); -void usage(int verbose); +void usage(int printlong); #endif /* _CAMCONTROL_H */ diff --git a/sbin/camcontrol/fwdownload.c b/sbin/camcontrol/fwdownload.c index 3ffa530..daa1520 100644 --- a/sbin/camcontrol/fwdownload.c +++ b/sbin/camcontrol/fwdownload.c @@ -131,7 +131,7 @@ static char *fw_read_img(const char *fw_img_path, const struct fw_vendor *vp, int *num_bytes); static int fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, char *buf, int img_size, - int sim_mode, int verbose, int retry_count, int timeout, + int sim_mode, int printerrors, int retry_count, int timeout, const char */*name*/, const char */*type*/); /* @@ -238,7 +238,7 @@ bailout1: */ static int fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, - char *buf, int img_size, int sim_mode, int verbose, int retry_count, + char *buf, int img_size, int sim_mode, int printerrors, int retry_count, int timeout, const char *imgname, const char *type) { struct scsi_write_buffer cdb; @@ -290,7 +290,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error sending identify/test unit ready"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); cam_freeccb(ccb); @@ -298,7 +298,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { warnx("Device is not ready"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); cam_freeccb(ccb); @@ -372,7 +372,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, /* Execute the command. */ if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error writing image to device"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); goto bailout; @@ -398,7 +398,7 @@ bailout: int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout, + char *combinedopt, int printerrors, int retry_count, int timeout, const char *type) { const struct fw_vendor *vp; @@ -450,7 +450,7 @@ fwdownload(struct cam_device *device, int argc, char **argv, if (sim_mode) fprintf(stdout, "Running in simulation mode\n"); - if (fw_download_img(device, vp, buf, img_size, sim_mode, verbose, + if (fw_download_img(device, vp, buf, img_size, sim_mode, printerrors, retry_count, timeout, fw_img_path, type) != 0) { fprintf(stderr, "Firmware download failed\n"); goto fail; diff --git a/sbin/camcontrol/modeedit.c b/sbin/camcontrol/modeedit.c index 6a628e8..8504208 100644 --- a/sbin/camcontrol/modeedit.c +++ b/sbin/camcontrol/modeedit.c @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include <camlib.h> #include "camcontrol.h" -int verbose = 0; - #define DEFAULT_SCSI_MODE_DB "/usr/share/misc/scsi_modes" #define DEFAULT_EDITOR "vi" #define MAX_FORMAT_SPEC 4096 /* Max CDB format specifier. */ |