socsvn commit: r256488 - soc2013/zcore/head/usr.sbin/bhyve
zcore at FreeBSD.org
zcore at FreeBSD.org
Sun Aug 25 10:18:09 UTC 2013
Author: zcore
Date: Sun Aug 25 10:18:08 2013
New Revision: 256488
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=256488
Log:
support ATA_SET_MULTI
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:17:16 2013 (r256487)
+++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Sun Aug 25 10:18:08 2013 (r256488)
@@ -92,6 +92,7 @@
uint64_t rfis;
int atapi;
int reset;
+ int mult_sectors;
uint8_t xfermode;
uint32_t clb;
@@ -288,6 +289,7 @@
pr->serr = 0;
pr->sact = 0;
pr->xfermode = ATA_UDMA6;
+ pr->mult_sectors = 128;
if (!pr->bctx) {
pr->ssts = ATA_SS_DET_NO_DEVICE;
@@ -355,12 +357,13 @@
ata_string((uint8_t *)(buf+10), "123456", 20);
ata_string((uint8_t *)(buf+23), "001", 8);
ata_string((uint8_t *)(buf+27), "BHYVE SATA DISK", 40);
- buf[47] = (0x8000 | 16);
+ buf[47] = (0x8000 | 128);
buf[48] = 0x1;
buf[49] = (1 << 8 | 1 << 9 | 1 << 11);
buf[50] = (1 << 14);
buf[53] = (1 << 1 | 1 << 2);
- buf[59] = (0x100 | 16);
+ if (p->mult_sectors)
+ buf[59] = (0x100 | p->mult_sectors);
buf[60] = sectors;
buf[61] = (sectors >> 16);
buf[63] = 0x7;
@@ -417,8 +420,6 @@
case ATA_SF_ENAB_RCACHE:
case ATA_SF_DIS_RCACHE:
p->tfd = ATA_S_DSC | ATA_S_READY;
- p->is |= AHCI_P_IX_DP;
- ahci_generate_intr(sc);
break;
case ATA_SF_SETXFER:
{
@@ -432,19 +433,29 @@
break;
}
p->tfd = ATA_S_DSC | ATA_S_READY;
- p->is |= AHCI_P_IX_DP;
- ahci_generate_intr(sc);
break;
}
default:
p->tfd = ATA_S_ERROR | ATA_S_READY;
p->tfd |= (ATA_ERROR_ABORT << 8);
- p->is |= AHCI_P_IX_DP;
- ahci_generate_intr(sc);
break;
}
+ p->is |= AHCI_P_IX_DP;
+ ahci_generate_intr(sc);
break;
}
+ case ATA_SET_MULTI:
+ if (cfis[12] != 0 &&
+ (cfis[12] > 128 || (cfis[12] & cfis[12] - 1))) {
+ p->tfd = ATA_S_ERROR | ATA_S_READY;
+ p->tfd |= (ATA_ERROR_ABORT << 8);
+ } else {
+ p->mult_sectors = cfis[12];
+ p->tfd = ATA_S_DSC | ATA_S_READY;
+ }
+ p->is |= AHCI_P_IX_DP;
+ ahci_generate_intr(sc);
+ break;
default:
break;
}
More information about the svn-soc-all
mailing list