ide: set IDE_AFLAG_DRQ_INTERRUPT in do_identify()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Mon, 13 Oct 2008 19:39:43 +0000 (21:39 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Mon, 13 Oct 2008 19:39:43 +0000 (21:39 +0200)
Set IDE_AFLAG_DRQ_INTERRUPT in do_identify() instead of ATAPI
device drivers *_setup() methods.

While at it:
- use ata_id_cdb_intr()

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-cd.c
drivers/ide/ide-floppy.c
drivers/ide/ide-probe.c
drivers/ide/ide-tape.c
drivers/scsi/ide-scsi.c

index 84bc2413312ad56fa893f6f3a1bc557f1a44d93c..e6c2a2e66ed28eb5a1933cea504786175a31b42e 100644 (file)
@@ -1891,9 +1891,6 @@ static int ide_cdrom_setup(ide_drive_t *drive)
        drive->atapi_flags = IDE_AFLAG_MEDIA_CHANGED | IDE_AFLAG_NO_EJECT |
                       ide_cd_flags(id);
 
-       if ((id[ATA_ID_CONFIG] & 0x0060) == 0x20)
-               drive->atapi_flags |= IDE_AFLAG_DRQ_INTERRUPT;
-
        if ((drive->atapi_flags & IDE_AFLAG_VERTOS_300_SSD) &&
            fw_rev[4] == '1' && fw_rev[6] <= '2')
                drive->atapi_flags |= (IDE_AFLAG_TOCTRACKS_AS_BCD |
index 8c2b00941bd8b7da7dd1d2893c7c1fb75a205434..9f2c6b2af98fb635c0cea2ade5ec51d3d09d24f9 100644 (file)
@@ -578,16 +578,11 @@ static const struct ide_proc_devset idefloppy_settings[] = {
 static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy)
 {
        u16 *id = drive->id;
-       u8 gcw[2];
-
-       *((u16 *)&gcw) = id[ATA_ID_CONFIG];
 
        drive->pc_callback       = ide_floppy_callback;
        drive->pc_update_buffers = idefloppy_update_buffers;
        drive->pc_io_buffers     = ide_io_buffers;
 
-       if (((gcw[0] & 0x60) >> 5) == 1)
-               drive->atapi_flags |= IDE_AFLAG_DRQ_INTERRUPT;
        /*
         * We used to check revisions here. At this point however I'm giving up.
         * Just assume they are all broken, its easier.
index 3269cbf0e56d55498344728ac2a06601b16c9dd5..bce427ee08aa3286301ae8342e7a32b09abf5337 100644 (file)
@@ -206,6 +206,8 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
                drive->media = type;
                /* an ATAPI device ignores DRDY */
                drive->ready_stat = 0;
+               if (ata_id_cdb_intr(id))
+                       drive->atapi_flags |= IDE_AFLAG_DRQ_INTERRUPT;
                return;
        }
 
index 27665e3a41cbf8357c2eeaa75e9cc4ea0be2ad2f..25ac60f532730a0d19edfdf923f660f7c8b4e0dc 100644 (file)
@@ -2185,7 +2185,6 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
        unsigned long t;
        int speed;
        int buffer_size;
-       u8 gcw[2];
        u16 *ctl = (u16 *)&tape->caps[12];
 
        drive->pc_callback       = ide_tape_callback;
@@ -2212,12 +2211,6 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
        tape->name[2] = '0' + minor;
        tape->chrdev_dir = IDETAPE_DIR_NONE;
 
-       *((u16 *)&gcw) = drive->id[ATA_ID_CONFIG];
-
-       /* Command packet DRQ type */
-       if (((gcw[0] & 0x60) >> 5) == 1)
-               set_bit(IDE_AFLAG_DRQ_INTERRUPT, &drive->atapi_flags);
-
        idetape_get_inquiry_results(drive);
        idetape_get_mode_sense_results(drive);
        ide_tape_get_bsize_from_bdesc(drive);
index c2995972052ca8cd1be3b56e0cdbe9ab56565212..740bad435995268112883ff77c61af58e93ce8b6 100644 (file)
@@ -385,8 +385,6 @@ static const struct ide_proc_devset idescsi_settings[] = {
  */
 static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi)
 {
-       if ((drive->id[ATA_ID_CONFIG] & 0x0060) == 0x20)
-               set_bit(IDE_AFLAG_DRQ_INTERRUPT, &drive->atapi_flags);
        clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform);
 #if IDESCSI_DEBUG_LOG
        set_bit(IDESCSI_LOG_CMD, &scsi->log);