From 8bfc297b1477ee40c3d278707eaec1bc1ad4b000 Mon Sep 17 00:00:00 2001 From: sos Date: Mon, 12 Mar 2007 15:34:08 +0000 Subject: Fix writes on siiprb type chips. --- sys/dev/ata/ata-chipset.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/dev/ata') diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index 068ca77..be7451b 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -4657,8 +4657,12 @@ ata_siiprb_end_transaction(struct ata_request *request) request->error = prb->fis[3]; /* update progress */ - if (!(request->status & ATA_S_ERROR) && !(request->flags & ATA_R_TIMEOUT)) - request->donecount = prb->transfer_count; + if (!(request->status & ATA_S_ERROR) && !(request->flags & ATA_R_TIMEOUT)) { + if (request->flags & ATA_R_READ) + request->donecount = prb->transfer_count; + else + request->donecount = request->bytecount; + } /* any controller errors flagged ? */ if ((error = ATA_INL(ctlr->r_res2, 0x1024 + offset))) { -- cgit v1.1