Exemplo n.º 1
0
static int try_ata_pass_through(HANDLE hdevice, IDEREGS * regs, void * data, int datasize)
{
	static char avail = 0x7;
	int rc;
	if (avail & 0x1) {
		rc = ata_pass_through(hdevice, regs, data, datasize);
		if (rc >= 0 || errno != ENOSYS)
			return rc;
		avail &= ~0x1;
	}
	if ((avail & 0x2) && datasize >= 0) {
		rc = ide_pass_through(hdevice, regs, data, datasize);
		if (rc >= 0 || errno != ENOSYS)
			return rc;
		avail &= ~0x2;
	}
	if ((avail & 0x4) && regs->bCommandReg == WIN_IDENTIFY) {
		rc = smart_rcv_drive_data(hdevice, regs, data, datasize);
		if (rc >= 0 || errno != ENOSYS)
			return rc;
		avail &= ~0x4;
	}
	if (win32_debug) {
		printf("  No ATA PASS THROUGH I/O control available\n");
		print_ide_regs(regs, NULL);
	}
	errno = ENOSYS;
	return -1;
}
Exemplo n.º 2
0
bool ata_device::ata_pass_through(const ata_cmd_in & in)
{
  ata_cmd_out dummy;
  return ata_pass_through(in, dummy);
}