]> Pileus Git - ~andy/linux/blobdiff - drivers/ide/ide-io.c
ide: move ide_pktcmd_tf_load() to ide-atapi.c
[~andy/linux] / drivers / ide / ide-io.c
index cc163319dfbdbe1812cb00c6a9fb0e72b957eda6..4344b6119d77a7d144638b44c8923e32866993e5 100644 (file)
@@ -418,11 +418,14 @@ void ide_map_sg(ide_drive_t *drive, struct request *rq)
        ide_hwif_t *hwif = drive->hwif;
        struct scatterlist *sg = hwif->sg_table;
 
-       if (rq->cmd_type != REQ_TYPE_ATA_TASKFILE) {
-               hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
-       } else {
+       if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
                sg_init_one(sg, rq->buffer, rq->nr_sectors * SECTOR_SIZE);
                hwif->sg_nents = 1;
+       } else if (!rq->bio) {
+               sg_init_one(sg, rq->data, rq->data_len);
+               hwif->sg_nents = 1;
+       } else {
+               hwif->sg_nents = blk_rq_map_sg(drive->queue, rq, sg);
        }
 }
 
@@ -905,7 +908,7 @@ void ide_timer_expiry (unsigned long data)
        ide_drive_t     *uninitialized_var(drive);
        ide_handler_t   *handler;
        unsigned long   flags;
-       unsigned long   wait = -1;
+       int             wait = -1;
        int             plug_device = 0;
 
        spin_lock_irqsave(&hwif->lock, flags);
@@ -1159,6 +1162,7 @@ out_early:
 
        return irq_ret;
 }
+EXPORT_SYMBOL_GPL(ide_intr);
 
 /**
  *     ide_do_drive_cmd        -       issue IDE special command
@@ -1188,26 +1192,6 @@ void ide_do_drive_cmd(ide_drive_t *drive, struct request *rq)
 }
 EXPORT_SYMBOL(ide_do_drive_cmd);
 
-void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount, u8 dma)
-{
-       ide_hwif_t *hwif = drive->hwif;
-       ide_task_t task;
-
-       memset(&task, 0, sizeof(task));
-       task.tf_flags = IDE_TFLAG_OUT_LBAH | IDE_TFLAG_OUT_LBAM |
-                       IDE_TFLAG_OUT_FEATURE | tf_flags;
-       task.tf.feature = dma;          /* Use PIO/DMA */
-       task.tf.lbam    = bcount & 0xff;
-       task.tf.lbah    = (bcount >> 8) & 0xff;
-
-       ide_tf_dump(drive->name, &task.tf);
-       hwif->tp_ops->set_irq(hwif, 1);
-       SELECT_MASK(drive, 0);
-       hwif->tp_ops->tf_load(drive, &task);
-}
-
-EXPORT_SYMBOL_GPL(ide_pktcmd_tf_load);
-
 void ide_pad_transfer(ide_drive_t *drive, int write, int len)
 {
        ide_hwif_t *hwif = drive->hwif;