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.c37
1 files changed, 10 insertions, 27 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 2a3c8d498343..73ef6bf5fbcc 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -8,23 +8,6 @@
8 * Copyright (C) 2003-2004 Bartlomiej Zolnierkiewicz 8 * Copyright (C) 2003-2004 Bartlomiej Zolnierkiewicz
9 * 9 *
10 * The big the bad and the ugly. 10 * The big the bad and the ugly.
11 *
12 * Problems to be fixed because of BH interface or the lack therefore.
13 *
14 * Fill me in stupid !!!
15 *
16 * HOST:
17 * General refers to the Controller and Driver "pair".
18 * DATA HANDLER:
19 * Under the context of Linux it generally refers to an interrupt handler.
20 * However, it correctly describes the 'HOST'
21 * DATA BLOCK:
22 * The amount of data needed to be transfered as predefined in the
23 * setup of the device.
24 * STORAGE ATOMIC:
25 * The 'DATA BLOCK' associated to the 'DATA HANDLER', and can be as
26 * small as a single sector or as large as the entire command block
27 * request.
28 */ 11 */
29 12
30#include <linux/module.h> 13#include <linux/module.h>
@@ -695,9 +678,6 @@ int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors,
695 return ide_do_drive_cmd(drive, &rq, ide_wait); 678 return ide_do_drive_cmd(drive, &rq, ide_wait);
696} 679}
697 680
698/*
699 * FIXME : this needs to map into at taskfile. <andre@linux-ide.org>
700 */
701int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) 681int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
702{ 682{
703 int err = 0; 683 int err = 0;
@@ -761,9 +741,6 @@ static int ide_wait_cmd_task(ide_drive_t *drive, u8 *buf)
761 return ide_do_drive_cmd(drive, &rq, ide_wait); 741 return ide_do_drive_cmd(drive, &rq, ide_wait);
762} 742}
763 743
764/*
765 * FIXME : this needs to map into at taskfile. <andre@linux-ide.org>
766 */
767int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) 744int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
768{ 745{
769 void __user *p = (void __user *)arg; 746 void __user *p = (void __user *)arg;
@@ -860,9 +837,14 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
860 case TASKFILE_OUT_DMA: 837 case TASKFILE_OUT_DMA:
861 case TASKFILE_IN_DMAQ: 838 case TASKFILE_IN_DMAQ:
862 case TASKFILE_IN_DMA: 839 case TASKFILE_IN_DMA:
863 hwif->dma_setup(drive); 840 if (!drive->using_dma)
864 hwif->dma_exec_cmd(drive, taskfile->command); 841 break;
865 hwif->dma_start(drive); 842
843 if (!hwif->dma_setup(drive)) {
844 hwif->dma_exec_cmd(drive, taskfile->command);
845 hwif->dma_start(drive);
846 return ide_started;
847 }
866 break; 848 break;
867 849
868 default: 850 default:
@@ -876,7 +858,8 @@ ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task)
876 return task->prehandler(drive, task->rq); 858 return task->prehandler(drive, task->rq);
877 } 859 }
878 ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL); 860 ide_execute_command(drive, taskfile->command, task->handler, WAIT_WORSTCASE, NULL);
861 return ide_started;
879 } 862 }
880 863
881 return ide_started; 864 return ide_stopped;
882} 865}