socsvn commit: r256484 - soc2013/zcore/head/usr.sbin/bhyve
zcore at FreeBSD.org
zcore at FreeBSD.org
Sun Aug 25 10:15:55 UTC 2013
Author: zcore
Date: Sun Aug 25 10:15:54 2013
New Revision: 256484
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=256484
Log:
handle reset control cfis
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 Sun Aug 25 10:15:16 2013 (r256483)
+++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Sun Aug 25 10:15:54 2013 (r256484)
@@ -90,6 +90,7 @@
uint64_t cmd_lst;
uint64_t rfis;
int atapi;
+ int reset;
uint32_t clb;
uint32_t clbu;
@@ -337,10 +338,27 @@
dprintf("%d@%08"PRIx64", %d\n", prdt->dbc & 0x3fffff, prdt->dba, (prdt->dbc >> 31) & 0x1);
prdt++;
}
+
+ if (cfis[0] != FIS_TYPE_REGH2D) {
+ WPRINTF(("Not a H2D FIS:%02x\n", cfis[0]));
+ return;
+ }
+
+ if (cfis[1] & 0x80) {
+ dprintf("command cfis\n");
+ } else {
+ dprintf("control cfis\n");
+ if (cfis[15] & (1 << 2))
+ p->reset = 1;
+ else if (p->reset) {
+ p->reset = 0;
+ ahci_port_reset(p);
+ }
+ }
}
static void
-handle_cmd(struct ahci_port *p)
+handle_port(struct ahci_port *p)
{
int i;
struct pci_ahci_softc *sc;
@@ -490,7 +508,7 @@
p->cmd &= ~AHCI_P_CMD_CLO;
}
- handle_cmd(p);
+ handle_port(p);
break;
}
case AHCI_P_TFD:
@@ -513,7 +531,7 @@
break;
case AHCI_P_CI:
p->ci |= value;
- handle_cmd(p);
+ handle_port(p);
break;
case AHCI_P_SNTF:
case AHCI_P_FBS:
More information about the svn-soc-all
mailing list