socsvn commit: r257084 - soc2013/zcore/head/usr.sbin/bhyve

zcore at FreeBSD.org zcore at FreeBSD.org
Sat Sep 7 16:08:48 UTC 2013


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);
 
 	/*


More information about the svn-soc-all mailing list