Lines 59-65
enum {
Link Here
|
59 |
}; |
59 |
}; |
60 |
|
60 |
|
61 |
/* define to see debug info */ |
61 |
/* define to see debug info */ |
62 |
#define IDETAPE_DEBUG_LOG 0 |
62 |
#define IDETAPE_DEBUG_LOG 1 |
63 |
|
63 |
|
64 |
#if IDETAPE_DEBUG_LOG |
64 |
#if IDETAPE_DEBUG_LOG |
65 |
#define debug_log(lvl, fmt, args...) \ |
65 |
#define debug_log(lvl, fmt, args...) \ |
Lines 720-728
static void idetape_create_mode_sense_cmd(struct ide_atapi_pc *pc, u8 page_code)
Link Here
|
720 |
if (page_code == IDETAPE_BLOCK_DESCRIPTOR) |
720 |
if (page_code == IDETAPE_BLOCK_DESCRIPTOR) |
721 |
pc->req_xfer = 12; |
721 |
pc->req_xfer = 12; |
722 |
else if (page_code == IDETAPE_CAPABILITIES_PAGE) |
722 |
else if (page_code == IDETAPE_CAPABILITIES_PAGE) |
723 |
pc->req_xfer = 24; |
723 |
pc->req_xfer = IDE_PC_BUFFER_SIZE; |
724 |
else |
724 |
else |
725 |
pc->req_xfer = 50; |
725 |
pc->req_xfer = 50; |
|
|
726 |
|
727 |
memset(pc->pc_buf, 0xf, IDE_PC_BUFFER_SIZE); |
726 |
} |
728 |
} |
727 |
|
729 |
|
728 |
static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive) |
730 |
static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive) |
Lines 795-805
static ide_startstop_t idetape_do_request(ide_drive_t *drive,
Link Here
|
795 |
if (rq->cmd_type == REQ_TYPE_SPECIAL) |
797 |
if (rq->cmd_type == REQ_TYPE_SPECIAL) |
796 |
drive->pc = (struct ide_atapi_pc *) rq->buffer; |
798 |
drive->pc = (struct ide_atapi_pc *) rq->buffer; |
797 |
|
799 |
|
798 |
debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %lu," |
800 |
printk(KERN_ERR "%s: cmd: 0x%x, 13: 0x%x, sector: %llu, nr_sectors: %lu," |
799 |
" current_nr_sectors: %u\n", |
801 |
" current_nr_sectors: %u\n", |
|
|
802 |
__func__, rq->cmd[0], rq->cmd[13], |
800 |
(unsigned long long)rq->sector, rq->nr_sectors, |
803 |
(unsigned long long)rq->sector, rq->nr_sectors, |
801 |
rq->current_nr_sectors); |
804 |
rq->current_nr_sectors); |
802 |
|
805 |
|
|
|
806 |
printk(KERN_ERR "%s: tape->failed_pc: %p, pc->c[0]: 0x%x\n", |
807 |
__func__, tape->failed_pc, |
808 |
(drive->pc ? drive->pc->c[0] : 0xdeadbeef)); |
809 |
|
810 |
blk_dump_rq_flags(rq, "this rq"); |
811 |
|
803 |
if (!blk_special_request(rq)) { |
812 |
if (!blk_special_request(rq)) { |
804 |
/* We do not support buffer cache originated requests. */ |
813 |
/* We do not support buffer cache originated requests. */ |
805 |
printk(KERN_NOTICE "ide-tape: %s: Unsupported request in " |
814 |
printk(KERN_NOTICE "ide-tape: %s: Unsupported request in " |
Lines 2075-2080
static void idetape_get_mode_sense_results(ide_drive_t *drive)
Link Here
|
2075 |
struct ide_atapi_pc pc; |
2084 |
struct ide_atapi_pc pc; |
2076 |
u8 *caps; |
2085 |
u8 *caps; |
2077 |
u8 speed, max_speed; |
2086 |
u8 speed, max_speed; |
|
|
2087 |
unsigned int i; |
2078 |
|
2088 |
|
2079 |
idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE); |
2089 |
idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE); |
2080 |
if (ide_queue_pc_tail(drive, tape->disk, &pc)) { |
2090 |
if (ide_queue_pc_tail(drive, tape->disk, &pc)) { |
Lines 2088-2093
static void idetape_get_mode_sense_results(ide_drive_t *drive)
Link Here
|
2088 |
} |
2098 |
} |
2089 |
caps = pc.buf + 4 + pc.buf[3]; |
2099 |
caps = pc.buf + 4 + pc.buf[3]; |
2090 |
|
2100 |
|
|
|
2101 |
printk(KERN_ERR "caps: "); |
2102 |
for (i = 0; i < IDE_PC_BUFFER_SIZE; i++) { |
2103 |
printk(KERN_CONT " %x", pc.buf[i]); |
2104 |
if ((i & 0xf) == 0xf) |
2105 |
printk(KERN_CONT "\n"); |
2106 |
printk(KERN_CONT "\n"); |
2107 |
} |
2108 |
|
2091 |
/* convert to host order and save for later use */ |
2109 |
/* convert to host order and save for later use */ |
2092 |
speed = be16_to_cpup((__be16 *)&caps[14]); |
2110 |
speed = be16_to_cpup((__be16 *)&caps[14]); |
2093 |
max_speed = be16_to_cpup((__be16 *)&caps[8]); |
2111 |
max_speed = be16_to_cpup((__be16 *)&caps[8]); |
Lines 2194-2199
static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
Link Here
|
2194 |
drive->pc_callback = ide_tape_callback; |
2212 |
drive->pc_callback = ide_tape_callback; |
2195 |
drive->pc_update_buffers = idetape_update_buffers; |
2213 |
drive->pc_update_buffers = idetape_update_buffers; |
2196 |
drive->pc_io_buffers = ide_tape_io_buffers; |
2214 |
drive->pc_io_buffers = ide_tape_io_buffers; |
|
|
2215 |
drive->debug_mask = 0xffffffff; |
2197 |
|
2216 |
|
2198 |
spin_lock_init(&tape->lock); |
2217 |
spin_lock_init(&tape->lock); |
2199 |
|
2218 |
|