Lines Matching refs:SRpnt

326 static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s)  in st_analyze_sense()  argument
329 const u8 *sense = SRpnt->sense; in st_analyze_sense()
331 s->have_sense = scsi_normalize_sense(SRpnt->sense, in st_analyze_sense()
361 static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) in st_chk_result() argument
363 int result = SRpnt->result; in st_chk_result()
373 st_analyze_sense(SRpnt, cmdstatp); in st_chk_result()
384 SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2], in st_chk_result()
385 SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]); in st_chk_result()
388 SRpnt->sense, SCSI_SENSE_BUFFERSIZE); in st_chk_result()
401 SRpnt->cmd[0] != MODE_SENSE && in st_chk_result()
402 SRpnt->cmd[0] != TEST_UNIT_READY) { in st_chk_result()
405 SRpnt->sense, SCSI_SENSE_BUFFERSIZE); in st_chk_result()
412 STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & in st_chk_result()
415 STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & in st_chk_result()
427 && SRpnt->cmd[0] != WRITE_6 in st_chk_result()
428 && SRpnt->cmd[0] != WRITE_FILEMARKS in st_chk_result()
436 if (SRpnt->cmd[0] == READ_6) in st_chk_result()
438 else if (SRpnt->cmd[0] == WRITE_6) in st_chk_result()
520 struct st_request *SRpnt = req->end_io_data; in st_scsi_execute_end() local
522 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute_end()
525 STp->buffer->cmdstat.midlevel_result = SRpnt->result = rq->result; in st_scsi_execute_end()
530 tmp = SRpnt->bio; in st_scsi_execute_end()
532 memcpy(SRpnt->sense, rq->sense, SCSI_SENSE_BUFFERSIZE); in st_scsi_execute_end()
533 if (SRpnt->waiting) in st_scsi_execute_end()
534 complete(SRpnt->waiting); in st_scsi_execute_end()
540 static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd, in st_scsi_execute() argument
546 struct rq_map_data *mdata = &SRpnt->stp->buffer->map_data; in st_scsi_execute()
548 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute()
550 req = blk_get_request(SRpnt->stp->device->request_queue, in st_scsi_execute()
580 SRpnt->bio = req->bio; in st_scsi_execute()
586 req->end_io_data = SRpnt; in st_scsi_execute()
596 st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd, in st_do_scsi() argument
614 if (!SRpnt) { in st_do_scsi()
615 SRpnt = st_allocate_request(STp); in st_do_scsi()
616 if (!SRpnt) in st_do_scsi()
623 (STp->buffer)->last_SRpnt = SRpnt; in st_do_scsi()
627 SRpnt->waiting = waiting; in st_do_scsi()
641 memcpy(SRpnt->cmd, cmd, sizeof(SRpnt->cmd)); in st_do_scsi()
645 ret = st_scsi_execute(SRpnt, cmd, direction, NULL, bytes, timeout, in st_do_scsi()
653 SRpnt->waiting = NULL; in st_do_scsi()
654 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in st_do_scsi()
657 return SRpnt; in st_do_scsi()
671 struct st_request *SRpnt; in write_behind_check() local
685 SRpnt = STbuffer->last_SRpnt; in write_behind_check()
687 SRpnt->waiting = NULL; in write_behind_check()
689 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in write_behind_check()
690 st_release_request(SRpnt); in write_behind_check()
731 struct st_request *SRpnt; in cross_eof() local
746 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in cross_eof()
749 if (!SRpnt) in cross_eof()
752 st_release_request(SRpnt); in cross_eof()
753 SRpnt = NULL; in cross_eof()
770 struct st_request *SRpnt; in st_flush_write_buffer() local
791 SRpnt = st_do_scsi(NULL, STp, cmd, transfer, DMA_TO_DEVICE, in st_flush_write_buffer()
794 if (!SRpnt) in st_flush_write_buffer()
823 st_release_request(SRpnt); in st_flush_write_buffer()
824 SRpnt = NULL; in st_flush_write_buffer()
972 struct st_request *SRpnt = NULL; in test_ready() local
980 SRpnt = st_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, in test_ready()
983 if (!SRpnt) { in test_ready()
1030 if (SRpnt != NULL) in test_ready()
1031 st_release_request(SRpnt); in test_ready()
1046 struct st_request *SRpnt = NULL; in check_tape() local
1113 SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, DMA_FROM_DEVICE, in check_tape()
1116 if (!SRpnt) { in check_tape()
1121 if (!SRpnt->result && !STp->buffer->cmdstat.have_sense) { in check_tape()
1140 SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, DMA_FROM_DEVICE, in check_tape()
1143 if (!SRpnt) { in check_tape()
1182 st_release_request(SRpnt); in check_tape()
1183 SRpnt = NULL; in check_tape()
1346 struct st_request *SRpnt; in st_flush() local
1387 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in st_flush()
1390 if (!SRpnt) { in st_flush()
1402 st_release_request(SRpnt); in st_flush()
1403 SRpnt = NULL; in st_flush()
1412 st_release_request(SRpnt); in st_flush()
1413 SRpnt = NULL; in st_flush()
1630 struct st_request *SRpnt = NULL; in st_write() local
1775 SRpnt = st_do_scsi(SRpnt, STp, cmd, transfer, DMA_TO_DEVICE, in st_write()
1778 if (!SRpnt) { in st_write()
1786 SRpnt = NULL; /* Prevent releasing this request! */ in st_write()
1886 if (SRpnt != NULL) in st_write()
1887 st_release_request(SRpnt); in st_write()
1905 struct st_request *SRpnt; in read_tape() local
1944 SRpnt = *aSRpnt; in read_tape()
1945 SRpnt = st_do_scsi(SRpnt, STp, cmd, bytes, DMA_FROM_DEVICE, in read_tape()
1949 *aSRpnt = SRpnt; in read_tape()
1950 if (!SRpnt) in read_tape()
1963 SRpnt->sense[0], SRpnt->sense[1], in read_tape()
1964 SRpnt->sense[2], SRpnt->sense[3], in read_tape()
1965 SRpnt->sense[4], SRpnt->sense[5], in read_tape()
1966 SRpnt->sense[6], SRpnt->sense[7]); in read_tape()
2001 st_release_request(SRpnt); in read_tape()
2002 SRpnt = *aSRpnt = NULL; in read_tape()
2102 struct st_request *SRpnt = NULL; in st_read() local
2174 special = read_tape(STp, count - total, &SRpnt); in st_read()
2228 if (SRpnt != NULL) { in st_read()
2229 st_release_request(SRpnt); in st_read()
2230 SRpnt = NULL; in st_read()
2480 struct st_request *SRpnt; in read_mode_page() local
2489 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_FROM_DEVICE, in read_mode_page()
2491 if (SRpnt == NULL) in read_mode_page()
2494 st_release_request(SRpnt); in read_mode_page()
2506 struct st_request *SRpnt; in write_mode_page() local
2523 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_TO_DEVICE, in write_mode_page()
2525 if (SRpnt == NULL) in write_mode_page()
2528 st_release_request(SRpnt); in write_mode_page()
2607 struct st_request *SRpnt; in do_load_unload() local
2644 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in do_load_unload()
2646 if (!SRpnt) in do_load_unload()
2650 st_release_request(SRpnt); in do_load_unload()
2704 struct st_request *SRpnt; in st_int_ioctl() local
2960 SRpnt = st_do_scsi(NULL, STp, cmd, datalen, direction, in st_int_ioctl()
2962 if (!SRpnt) in st_int_ioctl()
2968 st_release_request(SRpnt); in st_int_ioctl()
2969 SRpnt = NULL; in st_int_ioctl()
3083 st_release_request(SRpnt); in st_int_ioctl()
3084 SRpnt = NULL; in st_int_ioctl()
3093 st_release_request(SRpnt); in st_int_ioctl()
3094 SRpnt = NULL; in st_int_ioctl()
3109 struct st_request *SRpnt; in get_location() local
3123 SRpnt = st_do_scsi(NULL, STp, scmd, 20, DMA_FROM_DEVICE, in get_location()
3126 if (!SRpnt) in get_location()
3155 st_release_request(SRpnt); in get_location()
3156 SRpnt = NULL; in get_location()
3172 struct st_request *SRpnt; in set_location() local
3228 SRpnt = st_do_scsi(NULL, STp, scmd, 0, DMA_NONE, in set_location()
3230 if (!SRpnt) in set_location()
3257 st_release_request(SRpnt); in set_location()
3258 SRpnt = NULL; in set_location()
3338 struct st_request *SRpnt; in format_medium() local
3348 SRpnt = st_do_scsi(NULL, STp, scmd, 0, DMA_NONE, in format_medium()
3350 if (!SRpnt) in format_medium()