aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 5f6d01a4222c..835465d61f70 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -128,7 +128,6 @@ int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf)
128 args.tf.command = WIN_PIDENTIFY; 128 args.tf.command = WIN_PIDENTIFY;
129 args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; 129 args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
130 args.data_phase = TASKFILE_IN; 130 args.data_phase = TASKFILE_IN;
131 args.handler = task_in_intr;
132 return ide_raw_taskfile(drive, &args, buf, 1); 131 return ide_raw_taskfile(drive, &args, buf, 1);
133} 132}
134 133
@@ -151,6 +150,9 @@ static int inline task_dma_ok(ide_task_t *task)
151 return 0; 150 return 0;
152} 151}
153 152
153static ide_startstop_t task_no_data_intr(ide_drive_t *);
154static ide_startstop_t task_out_intr(ide_drive_t *);
155
154ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) 156ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
155{ 157{
156 ide_hwif_t *hwif = HWIF(drive); 158 ide_hwif_t *hwif = HWIF(drive);
@@ -173,12 +175,18 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
173 switch (task->data_phase) { 175 switch (task->data_phase) {
174 case TASKFILE_MULTI_OUT: 176 case TASKFILE_MULTI_OUT:
175 case TASKFILE_OUT: 177 case TASKFILE_OUT:
178 task->handler = task_out_intr;
176 hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG); 179 hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG);
177 ndelay(400); /* FIXME */ 180 ndelay(400); /* FIXME */
178 return pre_task_out_intr(drive, task->rq); 181 return pre_task_out_intr(drive, task->rq);
179 case TASKFILE_MULTI_IN: 182 case TASKFILE_MULTI_IN:
180 case TASKFILE_IN: 183 case TASKFILE_IN:
184 task->handler = task_in_intr;
185 /* fall-through */
181 case TASKFILE_NO_DATA: 186 case TASKFILE_NO_DATA:
187 /* WIN_{SPECIFY,RESTORE,SETMULT} use custom handlers */
188 if (task->handler == NULL)
189 task->handler = task_no_data_intr;
182 ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL); 190 ide_execute_command(drive, tf->command, task->handler, WAIT_WORSTCASE, NULL);
183 return ide_started; 191 return ide_started;
184 default: 192 default:
@@ -248,7 +256,7 @@ ide_startstop_t recal_intr (ide_drive_t *drive)
248/* 256/*
249 * Handler for commands without a data phase 257 * Handler for commands without a data phase
250 */ 258 */
251ide_startstop_t task_no_data_intr (ide_drive_t *drive) 259static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
252{ 260{
253 ide_task_t *args = HWGROUP(drive)->rq->special; 261 ide_task_t *args = HWGROUP(drive)->rq->special;
254 ide_hwif_t *hwif = HWIF(drive); 262 ide_hwif_t *hwif = HWIF(drive);
@@ -544,7 +552,6 @@ EXPORT_SYMBOL(ide_raw_taskfile);
544int ide_no_data_taskfile(ide_drive_t *drive, ide_task_t *task) 552int ide_no_data_taskfile(ide_drive_t *drive, ide_task_t *task)
545{ 553{
546 task->data_phase = TASKFILE_NO_DATA; 554 task->data_phase = TASKFILE_NO_DATA;
547 task->handler = task_no_data_intr;
548 555
549 return ide_raw_taskfile(drive, task, NULL, 0); 556 return ide_raw_taskfile(drive, task, NULL, 0);
550} 557}
@@ -667,7 +674,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
667 } 674 }
668 /* fall through */ 675 /* fall through */
669 case TASKFILE_OUT: 676 case TASKFILE_OUT:
670 args.handler = &task_out_intr;
671 /* fall through */ 677 /* fall through */
672 case TASKFILE_OUT_DMAQ: 678 case TASKFILE_OUT_DMAQ:
673 case TASKFILE_OUT_DMA: 679 case TASKFILE_OUT_DMA:
@@ -685,7 +691,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
685 } 691 }
686 /* fall through */ 692 /* fall through */
687 case TASKFILE_IN: 693 case TASKFILE_IN:
688 args.handler = &task_in_intr;
689 /* fall through */ 694 /* fall through */
690 case TASKFILE_IN_DMAQ: 695 case TASKFILE_IN_DMAQ:
691 case TASKFILE_IN_DMA: 696 case TASKFILE_IN_DMA:
@@ -693,7 +698,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
693 data_buf = inbuf; 698 data_buf = inbuf;
694 break; 699 break;
695 case TASKFILE_NO_DATA: 700 case TASKFILE_NO_DATA:
696 args.handler = &task_no_data_intr;
697 break; 701 break;
698 default: 702 default:
699 err = -EFAULT; 703 err = -EFAULT;