]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ide: add "flagged" taskfile flags to struct ide_taskfile (v2)
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:28 +0000 (12:46 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 27 Mar 2009 11:46:28 +0000 (12:46 +0100)
* Add ->ftf_flags field to struct ide_taskfile
  and convert flags for TASKFILE ioctl to use it.

* Rename "flagged" taskfile flags:
  - IDE_TFLAG_FLAGGED -> IDE_FTFLAG_FLAGGED
  - IDE_TFLAG_FLAGGED_SET_IN_FLAGS -> IDE_FTFLAG_SET_IN_FLAGS
  - IDE_TFLAG_{OUT,IN}_DATA -> IDE_FTFLAG_{OUT,IN}_DATA

v2:
* Remember to fully update ide-h8300.c, scc_pata.c and tx493{8,9}ide.c
  (thanks to Stephen Rothwell for noticing).

There should be no functional changes caused by this patch.

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/at91_ide.c
drivers/ide/ide-h8300.c
drivers/ide/ide-io-std.c
drivers/ide/ide-taskfile.c
drivers/ide/ns87415.c
drivers/ide/scc_pata.c
drivers/ide/tx4938ide.c
drivers/ide/tx4939ide.c
include/linux/ide.h

index 4bd46d2d6b640725c561c1ecb5376e4e1e57f44e..6eabf9e31290268aa19c009fb508040cbf5fed6f 100644 (file)
@@ -192,10 +192,10 @@ static void at91_ide_tf_load(ide_drive_t *drive, ide_task_t *task)
        struct ide_taskfile *tf = &task->tf;
        u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
 
-       if (task->tf_flags & IDE_TFLAG_FLAGGED)
+       if (task->tf_flags & IDE_FTFLAG_FLAGGED)
                HIHI = 0xFF;
 
-       if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
+       if (task->tf_flags & IDE_FTFLAG_OUT_DATA) {
                u16 data = (tf->hob_data << 8) | tf->data;
 
                at91_ide_output_data(drive, NULL, &data, 2);
@@ -233,7 +233,7 @@ static void at91_ide_tf_read(ide_drive_t *drive, ide_task_t *task)
        struct ide_io_ports *io_ports = &hwif->io_ports;
        struct ide_taskfile *tf = &task->tf;
 
-       if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+       if (task->tf_flags & IDE_FTFLAG_IN_DATA) {
                u16 data;
 
                at91_ide_input_data(drive, NULL, &data, 2);
index 9270d3255ee04ebcb1fb732928847df5a9712201..11e937485bff2b6c77a7f6ef4c77474141d8b06d 100644 (file)
@@ -51,10 +51,10 @@ static void h8300_tf_load(ide_drive_t *drive, ide_task_t *task)
        struct ide_taskfile *tf = &task->tf;
        u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
 
-       if (task->tf_flags & IDE_TFLAG_FLAGGED)
+       if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
                HIHI = 0xFF;
 
-       if (task->tf_flags & IDE_TFLAG_OUT_DATA)
+       if (task->ftf_flags & IDE_FTFLAG_OUT_DATA)
                mm_outw((tf->hob_data << 8) | tf->data, io_ports->data_addr);
 
        if (task->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
@@ -90,7 +90,7 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task)
        struct ide_io_ports *io_ports = &hwif->io_ports;
        struct ide_taskfile *tf = &task->tf;
 
-       if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
                u16 data = mm_inw(io_ports->data_addr);
 
                tf->data = data & 0xff;
index 9a8da6744d93f2b63b992e590cd5e22f031e0955..cad59f0bfbce395d3b9ce284d2b16e4fb3864ca1 100644 (file)
@@ -96,10 +96,10 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
        else
                tf_outb = ide_outb;
 
-       if (task->tf_flags & IDE_TFLAG_FLAGGED)
+       if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
                HIHI = 0xFF;
 
-       if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
                u16 data = (tf->hob_data << 8) | tf->data;
 
                if (mmio)
@@ -153,7 +153,7 @@ void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
                tf_inb  = ide_inb;
        }
 
-       if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
                u16 data;
 
                if (mmio)
index 2461245820b7c985c777ad0868bdbff0f64606fa..02240a3ee0fb5eebb58e7f460df94f9b184a85a7 100644 (file)
@@ -73,8 +73,8 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
                }
        }
 
-       if (task->tf_flags & IDE_TFLAG_FLAGGED)
-               task->tf_flags |= IDE_TFLAG_FLAGGED_SET_IN_FLAGS;
+       if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
+               task->ftf_flags |= IDE_FTFLAG_SET_IN_FLAGS;
 
        memcpy(&hwif->task, task, sizeof(*task));
 
@@ -551,10 +551,10 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
                args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_IN_HOB);
 
        if (req_task->out_flags.all) {
-               args.tf_flags |= IDE_TFLAG_FLAGGED;
+               args.ftf_flags |= IDE_FTFLAG_FLAGGED;
 
                if (req_task->out_flags.b.data)
-                       args.tf_flags |= IDE_TFLAG_OUT_DATA;
+                       args.ftf_flags |= IDE_FTFLAG_OUT_DATA;
 
                if (req_task->out_flags.b.nsector_hob)
                        args.tf_flags |= IDE_TFLAG_OUT_HOB_NSECT;
@@ -582,7 +582,7 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
        }
 
        if (req_task->in_flags.b.data)
-               args.tf_flags |= IDE_TFLAG_IN_DATA;
+               args.ftf_flags |= IDE_FTFLAG_IN_DATA;
 
        switch(req_task->data_phase) {
                case TASKFILE_MULTI_OUT:
@@ -647,7 +647,7 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
        memcpy(req_task->hob_ports, &args.tf_array[0], HDIO_DRIVE_HOB_HDR_SIZE - 2);
        memcpy(req_task->io_ports, &args.tf_array[6], HDIO_DRIVE_TASK_HDR_SIZE);
 
-       if ((args.tf_flags & IDE_TFLAG_FLAGGED_SET_IN_FLAGS) &&
+       if ((args.ftf_flags & IDE_FTFLAG_SET_IN_FLAGS) &&
            req_task->in_flags.all == 0) {
                req_task->in_flags.all = IDE_TASKFILE_STD_IN_FLAGS;
                if (drive->dev_flags & IDE_DFLAG_LBA48)
index ea48a3ee8063960b3a2b204b99a8d9d639a9541f..159eb39c7932733db57e01b5a01a06bf5c8b3387 100644 (file)
@@ -66,7 +66,7 @@ static void superio_tf_read(ide_drive_t *drive, ide_task_t *task)
        struct ide_io_ports *io_ports = &drive->hwif->io_ports;
        struct ide_taskfile *tf = &task->tf;
 
-       if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
                u16 data = inw(io_ports->data_addr);
 
                tf->data = data & 0xff;
index ae965da5dde04817a601cb49f634cb2e7c9ab3ba..82929c725d82899d01cb11d52b72aad78d0e6435 100644 (file)
@@ -672,10 +672,10 @@ static void scc_tf_load(ide_drive_t *drive, ide_task_t *task)
        struct ide_taskfile *tf = &task->tf;
        u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
 
-       if (task->tf_flags & IDE_TFLAG_FLAGGED)
+       if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
                HIHI = 0xFF;
 
-       if (task->tf_flags & IDE_TFLAG_OUT_DATA)
+       if (task->ftf_flags & IDE_FTFLAG_OUT_DATA)
                out_be32((void *)io_ports->data_addr,
                         (tf->hob_data << 8) | tf->data);
 
@@ -711,7 +711,7 @@ static void scc_tf_read(ide_drive_t *drive, ide_task_t *task)
        struct ide_io_ports *io_ports = &drive->hwif->io_ports;
        struct ide_taskfile *tf = &task->tf;
 
-       if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
                u16 data = (u16)in_be32((void *)io_ports->data_addr);
 
                tf->data = data & 0xff;
index efade9e898b38d8b22a428136cb5e1c73be805c2..6b51e0c58af79c315aa527b2f9f27bcf949e2f0d 100644 (file)
@@ -89,10 +89,10 @@ static void tx4938ide_tf_load(ide_drive_t *drive, ide_task_t *task)
        struct ide_taskfile *tf = &task->tf;
        u8 HIHI = task->tf_flags & IDE_TFLAG_LBA48 ? 0xE0 : 0xEF;
 
-       if (task->tf_flags & IDE_TFLAG_FLAGGED)
+       if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
                HIHI = 0xFF;
 
-       if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
                u16 data = (tf->hob_data << 8) | tf->data;
 
                /* no endian swap */
@@ -132,7 +132,7 @@ static void tx4938ide_tf_read(ide_drive_t *drive, ide_task_t *task)
        struct ide_io_ports *io_ports = &hwif->io_ports;
        struct ide_taskfile *tf = &task->tf;
 
-       if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
                u16 data;
 
                /* no endian swap */
index fb037a5e70b3ed0a4396e04289497675dda60d48..f0033eb2e8859bfed87e81797203b295af2ea2c0 100644 (file)
@@ -474,10 +474,10 @@ static void tx4939ide_tf_load(ide_drive_t *drive, ide_task_t *task)
        struct ide_taskfile *tf = &task->tf;
        u8 HIHI = task->tf_flags & IDE_TFLAG_LBA48 ? 0xE0 : 0xEF;
 
-       if (task->tf_flags & IDE_TFLAG_FLAGGED)
+       if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
                HIHI = 0xFF;
 
-       if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
                u16 data = (tf->hob_data << 8) | tf->data;
 
                /* no endian swap */
@@ -519,7 +519,7 @@ static void tx4939ide_tf_read(ide_drive_t *drive, ide_task_t *task)
        struct ide_io_ports *io_ports = &hwif->io_ports;
        struct ide_taskfile *tf = &task->tf;
 
-       if (task->tf_flags & IDE_TFLAG_IN_DATA) {
+       if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
                u16 data;
 
                /* no endian swap */
index 3d4ba8e95d4aca3975ac1c059e6b36cc60b33884..675d4363ece48de903db626ff5084b5489b6733b 100644 (file)
@@ -234,56 +234,52 @@ typedef enum {
 
 enum {
        IDE_TFLAG_LBA48                 = (1 << 0),
-       IDE_TFLAG_FLAGGED               = (1 << 2),
-       IDE_TFLAG_OUT_DATA              = (1 << 3),
-       IDE_TFLAG_OUT_HOB_FEATURE       = (1 << 4),
-       IDE_TFLAG_OUT_HOB_NSECT         = (1 << 5),
-       IDE_TFLAG_OUT_HOB_LBAL          = (1 << 6),
-       IDE_TFLAG_OUT_HOB_LBAM          = (1 << 7),
-       IDE_TFLAG_OUT_HOB_LBAH          = (1 << 8),
+       IDE_TFLAG_OUT_HOB_FEATURE       = (1 << 1),
+       IDE_TFLAG_OUT_HOB_NSECT         = (1 << 2),
+       IDE_TFLAG_OUT_HOB_LBAL          = (1 << 3),
+       IDE_TFLAG_OUT_HOB_LBAM          = (1 << 4),
+       IDE_TFLAG_OUT_HOB_LBAH          = (1 << 5),
        IDE_TFLAG_OUT_HOB               = IDE_TFLAG_OUT_HOB_FEATURE |
                                          IDE_TFLAG_OUT_HOB_NSECT |
                                          IDE_TFLAG_OUT_HOB_LBAL |
                                          IDE_TFLAG_OUT_HOB_LBAM |
                                          IDE_TFLAG_OUT_HOB_LBAH,
-       IDE_TFLAG_OUT_FEATURE           = (1 << 9),
-       IDE_TFLAG_OUT_NSECT             = (1 << 10),
-       IDE_TFLAG_OUT_LBAL              = (1 << 11),
-       IDE_TFLAG_OUT_LBAM              = (1 << 12),
-       IDE_TFLAG_OUT_LBAH              = (1 << 13),
+       IDE_TFLAG_OUT_FEATURE           = (1 << 6),
+       IDE_TFLAG_OUT_NSECT             = (1 << 7),
+       IDE_TFLAG_OUT_LBAL              = (1 << 8),
+       IDE_TFLAG_OUT_LBAM              = (1 << 9),
+       IDE_TFLAG_OUT_LBAH              = (1 << 10),
        IDE_TFLAG_OUT_TF                = IDE_TFLAG_OUT_FEATURE |
                                          IDE_TFLAG_OUT_NSECT |
                                          IDE_TFLAG_OUT_LBAL |
                                          IDE_TFLAG_OUT_LBAM |
                                          IDE_TFLAG_OUT_LBAH,
-       IDE_TFLAG_OUT_DEVICE            = (1 << 14),
-       IDE_TFLAG_WRITE                 = (1 << 15),
-       IDE_TFLAG_FLAGGED_SET_IN_FLAGS  = (1 << 16),
-       IDE_TFLAG_IN_DATA               = (1 << 17),
-       IDE_TFLAG_CUSTOM_HANDLER        = (1 << 18),
-       IDE_TFLAG_DMA_PIO_FALLBACK      = (1 << 19),
-       IDE_TFLAG_IN_HOB_FEATURE        = (1 << 20),
-       IDE_TFLAG_IN_HOB_NSECT          = (1 << 21),
-       IDE_TFLAG_IN_HOB_LBAL           = (1 << 22),
-       IDE_TFLAG_IN_HOB_LBAM           = (1 << 23),
-       IDE_TFLAG_IN_HOB_LBAH           = (1 << 24),
+       IDE_TFLAG_OUT_DEVICE            = (1 << 11),
+       IDE_TFLAG_WRITE                 = (1 << 12),
+       IDE_TFLAG_CUSTOM_HANDLER        = (1 << 13),
+       IDE_TFLAG_DMA_PIO_FALLBACK      = (1 << 14),
+       IDE_TFLAG_IN_HOB_FEATURE        = (1 << 15),
+       IDE_TFLAG_IN_HOB_NSECT          = (1 << 16),
+       IDE_TFLAG_IN_HOB_LBAL           = (1 << 17),
+       IDE_TFLAG_IN_HOB_LBAM           = (1 << 18),
+       IDE_TFLAG_IN_HOB_LBAH           = (1 << 19),
        IDE_TFLAG_IN_HOB_LBA            = IDE_TFLAG_IN_HOB_LBAL |
                                          IDE_TFLAG_IN_HOB_LBAM |
                                          IDE_TFLAG_IN_HOB_LBAH,
        IDE_TFLAG_IN_HOB                = IDE_TFLAG_IN_HOB_FEATURE |
                                          IDE_TFLAG_IN_HOB_NSECT |
                                          IDE_TFLAG_IN_HOB_LBA,
-       IDE_TFLAG_IN_FEATURE            = (1 << 1),
-       IDE_TFLAG_IN_NSECT              = (1 << 25),
-       IDE_TFLAG_IN_LBAL               = (1 << 26),
-       IDE_TFLAG_IN_LBAM               = (1 << 27),
-       IDE_TFLAG_IN_LBAH               = (1 << 28),
+       IDE_TFLAG_IN_FEATURE            = (1 << 20),
+       IDE_TFLAG_IN_NSECT              = (1 << 21),
+       IDE_TFLAG_IN_LBAL               = (1 << 22),
+       IDE_TFLAG_IN_LBAM               = (1 << 23),
+       IDE_TFLAG_IN_LBAH               = (1 << 24),
        IDE_TFLAG_IN_LBA                = IDE_TFLAG_IN_LBAL |
                                          IDE_TFLAG_IN_LBAM |
                                          IDE_TFLAG_IN_LBAH,
        IDE_TFLAG_IN_TF                 = IDE_TFLAG_IN_NSECT |
                                          IDE_TFLAG_IN_LBA,
-       IDE_TFLAG_IN_DEVICE             = (1 << 29),
+       IDE_TFLAG_IN_DEVICE             = (1 << 25),
        IDE_TFLAG_HOB                   = IDE_TFLAG_OUT_HOB |
                                          IDE_TFLAG_IN_HOB,
        IDE_TFLAG_TF                    = IDE_TFLAG_OUT_TF |
@@ -291,9 +287,16 @@ enum {
        IDE_TFLAG_DEVICE                = IDE_TFLAG_OUT_DEVICE |
                                          IDE_TFLAG_IN_DEVICE,
        /* force 16-bit I/O operations */
-       IDE_TFLAG_IO_16BIT              = (1 << 30),
+       IDE_TFLAG_IO_16BIT              = (1 << 26),
        /* ide_task_t was allocated using kmalloc() */
-       IDE_TFLAG_DYN                   = (1 << 31),
+       IDE_TFLAG_DYN                   = (1 << 27),
+};
+
+enum {
+       IDE_FTFLAG_FLAGGED              = (1 << 0),
+       IDE_FTFLAG_SET_IN_FLAGS         = (1 << 1),
+       IDE_FTFLAG_OUT_DATA             = (1 << 2),
+       IDE_FTFLAG_IN_DATA              = (1 << 3),
 };
 
 struct ide_taskfile {
@@ -330,6 +333,7 @@ typedef struct ide_task_s {
                struct ide_taskfile     tf;
                u8                      tf_array[14];
        };
+       u8                      ftf_flags;      /* for TASKFILE ioctl */
        u32                     tf_flags;
        int                     data_phase;
        struct request          *rq;            /* copy of request */