diff options
author | mdodd <mdodd@FreeBSD.org> | 2004-01-12 12:31:03 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2004-01-12 12:31:03 +0000 |
commit | 1e727c75e474554e0d66be5fca8981d038cb76b7 (patch) | |
tree | 0cc71cd15ad52448582c9f7c22d6dc8a5355fab1 | |
parent | 39966fbafe55a16dc7d5dda6b10b3f4cf4de6014 (diff) | |
download | FreeBSD-src-1e727c75e474554e0d66be5fca8981d038cb76b7.zip FreeBSD-src-1e727c75e474554e0d66be5fca8981d038cb76b7.tar.gz |
- Initialize qcb flags in ida_construct_qcb() with respect to DMA direction.
- Print operation type, if known in hard/soft error message in ida_done().
- NULL qcb struct bio pointer in ida_done().
-rw-r--r-- | sys/dev/ida/ida.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c index e95ff03..66781ec 100644 --- a/sys/dev/ida/ida.c +++ b/sys/dev/ida/ida.c @@ -393,7 +393,7 @@ ida_construct_qcb(struct ida_softc *ida) bioq_remove(&ida->bio_queue, bp); qcb->buf = bp; - qcb->flags = 0; + qcb->flags = bp->bio_cmd == BIO_READ ? DMA_DATA_IN : DMA_DATA_OUT; hwqcb = qcb->hwqcb; bzero(hwqcb, sizeof(struct ida_hdr) + sizeof(struct ida_req)); @@ -512,11 +512,22 @@ ida_done(struct ida_softc *ida, struct ida_qcb *qcb) bus_dmamap_unload(ida->buffer_dmat, qcb->dmamap); } - if (qcb->hwqcb->req.error & SOFT_ERROR) - device_printf(ida->dev, "soft error\n"); + if (qcb->hwqcb->req.error & SOFT_ERROR) { + if (qcb->buf) + device_printf(ida->dev, "soft %s error\n", + qcb->buf->bio_cmd == BIO_READ ? + "read" : "write"); + else + device_printf(ida->dev, "soft error\n"); + } if (qcb->hwqcb->req.error & HARD_ERROR) { error = 1; - device_printf(ida->dev, "hard error\n"); + if (qcb->buf) + device_printf(ida->dev, "hard %s error\n", + qcb->buf->bio_cmd == BIO_READ ? + "read" : "write"); + else + device_printf(ida->dev, "hard error\n"); } if (qcb->hwqcb->req.error & CMD_REJECTED) { error = 1; @@ -533,6 +544,7 @@ ida_done(struct ida_softc *ida, struct ida_qcb *qcb) } qcb->state = QCB_FREE; + qcb->buf = NULL; SLIST_INSERT_HEAD(&ida->free_qcbs, qcb, link.sle); ida_construct_qcb(ida); } |