From owner-svn-src-head@FreeBSD.ORG Wed Feb 12 00:32:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FB0F9E8; Wed, 12 Feb 2014 00:32:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A231156D; Wed, 12 Feb 2014 00:32:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1C0WFnn092912; Wed, 12 Feb 2014 00:32:15 GMT (envelope-from tychon@svn.freebsd.org) Received: (from tychon@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1C0WFlG092911; Wed, 12 Feb 2014 00:32:15 GMT (envelope-from tychon@svn.freebsd.org) Message-Id: <201402120032.s1C0WFlG092911@svn.freebsd.org> From: Tycho Nightingale Date: Wed, 12 Feb 2014 00:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261785 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Feb 2014 00:32:15 -0000 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: