diff options
Diffstat (limited to 'drivers/ide/ide-cd.c')
| -rw-r--r-- | drivers/ide/ide-cd.c | 155 |
1 files changed, 81 insertions, 74 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 2177cd11664c..3f630e4080d4 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
| @@ -100,8 +100,7 @@ static int cdrom_log_sense(ide_drive_t *drive, struct request *rq, | |||
| 100 | { | 100 | { |
| 101 | int log = 0; | 101 | int log = 0; |
| 102 | 102 | ||
| 103 | ide_debug_log(IDE_DBG_SENSE, "Call %s, sense_key: 0x%x\n", __func__, | 103 | ide_debug_log(IDE_DBG_SENSE, "sense_key: 0x%x", sense->sense_key); |
| 104 | sense->sense_key); | ||
| 105 | 104 | ||
| 106 | if (!sense || !rq || (rq->cmd_flags & REQ_QUIET)) | 105 | if (!sense || !rq || (rq->cmd_flags & REQ_QUIET)) |
| 107 | return 0; | 106 | return 0; |
| @@ -151,13 +150,12 @@ static void cdrom_analyze_sense_data(ide_drive_t *drive, | |||
| 151 | unsigned long bio_sectors; | 150 | unsigned long bio_sectors; |
| 152 | struct cdrom_info *info = drive->driver_data; | 151 | struct cdrom_info *info = drive->driver_data; |
| 153 | 152 | ||
| 154 | ide_debug_log(IDE_DBG_SENSE, "Call %s, error_code: 0x%x, " | 153 | ide_debug_log(IDE_DBG_SENSE, "error_code: 0x%x, sense_key: 0x%x", |
| 155 | "sense_key: 0x%x\n", __func__, sense->error_code, | 154 | sense->error_code, sense->sense_key); |
| 156 | sense->sense_key); | ||
| 157 | 155 | ||
| 158 | if (failed_command) | 156 | if (failed_command) |
| 159 | ide_debug_log(IDE_DBG_SENSE, "%s: failed cmd: 0x%x\n", | 157 | ide_debug_log(IDE_DBG_SENSE, "failed cmd: 0x%x", |
| 160 | __func__, failed_command->cmd[0]); | 158 | failed_command->cmd[0]); |
| 161 | 159 | ||
| 162 | if (!cdrom_log_sense(drive, failed_command, sense)) | 160 | if (!cdrom_log_sense(drive, failed_command, sense)) |
| 163 | return; | 161 | return; |
| @@ -215,9 +213,9 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense, | |||
| 215 | struct request *failed_command) | 213 | struct request *failed_command) |
| 216 | { | 214 | { |
| 217 | struct cdrom_info *info = drive->driver_data; | 215 | struct cdrom_info *info = drive->driver_data; |
| 218 | struct request *rq = &info->request_sense_request; | 216 | struct request *rq = &drive->request_sense_rq; |
| 219 | 217 | ||
| 220 | ide_debug_log(IDE_DBG_SENSE, "Call %s\n", __func__); | 218 | ide_debug_log(IDE_DBG_SENSE, "enter"); |
| 221 | 219 | ||
| 222 | if (sense == NULL) | 220 | if (sense == NULL) |
| 223 | sense = &info->sense_data; | 221 | sense = &info->sense_data; |
| @@ -239,8 +237,8 @@ static void cdrom_queue_request_sense(ide_drive_t *drive, void *sense, | |||
| 239 | rq->buffer = (void *) failed_command; | 237 | rq->buffer = (void *) failed_command; |
| 240 | 238 | ||
| 241 | if (failed_command) | 239 | if (failed_command) |
| 242 | ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x\n", | 240 | ide_debug_log(IDE_DBG_SENSE, "failed_cmd: 0x%x", |
| 243 | failed_command->cmd[0]); | 241 | failed_command->cmd[0]); |
| 244 | 242 | ||
| 245 | drive->hwif->rq = NULL; | 243 | drive->hwif->rq = NULL; |
| 246 | 244 | ||
| @@ -252,9 +250,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) | |||
| 252 | struct request *rq = drive->hwif->rq; | 250 | struct request *rq = drive->hwif->rq; |
| 253 | int nsectors = rq->hard_cur_sectors; | 251 | int nsectors = rq->hard_cur_sectors; |
| 254 | 252 | ||
| 255 | ide_debug_log(IDE_DBG_FUNC, "Call %s, cmd: 0x%x, uptodate: 0x%x, " | 253 | ide_debug_log(IDE_DBG_FUNC, "cmd: 0x%x, uptodate: 0x%x, nsectors: %d", |
| 256 | "nsectors: %d\n", __func__, rq->cmd[0], uptodate, | 254 | rq->cmd[0], uptodate, nsectors); |
| 257 | nsectors); | ||
| 258 | 255 | ||
| 259 | if (blk_sense_request(rq) && uptodate) { | 256 | if (blk_sense_request(rq) && uptodate) { |
| 260 | /* | 257 | /* |
| @@ -275,8 +272,8 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) | |||
| 275 | * now end the failed request | 272 | * now end the failed request |
| 276 | */ | 273 | */ |
| 277 | if (blk_fs_request(failed)) { | 274 | if (blk_fs_request(failed)) { |
| 278 | if (ide_end_dequeued_request(drive, failed, 0, | 275 | if (ide_end_rq(drive, failed, -EIO, |
| 279 | failed->hard_nr_sectors)) | 276 | failed->hard_nr_sectors << 9)) |
| 280 | BUG(); | 277 | BUG(); |
| 281 | } else { | 278 | } else { |
| 282 | if (blk_end_request(failed, -EIO, | 279 | if (blk_end_request(failed, -EIO, |
| @@ -295,10 +292,13 @@ static void cdrom_end_request(ide_drive_t *drive, int uptodate) | |||
| 295 | if (!nsectors) | 292 | if (!nsectors) |
| 296 | nsectors = 1; | 293 | nsectors = 1; |
| 297 | 294 | ||
| 298 | ide_debug_log(IDE_DBG_FUNC, "Exit %s, uptodate: 0x%x, nsectors: %d\n", | 295 | ide_debug_log(IDE_DBG_FUNC, "uptodate: 0x%x, nsectors: %d", |
| 299 | __func__, uptodate, nsectors); | 296 | uptodate, nsectors); |
| 300 | 297 | ||
| 301 | ide_end_request(drive, uptodate, nsectors); | 298 | if (blk_fs_request(rq) == 0 && uptodate <= 0 && rq->errors == 0) |
| 299 | rq->errors = -EIO; | ||
| 300 | |||
| 301 | ide_complete_rq(drive, uptodate ? 0 : -EIO, nsectors << 9); | ||
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 st) | 304 | static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 st) |
| @@ -338,9 +338,10 @@ static int cdrom_decode_status(ide_drive_t *drive, int good_stat, int *stat_ret) | |||
| 338 | return 1; | 338 | return 1; |
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | ide_debug_log(IDE_DBG_RQ, "%s: stat: 0x%x, good_stat: 0x%x, " | 341 | ide_debug_log(IDE_DBG_RQ, "stat: 0x%x, good_stat: 0x%x, cmd[0]: 0x%x, " |
| 342 | "rq->cmd[0]: 0x%x, rq->cmd_type: 0x%x, err: 0x%x\n", | 342 | "rq->cmd_type: 0x%x, err: 0x%x", |
| 343 | __func__, stat, good_stat, rq->cmd[0], rq->cmd_type, err); | 343 | stat, good_stat, rq->cmd[0], rq->cmd_type, |
| 344 | err); | ||
| 344 | 345 | ||
| 345 | if (blk_sense_request(rq)) { | 346 | if (blk_sense_request(rq)) { |
| 346 | /* | 347 | /* |
| @@ -530,8 +531,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
| 530 | { | 531 | { |
| 531 | ide_hwif_t *hwif = drive->hwif; | 532 | ide_hwif_t *hwif = drive->hwif; |
| 532 | 533 | ||
| 533 | ide_debug_log(IDE_DBG_FUNC, "Call %s, ireason: 0x%x, rw: 0x%x\n", | 534 | ide_debug_log(IDE_DBG_FUNC, "ireason: 0x%x, rw: 0x%x", ireason, rw); |
| 534 | __func__, ireason, rw); | ||
| 535 | 535 | ||
| 536 | /* | 536 | /* |
| 537 | * ireason == 0: the drive wants to receive data from us | 537 | * ireason == 0: the drive wants to receive data from us |
| @@ -572,7 +572,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
| 572 | */ | 572 | */ |
| 573 | static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) | 573 | static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) |
| 574 | { | 574 | { |
| 575 | ide_debug_log(IDE_DBG_FUNC, "Call %s, len: %d\n", __func__, len); | 575 | ide_debug_log(IDE_DBG_FUNC, "len: %d", len); |
| 576 | 576 | ||
| 577 | if ((len % SECTOR_SIZE) == 0) | 577 | if ((len % SECTOR_SIZE) == 0) |
| 578 | return 0; | 578 | return 0; |
| @@ -594,8 +594,7 @@ static int ide_cd_check_transfer_size(ide_drive_t *drive, int len) | |||
| 594 | static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, | 594 | static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, |
| 595 | struct request *rq) | 595 | struct request *rq) |
| 596 | { | 596 | { |
| 597 | ide_debug_log(IDE_DBG_RQ, "Call %s: rq->cmd_flags: 0x%x\n", __func__, | 597 | ide_debug_log(IDE_DBG_RQ, "rq->cmd_flags: 0x%x", rq->cmd_flags); |
| 598 | rq->cmd_flags); | ||
| 599 | 598 | ||
| 600 | if (rq_data_dir(rq) == READ) { | 599 | if (rq_data_dir(rq) == READ) { |
| 601 | unsigned short sectors_per_frame = | 600 | unsigned short sectors_per_frame = |
| @@ -639,7 +638,7 @@ static ide_startstop_t ide_cd_prepare_rw_request(ide_drive_t *drive, | |||
| 639 | static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq) | 638 | static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq) |
| 640 | { | 639 | { |
| 641 | 640 | ||
| 642 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 641 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 643 | 642 | ||
| 644 | if (rq->buffer != bio_data(rq->bio)) { | 643 | if (rq->buffer != bio_data(rq->bio)) { |
| 645 | sector_t n = | 644 | sector_t n = |
| @@ -658,8 +657,7 @@ static void ide_cd_restore_request(ide_drive_t *drive, struct request *rq) | |||
| 658 | 657 | ||
| 659 | static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq) | 658 | static void ide_cd_request_sense_fixup(ide_drive_t *drive, struct request *rq) |
| 660 | { | 659 | { |
| 661 | ide_debug_log(IDE_DBG_FUNC, "Call %s, rq->cmd[0]: 0x%x\n", | 660 | ide_debug_log(IDE_DBG_FUNC, "rq->cmd[0]: 0x%x", rq->cmd[0]); |
| 662 | __func__, rq->cmd[0]); | ||
| 663 | 661 | ||
| 664 | /* | 662 | /* |
| 665 | * Some of the trailing request sense fields are optional, | 663 | * Some of the trailing request sense fields are optional, |
| @@ -686,9 +684,9 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd, | |||
| 686 | if (!sense) | 684 | if (!sense) |
| 687 | sense = &local_sense; | 685 | sense = &local_sense; |
| 688 | 686 | ||
| 689 | ide_debug_log(IDE_DBG_PC, "Call %s, cmd[0]: 0x%x, write: 0x%x, " | 687 | ide_debug_log(IDE_DBG_PC, "cmd[0]: 0x%x, write: 0x%x, timeout: %d, " |
| 690 | "timeout: %d, cmd_flags: 0x%x\n", __func__, cmd[0], write, | 688 | "cmd_flags: 0x%x", |
| 691 | timeout, cmd_flags); | 689 | cmd[0], write, timeout, cmd_flags); |
| 692 | 690 | ||
| 693 | /* start of retry loop */ | 691 | /* start of retry loop */ |
| 694 | do { | 692 | do { |
| @@ -772,8 +770,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
| 772 | u16 len; | 770 | u16 len; |
| 773 | u8 ireason; | 771 | u8 ireason; |
| 774 | 772 | ||
| 775 | ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x\n", | 773 | ide_debug_log(IDE_DBG_PC, "cmd[0]: 0x%x, write: 0x%x", |
| 776 | __func__, rq->cmd[0], write); | 774 | rq->cmd[0], write); |
| 777 | 775 | ||
| 778 | /* check for errors */ | 776 | /* check for errors */ |
| 779 | dma = drive->dma; | 777 | dma = drive->dma; |
| @@ -795,10 +793,11 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
| 795 | if (dma_error) | 793 | if (dma_error) |
| 796 | return ide_error(drive, "dma error", stat); | 794 | return ide_error(drive, "dma error", stat); |
| 797 | if (blk_fs_request(rq)) { | 795 | if (blk_fs_request(rq)) { |
| 798 | ide_end_request(drive, 1, rq->nr_sectors); | 796 | ide_complete_rq(drive, 0, rq->nr_sectors |
| 797 | ? (rq->nr_sectors << 9) : ide_rq_bytes(rq)); | ||
| 799 | return ide_stopped; | 798 | return ide_stopped; |
| 800 | } else if (rq->cmd_type == REQ_TYPE_ATA_PC && !rq->bio) { | 799 | } else if (rq->cmd_type == REQ_TYPE_ATA_PC && !rq->bio) { |
| 801 | ide_end_request(drive, 1, 1); | 800 | ide_complete_rq(drive, 0, 512); |
| 802 | return ide_stopped; | 801 | return ide_stopped; |
| 803 | } | 802 | } |
| 804 | goto end_request; | 803 | goto end_request; |
| @@ -810,8 +809,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
| 810 | if (thislen > len) | 809 | if (thislen > len) |
| 811 | thislen = len; | 810 | thislen = len; |
| 812 | 811 | ||
| 813 | ide_debug_log(IDE_DBG_PC, "%s: DRQ: stat: 0x%x, thislen: %d\n", | 812 | ide_debug_log(IDE_DBG_PC, "DRQ: stat: 0x%x, thislen: %d", |
| 814 | __func__, stat, thislen); | 813 | stat, thislen); |
| 815 | 814 | ||
| 816 | /* If DRQ is clear, the command has completed. */ | 815 | /* If DRQ is clear, the command has completed. */ |
| 817 | if ((stat & ATA_DRQ) == 0) { | 816 | if ((stat & ATA_DRQ) == 0) { |
| @@ -876,8 +875,9 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
| 876 | xferfunc = hwif->tp_ops->input_data; | 875 | xferfunc = hwif->tp_ops->input_data; |
| 877 | } | 876 | } |
| 878 | 877 | ||
| 879 | ide_debug_log(IDE_DBG_PC, "%s: data transfer, rq->cmd_type: 0x%x, " | 878 | ide_debug_log(IDE_DBG_PC, "data transfer, rq->cmd_type: 0x%x, " |
| 880 | "ireason: 0x%x\n", __func__, rq->cmd_type, ireason); | 879 | "ireason: 0x%x", |
| 880 | rq->cmd_type, ireason); | ||
| 881 | 881 | ||
| 882 | /* transfer data */ | 882 | /* transfer data */ |
| 883 | while (thislen > 0) { | 883 | while (thislen > 0) { |
| @@ -959,7 +959,8 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
| 959 | expiry = ide_cd_expiry; | 959 | expiry = ide_cd_expiry; |
| 960 | } | 960 | } |
| 961 | 961 | ||
| 962 | ide_set_handler(drive, cdrom_newpc_intr, timeout, expiry); | 962 | hwif->expiry = expiry; |
| 963 | ide_set_handler(drive, cdrom_newpc_intr, timeout); | ||
| 963 | return ide_started; | 964 | return ide_started; |
| 964 | 965 | ||
| 965 | end_request: | 966 | end_request: |
| @@ -988,9 +989,9 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq) | |||
| 988 | unsigned short sectors_per_frame = | 989 | unsigned short sectors_per_frame = |
| 989 | queue_hardsect_size(drive->queue) >> SECTOR_BITS; | 990 | queue_hardsect_size(drive->queue) >> SECTOR_BITS; |
| 990 | 991 | ||
| 991 | ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, write: 0x%x, " | 992 | ide_debug_log(IDE_DBG_RQ, "rq->cmd[0]: 0x%x, write: 0x%x, " |
| 992 | "secs_per_frame: %u\n", | 993 | "secs_per_frame: %u", |
| 993 | __func__, rq->cmd[0], write, sectors_per_frame); | 994 | rq->cmd[0], write, sectors_per_frame); |
| 994 | 995 | ||
| 995 | if (write) { | 996 | if (write) { |
| 996 | /* disk has become write protected */ | 997 | /* disk has become write protected */ |
| @@ -1026,9 +1027,8 @@ static ide_startstop_t cdrom_start_rw(ide_drive_t *drive, struct request *rq) | |||
| 1026 | static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) | 1027 | static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) |
| 1027 | { | 1028 | { |
| 1028 | 1029 | ||
| 1029 | ide_debug_log(IDE_DBG_PC, "Call %s, rq->cmd[0]: 0x%x, " | 1030 | ide_debug_log(IDE_DBG_PC, "rq->cmd[0]: 0x%x, rq->cmd_type: 0x%x", |
| 1030 | "rq->cmd_type: 0x%x\n", __func__, rq->cmd[0], | 1031 | rq->cmd[0], rq->cmd_type); |
| 1031 | rq->cmd_type); | ||
| 1032 | 1032 | ||
| 1033 | if (blk_pc_request(rq)) | 1033 | if (blk_pc_request(rq)) |
| 1034 | rq->cmd_flags |= REQ_QUIET; | 1034 | rq->cmd_flags |= REQ_QUIET; |
| @@ -1067,10 +1067,13 @@ static void cdrom_do_block_pc(ide_drive_t *drive, struct request *rq) | |||
| 1067 | static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | 1067 | static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, |
| 1068 | sector_t block) | 1068 | sector_t block) |
| 1069 | { | 1069 | { |
| 1070 | ide_debug_log(IDE_DBG_RQ, "Call %s, rq->cmd[0]: 0x%x, " | 1070 | struct ide_cmd cmd; |
| 1071 | "rq->cmd_type: 0x%x, block: %llu\n", | 1071 | |
| 1072 | __func__, rq->cmd[0], rq->cmd_type, | 1072 | ide_debug_log(IDE_DBG_RQ, "cmd: 0x%x, block: %llu", |
| 1073 | (unsigned long long)block); | 1073 | rq->cmd[0], (unsigned long long)block); |
| 1074 | |||
| 1075 | if (drive->debug_mask & IDE_DBG_RQ) | ||
| 1076 | blk_dump_rq_flags(rq, "ide_cd_do_request"); | ||
| 1074 | 1077 | ||
| 1075 | if (blk_fs_request(rq)) { | 1078 | if (blk_fs_request(rq)) { |
| 1076 | if (cdrom_start_rw(drive, rq) == ide_stopped) | 1079 | if (cdrom_start_rw(drive, rq) == ide_stopped) |
| @@ -1094,7 +1097,14 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, | |||
| 1094 | return ide_stopped; | 1097 | return ide_stopped; |
| 1095 | } | 1098 | } |
| 1096 | 1099 | ||
| 1097 | return ide_issue_pc(drive); | 1100 | memset(&cmd, 0, sizeof(cmd)); |
| 1101 | |||
| 1102 | if (rq_data_dir(rq)) | ||
| 1103 | cmd.tf_flags |= IDE_TFLAG_WRITE; | ||
| 1104 | |||
| 1105 | cmd.rq = rq; | ||
| 1106 | |||
| 1107 | return ide_issue_pc(drive, &cmd); | ||
| 1098 | } | 1108 | } |
| 1099 | 1109 | ||
| 1100 | /* | 1110 | /* |
| @@ -1119,7 +1129,7 @@ int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) | |||
| 1119 | struct cdrom_device_info *cdi = &info->devinfo; | 1129 | struct cdrom_device_info *cdi = &info->devinfo; |
| 1120 | unsigned char cmd[BLK_MAX_CDB]; | 1130 | unsigned char cmd[BLK_MAX_CDB]; |
| 1121 | 1131 | ||
| 1122 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1132 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 1123 | 1133 | ||
| 1124 | memset(cmd, 0, BLK_MAX_CDB); | 1134 | memset(cmd, 0, BLK_MAX_CDB); |
| 1125 | cmd[0] = GPCMD_TEST_UNIT_READY; | 1135 | cmd[0] = GPCMD_TEST_UNIT_READY; |
| @@ -1147,7 +1157,7 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, | |||
| 1147 | unsigned len = sizeof(capbuf); | 1157 | unsigned len = sizeof(capbuf); |
| 1148 | u32 blocklen; | 1158 | u32 blocklen; |
| 1149 | 1159 | ||
| 1150 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1160 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 1151 | 1161 | ||
| 1152 | memset(cmd, 0, BLK_MAX_CDB); | 1162 | memset(cmd, 0, BLK_MAX_CDB); |
| 1153 | cmd[0] = GPCMD_READ_CDVD_CAPACITY; | 1163 | cmd[0] = GPCMD_READ_CDVD_CAPACITY; |
| @@ -1179,8 +1189,8 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, | |||
| 1179 | *capacity = 1 + be32_to_cpu(capbuf.lba); | 1189 | *capacity = 1 + be32_to_cpu(capbuf.lba); |
| 1180 | *sectors_per_frame = blocklen >> SECTOR_BITS; | 1190 | *sectors_per_frame = blocklen >> SECTOR_BITS; |
| 1181 | 1191 | ||
| 1182 | ide_debug_log(IDE_DBG_PROBE, "%s: cap: %lu, sectors_per_frame: %lu\n", | 1192 | ide_debug_log(IDE_DBG_PROBE, "cap: %lu, sectors_per_frame: %lu", |
| 1183 | __func__, *capacity, *sectors_per_frame); | 1193 | *capacity, *sectors_per_frame); |
| 1184 | 1194 | ||
| 1185 | return 0; | 1195 | return 0; |
| 1186 | } | 1196 | } |
| @@ -1191,7 +1201,7 @@ static int cdrom_read_tocentry(ide_drive_t *drive, int trackno, int msf_flag, | |||
| 1191 | { | 1201 | { |
| 1192 | unsigned char cmd[BLK_MAX_CDB]; | 1202 | unsigned char cmd[BLK_MAX_CDB]; |
| 1193 | 1203 | ||
| 1194 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1204 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 1195 | 1205 | ||
| 1196 | memset(cmd, 0, BLK_MAX_CDB); | 1206 | memset(cmd, 0, BLK_MAX_CDB); |
| 1197 | 1207 | ||
| @@ -1221,7 +1231,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) | |||
| 1221 | long last_written; | 1231 | long last_written; |
| 1222 | unsigned long sectors_per_frame = SECTORS_PER_FRAME; | 1232 | unsigned long sectors_per_frame = SECTORS_PER_FRAME; |
| 1223 | 1233 | ||
| 1224 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1234 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 1225 | 1235 | ||
| 1226 | if (toc == NULL) { | 1236 | if (toc == NULL) { |
| 1227 | /* try to allocate space */ | 1237 | /* try to allocate space */ |
| @@ -1383,7 +1393,7 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, u8 *buf) | |||
| 1383 | struct packet_command cgc; | 1393 | struct packet_command cgc; |
| 1384 | int stat, attempts = 3, size = ATAPI_CAPABILITIES_PAGE_SIZE; | 1394 | int stat, attempts = 3, size = ATAPI_CAPABILITIES_PAGE_SIZE; |
| 1385 | 1395 | ||
| 1386 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1396 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 1387 | 1397 | ||
| 1388 | if ((drive->atapi_flags & IDE_AFLAG_FULL_CAPS_PAGE) == 0) | 1398 | if ((drive->atapi_flags & IDE_AFLAG_FULL_CAPS_PAGE) == 0) |
| 1389 | size -= ATAPI_CAPABILITIES_PAGE_PAD_SIZE; | 1399 | size -= ATAPI_CAPABILITIES_PAGE_PAD_SIZE; |
| @@ -1403,7 +1413,7 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf) | |||
| 1403 | struct cdrom_info *cd = drive->driver_data; | 1413 | struct cdrom_info *cd = drive->driver_data; |
| 1404 | u16 curspeed, maxspeed; | 1414 | u16 curspeed, maxspeed; |
| 1405 | 1415 | ||
| 1406 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1416 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 1407 | 1417 | ||
| 1408 | if (drive->atapi_flags & IDE_AFLAG_LE_SPEED_FIELDS) { | 1418 | if (drive->atapi_flags & IDE_AFLAG_LE_SPEED_FIELDS) { |
| 1409 | curspeed = le16_to_cpup((__le16 *)&buf[8 + 14]); | 1419 | curspeed = le16_to_cpup((__le16 *)&buf[8 + 14]); |
| @@ -1413,8 +1423,8 @@ void ide_cdrom_update_speed(ide_drive_t *drive, u8 *buf) | |||
| 1413 | maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]); | 1423 | maxspeed = be16_to_cpup((__be16 *)&buf[8 + 8]); |
| 1414 | } | 1424 | } |
| 1415 | 1425 | ||
| 1416 | ide_debug_log(IDE_DBG_PROBE, "%s: curspeed: %u, maxspeed: %u\n", | 1426 | ide_debug_log(IDE_DBG_PROBE, "curspeed: %u, maxspeed: %u", |
| 1417 | __func__, curspeed, maxspeed); | 1427 | curspeed, maxspeed); |
| 1418 | 1428 | ||
| 1419 | cd->current_speed = (curspeed + (176/2)) / 176; | 1429 | cd->current_speed = (curspeed + (176/2)) / 176; |
| 1420 | cd->max_speed = (maxspeed + (176/2)) / 176; | 1430 | cd->max_speed = (maxspeed + (176/2)) / 176; |
| @@ -1448,7 +1458,7 @@ static int ide_cdrom_register(ide_drive_t *drive, int nslots) | |||
| 1448 | struct cdrom_info *info = drive->driver_data; | 1458 | struct cdrom_info *info = drive->driver_data; |
| 1449 | struct cdrom_device_info *devinfo = &info->devinfo; | 1459 | struct cdrom_device_info *devinfo = &info->devinfo; |
| 1450 | 1460 | ||
| 1451 | ide_debug_log(IDE_DBG_PROBE, "Call %s, nslots: %d\n", __func__, nslots); | 1461 | ide_debug_log(IDE_DBG_PROBE, "nslots: %d", nslots); |
| 1452 | 1462 | ||
| 1453 | devinfo->ops = &ide_cdrom_dops; | 1463 | devinfo->ops = &ide_cdrom_dops; |
| 1454 | devinfo->speed = info->current_speed; | 1464 | devinfo->speed = info->current_speed; |
| @@ -1471,9 +1481,8 @@ static int ide_cdrom_probe_capabilities(ide_drive_t *drive) | |||
| 1471 | mechtype_t mechtype; | 1481 | mechtype_t mechtype; |
| 1472 | int nslots = 1; | 1482 | int nslots = 1; |
| 1473 | 1483 | ||
| 1474 | ide_debug_log(IDE_DBG_PROBE, "Call %s, drive->media: 0x%x, " | 1484 | ide_debug_log(IDE_DBG_PROBE, "media: 0x%x, atapi_flags: 0x%lx", |
| 1475 | "drive->atapi_flags: 0x%lx\n", __func__, drive->media, | 1485 | drive->media, drive->atapi_flags); |
| 1476 | drive->atapi_flags); | ||
| 1477 | 1486 | ||
| 1478 | cdi->mask = (CDC_CD_R | CDC_CD_RW | CDC_DVD | CDC_DVD_R | | 1487 | cdi->mask = (CDC_CD_R | CDC_CD_RW | CDC_DVD | CDC_DVD_R | |
| 1479 | CDC_DVD_RAM | CDC_SELECT_DISC | CDC_PLAY_AUDIO | | 1488 | CDC_DVD_RAM | CDC_SELECT_DISC | CDC_PLAY_AUDIO | |
| @@ -1754,7 +1763,7 @@ static int ide_cdrom_setup(ide_drive_t *drive) | |||
| 1754 | char *fw_rev = (char *)&id[ATA_ID_FW_REV]; | 1763 | char *fw_rev = (char *)&id[ATA_ID_FW_REV]; |
| 1755 | int nslots; | 1764 | int nslots; |
| 1756 | 1765 | ||
| 1757 | ide_debug_log(IDE_DBG_PROBE, "Call %s\n", __func__); | 1766 | ide_debug_log(IDE_DBG_PROBE, "enter"); |
| 1758 | 1767 | ||
| 1759 | blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); | 1768 | blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); |
| 1760 | blk_queue_dma_alignment(drive->queue, 31); | 1769 | blk_queue_dma_alignment(drive->queue, 31); |
| @@ -1797,7 +1806,7 @@ static void ide_cd_remove(ide_drive_t *drive) | |||
| 1797 | { | 1806 | { |
| 1798 | struct cdrom_info *info = drive->driver_data; | 1807 | struct cdrom_info *info = drive->driver_data; |
| 1799 | 1808 | ||
| 1800 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1809 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 1801 | 1810 | ||
| 1802 | ide_proc_unregister_driver(drive, info->driver); | 1811 | ide_proc_unregister_driver(drive, info->driver); |
| 1803 | device_del(&info->dev); | 1812 | device_del(&info->dev); |
| @@ -1815,7 +1824,7 @@ static void ide_cd_release(struct device *dev) | |||
| 1815 | ide_drive_t *drive = info->drive; | 1824 | ide_drive_t *drive = info->drive; |
| 1816 | struct gendisk *g = info->disk; | 1825 | struct gendisk *g = info->disk; |
| 1817 | 1826 | ||
| 1818 | ide_debug_log(IDE_DBG_FUNC, "Call %s\n", __func__); | 1827 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 1819 | 1828 | ||
| 1820 | kfree(info->toc); | 1829 | kfree(info->toc); |
| 1821 | if (devinfo->handle == drive) | 1830 | if (devinfo->handle == drive) |
| @@ -1839,7 +1848,6 @@ static struct ide_driver ide_cdrom_driver = { | |||
| 1839 | .remove = ide_cd_remove, | 1848 | .remove = ide_cd_remove, |
| 1840 | .version = IDECD_VERSION, | 1849 | .version = IDECD_VERSION, |
| 1841 | .do_request = ide_cd_do_request, | 1850 | .do_request = ide_cd_do_request, |
| 1842 | .end_request = ide_end_request, | ||
| 1843 | #ifdef CONFIG_IDE_PROC_FS | 1851 | #ifdef CONFIG_IDE_PROC_FS |
| 1844 | .proc_entries = ide_cd_proc_entries, | 1852 | .proc_entries = ide_cd_proc_entries, |
| 1845 | .proc_devsets = ide_cd_proc_devsets, | 1853 | .proc_devsets = ide_cd_proc_devsets, |
| @@ -1974,9 +1982,8 @@ static int ide_cd_probe(ide_drive_t *drive) | |||
| 1974 | struct gendisk *g; | 1982 | struct gendisk *g; |
| 1975 | struct request_sense sense; | 1983 | struct request_sense sense; |
| 1976 | 1984 | ||
| 1977 | ide_debug_log(IDE_DBG_PROBE, "Call %s, drive->driver_req: %s, " | 1985 | ide_debug_log(IDE_DBG_PROBE, "driver_req: %s, media: 0x%x", |
| 1978 | "drive->media: 0x%x\n", __func__, drive->driver_req, | 1986 | drive->driver_req, drive->media); |
| 1979 | drive->media); | ||
| 1980 | 1987 | ||
| 1981 | if (!strstr("ide-cdrom", drive->driver_req)) | 1988 | if (!strstr("ide-cdrom", drive->driver_req)) |
| 1982 | goto failed; | 1989 | goto failed; |
