]> err.no Git - linux-2.6/blobdiff - drivers/ide/ide-taskfile.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6
[linux-2.6] / drivers / ide / ide-taskfile.c
index d32000109124942201ce6e0b712f0561b256e9e1..4e1da1c78cb51299ce359729a78b460e2c1d8c36 100644 (file)
@@ -1,11 +1,9 @@
 /*
- * linux/drivers/ide/ide-taskfile.c    Version 0.38    March 05, 2003
- *
- *  Copyright (C) 2000-2002    Michael Cornwell <cornwell@acm.org>
- *  Copyright (C) 2000-2002    Andre Hedrick <andre@linux-ide.org>
- *  Copyright (C) 2001-2002    Klaus Smolin
+ *  Copyright (C) 2000-2002       Michael Cornwell <cornwell@acm.org>
+ *  Copyright (C) 2000-2002       Andre Hedrick <andre@linux-ide.org>
+ *  Copyright (C) 2001-2002       Klaus Smolin
  *                                     IBM Storage Technology Division
- *  Copyright (C) 2003-2004    Bartlomiej Zolnierkiewicz
+ *  Copyright (C) 2003-2004, 2007  Bartlomiej Zolnierkiewicz
  *
  *  The big the bad and the ugly.
  */
@@ -757,6 +755,7 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
        u8 args[4], xfer_rate = 0;
        ide_task_t tfargs;
        struct ide_taskfile *tf = &tfargs.tf;
+       struct hd_driveid *id = drive->id;
 
        if (NULL == (void *) arg) {
                struct request rq;
@@ -794,10 +793,16 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
                        return -ENOMEM;
        }
 
-       if (set_transfer(drive, &tfargs)) {
+       if (tf->command == WIN_SETFEATURES &&
+           tf->feature == SETFEATURES_XFER &&
+           tf->nsect >= XFER_SW_DMA_0 &&
+           (id->dma_ultra || id->dma_mword || id->dma_1word)) {
                xfer_rate = args[1];
-               if (ide_ata66_check(drive, &tfargs))
+               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]);