• Home
  • Raw
  • Download

Lines Matching refs:pc

272 	struct ide_atapi_pc *pc = drive->failed_pc;  in idetape_analyze_error()  local
285 if (pc->flags & PC_FLAG_DMA_ERROR) in idetape_analyze_error()
293 if ((pc->c[0] == READ_6 || pc->c[0] == WRITE_6) in idetape_analyze_error()
295 && pc->c[4] == 0 && pc->c[3] == 0 && pc->c[2] == 0) { in idetape_analyze_error()
298 pc->error = 0; in idetape_analyze_error()
300 pc->flags |= PC_FLAG_ABORT; in idetape_analyze_error()
303 if (pc->c[0] == READ_6 && (sense[2] & 0x80)) { in idetape_analyze_error()
304 pc->error = IDE_DRV_ERROR_FILEMARK; in idetape_analyze_error()
305 pc->flags |= PC_FLAG_ABORT; in idetape_analyze_error()
307 if (pc->c[0] == WRITE_6) { in idetape_analyze_error()
310 pc->error = IDE_DRV_ERROR_EOD; in idetape_analyze_error()
311 pc->flags |= PC_FLAG_ABORT; in idetape_analyze_error()
314 if (pc->c[0] == READ_6 || pc->c[0] == WRITE_6) { in idetape_analyze_error()
316 pc->error = IDE_DRV_ERROR_EOD; in idetape_analyze_error()
317 pc->flags |= PC_FLAG_ABORT; in idetape_analyze_error()
319 if (!(pc->flags & PC_FLAG_ABORT) && in idetape_analyze_error()
321 pc->retries = IDETAPE_MAX_PC_RETRIES + 1; in idetape_analyze_error()
330 struct ide_atapi_pc *pc = drive->pc; in ide_tape_callback() local
332 int uptodate = pc->error ? 0 : 1; in ide_tape_callback()
341 if (drive->failed_pc == pc) in ide_tape_callback()
344 if (pc->c[0] == REQUEST_SENSE) { in ide_tape_callback()
350 } else if (pc->c[0] == READ_6 || pc->c[0] == WRITE_6) { in ide_tape_callback()
365 if (pc->error) { in ide_tape_callback()
367 err = pc->error; in ide_tape_callback()
442 struct ide_atapi_pc *pc) in ide_tape_issue_pc() argument
447 if (drive->failed_pc == NULL && pc->c[0] != REQUEST_SENSE) in ide_tape_issue_pc()
448 drive->failed_pc = pc; in ide_tape_issue_pc()
451 drive->pc = pc; in ide_tape_issue_pc()
453 if (pc->retries > IDETAPE_MAX_PC_RETRIES || in ide_tape_issue_pc()
454 (pc->flags & PC_FLAG_ABORT)) { in ide_tape_issue_pc()
461 if (!(pc->flags & PC_FLAG_ABORT)) { in ide_tape_issue_pc()
462 if (!(pc->c[0] == TEST_UNIT_READY && in ide_tape_issue_pc()
468 tape->name, pc->c[0], in ide_tape_issue_pc()
473 pc->error = IDE_DRV_ERROR_GENERAL; in ide_tape_issue_pc()
481 ide_debug_log(IDE_DBG_SENSE, "retry #%d, cmd: 0x%02x", pc->retries, in ide_tape_issue_pc()
482 pc->c[0]); in ide_tape_issue_pc()
484 pc->retries++; in ide_tape_issue_pc()
490 static void idetape_create_mode_sense_cmd(struct ide_atapi_pc *pc, u8 page_code) in idetape_create_mode_sense_cmd() argument
492 ide_init_pc(pc); in idetape_create_mode_sense_cmd()
493 pc->c[0] = MODE_SENSE; in idetape_create_mode_sense_cmd()
496 pc->c[1] = 8; in idetape_create_mode_sense_cmd()
497 pc->c[2] = page_code; in idetape_create_mode_sense_cmd()
505 pc->c[3] = 0; in idetape_create_mode_sense_cmd()
507 pc->c[4] = 255; in idetape_create_mode_sense_cmd()
509 pc->req_xfer = 12; in idetape_create_mode_sense_cmd()
511 pc->req_xfer = 24; in idetape_create_mode_sense_cmd()
513 pc->req_xfer = 50; in idetape_create_mode_sense_cmd()
520 struct ide_atapi_pc *pc = drive->pc; in idetape_media_access_finished() local
528 if (pc->c[0] != TEST_UNIT_READY) in idetape_media_access_finished()
535 pc->error = 0; in idetape_media_access_finished()
537 pc->error = IDE_DRV_ERROR_GENERAL; in idetape_media_access_finished()
545 struct ide_atapi_pc *pc, struct request *rq, in ide_tape_create_rw_cmd() argument
550 ide_init_pc(pc); in ide_tape_create_rw_cmd()
551 put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]); in ide_tape_create_rw_cmd()
552 pc->c[1] = 1; in ide_tape_create_rw_cmd()
555 pc->flags |= PC_FLAG_DMA_OK; in ide_tape_create_rw_cmd()
558 pc->c[0] = READ_6; in ide_tape_create_rw_cmd()
560 pc->c[0] = WRITE_6; in ide_tape_create_rw_cmd()
561 pc->flags |= PC_FLAG_WRITING; in ide_tape_create_rw_cmd()
564 memcpy(scsi_req(rq)->cmd, pc->c, 12); in ide_tape_create_rw_cmd()
572 struct ide_atapi_pc *pc = NULL; in idetape_do_request() local
586 if (drive->failed_pc && drive->pc->c[0] == REQUEST_SENSE) { in idetape_do_request()
587 pc = drive->failed_pc; in idetape_do_request()
633 pc = &tape->queued_pc; in idetape_do_request()
634 ide_tape_create_rw_cmd(tape, pc, rq, READ_6); in idetape_do_request()
638 pc = &tape->queued_pc; in idetape_do_request()
639 ide_tape_create_rw_cmd(tape, pc, rq, WRITE_6); in idetape_do_request()
643 pc = (struct ide_atapi_pc *)ide_req(rq)->special; in idetape_do_request()
668 return ide_tape_issue_pc(drive, &cmd, pc); in idetape_do_request()
676 struct ide_atapi_pc *pc, int write_filemark) in idetape_create_write_filemark_cmd() argument
678 ide_init_pc(pc); in idetape_create_write_filemark_cmd()
679 pc->c[0] = WRITE_FILEMARKS; in idetape_create_write_filemark_cmd()
680 pc->c[4] = write_filemark; in idetape_create_write_filemark_cmd()
681 pc->flags |= PC_FLAG_WAIT_FOR_DSC; in idetape_create_write_filemark_cmd()
715 struct ide_atapi_pc pc; in idetape_flush_tape_buffers() local
718 idetape_create_write_filemark_cmd(drive, &pc, 0); in idetape_flush_tape_buffers()
719 rc = ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0); in idetape_flush_tape_buffers()
729 struct ide_atapi_pc pc; in ide_tape_read_position() local
735 ide_init_pc(&pc); in ide_tape_read_position()
736 pc.c[0] = READ_POSITION; in ide_tape_read_position()
737 pc.req_xfer = 20; in ide_tape_read_position()
739 if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) in ide_tape_read_position()
742 if (!pc.error) { in ide_tape_read_position()
769 struct ide_atapi_pc *pc, in idetape_create_locate_cmd() argument
772 ide_init_pc(pc); in idetape_create_locate_cmd()
773 pc->c[0] = POSITION_TO_ELEMENT; in idetape_create_locate_cmd()
774 pc->c[1] = 2; in idetape_create_locate_cmd()
775 put_unaligned(cpu_to_be32(block), (unsigned int *) &pc->c[3]); in idetape_create_locate_cmd()
776 pc->c[8] = partition; in idetape_create_locate_cmd()
777 pc->flags |= PC_FLAG_WAIT_FOR_DSC; in idetape_create_locate_cmd()
809 struct ide_atapi_pc pc; in idetape_position_tape() local
814 idetape_create_locate_cmd(drive, &pc, block, partition, skip); in idetape_position_tape()
815 ret = ide_queue_pc_tail(drive, disk, &pc, NULL, 0); in idetape_position_tape()
889 static void idetape_create_inquiry_cmd(struct ide_atapi_pc *pc) in idetape_create_inquiry_cmd() argument
891 ide_init_pc(pc); in idetape_create_inquiry_cmd()
892 pc->c[0] = INQUIRY; in idetape_create_inquiry_cmd()
893 pc->c[4] = 254; in idetape_create_inquiry_cmd()
894 pc->req_xfer = 254; in idetape_create_inquiry_cmd()
898 struct ide_atapi_pc *pc) in idetape_create_rewind_cmd() argument
900 ide_init_pc(pc); in idetape_create_rewind_cmd()
901 pc->c[0] = REZERO_UNIT; in idetape_create_rewind_cmd()
902 pc->flags |= PC_FLAG_WAIT_FOR_DSC; in idetape_create_rewind_cmd()
905 static void idetape_create_erase_cmd(struct ide_atapi_pc *pc) in idetape_create_erase_cmd() argument
907 ide_init_pc(pc); in idetape_create_erase_cmd()
908 pc->c[0] = ERASE; in idetape_create_erase_cmd()
909 pc->c[1] = 1; in idetape_create_erase_cmd()
910 pc->flags |= PC_FLAG_WAIT_FOR_DSC; in idetape_create_erase_cmd()
913 static void idetape_create_space_cmd(struct ide_atapi_pc *pc, int count, u8 cmd) in idetape_create_space_cmd() argument
915 ide_init_pc(pc); in idetape_create_space_cmd()
916 pc->c[0] = SPACE; in idetape_create_space_cmd()
917 put_unaligned(cpu_to_be32(count), (unsigned int *) &pc->c[1]); in idetape_create_space_cmd()
918 pc->c[1] = cmd; in idetape_create_space_cmd()
919 pc->flags |= PC_FLAG_WAIT_FOR_DSC; in idetape_create_space_cmd()
1014 struct ide_atapi_pc pc; in idetape_rewind_tape() local
1019 idetape_create_rewind_cmd(drive, &pc); in idetape_rewind_tape()
1020 ret = ide_queue_pc_tail(drive, disk, &pc, NULL, 0); in idetape_rewind_tape()
1069 struct ide_atapi_pc pc; in idetape_space_over_filemarks() local
1095 idetape_create_space_cmd(&pc, mt_count - count, in idetape_space_over_filemarks()
1097 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); in idetape_space_over_filemarks()
1231 struct ide_atapi_pc pc; in idetape_write_filemark() local
1234 idetape_create_write_filemark_cmd(drive, &pc, 1); in idetape_write_filemark()
1235 if (ide_queue_pc_tail(drive, tape->disk, &pc, NULL, 0)) { in idetape_write_filemark()
1259 struct ide_atapi_pc pc; in idetape_mtioctop() local
1320 idetape_create_space_cmd(&pc, 0, IDETAPE_SPACE_TO_EOD); in idetape_mtioctop()
1321 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); in idetape_mtioctop()
1324 idetape_create_erase_cmd(&pc); in idetape_mtioctop()
1325 return ide_queue_pc_tail(drive, disk, &pc, NULL, 0); in idetape_mtioctop()
1455 struct ide_atapi_pc pc; in ide_tape_get_bsize_from_bdesc() local
1458 idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR); in ide_tape_get_bsize_from_bdesc()
1459 if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) { in ide_tape_get_bsize_from_bdesc()
1619 struct ide_atapi_pc pc; in idetape_get_inquiry_results() local
1623 idetape_create_inquiry_cmd(&pc); in idetape_get_inquiry_results()
1624 if (ide_queue_pc_tail(drive, tape->disk, &pc, pc_buf, pc.req_xfer)) { in idetape_get_inquiry_results()
1648 struct ide_atapi_pc pc; in idetape_get_mode_sense_results() local
1652 idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE); in idetape_get_mode_sense_results()
1653 if (ide_queue_pc_tail(drive, tape->disk, &pc, buf, pc.req_xfer)) { in idetape_get_mode_sense_results()