diff --git a/sys/dev/ic/dpt.c b/sys/dev/ic/dpt.c index de95ebf3bc69..17145e18adf0 100644 --- a/sys/dev/ic/dpt.c +++ b/sys/dev/ic/dpt.c @@ -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 -__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 #include @@ -1151,6 +1151,13 @@ dptioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) 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 @@ dpt_passthrough(struct dpt_softc *sc, struct eata_ucp *ucp, struct proc *proc) 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 --git a/sys/dev/ic/dptreg.h b/sys/dev/ic/dptreg.h index a6adb5ad7d62..0c3e304a8b46 100644 --- a/sys/dev/ic/dptreg.h +++ b/sys/dev/ic/dptreg.h @@ -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 @@ -113,6 +113,11 @@ struct eata_ucp { 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 */