} else if (rq->errors >= ERROR_MAX) { 
} else if (errors >= ERROR_MAX) { 
static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs){	idescsi_scsi_t *scsi = drive_to_idescsi(drive);	struct request *rq = HWGROUP(drive)->rq;	idescsi_pc_t *pc = (idescsi_pc_t *) rq->special;	int log = test_bit(IDESCSI_LOG_CMD, &scsi->log);	struct Scsi_Host *host;	u8 *scsi_buf;	unsigned long flags;	if (!(rq->flags & (REQ_SPECIAL|REQ_SENSE))) {		ide_end_request(drive, uptodate, nrsecs);		return 0;	}	ide_end_drive_cmd (drive, 0, 0);	if (rq->flags & REQ_SENSE) {		idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer;		if (log) {			printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number);			hexdump(pc->buffer,16);		}		memcpy((void *) opc->scsi_cmd->sense_buffer, pc->buffer, SCSI_SENSE_BUFFERSIZE);		kfree(pc->buffer);		kfree(pc);		kfree(rq);		pc = opc;		rq = pc->rq;		pc->scsi_cmd->result = (CHECK_CONDITION << 1) |					((test_bit(PC_TIMEDOUT, &pc->flags)?DID_TIME_OUT:DID_OK) << 16);	} else if (test_bit(PC_TIMEDOUT, &pc->flags)) {		if (log)			printk (KERN_WARNING "ide-scsi: %s: timed out for %lu\n",					drive->name, pc->scsi_cmd->serial_number);		pc->scsi_cmd->result = DID_TIME_OUT << 16;	} else if (rq->errors >= ERROR_MAX) {		pc->scsi_cmd->result = DID_ERROR << 16;		if (log)			printk ("ide-scsi: %s: I/O error for %lu\n", drive->name, pc->scsi_cmd->serial_number);	} else if (rq->errors) {		if (log)			printk ("ide-scsi: %s: check condition for %lu\n", drive->name, pc->scsi_cmd->serial_number);		if (!idescsi_check_condition(drive, rq))			/* we started a request sense, so we'll be back, exit for now */			return 0;		pc->scsi_cmd->result = (CHECK_CONDITION << 1) | (DID_OK << 16);	} else {		pc->scsi_cmd->result = DID_OK << 16;		idescsi_transform_pc2 (drive, pc);		if (log) {			printk ("ide-scsi: %s: suc %lu", drive->name, pc->scsi_cmd->serial_number);			if (!test_bit(PC_WRITING, &pc->flags) && pc->actually_transferred && pc->actually_transferred <= 1024 && pc->buffer) {				printk(", rst = ");				scsi_buf = pc->scsi_cmd->request_buffer;				hexdump(scsi_buf, min_t(unsigned, 16, pc->scsi_cmd->request_bufflen));			} else printk("\n");		}	}	host = pc->scsi_cmd->device->host;	spin_lock_irqsave(host->host_lock, flags);	pc->done(pc->scsi_cmd);	spin_unlock_irqrestore(host->host_lock, flags);	kfree(pc);	kfree(rq);	scsi->pc = NULL;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/3256534776203d4d86fea508e66cfde2b06d39a2/ide-scsi.c/clean/drivers/scsi/ide-scsi.c