aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 1826c58d2f85..6f1d6f22bebe 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -2068,21 +2068,6 @@ static int cdrom_select_speed(ide_drive_t *drive, int speed,
2068 return cdrom_queue_packet_command(drive, &req); 2068 return cdrom_queue_packet_command(drive, &req);
2069} 2069}
2070 2070
2071static int cdrom_play_audio(ide_drive_t *drive, int lba_start, int lba_end)
2072{
2073 struct request_sense sense;
2074 struct request req;
2075
2076 cdrom_prepare_request(drive, &req);
2077
2078 req.sense = &sense;
2079 req.cmd[0] = GPCMD_PLAY_AUDIO_MSF;
2080 lba_to_msf(lba_start, &req.cmd[3], &req.cmd[4], &req.cmd[5]);
2081 lba_to_msf(lba_end-1, &req.cmd[6], &req.cmd[7], &req.cmd[8]);
2082
2083 return cdrom_queue_packet_command(drive, &req);
2084}
2085
2086static int cdrom_get_toc_entry(ide_drive_t *drive, int track, 2071static int cdrom_get_toc_entry(ide_drive_t *drive, int track,
2087 struct atapi_toc_entry **ent) 2072 struct atapi_toc_entry **ent)
2088{ 2073{
@@ -2139,6 +2124,8 @@ static int ide_cd_fake_play_trkind(ide_drive_t *drive, void *arg)
2139 struct atapi_toc_entry *first_toc, *last_toc; 2124 struct atapi_toc_entry *first_toc, *last_toc;
2140 unsigned long lba_start, lba_end; 2125 unsigned long lba_start, lba_end;
2141 int stat; 2126 int stat;
2127 struct request rq;
2128 struct request_sense sense;
2142 2129
2143 stat = cdrom_get_toc_entry(drive, ti->cdti_trk0, &first_toc); 2130 stat = cdrom_get_toc_entry(drive, ti->cdti_trk0, &first_toc);
2144 if (stat) 2131 if (stat)
@@ -2156,7 +2143,14 @@ static int ide_cd_fake_play_trkind(ide_drive_t *drive, void *arg)
2156 if (lba_end <= lba_start) 2143 if (lba_end <= lba_start)
2157 return -EINVAL; 2144 return -EINVAL;
2158 2145
2159 return cdrom_play_audio(drive, lba_start, lba_end); 2146 cdrom_prepare_request(drive, &rq);
2147
2148 rq.sense = &sense;
2149 rq.cmd[0] = GPCMD_PLAY_AUDIO_MSF;
2150 lba_to_msf(lba_start, &rq.cmd[3], &rq.cmd[4], &rq.cmd[5]);
2151 lba_to_msf(lba_end - 1, &rq.cmd[6], &rq.cmd[7], &rq.cmd[8]);
2152
2153 return cdrom_queue_packet_command(drive, &rq);
2160} 2154}
2161 2155
2162/* the generic packet interface to cdrom.c */ 2156/* the generic packet interface to cdrom.c */