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

zcore at FreeBSD.org zcore at FreeBSD.org
Sat Sep 7 16:07:02 UTC 2013


Author: zcore
Date: Sat Sep  7 16:07:01 2013
New Revision: 257082
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257082

Log:
  support ATA_READ_DMA48 and ATA_WRITE_DMA48

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:05:58 2013	(r257081)
+++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c	Sat Sep  7 16:07:01 2013	(r257082)
@@ -323,7 +323,7 @@
 	struct ahci_prdt_entry *prdt = (struct ahci_prdt_entry *)(cfis + 0x80);
 	struct ahci_cmd_hdr *hdr = p->cmd_lst + slot * AHCI_CL_SIZE;
 
-	if (cfis[2] == ATA_WRITE_DMA)
+	if (cfis[2] == ATA_WRITE_DMA || cfis[2] == ATA_WRITE_DMA48)
 		readop = 0;
 
 	if (!p->iofree) {
@@ -334,14 +334,26 @@
 		return;
 	}
 
-	lba = ((cfis[7] & 0xf) << 24) | (cfis[6] << 16) |
-		(cfis[5] << 8) | cfis[4];
+	if (cfis[2] == ATA_READ_DMA48 || cfis[2] == ATA_WRITE_DMA48) {
+		lba = ((uint64_t)cfis[10] << 40) |
+			((uint64_t)cfis[9] << 32) |
+			((uint64_t)cfis[8] << 24) |
+			((uint64_t)cfis[6] << 16) |
+			((uint64_t)cfis[5] << 8) |
+			cfis[4];
+		if (!cfis[12] && !cfis[13])
+			len = 65536;
+		else
+			len = cfis[13] << 8 | cfis[12];
+	} else {
+		lba = ((cfis[7] & 0xf) << 24) | (cfis[6] << 16) |
+			(cfis[5] << 8) | cfis[4];
+		if (!cfis[12])
+			len = 256;
+		else
+			len = cfis[12];
+	}
 	lba *= blockif_sectsz(p->bctx);
-
-	if (!cfis[12])
-		len = 256;
-	else
-		len = cfis[12];
 	len *= blockif_sectsz(p->bctx);
 
 	/*
@@ -500,6 +512,8 @@
 		break;
 	case ATA_READ_DMA:
 	case ATA_WRITE_DMA:
+	case ATA_READ_DMA48:
+	case ATA_WRITE_DMA48:
 		handle_dma(p, slot, cfis);
 		break;
 	default:


More information about the svn-soc-all mailing list