Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Use SCSIPIRETRIES instead of hard-coded value...



details:   https://anonhg.NetBSD.org/src/rev/92cfdafc669d
branches:  trunk
changeset: 480684:92cfdafc669d
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Jan 17 17:59:48 2000 +0000

description:
Use SCSIPIRETRIES instead of hard-coded value '2' for number of retries in
common routines. Define SCSIPIRETRIES as 4, so that the command will finally
succeed after several consecutive downgrades from UDMA2 to PIO4.

diffstat:

 sys/dev/scsipi/scsi_base.c   |   4 ++--
 sys/dev/scsipi/scsipi_base.c |  13 +++++++------
 sys/dev/scsipi/scsipiconf.h  |   7 ++++++-
 3 files changed, 15 insertions(+), 9 deletions(-)

diffs (94 lines):

diff -r 091f8017df2d -r 92cfdafc669d sys/dev/scsipi/scsi_base.c
--- a/sys/dev/scsipi/scsi_base.c        Mon Jan 17 17:54:56 2000 +0000
+++ b/sys/dev/scsipi/scsi_base.c        Mon Jan 17 17:59:48 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsi_base.c,v 1.70 1999/10/20 15:22:27 enami Exp $     */
+/*     $NetBSD: scsi_base.c,v 1.71 2000/01/17 17:59:48 bouyer Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 
        return (scsipi_command(sc_link,
            (struct scsipi_generic *) &scsipi_cmd, sizeof(scsipi_cmd),
-           0, 0, 2, 100000, NULL, flags));
+           0, 0, SCSIPIRETRIES, 100000, NULL, flags));
 }
 
 /*
diff -r 091f8017df2d -r 92cfdafc669d sys/dev/scsipi/scsipi_base.c
--- a/sys/dev/scsipi/scsipi_base.c      Mon Jan 17 17:54:56 2000 +0000
+++ b/sys/dev/scsipi/scsipi_base.c      Mon Jan 17 17:59:48 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipi_base.c,v 1.28 2000/01/14 02:40:45 mjacob Exp $  */
+/*     $NetBSD: scsipi_base.c,v 1.29 2000/01/17 17:59:48 bouyer Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -465,7 +465,7 @@
         */
        if (scsipi_command(sc_link, (struct scsipi_generic *)&scsipi_cmd,
            sizeof(scsipi_cmd), (u_char *)&rdcap, sizeof(rdcap),
-           2, 20000, NULL, flags | XS_CTL_DATA_IN) != 0) {
+           SCSIPIRETRIES, 20000, NULL, flags | XS_CTL_DATA_IN) != 0) {
                sc_link->sc_print_addr(sc_link);
                printf("could not get size\n");
                return (0);
@@ -493,7 +493,7 @@
 
        return (scsipi_command(sc_link,
            (struct scsipi_generic *)&scsipi_cmd, sizeof(scsipi_cmd),
-           0, 0, 2, 10000, NULL, flags));
+           0, 0, SCSIPIRETRIES, 10000, NULL, flags));
 }
 
 /*
@@ -518,7 +518,7 @@
        return (scsipi_command(sc_link,
            (struct scsipi_generic *) &scsipi_cmd, sizeof(scsipi_cmd),
            (u_char *) inqbuf, sizeof(struct scsipi_inquiry_data),
-           2, 10000, NULL, XS_CTL_DATA_IN | flags));
+           SCSIPIRETRIES, 10000, NULL, XS_CTL_DATA_IN | flags));
 }
 
 /*
@@ -539,7 +539,7 @@
        scsipi_cmd.how = type;
        return (scsipi_command(sc_link,
            (struct scsipi_generic *) &scsipi_cmd, sizeof(scsipi_cmd),
-           0, 0, 2, 5000, NULL, flags));
+           0, 0, SCSIPIRETRIES, 5000, NULL, flags));
 }
 
 /*
@@ -561,7 +561,8 @@
        scsipi_cmd.how = type;
        return (scsipi_command(sc_link,
            (struct scsipi_generic *) &scsipi_cmd, sizeof(scsipi_cmd),
-           0, 0, 2, (type & SSS_START) ? 60000 : 10000, NULL, flags));
+           0, 0, SCSIPIRETRIES, (type & SSS_START) ? 60000 : 10000,
+           NULL, flags));
 }
 
 /*
diff -r 091f8017df2d -r 92cfdafc669d sys/dev/scsipi/scsipiconf.h
--- a/sys/dev/scsipi/scsipiconf.h       Mon Jan 17 17:54:56 2000 +0000
+++ b/sys/dev/scsipi/scsipiconf.h       Mon Jan 17 17:59:48 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsipiconf.h,v 1.35 2000/01/11 15:32:37 pk Exp $       */
+/*     $NetBSD: scsipiconf.h,v 1.36 2000/01/17 17:59:49 bouyer Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -379,6 +379,11 @@
        (*(l)->scsipi_cmd)((l), (c), (cl), (da), (dl), (r), (t), (b), (f))
 
 /*
+ * Default number of retries, used for generic routines.
+ */
+#define SCSIPIRETRIES 4
+
+/*
  * Similar, but invoke the controller directly with a scsipi_xfer.
  */
 #define        scsipi_command_direct(xs)                                       \



Home | Main Index | Thread Index | Old Index