Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic - Stop the system drive status check when re-conf...



details:   https://anonhg.NetBSD.org/src/rev/29212de765af
branches:  trunk
changeset: 513213:29212de765af
user:      ad <ad%NetBSD.org@localhost>
date:      Thu Jul 26 12:38:03 2001 +0000

description:
- Stop the system drive status check when re-configuring in order to
  avoid a issuing a possibly spurious warning.
- Squash some nits.

diffstat:

 sys/dev/ic/mlx.c    |  49 +++++++++++++++++++++++++++----------------------
 sys/dev/ic/mlxreg.h |   4 ++--
 sys/dev/ic/mlxvar.h |   3 ++-
 3 files changed, 31 insertions(+), 25 deletions(-)

diffs (176 lines):

diff -r a125df8ed6b2 -r 29212de765af sys/dev/ic/mlx.c
--- a/sys/dev/ic/mlx.c  Thu Jul 26 12:36:16 2001 +0000
+++ b/sys/dev/ic/mlx.c  Thu Jul 26 12:38:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mlx.c,v 1.11 2001/07/19 16:25:25 thorpej Exp $ */
+/*     $NetBSD: mlx.c,v 1.12 2001/07/26 12:38:03 ad Exp $      */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -69,11 +69,7 @@
  *
  * TODO:
  *
- * o Homogenize return values everywhere.
- * o Verify that status messages are correct.
  * o Test and enable channel pause.
- * o Time out commands on software queue.
- * o Don't use a S/G list for single-segment transfers.
  * o SCSI pass-through.
  */
 
@@ -541,13 +537,15 @@
        int i, nunits;
        u_int size;
 
+       mlx->mlx_flags |= MLXF_RESCANNING;
+
        if (mlx->mlx_iftype == 2) {
                meo = mlx_enquire(mlx, MLX_CMD_ENQUIRY_OLD,
                    sizeof(struct mlx_enquiry_old), NULL, waitok);
                if (meo == NULL) {
                        printf("%s: ENQUIRY_OLD failed\n",
                            mlx->mlx_dv.dv_xname);
-                       return;
+                       goto out;
                }
                mlx->mlx_numsysdrives = meo->me_num_sys_drvs;
                free(meo, M_DEVBUF);
@@ -556,7 +554,7 @@
                    sizeof(struct mlx_enquiry), NULL, waitok);
                if (me == NULL) {
                        printf("%s: ENQUIRY failed\n", mlx->mlx_dv.dv_xname);
-                       return;
+                       goto out;
                }
                mlx->mlx_numsysdrives = me->me_num_sys_drvs;
                free(me, M_DEVBUF);
@@ -568,7 +566,7 @@
                printf("%s: error fetching drive status\n",
                    mlx->mlx_dv.dv_xname);
                free(me, M_DEVBUF);
-               return;
+               goto out;
        }
 
        /* Allow 1 queued command per unit while re-configuring. */
@@ -612,6 +610,8 @@
        if (nunits != 0)
                mlx_adjqparam(mlx, mlx->mlx_max_queuecnt / nunits,
                    mlx->mlx_max_queuecnt % nunits);
+ out:
+       mlx->mlx_flags &= ~MLXF_RESCANNING;
 }
 
 /*
@@ -727,6 +727,9 @@
        struct mlx_sysdrive *ms;
        int i, rv, *arg, result;
 
+       if (securelevel >= 2)
+               return (EPERM);
+
        mlx = device_lookup(&mlx_cd, minor(dev));
 
        rb = (struct mlx_rebuild_request *)data;
@@ -973,10 +976,6 @@
                 */
                mlx_pause_action(mlx);
                mlx->mlx_pause.mp_when = 0;
-#ifdef notdef
-               sysbeep(500, hz);
-
-#endif
        } else if ((mlx->mlx_pause.mp_which != 0) &&
                   (mlx->mlx_pause.mp_when == 0)) {
                /*
@@ -986,11 +985,6 @@
                        mlx_pause_action(mlx);
                        mlx->mlx_pause.mp_which = 0;
                }
-#ifdef notdef
-                       sysbeep(500, hz);
-               } else
-                       sysbeep((ct % 5) * 100 + 500, hz/8);
-#endif
        } else if (ct > (mlx->mlx_lastpoll + 10)) {
                /* 
                 * Run normal periodic activities...
@@ -1155,8 +1149,16 @@
                break;
 
        case MLX_CMD_ENQSYSDRIVE:
+               /*
+                * Perform drive status comparison to see if something 
+                * has failed.  Don't perform the comparison if we're
+                * reconfiguring, since the system drive table will be
+                * changing.
+                */
+               if ((mlx->mlx_flags & MLXF_RESCANNING) != 0)
+                       break;
+
                mes = (struct mlx_enq_sys_drive *)mc->mc_mx.mx_context;
-
                dr = &mlx->mlx_sysdrive[0];
 
                for (i = 0; i < mlx->mlx_numsysdrives; i++) {
@@ -1321,9 +1323,12 @@
                                    mlx->mlx_dv.dv_xname, chan, targ, sensekey,
                                    el->el_asc, el->el_asq);
                                printf("%s:   info = %d:%d:%d:%d "
-                                   " csi = %d:%d:%d:%d\n", mlx->mlx_dv.dv_xname,
-                                   el->el_information[0], el->el_information[1],
-                                   el->el_information[2], el->el_information[3],
+                                   " csi = %d:%d:%d:%d\n",
+                                   mlx->mlx_dv.dv_xname,
+                                   el->el_information[0],
+                                   el->el_information[1],
+                                   el->el_information[2],
+                                   el->el_information[3],
                                    el->el_csi[0], el->el_csi[1],
                                    el->el_csi[2], el->el_csi[3]);
                        }
@@ -1886,7 +1891,7 @@
                if (mlx_ccb_submit(mlx, mc) != 0)
                        break;
                SIMPLEQ_REMOVE_HEAD(&mlx->mlx_ccb_queue, mc, mc_chain.simpleq);
-               TAILQ_INSERT_TAIL(&mlx->mlx_ccb_worklist, mc, mc_chain.tailq); 
+               TAILQ_INSERT_TAIL(&mlx->mlx_ccb_worklist, mc, mc_chain.tailq);
        }
 
        splx(s);
diff -r a125df8ed6b2 -r 29212de765af sys/dev/ic/mlxreg.h
--- a/sys/dev/ic/mlxreg.h       Thu Jul 26 12:36:16 2001 +0000
+++ b/sys/dev/ic/mlxreg.h       Thu Jul 26 12:38:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mlxreg.h,v 1.2 2001/05/06 19:53:04 ad Exp $    */
+/*     $NetBSD: mlxreg.h,v 1.3 2001/07/26 12:38:03 ad Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
 #define        MLX_STATUS_RDWROFFLINE  0x0002  /* read/write claims drive is offline */
 #define        MLX_STATUS_WEDGED       0xdeaf  /* controller not listening */
 #define        MLX_STATUS_LOST         0xdead  /* never came back */
-#define        MLX_STATUS_BUSY         0xdeed  /* command is in controller */
+#define        MLX_STATUS_BUSY         0xbabe  /* command is in controller */
 
 /*
  * V1 (EISA) interface.
diff -r a125df8ed6b2 -r 29212de765af sys/dev/ic/mlxvar.h
--- a/sys/dev/ic/mlxvar.h       Thu Jul 26 12:36:16 2001 +0000
+++ b/sys/dev/ic/mlxvar.h       Thu Jul 26 12:38:03 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mlxvar.h,v 1.3 2001/06/10 10:34:44 ad Exp $    */
+/*     $NetBSD: mlxvar.h,v 1.4 2001/07/26 12:38:03 ad Exp $    */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -178,6 +178,7 @@
 #define        MLXF_PERIODIC_DRIVE     0x0080  /* periodic check running */
 #define        MLXF_PERIODIC_REBUILD   0x0100  /* periodic check running */
 #define        MLXF_EISA               0x0200  /* EISA board */
+#define        MLXF_RESCANNING         0x0400  /* rescanning drive table */
 
 struct mlx_attach_args {
        int             mlxa_unit;



Home | Main Index | Thread Index | Old Index