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)
This commit is contained in:
parent
360bd8ad2b
commit
2a261121af
@ -253,6 +253,16 @@ ahci_write_fis(struct ahci_port *p, enum sata_fis_type ft, uint8_t *fis)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
static void
|
||||||
ahci_write_fis_sdb(struct ahci_port *p, int slot, uint32_t tfd)
|
ahci_write_fis_sdb(struct ahci_port *p, int slot, uint32_t tfd)
|
||||||
{
|
{
|
||||||
@ -587,6 +597,7 @@ handle_identify(struct ahci_port *p, int slot, uint8_t *cfis)
|
|||||||
buf[101] = (sectors >> 16);
|
buf[101] = (sectors >> 16);
|
||||||
buf[102] = (sectors >> 32);
|
buf[102] = (sectors >> 32);
|
||||||
buf[103] = (sectors >> 48);
|
buf[103] = (sectors >> 48);
|
||||||
|
ahci_write_fis_piosetup(p);
|
||||||
write_prdt(p, slot, cfis, (void *)buf, sizeof(buf));
|
write_prdt(p, slot, cfis, (void *)buf, sizeof(buf));
|
||||||
p->tfd = ATA_S_DSC | ATA_S_READY;
|
p->tfd = ATA_S_DSC | ATA_S_READY;
|
||||||
p->is |= AHCI_P_IX_DP;
|
p->is |= AHCI_P_IX_DP;
|
||||||
@ -629,6 +640,7 @@ handle_atapi_identify(struct ahci_port *p, int slot, uint8_t *cfis)
|
|||||||
buf[85] = (1 << 4);
|
buf[85] = (1 << 4);
|
||||||
buf[87] = (1 << 14);
|
buf[87] = (1 << 14);
|
||||||
buf[88] = (1 << 14 | 0x7f);
|
buf[88] = (1 << 14 | 0x7f);
|
||||||
|
ahci_write_fis_piosetup(p);
|
||||||
write_prdt(p, slot, cfis, (void *)buf, sizeof(buf));
|
write_prdt(p, slot, cfis, (void *)buf, sizeof(buf));
|
||||||
p->tfd = ATA_S_DSC | ATA_S_READY;
|
p->tfd = ATA_S_DSC | ATA_S_READY;
|
||||||
p->is |= AHCI_P_IX_DHR;
|
p->is |= AHCI_P_IX_DHR;
|
||||||
@ -1182,9 +1194,7 @@ ahci_handle_cmd(struct ahci_port *p, int slot, uint8_t *cfis)
|
|||||||
p->tfd |= (ATA_ERROR_ABORT << 8);
|
p->tfd |= (ATA_ERROR_ABORT << 8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
p->is |= AHCI_P_IX_DP;
|
ahci_write_fis_d2h(p, slot, cfis, p->tfd);
|
||||||
p->ci &= ~(1 << slot);
|
|
||||||
ahci_generate_intr(p->pr_sc);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ATA_SET_MULTI:
|
case ATA_SET_MULTI:
|
||||||
|
Loading…
Reference in New Issue
Block a user