svn commit: r261785 - head/usr.sbin/bhyve

Tycho Nightingale tychon at FreeBSD.org
Wed Feb 12 00:32:15 UTC 2014


Author: tychon
Date: Wed Feb 12 00:32:14 2014
New Revision: 261785
URL: http://svnweb.freebsd.org/changeset/base/261785

Log:
  Provide an indication a "PIO Setup Device to Host FIS" occurred while executing
  the IDENTIFY DEVICE and IDENTIFY PACKET DEVICE commands.
  
  Also, provide an indication a "D2H Register FIS" occurred during a SET FEATURES
  command.
  
  Approved by:	grehan (co-mentor)

Modified:
  head/usr.sbin/bhyve/pci_ahci.c

Modified: head/usr.sbin/bhyve/pci_ahci.c
==============================================================================
--- head/usr.sbin/bhyve/pci_ahci.c	Tue Feb 11 23:11:11 2014	(r261784)
+++ head/usr.sbin/bhyve/pci_ahci.c	Wed Feb 12 00:32:14 2014	(r261785)
@@ -254,6 +254,16 @@ ahci_write_fis(struct ahci_port *p, enum
 }
 
 static void
+ahci_write_fis_piosetup(struct ahci_port *p)
+{
+	uint8_t fis[20];
+
+	memset(fis, 0, sizeof(fis));
+	fis[0] = FIS_TYPE_PIOSETUP;
+	ahci_write_fis(p, FIS_TYPE_PIOSETUP, fis);
+}
+
+static void
 ahci_write_fis_sdb(struct ahci_port *p, int slot, uint32_t tfd)
 {
 	uint8_t fis[8];
@@ -587,6 +597,7 @@ handle_identify(struct ahci_port *p, int
 		buf[101] = (sectors >> 16);
 		buf[102] = (sectors >> 32);
 		buf[103] = (sectors >> 48);
+		ahci_write_fis_piosetup(p);
 		write_prdt(p, slot, cfis, (void *)buf, sizeof(buf));
 		p->tfd = ATA_S_DSC | ATA_S_READY;
 		p->is |= AHCI_P_IX_DP;
@@ -629,6 +640,7 @@ handle_atapi_identify(struct ahci_port *
 		buf[85] = (1 << 4);
 		buf[87] = (1 << 14);
 		buf[88] = (1 << 14 | 0x7f);
+		ahci_write_fis_piosetup(p);
 		write_prdt(p, slot, cfis, (void *)buf, sizeof(buf));
 		p->tfd = ATA_S_DSC | ATA_S_READY;
 		p->is |= AHCI_P_IX_DHR;
@@ -1182,9 +1194,7 @@ ahci_handle_cmd(struct ahci_port *p, int
 			p->tfd |= (ATA_ERROR_ABORT << 8);
 			break;
 		}
-		p->is |= AHCI_P_IX_DP;
-		p->ci &= ~(1 << slot);
-		ahci_generate_intr(p->pr_sc);
+		ahci_write_fis_d2h(p, slot, cfis, p->tfd);
 		break;
 	}
 	case ATA_SET_MULTI:


More information about the svn-src-all mailing list