From fb985e2a0c07e7e8e74515b81f7f31237c8eb559 Mon Sep 17 00:00:00 2001 From: mdodd Date: Tue, 14 Dec 2004 17:41:51 +0000 Subject: Modify ida_v3_done() to treat FIFO status of -1 as FIFO empty (0). This is what ida_v4_done() does and seems to be necessary with some firmware versions on v3 devices. --- sys/dev/ida/ida_pci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c index 82ecf4a..1053317 100644 --- a/sys/dev/ida/ida_pci.c +++ b/sys/dev/ida/ida_pci.c @@ -74,7 +74,13 @@ ida_v3_submit(struct ida_softc *ida, struct ida_qcb *qcb) static bus_addr_t ida_v3_done(struct ida_softc *ida) { - return (ida_inl(ida, R_DONE_FIFO)); + bus_addr_t completed; + + completed = ida_inl(ida, R_DONE_FIFO); + if (completed == -1) { + return (0); /* fifo is empty */ + } + return (completed); } static int -- cgit v1.1