]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-taskfile.c
ide: move ioctls handling to ide-ioctls.c
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-taskfile.c
index 7ffe9004a4d69137a6e4b788997873e6669daf48..487b18b3ebae9036d2f794291eb5026f3c59ae0a 100644 (file)
@@ -726,112 +726,3 @@ abort:
        return err;
 }
 #endif
-
-int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
-{
-       u8 *buf = NULL;
-       int bufsize = 0, err = 0;
-       u8 args[4], xfer_rate = 0;
-       ide_task_t tfargs;
-       struct ide_taskfile *tf = &tfargs.tf;
-       u16 *id = drive->id;
-
-       if (NULL == (void *) arg) {
-               struct request *rq;
-
-               rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
-               rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
-               err = blk_execute_rq(drive->queue, NULL, rq, 0);
-               blk_put_request(rq);
-
-               return err;
-       }
-
-       if (copy_from_user(args, (void __user *)arg, 4))
-               return -EFAULT;
-
-       memset(&tfargs, 0, sizeof(ide_task_t));
-       tf->feature = args[2];
-       if (args[0] == ATA_CMD_SMART) {
-               tf->nsect = args[3];
-               tf->lbal  = args[1];
-               tf->lbam  = 0x4f;
-               tf->lbah  = 0xc2;
-               tfargs.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_IN_NSECT;
-       } else {
-               tf->nsect = args[1];
-               tfargs.tf_flags = IDE_TFLAG_OUT_FEATURE |
-                                 IDE_TFLAG_OUT_NSECT | IDE_TFLAG_IN_NSECT;
-       }
-       tf->command = args[0];
-       tfargs.data_phase = args[3] ? TASKFILE_IN : TASKFILE_NO_DATA;
-
-       if (args[3]) {
-               tfargs.tf_flags |= IDE_TFLAG_IO_16BIT;
-               bufsize = SECTOR_SIZE * args[3];
-               buf = kzalloc(bufsize, GFP_KERNEL);
-               if (buf == NULL)
-                       return -ENOMEM;
-       }
-
-       if (tf->command == ATA_CMD_SET_FEATURES &&
-           tf->feature == SETFEATURES_XFER &&
-           tf->nsect >= XFER_SW_DMA_0 &&
-           (id[ATA_ID_UDMA_MODES] ||
-            id[ATA_ID_MWDMA_MODES] ||
-            id[ATA_ID_SWDMA_MODES])) {
-               xfer_rate = args[1];
-               if (tf->nsect > XFER_UDMA_2 && !eighty_ninty_three(drive)) {
-                       printk(KERN_WARNING "%s: UDMA speeds >UDMA33 cannot "
-                                           "be set\n", drive->name);
-                       goto abort;
-               }
-       }
-
-       err = ide_raw_taskfile(drive, &tfargs, buf, args[3]);
-
-       args[0] = tf->status;
-       args[1] = tf->error;
-       args[2] = tf->nsect;
-
-       if (!err && xfer_rate) {
-               /* active-retuning-calls future */
-               ide_set_xfer_rate(drive, xfer_rate);
-               ide_driveid_update(drive);
-       }
-abort:
-       if (copy_to_user((void __user *)arg, &args, 4))
-               err = -EFAULT;
-       if (buf) {
-               if (copy_to_user((void __user *)(arg + 4), buf, bufsize))
-                       err = -EFAULT;
-               kfree(buf);
-       }
-       return err;
-}
-
-int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
-{
-       void __user *p = (void __user *)arg;
-       int err = 0;
-       u8 args[7];
-       ide_task_t task;
-
-       if (copy_from_user(args, p, 7))
-               return -EFAULT;
-
-       memset(&task, 0, sizeof(task));
-       memcpy(&task.tf_array[7], &args[1], 6);
-       task.tf.command = args[0];
-       task.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
-
-       err = ide_no_data_taskfile(drive, &task);
-
-       args[0] = task.tf.command;
-       memcpy(&args[1], &task.tf_array[7], 6);
-
-       if (copy_to_user(p, args, 7))
-               err = -EFAULT;
-
-       return err;
-}