set_current_state(TASK_INTERRUPTIBLE); schedule_timeout (HZ / OSST_POLL_PER_SEC); 
schedule_timeout_interruptible(HZ / OSST_POLL_PER_SEC); 
static int osst_recover_wait_frame(struct osst_tape * STp, struct scsi_request ** aSRpnt, int writing){	struct scsi_request   * SRpnt;	unsigned char		cmd[MAX_COMMAND_SIZE];	unsigned long   	startwait = jiffies;	int			retval    = 1;        char		      * name      = tape_name(STp);                                                                                                                                	if (writing) {		char	mybuf[24];		char  * olddata = STp->buffer->b_data;		int	oldsize = STp->buffer->buffer_size;		/* write zero fm then read pos - if shows write error, try to recover - if no progress, wait */		memset(cmd, 0, MAX_COMMAND_SIZE);		cmd[0] = WRITE_FILEMARKS;		cmd[1] = 1;		SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, DMA_NONE, STp->timeout,								MAX_RETRIES, 1);		while (retval && time_before (jiffies, startwait + 5*60*HZ)) {			if (STp->buffer->syscall_result && (SRpnt->sr_sense_buffer[2] & 0x0f) != 2) {				/* some failure - not just not-ready */				retval = osst_write_error_recovery(STp, aSRpnt, 0);				break;			}			set_current_state(TASK_INTERRUPTIBLE);			schedule_timeout (HZ / OSST_POLL_PER_SEC);			STp->buffer->b_data = mybuf; STp->buffer->buffer_size = 24;			memset(cmd, 0, MAX_COMMAND_SIZE);			cmd[0] = READ_POSITION;			SRpnt = osst_do_scsi(SRpnt, STp, cmd, 20, DMA_FROM_DEVICE, STp->timeout,										MAX_RETRIES, 1);			retval = ( STp->buffer->syscall_result || (STp->buffer)->b_data[15] > 25 );			STp->buffer->b_data = olddata; STp->buffer->buffer_size = oldsize;		}		if (retval)			printk(KERN_ERR "%s:E: Device did not succeed to write buffered data\n", name);	} else		/* TODO - figure out which error conditions can be handled */		if (STp->buffer->syscall_result)			printk(KERN_WARNING				"%s:W: Recover_wait_frame(read) cannot handle %02x:%02x:%02x\n", name,					(*aSRpnt)->sr_sense_buffer[ 2] & 0x0f,					(*aSRpnt)->sr_sense_buffer[12],					(*aSRpnt)->sr_sense_buffer[13]);	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a9a3047dd8ae43ff24caae5ec733a93df129568e/osst.c/clean/drivers/scsi/osst.c