diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-06-22 16:32:07 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-06-22 16:32:07 +0000 |
commit | e0c091fe9dd7fe570750c3f29f85909aa1904f32 (patch) | |
tree | 1f14773397aa19d9b44bd8a373f3dc1c75f19fea | |
parent | 820302ffd779bb4114b5022da13842de129911d3 (diff) |
Replace MUSTEK_RETRIES, SCANJET_RETRIES and ST_RETRIES with SCSI_RETRIES,
all defined to 4. Replace some magic number 4's with SCSI_RETRIES. Fix a
few lines that were now too long.
-rw-r--r-- | sys/scsi/cd.c | 6 | ||||
-rw-r--r-- | sys/scsi/ch.c | 5 | ||||
-rw-r--r-- | sys/scsi/scsi_base.c | 16 | ||||
-rw-r--r-- | sys/scsi/ss.c | 13 | ||||
-rw-r--r-- | sys/scsi/ss_mustek.c | 16 | ||||
-rw-r--r-- | sys/scsi/ss_scanjet.c | 6 | ||||
-rw-r--r-- | sys/scsi/st.c | 11 |
7 files changed, 35 insertions, 38 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 7598251c26f..3ec1d2a3c32 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.141 2008/06/21 21:11:34 krw Exp $ */ +/* $OpenBSD: cd.c,v 1.142 2008/06/22 16:32:05 krw Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -637,8 +637,8 @@ cdstart(void *v) * Note: we cannot sleep as we may be an interrupt */ error = scsi_scsi_cmd(sc_link, cmdp, cmdlen, - (u_char *) bp->b_data, bp->b_bcount, SCSI_RETRIES, 30000, bp, - SCSI_NOSLEEP | ((bp->b_flags & B_READ) ? SCSI_DATA_IN : + (u_char *) bp->b_data, bp->b_bcount, SCSI_RETRIES, 30000, + bp, SCSI_NOSLEEP | ((bp->b_flags & B_READ) ? SCSI_DATA_IN : SCSI_DATA_OUT)); switch (error) { case 0: diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index 1fc1fa1a712..03a0902287e 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ch.c,v 1.34 2007/09/16 01:30:24 krw Exp $ */ +/* $OpenBSD: ch.c,v 1.35 2008/06/22 16:32:05 krw Exp $ */ /* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */ /* @@ -654,7 +654,8 @@ ch_getelemstatus(sc, first, count, data, datalen, voltag) * Send command to changer. */ return (scsi_scsi_cmd(sc->sc_link, (struct scsi_generic *)&cmd, - sizeof(cmd), (u_char *)data, datalen, CHRETRIES, 100000, NULL, SCSI_DATA_IN)); + sizeof(cmd), (u_char *)data, datalen, CHRETRIES, 100000, NULL, + SCSI_DATA_IN)); } diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 84464563d93..f3ee37c4777 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.128 2008/06/21 21:35:27 krw Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.129 2008/06/22 16:32:05 krw Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -426,7 +426,7 @@ scsi_mode_sense(struct scsi_link *sc_link, int byte2, int page, scsi_cmd.length = len; error = scsi_scsi_cmd(sc_link, (struct scsi_generic *)&scsi_cmd, - sizeof(scsi_cmd), (u_char *)data, len, 4, timeout, NULL, + sizeof(scsi_cmd), (u_char *)data, len, SCSI_RETRIES, timeout, NULL, flags | SCSI_DATA_IN); SC_DEBUG(sc_link, SDEV_DB2, ("scsi_mode_sense: page %#x, error = %d\n", @@ -459,7 +459,7 @@ scsi_mode_sense_big(struct scsi_link *sc_link, int byte2, int page, _lto2b(len, scsi_cmd.length); error = scsi_scsi_cmd(sc_link, (struct scsi_generic *)&scsi_cmd, - sizeof(scsi_cmd), (u_char *)data, len, 4, timeout, NULL, + sizeof(scsi_cmd), (u_char *)data, len, SCSI_RETRIES, timeout, NULL, flags | SCSI_DATA_IN); SC_DEBUG(sc_link, SDEV_DB2, @@ -616,8 +616,8 @@ scsi_mode_select(struct scsi_link *sc_link, int byte2, data->data_length = 0; error = scsi_scsi_cmd(sc_link, (struct scsi_generic *)&scsi_cmd, - sizeof(scsi_cmd), (u_char *)data, scsi_cmd.length, 4, timeout, NULL, - flags | SCSI_DATA_OUT); + sizeof(scsi_cmd), (u_char *)data, scsi_cmd.length, SCSI_RETRIES, + timeout, NULL, flags | SCSI_DATA_OUT); SC_DEBUG(sc_link, SDEV_DB2, ("scsi_mode_select: error = %d\n", error)); @@ -643,7 +643,7 @@ scsi_mode_select_big(struct scsi_link *sc_link, int byte2, _lto2b(0, data->data_length); error = scsi_scsi_cmd(sc_link, (struct scsi_generic *)&scsi_cmd, - sizeof(scsi_cmd), (u_char *)data, len, 4, timeout, NULL, + sizeof(scsi_cmd), (u_char *)data, len, SCSI_RETRIES, timeout, NULL, flags | SCSI_DATA_OUT); SC_DEBUG(sc_link, SDEV_DB2, ("scsi_mode_select_big: error = %d\n", @@ -668,8 +668,8 @@ scsi_report_luns(struct scsi_link *sc_link, int selectreport, _lto4b(datalen, scsi_cmd.length); error = scsi_scsi_cmd(sc_link, (struct scsi_generic *)&scsi_cmd, - sizeof(scsi_cmd), (u_char *)data, datalen, 4, timeout, NULL, - flags | SCSI_DATA_IN); + sizeof(scsi_cmd), (u_char *)data, datalen, SCSI_RETRIES, timeout, + NULL, flags | SCSI_DATA_IN); SC_DEBUG(sc_link, SDEV_DB2, ("scsi_report_luns: error = %d\n", error)); diff --git a/sys/scsi/ss.c b/sys/scsi/ss.c index 620af6002f0..d38ca4931e8 100644 --- a/sys/scsi/ss.c +++ b/sys/scsi/ss.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ss.c,v 1.61 2008/05/22 21:53:12 jasper Exp $ */ +/* $OpenBSD: ss.c,v 1.62 2008/06/22 16:32:05 krw Exp $ */ /* $NetBSD: ss.c,v 1.10 1996/05/05 19:52:55 christos Exp $ */ /* @@ -540,7 +540,8 @@ ssread(dev, uio, flag) trigger_cmd.how = SSS_START; scsi_scsi_cmd(ss->sc_link, (struct scsi_generic *)&trigger_cmd, - sizeof(trigger_cmd), 0, 0, 4, 5000, NULL, 0); + sizeof(trigger_cmd), 0, 0, SCSI_RETRIES, 5000, + NULL, 0); } ss->flags |= SSF_TRIGGERED; } @@ -859,7 +860,7 @@ ss_set_window(ss, sio) sizeof(window_cmd), (u_char *) &wd.window_data, (ss->quirkdata->quirks & SS_Q_WINDOW_DESC_LEN) ? ss->quirkdata->window_descriptor_length : 40, - 4, 5000, NULL, SCSI_DATA_OUT)); + SCSI_RETRIES, 5000, NULL, SCSI_DATA_OUT)); } int @@ -884,7 +885,7 @@ ricoh_is410_sw(ss, sio, wcmd, vwd) /* send the command to the scanner */ return (scsi_scsi_cmd(sc_link, (struct scsi_generic *)wcmd, sizeof(struct scsi_set_window), (u_char *)rwd, - sizeof(struct ricoh_is410_window_data), 4, 5000, NULL, + sizeof(struct ricoh_is410_window_data), SCSI_RETRIES, 5000, NULL, SCSI_DATA_OUT)); } @@ -924,7 +925,7 @@ umax_uc630_sw(ss, sio, wcmd, vwd) /* send the command to the scanner */ return (scsi_scsi_cmd(sc_link, (struct scsi_generic *)wcmd, sizeof(struct scsi_set_window), (u_char *)uwd, - sizeof(struct umax_uc630_window_data), 4, 5000, NULL, + sizeof(struct umax_uc630_window_data), SCSI_RETRIES, 5000, NULL, SCSI_DATA_OUT)); } @@ -968,7 +969,7 @@ fujitsu_m3096g_sw(ss, sio, wcmd, vwd) /* send the command to the scanner */ return (scsi_scsi_cmd(sc_link, (struct scsi_generic *)wcmd, sizeof(struct scsi_set_window), (u_char *)fwd, - sizeof(struct fujitsu_m3096g_window_data), 4, 5000, NULL, + sizeof(struct fujitsu_m3096g_window_data), SCSI_RETRIES, 5000, NULL, SCSI_DATA_OUT)); } #endif diff --git a/sys/scsi/ss_mustek.c b/sys/scsi/ss_mustek.c index a20153c606b..5246a8b7dc5 100644 --- a/sys/scsi/ss_mustek.c +++ b/sys/scsi/ss_mustek.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ss_mustek.c,v 1.15 2007/09/16 01:30:24 krw Exp $ */ +/* $OpenBSD: ss_mustek.c,v 1.16 2008/06/22 16:32:05 krw Exp $ */ /* $NetBSD: ss_mustek.c,v 1.4 1996/05/05 19:52:57 christos Exp $ */ /* @@ -66,8 +66,6 @@ #include <scsi/ssvar.h> #include <scsi/ss_mustek.h> -#define MUSTEK_RETRIES 4 - int mustek_set_params(struct ss_softc *, struct scan_io *); int mustek_trigger_scanner(struct ss_softc *); void mustek_minphys(struct ss_softc *, struct buf *); @@ -303,7 +301,7 @@ mustek_trigger_scanner(ss) SC_DEBUG(sc_link, SDEV_DB1, ("mustek_set_parms: set_window\n")); error = scsi_scsi_cmd(sc_link, (struct scsi_generic *) &window_cmd, sizeof(window_cmd), (u_char *) &window_data, sizeof(window_data), - MUSTEK_RETRIES, 5000, NULL, SCSI_DATA_OUT); + SCSI_RETRIES, 5000, NULL, SCSI_DATA_OUT); if (error) return (error); @@ -342,7 +340,7 @@ mustek_trigger_scanner(ss) /* send the command to the scanner */ error = scsi_scsi_cmd(sc_link, (struct scsi_generic *) &mode_cmd, sizeof(mode_cmd), (u_char *) &mode_data, sizeof(mode_data), - MUSTEK_RETRIES, 5000, NULL, SCSI_DATA_OUT); + SCSI_RETRIES, 5000, NULL, SCSI_DATA_OUT); if (error) return (error); @@ -379,7 +377,7 @@ mustek_trigger_scanner(ss) SC_DEBUG(sc_link, SDEV_DB1, ("mustek_trigger_scanner: start_scan\n")); error = scsi_scsi_cmd(sc_link, (struct scsi_generic *) &start_scan_cmd, sizeof(start_scan_cmd), NULL, 0, - MUSTEK_RETRIES, 5000, NULL, 0); + SCSI_RETRIES, 5000, NULL, 0); if (error) return (error); @@ -421,7 +419,7 @@ mustek_rewind_scanner(ss) SC_DEBUG(sc_link, SDEV_DB1, ("mustek_rewind_scanner: stop_scan\n")); error = scsi_scsi_cmd(sc_link, (struct scsi_generic *) &cmd, - sizeof(cmd), NULL, 0, MUSTEK_RETRIES, 5000, NULL, 0); + sizeof(cmd), NULL, 0, SCSI_RETRIES, 5000, NULL, 0); if (error) return (error); } @@ -459,7 +457,7 @@ mustek_read(ss, bp) * go ask the adapter to do all this for us */ if (scsi_scsi_cmd(sc_link, (struct scsi_generic *) &cmd, sizeof(cmd), - (u_char *) bp->b_data, bp->b_bcount, MUSTEK_RETRIES, 10000, bp, + (u_char *) bp->b_data, bp->b_bcount, SCSI_RETRIES, 10000, bp, SCSI_NOSLEEP | SCSI_DATA_IN) != SUCCESSFULLY_QUEUED) printf("%s: not queued\n", ss->sc_dev.dv_xname); else { @@ -494,7 +492,7 @@ mustek_get_status(ss, timeout, update) while (1) { SC_DEBUG(sc_link, SDEV_DB1, ("mustek_get_status: stat_cmd\n")); error = scsi_scsi_cmd(sc_link, (struct scsi_generic *) &cmd, - sizeof(cmd), (u_char *) &data, sizeof(data), MUSTEK_RETRIES, + sizeof(cmd), (u_char *) &data, sizeof(data), SCSI_RETRIES, 5000, NULL, SCSI_DATA_IN); if (error) return (error); diff --git a/sys/scsi/ss_scanjet.c b/sys/scsi/ss_scanjet.c index 1b9e9753cec..ccf789fedf9 100644 --- a/sys/scsi/ss_scanjet.c +++ b/sys/scsi/ss_scanjet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ss_scanjet.c,v 1.32 2007/09/16 01:30:24 krw Exp $ */ +/* $OpenBSD: ss_scanjet.c,v 1.33 2008/06/22 16:32:05 krw Exp $ */ /* $NetBSD: ss_scanjet.c,v 1.6 1996/05/18 22:58:01 christos Exp $ */ /* @@ -52,8 +52,6 @@ #include <scsi/scsiconf.h> #include <scsi/ssvar.h> -#define SCANJET_RETRIES 4 - int scanjet_set_params(struct ss_softc *, struct scan_io *); int scanjet_trigger_scanner(struct ss_softc *); int scanjet_read(struct ss_softc *, struct buf *); @@ -301,7 +299,7 @@ scanjet_read(ss, bp) * go ask the adapter to do all this for us */ if (scsi_scsi_cmd(sc_link, (struct scsi_generic *) &cmd, sizeof(cmd), - (u_char *) bp->b_data, bp->b_bcount, SCANJET_RETRIES, 100000, bp, + (u_char *) bp->b_data, bp->b_bcount, SCSI_RETRIES, 100000, bp, SCSI_NOSLEEP | SCSI_DATA_IN) != SUCCESSFULLY_QUEUED) printf("%s: not queued\n", ss->sc_dev.dv_xname); else { diff --git a/sys/scsi/st.c b/sys/scsi/st.c index aa13a5b16d8..2d52b0d7c65 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -1,4 +1,4 @@ -/* $OpenBSD: st.c,v 1.82 2008/05/12 22:14:46 krw Exp $ */ +/* $OpenBSD: st.c,v 1.83 2008/06/22 16:32:06 krw Exp $ */ /* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */ /* @@ -77,7 +77,6 @@ /* Defines for device specific stuff */ #define DEF_FIXED_BSIZE 512 -#define ST_RETRIES 4 /* only on non IO commands */ #define STMODE(z) ( minor(z) & 0x03) #define STUNIT(z) ((minor(z) >> 4) ) @@ -1388,7 +1387,7 @@ st_read_block_limits(struct st_softc *st, int flags) */ error = scsi_scsi_cmd(sc_link, (struct scsi_generic *) &cmd, sizeof(cmd), (u_char *) &block_limits, sizeof(block_limits), - ST_RETRIES, ST_CTL_TIME, NULL, flags | SCSI_DATA_IN); + SCSI_RETRIES, ST_CTL_TIME, NULL, flags | SCSI_DATA_IN); if (error) return error; @@ -1604,7 +1603,7 @@ st_erase(struct st_softc *st, int full, int flags) * we wait if we want to (eventually) to it synchronously? */ return (scsi_scsi_cmd(st->sc_link, (struct scsi_generic *)&cmd, - sizeof(cmd), 0, 0, ST_RETRIES, tmo, NULL, flags)); + sizeof(cmd), 0, 0, SCSI_RETRIES, tmo, NULL, flags)); } /* @@ -1824,7 +1823,7 @@ st_load(struct st_softc *st, u_int type, int flags) cmd.how = type; return scsi_scsi_cmd(st->sc_link, (struct scsi_generic *) &cmd, - sizeof(cmd), 0, 0, ST_RETRIES, ST_SPC_TIME, NULL, flags); + sizeof(cmd), 0, 0, SCSI_RETRIES, ST_SPC_TIME, NULL, flags); } /* @@ -1847,7 +1846,7 @@ st_rewind(struct st_softc *st, u_int immediate, int flags) cmd.byte2 = immediate; error = scsi_scsi_cmd(st->sc_link, (struct scsi_generic *) &cmd, - sizeof(cmd), 0, 0, ST_RETRIES, + sizeof(cmd), 0, 0, SCSI_RETRIES, immediate ? ST_CTL_TIME: ST_SPC_TIME, NULL, flags); if (error == 0) { |