Commit 3c655432 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide: add ide_hwif_t->data_phase

Use it for taskfile requests (only PIO/DMA for now) for storing
ide_task_t->data_phase of the active command.

Also add some missing task->data_phase assignments.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 64ad1bfd
...@@ -509,9 +509,11 @@ static u8 get_command(ide_drive_t *drive, struct request *rq, ide_task_t *task) ...@@ -509,9 +509,11 @@ static u8 get_command(ide_drive_t *drive, struct request *rq, ide_task_t *task)
if (dma) if (dma)
return lba48 ? WIN_READDMA_EXT : WIN_READDMA; return lba48 ? WIN_READDMA_EXT : WIN_READDMA;
if (drive->mult_count) { if (drive->mult_count) {
task->data_phase = TASKFILE_MULTI_IN;
task->handler = &task_mulin_intr; task->handler = &task_mulin_intr;
return lba48 ? WIN_MULTREAD_EXT : WIN_MULTREAD; return lba48 ? WIN_MULTREAD_EXT : WIN_MULTREAD;
} }
task->data_phase = TASKFILE_IN;
task->handler = &task_in_intr; task->handler = &task_in_intr;
return lba48 ? WIN_READ_EXT : WIN_READ; return lba48 ? WIN_READ_EXT : WIN_READ;
} else { } else {
...@@ -519,10 +521,12 @@ static u8 get_command(ide_drive_t *drive, struct request *rq, ide_task_t *task) ...@@ -519,10 +521,12 @@ static u8 get_command(ide_drive_t *drive, struct request *rq, ide_task_t *task)
if (dma) if (dma)
return lba48 ? WIN_WRITEDMA_EXT : WIN_WRITEDMA; return lba48 ? WIN_WRITEDMA_EXT : WIN_WRITEDMA;
if (drive->mult_count) { if (drive->mult_count) {
task->data_phase = TASKFILE_MULTI_OUT;
task->prehandler = &pre_task_mulout_intr; task->prehandler = &pre_task_mulout_intr;
task->handler = &task_mulout_intr; task->handler = &task_mulout_intr;
return lba48 ? WIN_MULTWRITE_EXT : WIN_MULTWRITE; return lba48 ? WIN_MULTWRITE_EXT : WIN_MULTWRITE;
} }
task->data_phase = TASKFILE_OUT;
task->prehandler = &pre_task_out_intr; task->prehandler = &pre_task_out_intr;
task->handler = &task_out_intr; task->handler = &task_out_intr;
return lba48 ? WIN_WRITE_EXT : WIN_WRITE; return lba48 ? WIN_WRITE_EXT : WIN_WRITE;
...@@ -556,6 +560,7 @@ static ide_startstop_t chs_rw_disk (ide_drive_t *drive, struct request *rq, unsi ...@@ -556,6 +560,7 @@ static ide_startstop_t chs_rw_disk (ide_drive_t *drive, struct request *rq, unsi
args.tfRegister[IDE_COMMAND_OFFSET] = get_command(drive, rq, &args); args.tfRegister[IDE_COMMAND_OFFSET] = get_command(drive, rq, &args);
args.rq = (struct request *) rq; args.rq = (struct request *) rq;
rq->special = (ide_task_t *)&args; rq->special = (ide_task_t *)&args;
drive->hwif->data_phase = args.data_phase;
return do_rw_taskfile(drive, &args); return do_rw_taskfile(drive, &args);
} }
...@@ -580,6 +585,7 @@ static ide_startstop_t lba_28_rw_disk (ide_drive_t *drive, struct request *rq, u ...@@ -580,6 +585,7 @@ static ide_startstop_t lba_28_rw_disk (ide_drive_t *drive, struct request *rq, u
args.tfRegister[IDE_COMMAND_OFFSET] = get_command(drive, rq, &args); args.tfRegister[IDE_COMMAND_OFFSET] = get_command(drive, rq, &args);
args.rq = (struct request *) rq; args.rq = (struct request *) rq;
rq->special = (ide_task_t *)&args; rq->special = (ide_task_t *)&args;
drive->hwif->data_phase = args.data_phase;
return do_rw_taskfile(drive, &args); return do_rw_taskfile(drive, &args);
} }
...@@ -615,6 +621,7 @@ static ide_startstop_t lba_48_rw_disk (ide_drive_t *drive, struct request *rq, u ...@@ -615,6 +621,7 @@ static ide_startstop_t lba_48_rw_disk (ide_drive_t *drive, struct request *rq, u
args.hobRegister[IDE_CONTROL_OFFSET_HOB]= (drive->ctl|0x80); args.hobRegister[IDE_CONTROL_OFFSET_HOB]= (drive->ctl|0x80);
args.rq = (struct request *) rq; args.rq = (struct request *) rq;
rq->special = (ide_task_t *)&args; rq->special = (ide_task_t *)&args;
drive->hwif->data_phase = args.data_phase;
return do_rw_taskfile(drive, &args); return do_rw_taskfile(drive, &args);
} }
...@@ -1156,6 +1163,7 @@ static int get_smart_values(ide_drive_t *drive, u8 *buf) ...@@ -1156,6 +1163,7 @@ static int get_smart_values(ide_drive_t *drive, u8 *buf)
args.tfRegister[IDE_HCYL_OFFSET] = SMART_HCYL_PASS; args.tfRegister[IDE_HCYL_OFFSET] = SMART_HCYL_PASS;
args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SMART; args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SMART;
args.command_type = IDE_DRIVE_TASK_IN; args.command_type = IDE_DRIVE_TASK_IN;
args.data_phase = TASKFILE_IN;
args.handler = &task_in_intr; args.handler = &task_in_intr;
(void) smart_enable(drive); (void) smart_enable(drive);
return ide_raw_taskfile(drive, &args, buf); return ide_raw_taskfile(drive, &args, buf);
......
...@@ -693,6 +693,8 @@ ide_startstop_t execute_drive_cmd (ide_drive_t *drive, struct request *rq) ...@@ -693,6 +693,8 @@ ide_startstop_t execute_drive_cmd (ide_drive_t *drive, struct request *rq)
if (!args) if (!args)
goto done; goto done;
hwif->data_phase = args->data_phase;
if (args->tf_out_flags.all != 0) if (args->tf_out_flags.all != 0)
return flagged_taskfile(drive, args); return flagged_taskfile(drive, args);
return do_rw_taskfile(drive, args); return do_rw_taskfile(drive, args);
......
...@@ -96,6 +96,7 @@ int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf) ...@@ -96,6 +96,7 @@ int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf)
else else
args.tfRegister[IDE_COMMAND_OFFSET] = WIN_PIDENTIFY; args.tfRegister[IDE_COMMAND_OFFSET] = WIN_PIDENTIFY;
args.command_type = IDE_DRIVE_TASK_IN; args.command_type = IDE_DRIVE_TASK_IN;
args.data_phase = TASKFILE_IN;
args.handler = &task_in_intr; args.handler = &task_in_intr;
return ide_raw_taskfile(drive, &args, buf); return ide_raw_taskfile(drive, &args, buf);
} }
......
...@@ -931,6 +931,9 @@ typedef struct hwif_s { ...@@ -931,6 +931,9 @@ typedef struct hwif_s {
int sg_dma_direction; /* dma transfer direction */ int sg_dma_direction; /* dma transfer direction */
int sg_dma_active; /* is it in use */ int sg_dma_active; /* is it in use */
/* data phase of the active command (currently only valid for PIO/DMA) */
int data_phase;
int mmio; /* hosts iomio (0) or custom (2) select */ int mmio; /* hosts iomio (0) or custom (2) select */
int rqsize; /* max sectors per request */ int rqsize; /* max sectors per request */
int irq; /* our irq number */ int irq; /* our irq number */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment