Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Also save status info in the user command packet.



details:   https://anonhg.NetBSD.org/src/rev/98255ba51d14
branches:  trunk
changeset: 542408:98255ba51d14
user:      ad <ad%NetBSD.org@localhost>
date:      Mon Jan 27 23:31:19 2003 +0000

description:
Also save status info in the user command packet.

diffstat:

 sys/dev/ic/dpt.c    |  13 +++++++++++--
 sys/dev/ic/dptreg.h |   7 ++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diffs (62 lines):

diff -r 3cce5e3907a5 -r 98255ba51d14 sys/dev/ic/dpt.c
--- a/sys/dev/ic/dpt.c  Mon Jan 27 23:17:56 2003 +0000
+++ b/sys/dev/ic/dpt.c  Mon Jan 27 23:31:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dpt.c,v 1.36 2003/01/18 10:14:20 thorpej Exp $ */
+/*     $NetBSD: dpt.c,v 1.37 2003/01/27 23:31:19 ad Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.36 2003/01/18 10:14:20 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dpt.c,v 1.37 2003/01/27 23:31:19 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1151,6 +1151,13 @@
                break;
 
        case DPT_EATAUSRCMD:
+               if (IOCPARM_LEN(cmd) < sizeof(struct eata_ucp)) {
+                       DPRINTF(("%s: ucp %d vs %d bytes\n",
+                           sc->sc_dv.dv_xname, IOCPARM_LEN(cmd),
+                           sizeof(struct eata_ucp)));
+                       return (EINVAL);
+               }
+
                if (sc->sc_uactive++)
                        tsleep(&sc->sc_uactive, PRIBIO, "dptslp", 0);
 
@@ -1370,6 +1377,8 @@
                            sc->sc_dv.dv_xname));
        }
 
+       ucp->ucp_hstatus = (u_int8_t)ccb->ccb_hba_status;
+       ucp->ucp_tstatus = (u_int8_t)ccb->ccb_scsi_status;
        dpt_ccb_free(sc, ccb);
        return (rv);
 }
diff -r 3cce5e3907a5 -r 98255ba51d14 sys/dev/ic/dptreg.h
--- a/sys/dev/ic/dptreg.h       Mon Jan 27 23:17:56 2003 +0000
+++ b/sys/dev/ic/dptreg.h       Mon Jan 27 23:31:19 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dptreg.h,v 1.12 2002/12/28 20:06:09 kristerw Exp $     */
+/*     $NetBSD: dptreg.h,v 1.13 2003/01/27 23:31:19 ad Exp $   */
 
 /*
  * Copyright (c) 1999, 2000, 2001 Andrew Doran <ad%netbsd.org@localhost>
@@ -113,6 +113,11 @@
        caddr_t         ucp_dataaddr;
        caddr_t         ucp_stataddr;
        caddr_t         ucp_senseaddr;
+       u_long          ucp_timeout;
+       u_int8_t        ucp_hstatus;
+       u_int8_t        ucp_tstatus;
+       u_int8_t        ucp_retries;
+       u_int8_t        ucp_padding;
 } __attribute__ ((__packed__));
 
 #define CP_C0_SCSI_RESET       0x01    /* Cause a bus reset */



Home | Main Index | Thread Index | Old Index