From fc601c53dcb1d99c5f63d111baadbce118ffa9c1 Mon Sep 17 00:00:00 2001 From: "Matthew N. Dodd" 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(-) (limited to 'sys/dev/ida/ida_pci.c') diff --git a/sys/dev/ida/ida_pci.c b/sys/dev/ida/ida_pci.c index 82ecf4ad066b..105331792331 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.2.3