*	write and read all taskfile registers (except data) *	write and read the hob registers (sector,nsector,lcyl,hcyl) 
*	read all taskfile registers (except data) *	read the hob registers (sector, nsector, lcyl, hcyl) 
ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task){	ide_hwif_t *hwif	= HWIF(drive);	task_struct_t *taskfile	= (task_struct_t *) task->tfRegister;	hob_struct_t *hobfile	= (hob_struct_t *) task->hobRegister;	if (task->data_phase == TASKFILE_MULTI_IN ||	    task->data_phase == TASKFILE_MULTI_OUT) {		if (!drive->mult_count) {			printk(KERN_ERR "%s: multimode not set!\n", drive->name);			return ide_stopped;		}	}	/*	 * (ks) Check taskfile in/out flags.	 * If set, then execute as it is defined.	 * If not set, then define default settings.	 * The default values are:	 *	write and read all taskfile registers (except data) 	 *	write and read the hob registers (sector,nsector,lcyl,hcyl)	 */	if (task->tf_out_flags.all == 0) {		task->tf_out_flags.all = IDE_TASKFILE_STD_OUT_FLAGS;		if (drive->addressing == 1)			task->tf_out_flags.all |= (IDE_HOB_STD_OUT_FLAGS << 8);        }	if (task->tf_in_flags.all == 0) {		task->tf_in_flags.all = IDE_TASKFILE_STD_IN_FLAGS;		if (drive->addressing == 1)			task->tf_in_flags.all |= (IDE_HOB_STD_IN_FLAGS  << 8);        }	/* ALL Command Block Executions SHALL clear nIEN, unless otherwise */	if (IDE_CONTROL_REG)		/* clear nIEN */		hwif->OUTB(drive->ctl, IDE_CONTROL_REG);	SELECT_MASK(drive, 0);	if (task->tf_out_flags.b.data) {		u16 data =  taskfile->data + (hobfile->data << 8);		hwif->OUTW(data, IDE_DATA_REG);	}	/* (ks) send hob registers first */	if (task->tf_out_flags.b.nsector_hob)		hwif->OUTB(hobfile->sector_count, IDE_NSECTOR_REG);	if (task->tf_out_flags.b.sector_hob)		hwif->OUTB(hobfile->sector_number, IDE_SECTOR_REG);	if (task->tf_out_flags.b.lcyl_hob)		hwif->OUTB(hobfile->low_cylinder, IDE_LCYL_REG);	if (task->tf_out_flags.b.hcyl_hob)		hwif->OUTB(hobfile->high_cylinder, IDE_HCYL_REG);	/* (ks) Send now the standard registers */	if (task->tf_out_flags.b.error_feature)		hwif->OUTB(taskfile->feature, IDE_FEATURE_REG);	/* refers to number of sectors to transfer */	if (task->tf_out_flags.b.nsector)		hwif->OUTB(taskfile->sector_count, IDE_NSECTOR_REG);	/* refers to sector offset or start sector */	if (task->tf_out_flags.b.sector)		hwif->OUTB(taskfile->sector_number, IDE_SECTOR_REG);	if (task->tf_out_flags.b.lcyl)		hwif->OUTB(taskfile->low_cylinder, IDE_LCYL_REG);	if (task->tf_out_flags.b.hcyl)		hwif->OUTB(taskfile->high_cylinder, IDE_HCYL_REG);        /*	 * (ks) In the flagged taskfile approch, we will use all specified	 * registers and the register value will not be changed, except the	 * select bit (master/slave) in the drive_head register. We must make	 * sure that the desired drive is selected.	 */	hwif->OUTB(taskfile->device_head | drive->select.all, IDE_SELECT_REG);	switch(task->data_phase) {   	        case TASKFILE_OUT_DMAQ:		case TASKFILE_OUT_DMA:		case TASKFILE_IN_DMAQ:		case TASKFILE_IN_DMA:			hwif->dma_setup(drive);			hwif->dma_exec_cmd(drive, taskfile->command);			hwif->dma_start(drive);			break;	        default: 			if (task->handler == NULL)				return ide_stopped;			/* Issue the command */			if (task->prehandler) {				hwif->OUTBSYNC(drive, taskfile->command, IDE_COMMAND_REG);				ndelay(400);	/* FIXME */				return task->prehandler(drive, task->rq);			}			ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL);	}	return ide_started;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e07bc7096424b977e53a16d72ec02645389107ba/ide-taskfile.c/clean/drivers/ide/ide-taskfile.c