aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bhyve/pci_ahci.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-03-13 20:56:17 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-03-13 20:56:17 +0000
commit9463f47b3a784c5b2e33cdd937c7eb1d0306a2ae (patch)
treed8ae5329f6b120da92b0f9319350879d1da41698 /usr.sbin/bhyve/pci_ahci.c
parenta52c3ec43ce7abd889da0bf0424c61ca071fbf3c (diff)
downloadsrc-9463f47b3a784c5b2e33cdd937c7eb1d0306a2ae.tar.gz
src-9463f47b3a784c5b2e33cdd937c7eb1d0306a2ae.zip
Change prdbc value reporting.
MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=279967
Diffstat (limited to 'usr.sbin/bhyve/pci_ahci.c')
-rw-r--r--usr.sbin/bhyve/pci_ahci.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c
index 215be6c4855d..8d9786f8213f 100644
--- a/usr.sbin/bhyve/pci_ahci.c
+++ b/usr.sbin/bhyve/pci_ahci.c
@@ -1662,6 +1662,9 @@ ata_ioreq_cb(struct blockif_req *br, int err)
*/
STAILQ_INSERT_TAIL(&p->iofhd, aior, io_flist);
+ if (!err)
+ hdr->prdbc = aior->done;
+
if (dsm) {
if (aior->done != aior->len && !err) {
ahci_handle_dsm_trim(p, slot, cfis, aior->done);
@@ -1677,13 +1680,8 @@ ata_ioreq_cb(struct blockif_req *br, int err)
if (!err && aior->done == aior->len) {
tfd = ATA_S_READY | ATA_S_DSC;
- if (ncq)
- hdr->prdbc = 0;
- else
- hdr->prdbc = aior->len;
} else {
tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR;
- hdr->prdbc = 0;
if (ncq)
p->serr |= (1 << slot);
}
@@ -1738,6 +1736,9 @@ atapi_ioreq_cb(struct blockif_req *br, int err)
*/
STAILQ_INSERT_TAIL(&p->iofhd, aior, io_flist);
+ if (!err)
+ hdr->prdbc = aior->done;
+
if (pending && !err) {
atapi_read(p, slot, cfis, aior->done, hdr->prdtl - pending);
goto out;
@@ -1745,12 +1746,10 @@ atapi_ioreq_cb(struct blockif_req *br, int err)
if (!err && aior->done == aior->len) {
tfd = ATA_S_READY | ATA_S_DSC;
- hdr->prdbc = aior->len;
} else {
p->sense_key = ATA_SENSE_ILLEGAL_REQUEST;
p->asc = 0x21;
tfd = (p->sense_key << 12) | ATA_S_READY | ATA_S_ERROR;
- hdr->prdbc = 0;
}
cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN;