diff options
-rw-r--r-- | drivers/ide/Kconfig | 1 | ||||
-rw-r--r-- | drivers/ide/ide-atapi.c | 15 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 4 | ||||
-rw-r--r-- | include/linux/ide.h | 2 |
4 files changed, 19 insertions, 3 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 937945e471df..4ee85fcf9aaf 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -137,6 +137,7 @@ config BLK_DEV_DELKIN | |||
137 | 137 | ||
138 | config BLK_DEV_IDECD | 138 | config BLK_DEV_IDECD |
139 | tristate "Include IDE/ATAPI CDROM support" | 139 | tristate "Include IDE/ATAPI CDROM support" |
140 | select IDE_ATAPI | ||
140 | ---help--- | 141 | ---help--- |
141 | If you have a CD-ROM drive using the ATAPI protocol, say Y. ATAPI is | 142 | If you have a CD-ROM drive using the ATAPI protocol, say Y. ATAPI is |
142 | a newer protocol used by IDE CD-ROM and TAPE drives, similar to the | 143 | a newer protocol used by IDE CD-ROM and TAPE drives, similar to the |
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 74273fdc8827..8884877bd2b5 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -252,6 +252,18 @@ int ide_scsi_expiry(ide_drive_t *drive) | |||
252 | } | 252 | } |
253 | EXPORT_SYMBOL_GPL(ide_scsi_expiry); | 253 | EXPORT_SYMBOL_GPL(ide_scsi_expiry); |
254 | 254 | ||
255 | int ide_cd_get_xferlen(struct request *rq) | ||
256 | { | ||
257 | if (blk_fs_request(rq)) | ||
258 | return 32768; | ||
259 | else if (blk_sense_request(rq) || blk_pc_request(rq) || | ||
260 | rq->cmd_type == REQ_TYPE_ATA_PC) | ||
261 | return rq->data_len; | ||
262 | else | ||
263 | return 0; | ||
264 | } | ||
265 | EXPORT_SYMBOL_GPL(ide_cd_get_xferlen); | ||
266 | |||
255 | /* | 267 | /* |
256 | * This is the usual interrupt handler which will be called during a packet | 268 | * This is the usual interrupt handler which will be called during a packet |
257 | * command. We will transfer some of the data (as requested by the drive) | 269 | * command. We will transfer some of the data (as requested by the drive) |
@@ -551,7 +563,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout, | |||
551 | struct ide_atapi_pc *pc = drive->pc; | 563 | struct ide_atapi_pc *pc = drive->pc; |
552 | ide_hwif_t *hwif = drive->hwif; | 564 | ide_hwif_t *hwif = drive->hwif; |
553 | u32 tf_flags; | 565 | u32 tf_flags; |
554 | u16 bcount = 0; | 566 | u16 bcount; |
555 | u8 scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI); | 567 | u8 scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI); |
556 | 568 | ||
557 | /* We haven't transferred any data yet */ | 569 | /* We haven't transferred any data yet */ |
@@ -560,6 +572,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout, | |||
560 | 572 | ||
561 | if (dev_is_idecd(drive)) { | 573 | if (dev_is_idecd(drive)) { |
562 | tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL; | 574 | tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL; |
575 | bcount = ide_cd_get_xferlen(hwif->hwgroup->rq); | ||
563 | } else if (scsi) { | 576 | } else if (scsi) { |
564 | tf_flags = 0; | 577 | tf_flags = 0; |
565 | bcount = min(pc->req_xfer, 63 * 1024); | 578 | bcount = min(pc->req_xfer, 63 * 1024); |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 65e5513758b0..8d3c7714682e 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -1214,8 +1214,9 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
1214 | __func__, rq->cmd[0], rq->cmd_type, | 1214 | __func__, rq->cmd[0], rq->cmd_type, |
1215 | (unsigned long long)block); | 1215 | (unsigned long long)block); |
1216 | 1216 | ||
1217 | xferlen = ide_cd_get_xferlen(rq); | ||
1218 | |||
1217 | if (blk_fs_request(rq)) { | 1219 | if (blk_fs_request(rq)) { |
1218 | xferlen = 32768; | ||
1219 | fn = cdrom_start_rw_cont; | 1220 | fn = cdrom_start_rw_cont; |
1220 | 1221 | ||
1221 | if (cdrom_start_rw(drive, rq) == ide_stopped) | 1222 | if (cdrom_start_rw(drive, rq) == ide_stopped) |
@@ -1225,7 +1226,6 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
1225 | return ide_stopped; | 1226 | return ide_stopped; |
1226 | } else if (blk_sense_request(rq) || blk_pc_request(rq) || | 1227 | } else if (blk_sense_request(rq) || blk_pc_request(rq) || |
1227 | rq->cmd_type == REQ_TYPE_ATA_PC) { | 1228 | rq->cmd_type == REQ_TYPE_ATA_PC) { |
1228 | xferlen = rq->data_len; | ||
1229 | fn = cdrom_do_newpc_cont; | 1229 | fn = cdrom_do_newpc_cont; |
1230 | 1230 | ||
1231 | if (!rq->timeout) | 1231 | if (!rq->timeout) |
diff --git a/include/linux/ide.h b/include/linux/ide.h index eb4c01f7f253..e35ff6827897 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1254,6 +1254,8 @@ static inline unsigned long ide_scsi_get_timeout(struct ide_atapi_pc *pc) | |||
1254 | 1254 | ||
1255 | int ide_scsi_expiry(ide_drive_t *); | 1255 | int ide_scsi_expiry(ide_drive_t *); |
1256 | 1256 | ||
1257 | int ide_cd_get_xferlen(struct request *); | ||
1258 | |||
1257 | ide_startstop_t ide_issue_pc(ide_drive_t *, unsigned int, ide_expiry_t *); | 1259 | ide_startstop_t ide_issue_pc(ide_drive_t *, unsigned int, ide_expiry_t *); |
1258 | 1260 | ||
1259 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); | 1261 | ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); |