Date: Sat, 7 Sep 2013 16:08:48 GMT From: zcore@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257084 - soc2013/zcore/head/usr.sbin/bhyve Message-ID: <201309071608.r87G8mV6011065@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: zcore Date: Sat Sep 7 16:08:48 2013 New Revision: 257084 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257084 Log: should set prdbc before send h2d fis Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Modified: soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Sat Sep 7 16:08:00 2013 (r257083) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Sat Sep 7 16:08:48 2013 (r257084) @@ -83,6 +83,7 @@ struct ahci_port *io_pr; STAILQ_ENTRY(ahci_ioreq) io_list; uint8_t *cfis; + uint32_t len; int slot; }; @@ -369,6 +370,7 @@ p->iofree--; aior->cfis = cfis; aior->slot = slot; + aior->len = len; breq = &aior->io_req; breq->br_offset = lba; breq->br_iovcnt = hdr->prdtl; @@ -618,18 +620,23 @@ struct pci_ahci_softc *sc; struct ahci_ioreq *aior; uint32_t tfd; + struct ahci_cmd_hdr *hdr; aior = br->br_param; p = aior->io_pr; sc = p->pr_sc; + hdr = p->cmd_lst + aior->slot * AHCI_CL_SIZE; DPRINTF(("ahci_ioreq_cb %d\n", err)); pthread_mutex_lock(&sc->mtx); - if (err) - tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; - else + if (!err) { tfd = ATA_S_READY | ATA_S_DSC; + hdr->prdbc = aior->len; + } else { + tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; + hdr->prdbc = 0; + } ahci_write_fis_d2h(p, aior->slot, aior->cfis, tfd); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309071608.r87G8mV6011065>