diff options
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r-- | drivers/ide/ide-taskfile.c | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index ab545ffa1549..cf55a48a7dd2 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -109,13 +109,15 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) | |||
109 | 109 | ||
110 | if ((task->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) { | 110 | if ((task->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) { |
111 | ide_tf_dump(drive->name, tf); | 111 | ide_tf_dump(drive->name, tf); |
112 | ide_set_irq(drive, 1); | ||
113 | SELECT_MASK(drive, 0); | ||
112 | hwif->tf_load(drive, task); | 114 | hwif->tf_load(drive, task); |
113 | } | 115 | } |
114 | 116 | ||
115 | switch (task->data_phase) { | 117 | switch (task->data_phase) { |
116 | case TASKFILE_MULTI_OUT: | 118 | case TASKFILE_MULTI_OUT: |
117 | case TASKFILE_OUT: | 119 | case TASKFILE_OUT: |
118 | hwif->OUTBSYNC(drive, tf->command, hwif->io_ports.command_addr); | 120 | hwif->OUTBSYNC(hwif, tf->command, hwif->io_ports.command_addr); |
119 | ndelay(400); /* FIXME */ | 121 | ndelay(400); /* FIXME */ |
120 | return pre_task_out_intr(drive, task->rq); | 122 | return pre_task_out_intr(drive, task->rq); |
121 | case TASKFILE_MULTI_IN: | 123 | case TASKFILE_MULTI_IN: |
@@ -492,11 +494,12 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, struct request *rq) | |||
492 | 494 | ||
493 | int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *task, u8 *buf, u16 nsect) | 495 | int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *task, u8 *buf, u16 nsect) |
494 | { | 496 | { |
495 | struct request rq; | 497 | struct request *rq; |
498 | int error; | ||
496 | 499 | ||
497 | blk_rq_init(NULL, &rq); | 500 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
498 | rq.cmd_type = REQ_TYPE_ATA_TASKFILE; | 501 | rq->cmd_type = REQ_TYPE_ATA_TASKFILE; |
499 | rq.buffer = buf; | 502 | rq->buffer = buf; |
500 | 503 | ||
501 | /* | 504 | /* |
502 | * (ks) We transfer currently only whole sectors. | 505 | * (ks) We transfer currently only whole sectors. |
@@ -504,16 +507,19 @@ int ide_raw_taskfile(ide_drive_t *drive, ide_task_t *task, u8 *buf, u16 nsect) | |||
504 | * if we would find a solution to transfer any size. | 507 | * if we would find a solution to transfer any size. |
505 | * To support special commands like READ LONG. | 508 | * To support special commands like READ LONG. |
506 | */ | 509 | */ |
507 | rq.hard_nr_sectors = rq.nr_sectors = nsect; | 510 | rq->hard_nr_sectors = rq->nr_sectors = nsect; |
508 | rq.hard_cur_sectors = rq.current_nr_sectors = nsect; | 511 | rq->hard_cur_sectors = rq->current_nr_sectors = nsect; |
509 | 512 | ||
510 | if (task->tf_flags & IDE_TFLAG_WRITE) | 513 | if (task->tf_flags & IDE_TFLAG_WRITE) |
511 | rq.cmd_flags |= REQ_RW; | 514 | rq->cmd_flags |= REQ_RW; |
512 | 515 | ||
513 | rq.special = task; | 516 | rq->special = task; |
514 | task->rq = &rq; | 517 | task->rq = rq; |
515 | 518 | ||
516 | return ide_do_drive_cmd(drive, &rq, ide_wait); | 519 | error = blk_execute_rq(drive->queue, NULL, rq, 0); |
520 | blk_put_request(rq); | ||
521 | |||
522 | return error; | ||
517 | } | 523 | } |
518 | 524 | ||
519 | EXPORT_SYMBOL(ide_raw_taskfile); | 525 | EXPORT_SYMBOL(ide_raw_taskfile); |
@@ -739,12 +745,14 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg) | |||
739 | struct hd_driveid *id = drive->id; | 745 | struct hd_driveid *id = drive->id; |
740 | 746 | ||
741 | if (NULL == (void *) arg) { | 747 | if (NULL == (void *) arg) { |
742 | struct request rq; | 748 | struct request *rq; |
743 | 749 | ||
744 | ide_init_drive_cmd(&rq); | 750 | rq = blk_get_request(drive->queue, READ, __GFP_WAIT); |
745 | rq.cmd_type = REQ_TYPE_ATA_TASKFILE; | 751 | rq->cmd_type = REQ_TYPE_ATA_TASKFILE; |
752 | err = blk_execute_rq(drive->queue, NULL, rq, 0); | ||
753 | blk_put_request(rq); | ||
746 | 754 | ||
747 | return ide_do_drive_cmd(drive, &rq, ide_wait); | 755 | return err; |
748 | } | 756 | } |
749 | 757 | ||
750 | if (copy_from_user(args, (void __user *)arg, 4)) | 758 | if (copy_from_user(args, (void __user *)arg, 4)) |