diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-07-23 13:56:02 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:56:02 -0400 |
commit | 570f89ea5f3ee93756dc2293b83bdfedb8d35348 (patch) | |
tree | 60fa058726e1900cd3066244b62183c98086a970 /drivers/ide/ide-cd.c | |
parent | ac77ef8b03677c8ae8afe77bccc5f6a969193a79 (diff) |
ide-cd: convert to using the new atapi_flags
There should be no functionality change resulting from this patch.
[bart: IDE_FLAG_* -> IDE_AFLAG_*, dev_flags -> atapi_flags]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 108 |
1 files changed, 52 insertions, 56 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index d9798ca433ba..52fe3b95dc92 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -85,10 +85,8 @@ static void ide_cd_put(struct cdrom_info *cd) | |||
85 | /* Mark that we've seen a media change and invalidate our internal buffers. */ | 85 | /* Mark that we've seen a media change and invalidate our internal buffers. */ |
86 | static void cdrom_saw_media_change(ide_drive_t *drive) | 86 | static void cdrom_saw_media_change(ide_drive_t *drive) |
87 | { | 87 | { |
88 | struct cdrom_info *cd = drive->driver_data; | 88 | drive->atapi_flags |= IDE_AFLAG_MEDIA_CHANGED; |
89 | 89 | drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID; | |
90 | cd->cd_flags |= IDE_CD_FLAG_MEDIA_CHANGED; | ||
91 | cd->cd_flags &= ~IDE_CD_FLAG_TOC_VALID; | ||
92 | } | 90 | } |
93 | 91 | ||
94 | static int cdrom_log_sense(ide_drive_t *drive, struct request *rq, | 92 | static int cdrom_log_sense(ide_drive_t *drive, struct request *rq, |
@@ -529,7 +527,7 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive, | |||
529 | ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL, | 527 | ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL, |
530 | xferlen, info->dma); | 528 | xferlen, info->dma); |
531 | 529 | ||
532 | if (info->cd_flags & IDE_CD_FLAG_DRQ_INTERRUPT) { | 530 | if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) { |
533 | /* waiting for CDB interrupt, not DMA yet. */ | 531 | /* waiting for CDB interrupt, not DMA yet. */ |
534 | if (info->dma) | 532 | if (info->dma) |
535 | drive->waiting_for_dma = 0; | 533 | drive->waiting_for_dma = 0; |
@@ -561,7 +559,7 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive, | |||
561 | struct cdrom_info *info = drive->driver_data; | 559 | struct cdrom_info *info = drive->driver_data; |
562 | ide_startstop_t startstop; | 560 | ide_startstop_t startstop; |
563 | 561 | ||
564 | if (info->cd_flags & IDE_CD_FLAG_DRQ_INTERRUPT) { | 562 | if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) { |
565 | /* | 563 | /* |
566 | * Here we should have been called after receiving an interrupt | 564 | * Here we should have been called after receiving an interrupt |
567 | * from the device. DRQ should how be set. | 565 | * from the device. DRQ should how be set. |
@@ -648,20 +646,18 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
648 | */ | 646 | */ |
649 | static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) | 647 | static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) |
650 | { | 648 | { |
651 | struct cdrom_info *cd = drive->driver_data; | ||
652 | |||
653 | if ((len % SECTOR_SIZE) == 0) | 649 | if ((len % SECTOR_SIZE) == 0) |
654 | return 0; | 650 | return 0; |
655 | 651 | ||
656 | printk(KERN_ERR "%s: %s: Bad transfer size %d\n", | 652 | printk(KERN_ERR "%s: %s: Bad transfer size %d\n", |
657 | drive->name, __func__, len); | 653 | drive->name, __func__, len); |
658 | 654 | ||
659 | if (cd->cd_flags & IDE_CD_FLAG_LIMIT_NFRAMES) | 655 | if (drive->atapi_flags & IDE_AFLAG_LIMIT_NFRAMES) |
660 | printk(KERN_ERR " This drive is not supported by " | 656 | printk(KERN_ERR " This drive is not supported by " |
661 | "this version of the driver\n"); | 657 | "this version of the driver\n"); |
662 | else { | 658 | else { |
663 | printk(KERN_ERR " Trying to limit transfer sizes\n"); | 659 | printk(KERN_ERR " Trying to limit transfer sizes\n"); |
664 | cd->cd_flags |= IDE_CD_FLAG_LIMIT_NFRAMES; | 660 | drive->atapi_flags |= IDE_AFLAG_LIMIT_NFRAMES; |
665 | } | 661 | } |
666 | 662 | ||
667 | return 1; | 663 | return 1; |
@@ -738,7 +734,7 @@ static ide_startstop_t cdrom_seek_intr(ide_drive_t *drive) | |||
738 | if (cdrom_decode_status(drive, 0, &stat)) | 734 | if (cdrom_decode_status(drive, 0, &stat)) |
739 | return ide_stopped; | 735 | return ide_stopped; |
740 | 736 | ||
741 | info->cd_flags |= IDE_CD_FLAG_SEEKING; | 737 | drive->atapi_flags |= IDE_AFLAG_SEEKING; |
742 | 738 | ||
743 | if (retry && time_after(jiffies, info->start_seek + IDECD_SEEK_TIMER)) { | 739 | if (retry && time_after(jiffies, info->start_seek + IDECD_SEEK_TIMER)) { |
744 | if (--retry == 0) | 740 | if (--retry == 0) |
@@ -1197,7 +1193,7 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
1197 | int xferlen; | 1193 | int xferlen; |
1198 | 1194 | ||
1199 | if (blk_fs_request(rq)) { | 1195 | if (blk_fs_request(rq)) { |
1200 | if (info->cd_flags & IDE_CD_FLAG_SEEKING) { | 1196 | if (drive->atapi_flags & IDE_AFLAG_SEEKING) { |
1201 | ide_hwif_t *hwif = drive->hwif; | 1197 | ide_hwif_t *hwif = drive->hwif; |
1202 | unsigned long elapsed = jiffies - info->start_seek; | 1198 | unsigned long elapsed = jiffies - info->start_seek; |
1203 | int stat = hwif->tp_ops->read_status(hwif); | 1199 | int stat = hwif->tp_ops->read_status(hwif); |
@@ -1211,7 +1207,7 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
1211 | printk(KERN_ERR "%s: DSC timeout\n", | 1207 | printk(KERN_ERR "%s: DSC timeout\n", |
1212 | drive->name); | 1208 | drive->name); |
1213 | } | 1209 | } |
1214 | info->cd_flags &= ~IDE_CD_FLAG_SEEKING; | 1210 | drive->atapi_flags &= ~IDE_AFLAG_SEEKING; |
1215 | } | 1211 | } |
1216 | if (rq_data_dir(rq) == READ && | 1212 | if (rq_data_dir(rq) == READ && |
1217 | IDE_LARGE_SEEK(info->last_block, block, | 1213 | IDE_LARGE_SEEK(info->last_block, block, |
@@ -1369,7 +1365,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
1369 | */ | 1365 | */ |
1370 | (void) cdrom_check_status(drive, sense); | 1366 | (void) cdrom_check_status(drive, sense); |
1371 | 1367 | ||
1372 | if (info->cd_flags & IDE_CD_FLAG_TOC_VALID) | 1368 | if (drive->atapi_flags & IDE_AFLAG_TOC_VALID) |
1373 | return 0; | 1369 | return 0; |
1374 | 1370 | ||
1375 | /* try to get the total cdrom capacity and sector size */ | 1371 | /* try to get the total cdrom capacity and sector size */ |
@@ -1391,7 +1387,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
1391 | if (stat) | 1387 | if (stat) |
1392 | return stat; | 1388 | return stat; |
1393 | 1389 | ||
1394 | if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { | 1390 | if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) { |
1395 | toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); | 1391 | toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); |
1396 | toc->hdr.last_track = BCD2BIN(toc->hdr.last_track); | 1392 | toc->hdr.last_track = BCD2BIN(toc->hdr.last_track); |
1397 | } | 1393 | } |
@@ -1432,7 +1428,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
1432 | if (stat) | 1428 | if (stat) |
1433 | return stat; | 1429 | return stat; |
1434 | 1430 | ||
1435 | if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { | 1431 | if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) { |
1436 | toc->hdr.first_track = (u8)BIN2BCD(CDROM_LEADOUT); | 1432 | toc->hdr.first_track = (u8)BIN2BCD(CDROM_LEADOUT); |
1437 | toc->hdr.last_track = (u8)BIN2BCD(CDROM_LEADOUT); | 1433 | toc->hdr.last_track = (u8)BIN2BCD(CDROM_LEADOUT); |
1438 | } else { | 1434 | } else { |
@@ -1446,14 +1442,14 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
1446 | 1442 | ||
1447 | toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length); | 1443 | toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length); |
1448 | 1444 | ||
1449 | if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { | 1445 | if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) { |
1450 | toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); | 1446 | toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); |
1451 | toc->hdr.last_track = BCD2BIN(toc->hdr.last_track); | 1447 | toc->hdr.last_track = BCD2BIN(toc->hdr.last_track); |
1452 | } | 1448 | } |
1453 | 1449 | ||
1454 | for (i = 0; i <= ntracks; i++) { | 1450 | for (i = 0; i <= ntracks; i++) { |
1455 | if (info->cd_flags & IDE_CD_FLAG_TOCADDR_AS_BCD) { | 1451 | if (drive->atapi_flags & IDE_AFLAG_TOCADDR_AS_BCD) { |
1456 | if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) | 1452 | if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) |
1457 | toc->ent[i].track = BCD2BIN(toc->ent[i].track); | 1453 | toc->ent[i].track = BCD2BIN(toc->ent[i].track); |
1458 | msf_from_bcd(&toc->ent[i].addr.msf); | 1454 | msf_from_bcd(&toc->ent[i].addr.msf); |
1459 | } | 1455 | } |
@@ -1476,7 +1472,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
1476 | toc->last_session_lba = msf_to_lba(0, 2, 0); /* 0m 2s 0f */ | 1472 | toc->last_session_lba = msf_to_lba(0, 2, 0); /* 0m 2s 0f */ |
1477 | } | 1473 | } |
1478 | 1474 | ||
1479 | if (info->cd_flags & IDE_CD_FLAG_TOCADDR_AS_BCD) { | 1475 | if (drive->atapi_flags & IDE_AFLAG_TOCADDR_AS_BCD) { |
1480 | /* re-read multisession information using MSF format */ | 1476 | /* re-read multisession information using MSF format */ |
1481 | stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp, | 1477 | stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp, |
1482 | sizeof(ms_tmp), sense); | 1478 | sizeof(ms_tmp), sense); |
@@ -1500,7 +1496,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
1500 | } | 1496 | } |
1501 | 1497 | ||
1502 | /* Remember that we've read this stuff. */ | 1498 | /* Remember that we've read this stuff. */ |
1503 | info->cd_flags |= IDE_CD_FLAG_TOC_VALID; | 1499 | drive->atapi_flags |= IDE_AFLAG_TOC_VALID; |
1504 | 1500 | ||
1505 | return 0; | 1501 | return 0; |
1506 | } | 1502 | } |
@@ -1512,7 +1508,7 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, u8 *buf) | |||
1512 | struct packet_command cgc; | 1508 | struct packet_command cgc; |
1513 | int stat, attempts = 3, size = ATAPI_CAPABILITIES_PAGE_SIZE; | 1509 | int stat, attempts = 3, size = ATAPI_CAPABILITIES_PAGE_SIZE; |
1514 | 1510 | ||
1515 | if ((info->cd_flags & IDE_CD_FLAG_FULL_CAPS_PAGE) == 0) | 1511 | if ((drive->atapi_flags & IDE_AFLAG_FULL_CAPS_PAGE) == 0) |
1516 | size -= ATAPI_CAPABILITIES_PAGE_PAD_SIZE; | 1512 | size -= ATAPI_CAPABILITIES_PAGE_PAD_SIZE; |
1517 | 1513 | ||
1518 | init_cdrom_command(&cgc, buf, size, CGC_DATA_UNKNOWN); | 1514 | init_cdrom_command(&cgc, buf, size, CGC_DATA_UNKNOWN); |
@@ -1533,7 +1529,7 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf) | |||
1533 | curspeed = *(u16 *)&buf[8 + 14]; | 1529 | curspeed = *(u16 *)&buf[8 + 14]; |
1534 | maxspeed = *(u16 *)&buf[8 + 8]; | 1530 | maxspeed = *(u16 *)&buf[8 + 8]; |
1535 | 1531 | ||
1536 | if (cd->cd_flags & IDE_CD_FLAG_LE_SPEED_FIELDS) { | 1532 | if (drive->atapi_flags & IDE_AFLAG_LE_SPEED_FIELDS) { |
1537 | curspeed = le16_to_cpu(curspeed); | 1533 | curspeed = le16_to_cpu(curspeed); |
1538 | maxspeed = le16_to_cpu(maxspeed); | 1534 | maxspeed = le16_to_cpu(maxspeed); |
1539 | } else { | 1535 | } else { |
@@ -1579,7 +1575,7 @@ static int ide_cdrom_register(ide_drive_t *drive, int nslots) | |||
1579 | devinfo->handle = drive; | 1575 | devinfo->handle = drive; |
1580 | strcpy(devinfo->name, drive->name); | 1576 | strcpy(devinfo->name, drive->name); |
1581 | 1577 | ||
1582 | if (info->cd_flags & IDE_CD_FLAG_NO_SPEED_SELECT) | 1578 | if (drive->atapi_flags & IDE_AFLAG_NO_SPEED_SELECT) |
1583 | devinfo->mask |= CDC_SELECT_SPEED; | 1579 | devinfo->mask |= CDC_SELECT_SPEED; |
1584 | 1580 | ||
1585 | devinfo->disk = info->disk; | 1581 | devinfo->disk = info->disk; |
@@ -1605,8 +1601,8 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive) | |||
1605 | return nslots; | 1601 | return nslots; |
1606 | } | 1602 | } |
1607 | 1603 | ||
1608 | if (cd->cd_flags & IDE_CD_FLAG_PRE_ATAPI12) { | 1604 | if (drive->atapi_flags & IDE_AFLAG_PRE_ATAPI12) { |
1609 | cd->cd_flags &= ~IDE_CD_FLAG_NO_EJECT; | 1605 | drive->atapi_flags &= ~IDE_AFLAG_NO_EJECT; |
1610 | cdi->mask &= ~CDC_PLAY_AUDIO; | 1606 | cdi->mask &= ~CDC_PLAY_AUDIO; |
1611 | return nslots; | 1607 | return nslots; |
1612 | } | 1608 | } |
@@ -1624,9 +1620,9 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive) | |||
1624 | return 0; | 1620 | return 0; |
1625 | 1621 | ||
1626 | if ((buf[8 + 6] & 0x01) == 0) | 1622 | if ((buf[8 + 6] & 0x01) == 0) |
1627 | cd->cd_flags |= IDE_CD_FLAG_NO_DOORLOCK; | 1623 | drive->atapi_flags |= IDE_AFLAG_NO_DOORLOCK; |
1628 | if (buf[8 + 6] & 0x08) | 1624 | if (buf[8 + 6] & 0x08) |
1629 | cd->cd_flags &= ~IDE_CD_FLAG_NO_EJECT; | 1625 | drive->atapi_flags &= ~IDE_AFLAG_NO_EJECT; |
1630 | if (buf[8 + 3] & 0x01) | 1626 | if (buf[8 + 3] & 0x01) |
1631 | cdi->mask &= ~CDC_CD_R; | 1627 | cdi->mask &= ~CDC_CD_R; |
1632 | if (buf[8 + 3] & 0x02) | 1628 | if (buf[8 + 3] & 0x02) |
@@ -1637,7 +1633,7 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive) | |||
1637 | cdi->mask &= ~(CDC_DVD_RAM | CDC_RAM); | 1633 | cdi->mask &= ~(CDC_DVD_RAM | CDC_RAM); |
1638 | if (buf[8 + 3] & 0x10) | 1634 | if (buf[8 + 3] & 0x10) |
1639 | cdi->mask &= ~CDC_DVD_R; | 1635 | cdi->mask &= ~CDC_DVD_R; |
1640 | if ((buf[8 + 4] & 0x01) || (cd->cd_flags & IDE_CD_FLAG_PLAY_AUDIO_OK)) | 1636 | if ((buf[8 + 4] & 0x01) || (drive->atapi_flags & IDE_AFLAG_PLAY_AUDIO_OK)) |
1641 | cdi->mask &= ~CDC_PLAY_AUDIO; | 1637 | cdi->mask &= ~CDC_PLAY_AUDIO; |
1642 | 1638 | ||
1643 | mechtype = buf[8 + 6] >> 5; | 1639 | mechtype = buf[8 + 6] >> 5; |
@@ -1802,43 +1798,43 @@ static inline void ide_cdrom_add_settings(ide_drive_t *drive) { ; } | |||
1802 | 1798 | ||
1803 | static const struct cd_list_entry ide_cd_quirks_list[] = { | 1799 | static const struct cd_list_entry ide_cd_quirks_list[] = { |
1804 | /* Limit transfer size per interrupt. */ | 1800 | /* Limit transfer size per interrupt. */ |
1805 | { "SAMSUNG CD-ROM SCR-2430", NULL, IDE_CD_FLAG_LIMIT_NFRAMES }, | 1801 | { "SAMSUNG CD-ROM SCR-2430", NULL, IDE_AFLAG_LIMIT_NFRAMES }, |
1806 | { "SAMSUNG CD-ROM SCR-2432", NULL, IDE_CD_FLAG_LIMIT_NFRAMES }, | 1802 | { "SAMSUNG CD-ROM SCR-2432", NULL, IDE_AFLAG_LIMIT_NFRAMES }, |
1807 | /* SCR-3231 doesn't support the SET_CD_SPEED command. */ | 1803 | /* SCR-3231 doesn't support the SET_CD_SPEED command. */ |
1808 | { "SAMSUNG CD-ROM SCR-3231", NULL, IDE_CD_FLAG_NO_SPEED_SELECT }, | 1804 | { "SAMSUNG CD-ROM SCR-3231", NULL, IDE_AFLAG_NO_SPEED_SELECT }, |
1809 | /* Old NEC260 (not R) was released before ATAPI 1.2 spec. */ | 1805 | /* Old NEC260 (not R) was released before ATAPI 1.2 spec. */ |
1810 | { "NEC CD-ROM DRIVE:260", "1.01", IDE_CD_FLAG_TOCADDR_AS_BCD | | 1806 | { "NEC CD-ROM DRIVE:260", "1.01", IDE_AFLAG_TOCADDR_AS_BCD | |
1811 | IDE_CD_FLAG_PRE_ATAPI12, }, | 1807 | IDE_AFLAG_PRE_ATAPI12, }, |
1812 | /* Vertos 300, some versions of this drive like to talk BCD. */ | 1808 | /* Vertos 300, some versions of this drive like to talk BCD. */ |
1813 | { "V003S0DS", NULL, IDE_CD_FLAG_VERTOS_300_SSD, }, | 1809 | { "V003S0DS", NULL, IDE_AFLAG_VERTOS_300_SSD, }, |
1814 | /* Vertos 600 ESD. */ | 1810 | /* Vertos 600 ESD. */ |
1815 | { "V006E0DS", NULL, IDE_CD_FLAG_VERTOS_600_ESD, }, | 1811 | { "V006E0DS", NULL, IDE_AFLAG_VERTOS_600_ESD, }, |
1816 | /* | 1812 | /* |
1817 | * Sanyo 3 CD changer uses a non-standard command for CD changing | 1813 | * Sanyo 3 CD changer uses a non-standard command for CD changing |
1818 | * (by default standard ATAPI support for CD changers is used). | 1814 | * (by default standard ATAPI support for CD changers is used). |
1819 | */ | 1815 | */ |
1820 | { "CD-ROM CDR-C3 G", NULL, IDE_CD_FLAG_SANYO_3CD }, | 1816 | { "CD-ROM CDR-C3 G", NULL, IDE_AFLAG_SANYO_3CD }, |
1821 | { "CD-ROM CDR-C3G", NULL, IDE_CD_FLAG_SANYO_3CD }, | 1817 | { "CD-ROM CDR-C3G", NULL, IDE_AFLAG_SANYO_3CD }, |
1822 | { "CD-ROM CDR_C36", NULL, IDE_CD_FLAG_SANYO_3CD }, | 1818 | { "CD-ROM CDR_C36", NULL, IDE_AFLAG_SANYO_3CD }, |
1823 | /* Stingray 8X CD-ROM. */ | 1819 | /* Stingray 8X CD-ROM. */ |
1824 | { "STINGRAY 8422 IDE 8X CD-ROM 7-27-95", NULL, IDE_CD_FLAG_PRE_ATAPI12}, | 1820 | { "STINGRAY 8422 IDE 8X CD-ROM 7-27-95", NULL, IDE_AFLAG_PRE_ATAPI12 }, |
1825 | /* | 1821 | /* |
1826 | * ACER 50X CD-ROM and WPI 32X CD-ROM require the full spec length | 1822 | * ACER 50X CD-ROM and WPI 32X CD-ROM require the full spec length |
1827 | * mode sense page capabilities size, but older drives break. | 1823 | * mode sense page capabilities size, but older drives break. |
1828 | */ | 1824 | */ |
1829 | { "ATAPI CD ROM DRIVE 50X MAX", NULL, IDE_CD_FLAG_FULL_CAPS_PAGE }, | 1825 | { "ATAPI CD ROM DRIVE 50X MAX", NULL, IDE_AFLAG_FULL_CAPS_PAGE }, |
1830 | { "WPI CDS-32X", NULL, IDE_CD_FLAG_FULL_CAPS_PAGE }, | 1826 | { "WPI CDS-32X", NULL, IDE_AFLAG_FULL_CAPS_PAGE }, |
1831 | /* ACER/AOpen 24X CD-ROM has the speed fields byte-swapped. */ | 1827 | /* ACER/AOpen 24X CD-ROM has the speed fields byte-swapped. */ |
1832 | { "", "241N", IDE_CD_FLAG_LE_SPEED_FIELDS }, | 1828 | { "", "241N", IDE_AFLAG_LE_SPEED_FIELDS }, |
1833 | /* | 1829 | /* |
1834 | * Some drives used by Apple don't advertise audio play | 1830 | * Some drives used by Apple don't advertise audio play |
1835 | * but they do support reading TOC & audio datas. | 1831 | * but they do support reading TOC & audio datas. |
1836 | */ | 1832 | */ |
1837 | { "MATSHITADVD-ROM SR-8187", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK }, | 1833 | { "MATSHITADVD-ROM SR-8187", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, |
1838 | { "MATSHITADVD-ROM SR-8186", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK }, | 1834 | { "MATSHITADVD-ROM SR-8186", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, |
1839 | { "MATSHITADVD-ROM SR-8176", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK }, | 1835 | { "MATSHITADVD-ROM SR-8176", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, |
1840 | { "MATSHITADVD-ROM SR-8174", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK }, | 1836 | { "MATSHITADVD-ROM SR-8174", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, |
1841 | { "Optiarc DVD RW AD-5200A", NULL, IDE_CD_FLAG_PLAY_AUDIO_OK }, | 1837 | { "Optiarc DVD RW AD-5200A", NULL, IDE_AFLAG_PLAY_AUDIO_OK }, |
1842 | { NULL, NULL, 0 } | 1838 | { NULL, NULL, 0 } |
1843 | }; | 1839 | }; |
1844 | 1840 | ||
@@ -1873,20 +1869,20 @@ static int ide_cdrom_setup(ide_drive_t *drive) | |||
1873 | 1869 | ||
1874 | drive->special.all = 0; | 1870 | drive->special.all = 0; |
1875 | 1871 | ||
1876 | cd->cd_flags = IDE_CD_FLAG_MEDIA_CHANGED | IDE_CD_FLAG_NO_EJECT | | 1872 | drive->atapi_flags = IDE_AFLAG_MEDIA_CHANGED | IDE_AFLAG_NO_EJECT | |
1877 | ide_cd_flags(id); | 1873 | ide_cd_flags(id); |
1878 | 1874 | ||
1879 | if ((id->config & 0x0060) == 0x20) | 1875 | if ((id->config & 0x0060) == 0x20) |
1880 | cd->cd_flags |= IDE_CD_FLAG_DRQ_INTERRUPT; | 1876 | drive->atapi_flags |= IDE_AFLAG_DRQ_INTERRUPT; |
1881 | 1877 | ||
1882 | if ((cd->cd_flags & IDE_CD_FLAG_VERTOS_300_SSD) && | 1878 | if ((drive->atapi_flags & IDE_AFLAG_VERTOS_300_SSD) && |
1883 | id->fw_rev[4] == '1' && id->fw_rev[6] <= '2') | 1879 | id->fw_rev[4] == '1' && id->fw_rev[6] <= '2') |
1884 | cd->cd_flags |= (IDE_CD_FLAG_TOCTRACKS_AS_BCD | | 1880 | drive->atapi_flags |= (IDE_AFLAG_TOCTRACKS_AS_BCD | |
1885 | IDE_CD_FLAG_TOCADDR_AS_BCD); | 1881 | IDE_AFLAG_TOCADDR_AS_BCD); |
1886 | else if ((cd->cd_flags & IDE_CD_FLAG_VERTOS_600_ESD) && | 1882 | else if ((drive->atapi_flags & IDE_AFLAG_VERTOS_600_ESD) && |
1887 | id->fw_rev[4] == '1' && id->fw_rev[6] <= '2') | 1883 | id->fw_rev[4] == '1' && id->fw_rev[6] <= '2') |
1888 | cd->cd_flags |= IDE_CD_FLAG_TOCTRACKS_AS_BCD; | 1884 | drive->atapi_flags |= IDE_AFLAG_TOCTRACKS_AS_BCD; |
1889 | else if (cd->cd_flags & IDE_CD_FLAG_SANYO_3CD) | 1885 | else if (drive->atapi_flags & IDE_AFLAG_SANYO_3CD) |
1890 | /* 3 => use CD in slot 0 */ | 1886 | /* 3 => use CD in slot 0 */ |
1891 | cdi->sanyo_slot = 3; | 1887 | cdi->sanyo_slot = 3; |
1892 | 1888 | ||