summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortychon <tychon@FreeBSD.org>2014-03-16 12:33:40 +0000
committertychon <tychon@FreeBSD.org>2014-03-16 12:33:40 +0000
commit8de9dac190c0ed381ef0edd6bfb170be288de627 (patch)
treeb649b26576b77e25bb0d88bfc3b89bfad820ad2f
parent529b98b9434e4c5cd1c7bb20de4061f824fb1b9d (diff)
downloadFreeBSD-src-8de9dac190c0ed381ef0edd6bfb170be288de627.zip
FreeBSD-src-8de9dac190c0ed381ef0edd6bfb170be288de627.tar.gz
Though there currently isn't a way to insert new media into an ATAPI
drive, at least pretend to support Asynchronous Notification (AN) to avoid a guest needlessly polling for it. Approved by: grehan (co-mentor)
-rw-r--r--usr.sbin/bhyve/pci_ahci.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c
index f4666ff..343202e 100644
--- a/usr.sbin/bhyve/pci_ahci.c
+++ b/usr.sbin/bhyve/pci_ahci.c
@@ -95,6 +95,13 @@ enum sata_fis_type {
#define MODEPAGE_CD_CAPABILITIES 0x2A
/*
+ * ATA commands
+ */
+#define ATA_SF_ENAB_SATA_SF 0x10
+#define ATA_SATA_SF_AN 0x05
+#define ATA_SF_DIS_SATA_SF 0x90
+
+/*
* Debug printf
*/
#ifdef AHCI_DEBUG
@@ -1169,6 +1176,17 @@ ahci_handle_cmd(struct ahci_port *p, int slot, uint8_t *cfis)
case ATA_SETFEATURES:
{
switch (cfis[3]) {
+ case ATA_SF_ENAB_SATA_SF:
+ switch (cfis[12]) {
+ case ATA_SATA_SF_AN:
+ p->tfd = ATA_S_DSC | ATA_S_READY;
+ break;
+ default:
+ p->tfd = ATA_S_ERROR | ATA_S_READY;
+ p->tfd |= (ATA_ERROR_ABORT << 8);
+ break;
+ }
+ break;
case ATA_SF_ENAB_WCACHE:
case ATA_SF_DIS_WCACHE:
case ATA_SF_ENAB_RCACHE:
OpenPOWER on IntegriCloud