summaryrefslogtreecommitdiff
path: root/sys/dev/nsp/nsp.c
diff options
context:
space:
mode:
authorNoriaki Mitsunaga <non@FreeBSD.org>2001-09-02 07:18:29 +0000
committerNoriaki Mitsunaga <non@FreeBSD.org>2001-09-02 07:18:29 +0000
commit9d92f16230a510d3ae6a915faf807cb6879062fd (patch)
treedddc0e69b48cc819771cba013af4beef231a3d77 /sys/dev/nsp/nsp.c
parentdaee21d1b4584cf74445e74e953618c997ede37a (diff)
Notes
Diffstat (limited to 'sys/dev/nsp/nsp.c')
-rw-r--r--sys/dev/nsp/nsp.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/sys/dev/nsp/nsp.c b/sys/dev/nsp/nsp.c
index a78dd34ee21d..61f4740e2bcb 100644
--- a/sys/dev/nsp/nsp.c
+++ b/sys/dev/nsp/nsp.c
@@ -452,7 +452,7 @@ nsphw_start_selection(sc, cb)
continue;
}
- SCSI_LOW_DELAY(1);
+ SCSI_LOW_DELAY(1);
ph = nsp_cr_read_1(bst, bsh, NSPR_SCBUSMON);
if ((ph & SCBUSMON_BSY) != 0)
{
@@ -1168,21 +1168,35 @@ WriteLoop:
* is ready to recieve data without
* heavy delays.
*/
- acount = nsp_fifo_count(sc);
- rcount = nsp_request_count(sc);
- if (rcount <= acount)
+ if ((slp->sl_scp.scp_datalen % suspendio) == 0)
{
+ /* Step I:
+ * fill the nsp fifo, and waiting for
+ * the fifo empty.
+ */
nsp_write_fifo(sc, 0);
-#ifdef NSP_STATICS
- nsp_statics.device_busy ++;
-#endif /* NSP_STATICS */
}
else
{
- nsp_write_fifo(sc, suspendio);
+ /* Step II:
+ * check the request singals.
+ */
+ acount = nsp_fifo_count(sc);
+ rcount = nsp_request_count(sc);
+ if (rcount <= acount)
+ {
+ nsp_write_fifo(sc, 0);
+#ifdef NSP_STATICS
+ nsp_statics.device_busy ++;
+#endif /* NSP_STATICS */
+ }
+ else
+ {
+ nsp_write_fifo(sc, suspendio);
#ifdef NSP_STATICS
- nsp_statics.device_data_write ++;
+ nsp_statics.device_data_write ++;
#endif /* NSP_STATICS */
+ }
}
}
else