/* Called when an error was detected during the last packet command. We queue a request sense packet command at the head of the request queue.  */
void ide_retry_pc(ide_drive_t *drive)
/* Called when an error was detected during the last packet command. We queue a request sense packet command at the head of the request queue.  */
void ide_retry_pc(ide_drive_t *drive)
{
	struct request *failed_rq = drive->hwif->rq;
	struct request *sense_rq = &drive->sense_rq;
	struct ide_atapi_pc *pc = &drive->request_sense_pc;
	(void)ide_read_error(drive);
	ide_init_pc(pc);
	memcpy(pc->c, sense_rq->cmd, 12);
	if (drive->media == ide_tape)
		drive->atapi_flags |= IDE_AFLAG_IGNORE_DSC;
	blk_requeue_request(failed_rq->q, failed_rq);
	drive->hwif->rq = NULL;
	if (ide_queue_sense_rq(drive, pc)) {
		blk_start_request(failed_rq);
		ide_complete_rq(drive, -EIO, blk_rq_bytes(failed_rq));
	}
}