Lines Matching refs:SRpnt

324 static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s)  in st_analyze_sense()  argument
327 const u8 *sense = SRpnt->sense; in st_analyze_sense()
329 s->have_sense = scsi_normalize_sense(SRpnt->sense, in st_analyze_sense()
357 static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) in st_chk_result() argument
359 int result = SRpnt->result; in st_chk_result()
369 st_analyze_sense(SRpnt, cmdstatp); in st_chk_result()
380 SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2], in st_chk_result()
381 SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]); in st_chk_result()
384 SRpnt->sense, SCSI_SENSE_BUFFERSIZE); in st_chk_result()
397 SRpnt->cmd[0] != MODE_SENSE && in st_chk_result()
398 SRpnt->cmd[0] != TEST_UNIT_READY) { in st_chk_result()
401 SRpnt->sense, SCSI_SENSE_BUFFERSIZE); in st_chk_result()
408 STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & in st_chk_result()
411 STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & in st_chk_result()
423 && SRpnt->cmd[0] != WRITE_6 in st_chk_result()
424 && SRpnt->cmd[0] != WRITE_FILEMARKS in st_chk_result()
432 if (SRpnt->cmd[0] == READ_6) in st_chk_result()
434 else if (SRpnt->cmd[0] == WRITE_6) in st_chk_result()
516 struct st_request *SRpnt = req->end_io_data; in st_scsi_execute_end() local
518 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute_end()
521 STp->buffer->cmdstat.midlevel_result = SRpnt->result = rq->result; in st_scsi_execute_end()
526 tmp = SRpnt->bio; in st_scsi_execute_end()
528 memcpy(SRpnt->sense, rq->sense, SCSI_SENSE_BUFFERSIZE); in st_scsi_execute_end()
529 if (SRpnt->waiting) in st_scsi_execute_end()
530 complete(SRpnt->waiting); in st_scsi_execute_end()
536 static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd, in st_scsi_execute() argument
542 struct rq_map_data *mdata = &SRpnt->stp->buffer->map_data; in st_scsi_execute()
544 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute()
546 req = blk_get_request(SRpnt->stp->device->request_queue, in st_scsi_execute()
576 SRpnt->bio = req->bio; in st_scsi_execute()
582 req->end_io_data = SRpnt; in st_scsi_execute()
592 st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd, in st_do_scsi() argument
610 if (!SRpnt) { in st_do_scsi()
611 SRpnt = st_allocate_request(STp); in st_do_scsi()
612 if (!SRpnt) in st_do_scsi()
619 (STp->buffer)->last_SRpnt = SRpnt; in st_do_scsi()
623 SRpnt->waiting = waiting; in st_do_scsi()
637 memcpy(SRpnt->cmd, cmd, sizeof(SRpnt->cmd)); in st_do_scsi()
641 ret = st_scsi_execute(SRpnt, cmd, direction, NULL, bytes, timeout, in st_do_scsi()
649 SRpnt->waiting = NULL; in st_do_scsi()
650 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in st_do_scsi()
653 return SRpnt; in st_do_scsi()
667 struct st_request *SRpnt; in write_behind_check() local
681 SRpnt = STbuffer->last_SRpnt; in write_behind_check()
683 SRpnt->waiting = NULL; in write_behind_check()
685 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in write_behind_check()
686 st_release_request(SRpnt); in write_behind_check()
727 struct st_request *SRpnt; in cross_eof() local
742 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in cross_eof()
745 if (!SRpnt) in cross_eof()
748 st_release_request(SRpnt); in cross_eof()
749 SRpnt = NULL; in cross_eof()
766 struct st_request *SRpnt; in st_flush_write_buffer() local
787 SRpnt = st_do_scsi(NULL, STp, cmd, transfer, DMA_TO_DEVICE, in st_flush_write_buffer()
790 if (!SRpnt) in st_flush_write_buffer()
819 st_release_request(SRpnt); in st_flush_write_buffer()
820 SRpnt = NULL; in st_flush_write_buffer()
968 struct st_request *SRpnt = NULL; in test_ready() local
976 SRpnt = st_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, in test_ready()
979 if (!SRpnt) { in test_ready()
1026 if (SRpnt != NULL) in test_ready()
1027 st_release_request(SRpnt); in test_ready()
1042 struct st_request *SRpnt = NULL; in check_tape() local
1109 SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, DMA_FROM_DEVICE, in check_tape()
1112 if (!SRpnt) { in check_tape()
1117 if (!SRpnt->result && !STp->buffer->cmdstat.have_sense) { in check_tape()
1136 SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, DMA_FROM_DEVICE, in check_tape()
1139 if (!SRpnt) { in check_tape()
1178 st_release_request(SRpnt); in check_tape()
1179 SRpnt = NULL; in check_tape()
1342 struct st_request *SRpnt; in st_flush() local
1383 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in st_flush()
1386 if (!SRpnt) { in st_flush()
1398 st_release_request(SRpnt); in st_flush()
1399 SRpnt = NULL; in st_flush()
1408 st_release_request(SRpnt); in st_flush()
1409 SRpnt = NULL; in st_flush()
1627 struct st_request *SRpnt = NULL; in st_write() local
1772 SRpnt = st_do_scsi(SRpnt, STp, cmd, transfer, DMA_TO_DEVICE, in st_write()
1775 if (!SRpnt) { in st_write()
1783 SRpnt = NULL; /* Prevent releasing this request! */ in st_write()
1883 if (SRpnt != NULL) in st_write()
1884 st_release_request(SRpnt); in st_write()
1902 struct st_request *SRpnt; in read_tape() local
1941 SRpnt = *aSRpnt; in read_tape()
1942 SRpnt = st_do_scsi(SRpnt, STp, cmd, bytes, DMA_FROM_DEVICE, in read_tape()
1946 *aSRpnt = SRpnt; in read_tape()
1947 if (!SRpnt) in read_tape()
1960 SRpnt->sense[0], SRpnt->sense[1], in read_tape()
1961 SRpnt->sense[2], SRpnt->sense[3], in read_tape()
1962 SRpnt->sense[4], SRpnt->sense[5], in read_tape()
1963 SRpnt->sense[6], SRpnt->sense[7]); in read_tape()
1998 st_release_request(SRpnt); in read_tape()
1999 SRpnt = *aSRpnt = NULL; in read_tape()
2099 struct st_request *SRpnt = NULL; in st_read() local
2171 special = read_tape(STp, count - total, &SRpnt); in st_read()
2225 if (SRpnt != NULL) { in st_read()
2226 st_release_request(SRpnt); in st_read()
2227 SRpnt = NULL; in st_read()
2477 struct st_request *SRpnt; in read_mode_page() local
2486 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_FROM_DEVICE, in read_mode_page()
2488 if (SRpnt == NULL) in read_mode_page()
2491 st_release_request(SRpnt); in read_mode_page()
2503 struct st_request *SRpnt; in write_mode_page() local
2520 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_TO_DEVICE, in write_mode_page()
2522 if (SRpnt == NULL) in write_mode_page()
2525 st_release_request(SRpnt); in write_mode_page()
2604 struct st_request *SRpnt; in do_load_unload() local
2641 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in do_load_unload()
2643 if (!SRpnt) in do_load_unload()
2647 st_release_request(SRpnt); in do_load_unload()
2702 struct st_request *SRpnt; in st_int_ioctl() local
2956 SRpnt = st_do_scsi(NULL, STp, cmd, datalen, direction, in st_int_ioctl()
2958 if (!SRpnt) in st_int_ioctl()
2964 st_release_request(SRpnt); in st_int_ioctl()
2965 SRpnt = NULL; in st_int_ioctl()
3079 st_release_request(SRpnt); in st_int_ioctl()
3080 SRpnt = NULL; in st_int_ioctl()
3089 st_release_request(SRpnt); in st_int_ioctl()
3090 SRpnt = NULL; in st_int_ioctl()
3105 struct st_request *SRpnt; in get_location() local
3119 SRpnt = st_do_scsi(NULL, STp, scmd, 20, DMA_FROM_DEVICE, in get_location()
3122 if (!SRpnt) in get_location()
3151 st_release_request(SRpnt); in get_location()
3152 SRpnt = NULL; in get_location()
3168 struct st_request *SRpnt; in set_location() local
3224 SRpnt = st_do_scsi(NULL, STp, scmd, 0, DMA_NONE, in set_location()
3226 if (!SRpnt) in set_location()
3253 st_release_request(SRpnt); in set_location()
3254 SRpnt = NULL; in set_location()
3334 struct st_request *SRpnt; in format_medium() local
3344 SRpnt = st_do_scsi(NULL, STp, scmd, 0, DMA_NONE, in format_medium()
3346 if (!SRpnt) in format_medium()