diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:21 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:21 -0500 |
commit | 4fe6717862d4977b8e61307a2623ed7739068bdc (patch) | |
tree | 58936939f62e8e83fb815d27fcc13f674831e790 | |
parent | 3f1b86d89dc73dedda426a85e600ad244ed9fad4 (diff) |
ide-cd: kill CDROM_CONFIG_FLAGS() macro
While at it rename 'info' variable to 'cd' in
ide_cdrom_probe_capabilities() and ide_cdrom_setup().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-cd.c | 96 | ||||
-rw-r--r-- | drivers/ide/ide-cd.h | 2 |
2 files changed, 50 insertions, 48 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 81247a0587e6..3e1923d0bec1 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -657,8 +657,8 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive, | |||
657 | /* Set up the controller registers. */ | 657 | /* Set up the controller registers. */ |
658 | ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL | | 658 | ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL | |
659 | IDE_TFLAG_NO_SELECT_MASK, xferlen, info->dma); | 659 | IDE_TFLAG_NO_SELECT_MASK, xferlen, info->dma); |
660 | 660 | ||
661 | if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) { | 661 | if (info->config_flags.drq_interrupt) { |
662 | /* waiting for CDB interrupt, not DMA yet. */ | 662 | /* waiting for CDB interrupt, not DMA yet. */ |
663 | if (info->dma) | 663 | if (info->dma) |
664 | drive->waiting_for_dma = 0; | 664 | drive->waiting_for_dma = 0; |
@@ -694,7 +694,7 @@ static ide_startstop_t cdrom_transfer_packet_command (ide_drive_t *drive, | |||
694 | struct cdrom_info *info = drive->driver_data; | 694 | struct cdrom_info *info = drive->driver_data; |
695 | ide_startstop_t startstop; | 695 | ide_startstop_t startstop; |
696 | 696 | ||
697 | if (CDROM_CONFIG_FLAGS(drive)->drq_interrupt) { | 697 | if (info->config_flags.drq_interrupt) { |
698 | /* Here we should have been called after receiving an interrupt | 698 | /* Here we should have been called after receiving an interrupt |
699 | from the device. DRQ should how be set. */ | 699 | from the device. DRQ should how be set. */ |
700 | 700 | ||
@@ -893,11 +893,11 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive) | |||
893 | if ((len % SECTOR_SIZE) != 0) { | 893 | if ((len % SECTOR_SIZE) != 0) { |
894 | printk (KERN_ERR "%s: cdrom_read_intr: Bad transfer size %d\n", | 894 | printk (KERN_ERR "%s: cdrom_read_intr: Bad transfer size %d\n", |
895 | drive->name, len); | 895 | drive->name, len); |
896 | if (CDROM_CONFIG_FLAGS(drive)->limit_nframes) | 896 | if (info->config_flags.limit_nframes) |
897 | printk (KERN_ERR " This drive is not supported by this version of the driver\n"); | 897 | printk (KERN_ERR " This drive is not supported by this version of the driver\n"); |
898 | else { | 898 | else { |
899 | printk (KERN_ERR " Trying to limit transfer sizes\n"); | 899 | printk (KERN_ERR " Trying to limit transfer sizes\n"); |
900 | CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; | 900 | info->config_flags.limit_nframes = 1; |
901 | } | 901 | } |
902 | cdrom_end_request(drive, 0); | 902 | cdrom_end_request(drive, 0); |
903 | return ide_stopped; | 903 | return ide_stopped; |
@@ -1073,7 +1073,8 @@ static ide_startstop_t cdrom_seek_intr (ide_drive_t *drive) | |||
1073 | 1073 | ||
1074 | if (cdrom_decode_status(drive, 0, &stat)) | 1074 | if (cdrom_decode_status(drive, 0, &stat)) |
1075 | return ide_stopped; | 1075 | return ide_stopped; |
1076 | CDROM_CONFIG_FLAGS(drive)->seeking = 1; | 1076 | |
1077 | info->config_flags.seeking = 1; | ||
1077 | 1078 | ||
1078 | if (retry && time_after(jiffies, info->start_seek + IDECD_SEEK_TIMER)) { | 1079 | if (retry && time_after(jiffies, info->start_seek + IDECD_SEEK_TIMER)) { |
1079 | if (--retry == 0) { | 1080 | if (--retry == 0) { |
@@ -1721,7 +1722,7 @@ ide_do_rw_cdrom (ide_drive_t *drive, struct request *rq, sector_t block) | |||
1721 | struct cdrom_info *info = drive->driver_data; | 1722 | struct cdrom_info *info = drive->driver_data; |
1722 | 1723 | ||
1723 | if (blk_fs_request(rq)) { | 1724 | if (blk_fs_request(rq)) { |
1724 | if (CDROM_CONFIG_FLAGS(drive)->seeking) { | 1725 | if (info->config_flags.seeking) { |
1725 | unsigned long elapsed = jiffies - info->start_seek; | 1726 | unsigned long elapsed = jiffies - info->start_seek; |
1726 | int stat = HWIF(drive)->INB(IDE_STATUS_REG); | 1727 | int stat = HWIF(drive)->INB(IDE_STATUS_REG); |
1727 | 1728 | ||
@@ -1732,7 +1733,7 @@ ide_do_rw_cdrom (ide_drive_t *drive, struct request *rq, sector_t block) | |||
1732 | } | 1733 | } |
1733 | printk (KERN_ERR "%s: DSC timeout\n", drive->name); | 1734 | printk (KERN_ERR "%s: DSC timeout\n", drive->name); |
1734 | } | 1735 | } |
1735 | CDROM_CONFIG_FLAGS(drive)->seeking = 0; | 1736 | info->config_flags.seeking = 0; |
1736 | } | 1737 | } |
1737 | if ((rq_data_dir(rq) == READ) && IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) { | 1738 | if ((rq_data_dir(rq) == READ) && IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) { |
1738 | action = cdrom_start_seek(drive, block); | 1739 | action = cdrom_start_seek(drive, block); |
@@ -1844,6 +1845,7 @@ static int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) | |||
1844 | static int | 1845 | static int |
1845 | cdrom_lockdoor(ide_drive_t *drive, int lockflag, struct request_sense *sense) | 1846 | cdrom_lockdoor(ide_drive_t *drive, int lockflag, struct request_sense *sense) |
1846 | { | 1847 | { |
1848 | struct cdrom_info *cd = drive->driver_data; | ||
1847 | struct request_sense my_sense; | 1849 | struct request_sense my_sense; |
1848 | struct request req; | 1850 | struct request req; |
1849 | int stat; | 1851 | int stat; |
@@ -1852,7 +1854,7 @@ cdrom_lockdoor(ide_drive_t *drive, int lockflag, struct request_sense *sense) | |||
1852 | sense = &my_sense; | 1854 | sense = &my_sense; |
1853 | 1855 | ||
1854 | /* If the drive cannot lock the door, just pretend. */ | 1856 | /* If the drive cannot lock the door, just pretend. */ |
1855 | if (CDROM_CONFIG_FLAGS(drive)->no_doorlock) { | 1857 | if (cd->config_flags.no_doorlock) { |
1856 | stat = 0; | 1858 | stat = 0; |
1857 | } else { | 1859 | } else { |
1858 | cdrom_prepare_request(drive, &req); | 1860 | cdrom_prepare_request(drive, &req); |
@@ -1869,7 +1871,7 @@ cdrom_lockdoor(ide_drive_t *drive, int lockflag, struct request_sense *sense) | |||
1869 | (sense->asc == 0x24 || sense->asc == 0x20)) { | 1871 | (sense->asc == 0x24 || sense->asc == 0x20)) { |
1870 | printk (KERN_ERR "%s: door locking not supported\n", | 1872 | printk (KERN_ERR "%s: door locking not supported\n", |
1871 | drive->name); | 1873 | drive->name); |
1872 | CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; | 1874 | cd->config_flags.no_doorlock = 1; |
1873 | stat = 0; | 1875 | stat = 0; |
1874 | } | 1876 | } |
1875 | 1877 | ||
@@ -1894,9 +1896,9 @@ static int cdrom_eject(ide_drive_t *drive, int ejectflag, | |||
1894 | struct request req; | 1896 | struct request req; |
1895 | char loej = 0x02; | 1897 | char loej = 0x02; |
1896 | 1898 | ||
1897 | if (CDROM_CONFIG_FLAGS(drive)->no_eject && !ejectflag) | 1899 | if (cd->config_flags.no_eject && !ejectflag) |
1898 | return -EDRIVE_CANT_DO_THIS; | 1900 | return -EDRIVE_CANT_DO_THIS; |
1899 | 1901 | ||
1900 | /* reload fails on some drives, if the tray is locked */ | 1902 | /* reload fails on some drives, if the tray is locked */ |
1901 | if (CDROM_STATE_FLAGS(drive)->door_locked && ejectflag) | 1903 | if (CDROM_STATE_FLAGS(drive)->door_locked && ejectflag) |
1902 | return 0; | 1904 | return 0; |
@@ -2019,7 +2021,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
2019 | return stat; | 2021 | return stat; |
2020 | 2022 | ||
2021 | #if ! STANDARD_ATAPI | 2023 | #if ! STANDARD_ATAPI |
2022 | if (CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd) { | 2024 | if (info->config_flags.toctracks_as_bcd) { |
2023 | toc->hdr.first_track = bcd2bin(toc->hdr.first_track); | 2025 | toc->hdr.first_track = bcd2bin(toc->hdr.first_track); |
2024 | toc->hdr.last_track = bcd2bin(toc->hdr.last_track); | 2026 | toc->hdr.last_track = bcd2bin(toc->hdr.last_track); |
2025 | } | 2027 | } |
@@ -2059,7 +2061,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
2059 | return stat; | 2061 | return stat; |
2060 | } | 2062 | } |
2061 | #if ! STANDARD_ATAPI | 2063 | #if ! STANDARD_ATAPI |
2062 | if (CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd) { | 2064 | if (info->config_flags.toctracks_as_bcd) { |
2063 | toc->hdr.first_track = bin2bcd(CDROM_LEADOUT); | 2065 | toc->hdr.first_track = bin2bcd(CDROM_LEADOUT); |
2064 | toc->hdr.last_track = bin2bcd(CDROM_LEADOUT); | 2066 | toc->hdr.last_track = bin2bcd(CDROM_LEADOUT); |
2065 | } else | 2067 | } else |
@@ -2076,7 +2078,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
2076 | toc->hdr.toc_length = ntohs (toc->hdr.toc_length); | 2078 | toc->hdr.toc_length = ntohs (toc->hdr.toc_length); |
2077 | 2079 | ||
2078 | #if ! STANDARD_ATAPI | 2080 | #if ! STANDARD_ATAPI |
2079 | if (CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd) { | 2081 | if (info->config_flags.toctracks_as_bcd) { |
2080 | toc->hdr.first_track = bcd2bin(toc->hdr.first_track); | 2082 | toc->hdr.first_track = bcd2bin(toc->hdr.first_track); |
2081 | toc->hdr.last_track = bcd2bin(toc->hdr.last_track); | 2083 | toc->hdr.last_track = bcd2bin(toc->hdr.last_track); |
2082 | } | 2084 | } |
@@ -2084,8 +2086,8 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
2084 | 2086 | ||
2085 | for (i=0; i<=ntracks; i++) { | 2087 | for (i=0; i<=ntracks; i++) { |
2086 | #if ! STANDARD_ATAPI | 2088 | #if ! STANDARD_ATAPI |
2087 | if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd) { | 2089 | if (info->config_flags.tocaddr_as_bcd) { |
2088 | if (CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd) | 2090 | if (info->config_flags.toctracks_as_bcd) |
2089 | toc->ent[i].track = bcd2bin(toc->ent[i].track); | 2091 | toc->ent[i].track = bcd2bin(toc->ent[i].track); |
2090 | msf_from_bcd(&toc->ent[i].addr.msf); | 2092 | msf_from_bcd(&toc->ent[i].addr.msf); |
2091 | } | 2093 | } |
@@ -2110,7 +2112,7 @@ static int cdrom_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
2110 | } | 2112 | } |
2111 | 2113 | ||
2112 | #if ! STANDARD_ATAPI | 2114 | #if ! STANDARD_ATAPI |
2113 | if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd) { | 2115 | if (info->config_flags.tocaddr_as_bcd) { |
2114 | /* Re-read multisession information using MSF format */ | 2116 | /* Re-read multisession information using MSF format */ |
2115 | stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp, | 2117 | stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp, |
2116 | sizeof(ms_tmp), sense); | 2118 | sizeof(ms_tmp), sense); |
@@ -2419,6 +2421,7 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, struct atapi_capabilities_pag | |||
2419 | static | 2421 | static |
2420 | void ide_cdrom_update_speed (ide_drive_t *drive, struct atapi_capabilities_page *cap) | 2422 | void ide_cdrom_update_speed (ide_drive_t *drive, struct atapi_capabilities_page *cap) |
2421 | { | 2423 | { |
2424 | struct cdrom_info *cd = drive->driver_data; | ||
2422 | u16 curspeed, maxspeed; | 2425 | u16 curspeed, maxspeed; |
2423 | 2426 | ||
2424 | /* The ACER/AOpen 24X cdrom has the speed fields byte-swapped */ | 2427 | /* The ACER/AOpen 24X cdrom has the speed fields byte-swapped */ |
@@ -2432,7 +2435,7 @@ void ide_cdrom_update_speed (ide_drive_t *drive, struct atapi_capabilities_page | |||
2432 | } | 2435 | } |
2433 | 2436 | ||
2434 | CDROM_STATE_FLAGS(drive)->current_speed = (curspeed + (176/2)) / 176; | 2437 | CDROM_STATE_FLAGS(drive)->current_speed = (curspeed + (176/2)) / 176; |
2435 | CDROM_CONFIG_FLAGS(drive)->max_speed = (maxspeed + (176/2)) / 176; | 2438 | cd->config_flags.max_speed = (maxspeed + (176/2)) / 176; |
2436 | } | 2439 | } |
2437 | 2440 | ||
2438 | static | 2441 | static |
@@ -2617,7 +2620,7 @@ static int ide_cdrom_register (ide_drive_t *drive, int nslots) | |||
2617 | devinfo->handle = drive; | 2620 | devinfo->handle = drive; |
2618 | strcpy(devinfo->name, drive->name); | 2621 | strcpy(devinfo->name, drive->name); |
2619 | 2622 | ||
2620 | if (CDROM_CONFIG_FLAGS(drive)->no_speed_select) | 2623 | if (info->config_flags.no_speed_select) |
2621 | devinfo->mask |= CDC_SELECT_SPEED; | 2624 | devinfo->mask |= CDC_SELECT_SPEED; |
2622 | 2625 | ||
2623 | devinfo->disk = info->disk; | 2626 | devinfo->disk = info->disk; |
@@ -2627,8 +2630,8 @@ static int ide_cdrom_register (ide_drive_t *drive, int nslots) | |||
2627 | static | 2630 | static |
2628 | int ide_cdrom_probe_capabilities (ide_drive_t *drive) | 2631 | int ide_cdrom_probe_capabilities (ide_drive_t *drive) |
2629 | { | 2632 | { |
2630 | struct cdrom_info *info = drive->driver_data; | 2633 | struct cdrom_info *cd = drive->driver_data; |
2631 | struct cdrom_device_info *cdi = &info->devinfo; | 2634 | struct cdrom_device_info *cdi = &cd->devinfo; |
2632 | struct atapi_capabilities_page cap; | 2635 | struct atapi_capabilities_page cap; |
2633 | int nslots = 1; | 2636 | int nslots = 1; |
2634 | 2637 | ||
@@ -2642,9 +2645,9 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive) | |||
2642 | return nslots; | 2645 | return nslots; |
2643 | } | 2646 | } |
2644 | 2647 | ||
2645 | if (CDROM_CONFIG_FLAGS(drive)->nec260 || | 2648 | if (cd->config_flags.nec260 || |
2646 | !strcmp(drive->id->model,"STINGRAY 8422 IDE 8X CD-ROM 7-27-95")) { | 2649 | !strcmp(drive->id->model,"STINGRAY 8422 IDE 8X CD-ROM 7-27-95")) { |
2647 | CDROM_CONFIG_FLAGS(drive)->no_eject = 0; | 2650 | cd->config_flags.no_eject = 0; |
2648 | cdi->mask &= ~CDC_PLAY_AUDIO; | 2651 | cdi->mask &= ~CDC_PLAY_AUDIO; |
2649 | return nslots; | 2652 | return nslots; |
2650 | } | 2653 | } |
@@ -2663,9 +2666,9 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive) | |||
2663 | return 0; | 2666 | return 0; |
2664 | 2667 | ||
2665 | if (cap.lock == 0) | 2668 | if (cap.lock == 0) |
2666 | CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; | 2669 | cd->config_flags.no_doorlock = 1; |
2667 | if (cap.eject) | 2670 | if (cap.eject) |
2668 | CDROM_CONFIG_FLAGS(drive)->no_eject = 0; | 2671 | cd->config_flags.no_eject = 0; |
2669 | if (cap.cd_r_write) | 2672 | if (cap.cd_r_write) |
2670 | cdi->mask &= ~CDC_CD_R; | 2673 | cdi->mask &= ~CDC_CD_R; |
2671 | if (cap.cd_rw_write) | 2674 | if (cap.cd_rw_write) |
@@ -2706,11 +2709,13 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive) | |||
2706 | } | 2709 | } |
2707 | 2710 | ||
2708 | ide_cdrom_update_speed(drive, &cap); | 2711 | ide_cdrom_update_speed(drive, &cap); |
2709 | /* don't print speed if the drive reported 0. | 2712 | |
2710 | */ | ||
2711 | printk(KERN_INFO "%s: ATAPI", drive->name); | 2713 | printk(KERN_INFO "%s: ATAPI", drive->name); |
2712 | if (CDROM_CONFIG_FLAGS(drive)->max_speed) | 2714 | |
2713 | printk(" %dX", CDROM_CONFIG_FLAGS(drive)->max_speed); | 2715 | /* don't print speed if the drive reported 0 */ |
2716 | if (cd->config_flags.max_speed) | ||
2717 | printk(KERN_CONT " %dX", cd->config_flags.max_speed); | ||
2718 | |||
2714 | printk(KERN_CONT " %s", (cdi->mask & CDC_DVD) ? "CD-ROM" : "DVD-ROM"); | 2719 | printk(KERN_CONT " %s", (cdi->mask & CDC_DVD) ? "CD-ROM" : "DVD-ROM"); |
2715 | 2720 | ||
2716 | if ((cdi->mask & CDC_DVD_R) == 0 || (cdi->mask & CDC_DVD_RAM) == 0) | 2721 | if ((cdi->mask & CDC_DVD_R) == 0 || (cdi->mask & CDC_DVD_RAM) == 0) |
@@ -2824,8 +2829,8 @@ static int ide_cdrom_prep_fn(struct request_queue *q, struct request *rq) | |||
2824 | static | 2829 | static |
2825 | int ide_cdrom_setup (ide_drive_t *drive) | 2830 | int ide_cdrom_setup (ide_drive_t *drive) |
2826 | { | 2831 | { |
2827 | struct cdrom_info *info = drive->driver_data; | 2832 | struct cdrom_info *cd = drive->driver_data; |
2828 | struct cdrom_device_info *cdi = &info->devinfo; | 2833 | struct cdrom_device_info *cdi = &cd->devinfo; |
2829 | int nslots; | 2834 | int nslots; |
2830 | 2835 | ||
2831 | blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); | 2836 | blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); |
@@ -2839,21 +2844,20 @@ int ide_cdrom_setup (ide_drive_t *drive) | |||
2839 | CDROM_STATE_FLAGS(drive)->media_changed = 1; | 2844 | CDROM_STATE_FLAGS(drive)->media_changed = 1; |
2840 | 2845 | ||
2841 | #if NO_DOOR_LOCKING | 2846 | #if NO_DOOR_LOCKING |
2842 | CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; | 2847 | cd->config_flags.no_doorlock = 1; |
2843 | #endif | 2848 | #endif |
2844 | if ((drive->id->config & 0x0060) == 0x20) | 2849 | if ((drive->id->config & 0x0060) == 0x20) |
2845 | CDROM_CONFIG_FLAGS(drive)->drq_interrupt = 1; | 2850 | cd->config_flags.drq_interrupt = 1; |
2846 | CDROM_CONFIG_FLAGS(drive)->no_eject = 1; | 2851 | cd->config_flags.no_eject = 1; |
2847 | 2852 | ||
2848 | /* limit transfer size per interrupt. */ | 2853 | /* limit transfer size per interrupt. */ |
2849 | /* a testament to the nice quality of Samsung drives... */ | 2854 | /* a testament to the nice quality of Samsung drives... */ |
2850 | if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2430")) | 2855 | if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2430") || |
2851 | CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; | 2856 | !strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2432")) |
2852 | else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2432")) | 2857 | cd->config_flags.limit_nframes = 1; |
2853 | CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; | ||
2854 | /* the 3231 model does not support the SET_CD_SPEED command */ | 2858 | /* the 3231 model does not support the SET_CD_SPEED command */ |
2855 | else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-3231")) | 2859 | else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-3231")) |
2856 | CDROM_CONFIG_FLAGS(drive)->no_speed_select = 1; | 2860 | cd->config_flags.no_speed_select = 1; |
2857 | 2861 | ||
2858 | #if ! STANDARD_ATAPI | 2862 | #if ! STANDARD_ATAPI |
2859 | if (strcmp (drive->id->model, "V003S0DS") == 0 && | 2863 | if (strcmp (drive->id->model, "V003S0DS") == 0 && |
@@ -2861,22 +2865,22 @@ int ide_cdrom_setup (ide_drive_t *drive) | |||
2861 | drive->id->fw_rev[6] <= '2') { | 2865 | drive->id->fw_rev[6] <= '2') { |
2862 | /* Vertos 300. | 2866 | /* Vertos 300. |
2863 | Some versions of this drive like to talk BCD. */ | 2867 | Some versions of this drive like to talk BCD. */ |
2864 | CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd = 1; | 2868 | cd->config_flags.toctracks_as_bcd = 1; |
2865 | CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd = 1; | 2869 | cd->config_flags.tocaddr_as_bcd = 1; |
2866 | } | 2870 | } |
2867 | else if (strcmp (drive->id->model, "V006E0DS") == 0 && | 2871 | else if (strcmp (drive->id->model, "V006E0DS") == 0 && |
2868 | drive->id->fw_rev[4] == '1' && | 2872 | drive->id->fw_rev[4] == '1' && |
2869 | drive->id->fw_rev[6] <= '2') { | 2873 | drive->id->fw_rev[6] <= '2') { |
2870 | /* Vertos 600 ESD. */ | 2874 | /* Vertos 600 ESD. */ |
2871 | CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd = 1; | 2875 | cd->config_flags.toctracks_as_bcd = 1; |
2872 | } | 2876 | } |
2873 | else if (strcmp(drive->id->model, "NEC CD-ROM DRIVE:260") == 0 && | 2877 | else if (strcmp(drive->id->model, "NEC CD-ROM DRIVE:260") == 0 && |
2874 | strncmp(drive->id->fw_rev, "1.01", 4) == 0) { /* FIXME */ | 2878 | strncmp(drive->id->fw_rev, "1.01", 4) == 0) { /* FIXME */ |
2875 | /* Old NEC260 (not R). | 2879 | /* Old NEC260 (not R). |
2876 | This drive was released before the 1.2 version | 2880 | This drive was released before the 1.2 version |
2877 | of the spec. */ | 2881 | of the spec. */ |
2878 | CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd = 1; | 2882 | cd->config_flags.tocaddr_as_bcd = 1; |
2879 | CDROM_CONFIG_FLAGS(drive)->nec260 = 1; | 2883 | cd->config_flags.nec260 = 1; |
2880 | } | 2884 | } |
2881 | /* | 2885 | /* |
2882 | * Sanyo 3 CD changer uses a non-standard command for CD changing | 2886 | * Sanyo 3 CD changer uses a non-standard command for CD changing |
@@ -2903,7 +2907,7 @@ int ide_cdrom_setup (ide_drive_t *drive) | |||
2903 | 2907 | ||
2904 | if (ide_cdrom_register(drive, nslots)) { | 2908 | if (ide_cdrom_register(drive, nslots)) { |
2905 | printk (KERN_ERR "%s: ide_cdrom_setup failed to register device with the cdrom driver.\n", drive->name); | 2909 | printk (KERN_ERR "%s: ide_cdrom_setup failed to register device with the cdrom driver.\n", drive->name); |
2906 | info->devinfo.handle = NULL; | 2910 | cd->devinfo.handle = NULL; |
2907 | return 1; | 2911 | return 1; |
2908 | } | 2912 | } |
2909 | ide_cdrom_add_settings(drive); | 2913 | ide_cdrom_add_settings(drive); |
diff --git a/drivers/ide/ide-cd.h b/drivers/ide/ide-cd.h index b989c9835174..9e1cee69c0fc 100644 --- a/drivers/ide/ide-cd.h +++ b/drivers/ide/ide-cd.h | |||
@@ -68,9 +68,7 @@ struct ide_cd_config_flags { | |||
68 | __u8 no_speed_select : 1; /* SET_CD_SPEED command is unsupported. */ | 68 | __u8 no_speed_select : 1; /* SET_CD_SPEED command is unsupported. */ |
69 | byte max_speed; /* Max speed of the drive */ | 69 | byte max_speed; /* Max speed of the drive */ |
70 | }; | 70 | }; |
71 | #define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags)) | ||
72 | 71 | ||
73 | |||
74 | /* State flags. These give information about the current state of the | 72 | /* State flags. These give information about the current state of the |
75 | drive, and will change during normal operation. */ | 73 | drive, and will change during normal operation. */ |
76 | struct ide_cd_state_flags { | 74 | struct ide_cd_state_flags { |