Date: Sat, 14 Sep 2013 15:59:26 GMT From: zcore@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r257330 - soc2013/zcore/head/usr.sbin/bhyve Message-ID: <201309141559.r8EFxQsM001129@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: zcore Date: Sat Sep 14 15:59:26 2013 New Revision: 257330 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=257330 Log: support ATA_PACKET_CMD 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 Sat Sep 14 15:57:49 2013 (r257329) +++ soc2013/zcore/head/usr.sbin/bhyve/pci_ahci.c Sat Sep 14 15:59:26 2013 (r257330) @@ -100,6 +100,8 @@ uint32_t unhandled_write; pthread_cond_t flush_cond; uint8_t xfermode; + uint8_t sense_key; + uint8_t asc; uint32_t clb; uint32_t clbu; @@ -570,9 +572,31 @@ } static void +handle_packet_cmd(struct ahci_port *p, int slot, uint8_t *cfis) +{ + uint8_t *acmd = cfis + 0x40; + + { + int i; + dprintf("ACMD:\n"); + for (i = 0; i < 16; i++) + dprintf("%02x ", acmd[i]); + dprintf("\n"); + } + switch (acmd[0]) { + case ATAPI_TEST_UNIT_READY: + cfis[4] = (cfis[4] & ~7) | ATA_I_CMD | ATA_I_IN; + ahci_write_fis_d2h(p, slot, cfis, ATA_S_READY | ATA_S_DSC); + break; + default: + break; + } +} + +static void handle_cmd(struct ahci_port *p, int slot, uint8_t *cfis) { - switch(cfis[2]) { + switch (cfis[2]) { case ATA_ATA_IDENTIFY: handle_identify(p, slot, cfis); break; @@ -645,6 +669,15 @@ case ATA_ATAPI_IDENTIFY: handle_atapi_identify(p, slot, cfis); break; + case ATA_PACKET_CMD: + if (!p->atapi) { + p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR; + p->is |= AHCI_P_IX_TFE; + p->ci &= ~(1 << slot); + ahci_generate_intr(p->pr_sc); + } else + handle_packet_cmd(p, slot, cfis); + break; default: WPRINTF(("Unsupported cmd:%02x\n", cfis[2])); p->tfd = (ATA_E_ABORT << 8) | ATA_S_READY | ATA_S_ERROR;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309141559.r8EFxQsM001129>