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
517 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute_end()
520 STp->buffer->cmdstat.midlevel_result = SRpnt->result = req->errors; in st_scsi_execute_end()
525 tmp = SRpnt->bio; in st_scsi_execute_end()
526 if (SRpnt->waiting) in st_scsi_execute_end()
527 complete(SRpnt->waiting); in st_scsi_execute_end()
533 static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd, in st_scsi_execute() argument
538 struct rq_map_data *mdata = &SRpnt->stp->buffer->map_data; in st_scsi_execute()
541 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute()
543 req = blk_get_request(SRpnt->stp->device->request_queue, write, in st_scsi_execute()
573 SRpnt->bio = req->bio; in st_scsi_execute()
577 req->sense = SRpnt->sense; in st_scsi_execute()
581 req->end_io_data = SRpnt; in st_scsi_execute()
591 st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd, in st_do_scsi() argument
609 if (!SRpnt) { in st_do_scsi()
610 SRpnt = st_allocate_request(STp); in st_do_scsi()
611 if (!SRpnt) in st_do_scsi()
618 (STp->buffer)->last_SRpnt = SRpnt; in st_do_scsi()
622 SRpnt->waiting = waiting; in st_do_scsi()
636 memcpy(SRpnt->cmd, cmd, sizeof(SRpnt->cmd)); in st_do_scsi()
640 ret = st_scsi_execute(SRpnt, cmd, direction, NULL, bytes, timeout, in st_do_scsi()
648 SRpnt->waiting = NULL; in st_do_scsi()
649 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in st_do_scsi()
652 return SRpnt; in st_do_scsi()
666 struct st_request *SRpnt; in write_behind_check() local
680 SRpnt = STbuffer->last_SRpnt; in write_behind_check()
682 SRpnt->waiting = NULL; in write_behind_check()
684 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in write_behind_check()
685 st_release_request(SRpnt); in write_behind_check()
726 struct st_request *SRpnt; in cross_eof() local
741 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in cross_eof()
744 if (!SRpnt) in cross_eof()
747 st_release_request(SRpnt); in cross_eof()
748 SRpnt = NULL; in cross_eof()
765 struct st_request *SRpnt; in st_flush_write_buffer() local
786 SRpnt = st_do_scsi(NULL, STp, cmd, transfer, DMA_TO_DEVICE, in st_flush_write_buffer()
789 if (!SRpnt) in st_flush_write_buffer()
818 st_release_request(SRpnt); in st_flush_write_buffer()
819 SRpnt = NULL; in st_flush_write_buffer()
970 struct st_request *SRpnt = NULL; in test_ready() local
978 SRpnt = st_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, in test_ready()
981 if (!SRpnt) { in test_ready()
1028 if (SRpnt != NULL) in test_ready()
1029 st_release_request(SRpnt); in test_ready()
1044 struct st_request *SRpnt = NULL; in check_tape() local
1111 SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, DMA_FROM_DEVICE, in check_tape()
1114 if (!SRpnt) { in check_tape()
1119 if (!SRpnt->result && !STp->buffer->cmdstat.have_sense) { in check_tape()
1138 SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, DMA_FROM_DEVICE, in check_tape()
1141 if (!SRpnt) { in check_tape()
1180 st_release_request(SRpnt); in check_tape()
1181 SRpnt = NULL; in check_tape()
1344 struct st_request *SRpnt; in st_flush() local
1385 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in st_flush()
1388 if (!SRpnt) { in st_flush()
1400 st_release_request(SRpnt); in st_flush()
1401 SRpnt = NULL; in st_flush()
1410 st_release_request(SRpnt); in st_flush()
1411 SRpnt = NULL; in st_flush()
1629 struct st_request *SRpnt = NULL; in st_write() local
1774 SRpnt = st_do_scsi(SRpnt, STp, cmd, transfer, DMA_TO_DEVICE, in st_write()
1777 if (!SRpnt) { in st_write()
1785 SRpnt = NULL; /* Prevent releasing this request! */ in st_write()
1885 if (SRpnt != NULL) in st_write()
1886 st_release_request(SRpnt); in st_write()
1904 struct st_request *SRpnt; in read_tape() local
1943 SRpnt = *aSRpnt; in read_tape()
1944 SRpnt = st_do_scsi(SRpnt, STp, cmd, bytes, DMA_FROM_DEVICE, in read_tape()
1948 *aSRpnt = SRpnt; in read_tape()
1949 if (!SRpnt) in read_tape()
1962 SRpnt->sense[0], SRpnt->sense[1], in read_tape()
1963 SRpnt->sense[2], SRpnt->sense[3], in read_tape()
1964 SRpnt->sense[4], SRpnt->sense[5], in read_tape()
1965 SRpnt->sense[6], SRpnt->sense[7]); in read_tape()
1997 st_release_request(SRpnt); in read_tape()
1998 SRpnt = *aSRpnt = NULL; in read_tape()
2098 struct st_request *SRpnt = NULL; in st_read() local
2170 special = read_tape(STp, count - total, &SRpnt); in st_read()
2224 if (SRpnt != NULL) { in st_read()
2225 st_release_request(SRpnt); in st_read()
2226 SRpnt = NULL; in st_read()
2476 struct st_request *SRpnt; in read_mode_page() local
2485 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_FROM_DEVICE, in read_mode_page()
2487 if (SRpnt == NULL) in read_mode_page()
2490 st_release_request(SRpnt); in read_mode_page()
2502 struct st_request *SRpnt; in write_mode_page() local
2519 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_TO_DEVICE, in write_mode_page()
2521 if (SRpnt == NULL) in write_mode_page()
2524 st_release_request(SRpnt); in write_mode_page()
2603 struct st_request *SRpnt; in do_load_unload() local
2640 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in do_load_unload()
2642 if (!SRpnt) in do_load_unload()
2646 st_release_request(SRpnt); in do_load_unload()
2701 struct st_request *SRpnt; in st_int_ioctl() local
2955 SRpnt = st_do_scsi(NULL, STp, cmd, datalen, direction, in st_int_ioctl()
2957 if (!SRpnt) in st_int_ioctl()
2963 st_release_request(SRpnt); in st_int_ioctl()
2964 SRpnt = NULL; in st_int_ioctl()
3078 st_release_request(SRpnt); in st_int_ioctl()
3079 SRpnt = NULL; in st_int_ioctl()
3088 st_release_request(SRpnt); in st_int_ioctl()
3089 SRpnt = NULL; in st_int_ioctl()
3104 struct st_request *SRpnt; in get_location() local
3118 SRpnt = st_do_scsi(NULL, STp, scmd, 20, DMA_FROM_DEVICE, in get_location()
3121 if (!SRpnt) in get_location()
3150 st_release_request(SRpnt); in get_location()
3151 SRpnt = NULL; in get_location()
3167 struct st_request *SRpnt; in set_location() local
3223 SRpnt = st_do_scsi(NULL, STp, scmd, 0, DMA_NONE, in set_location()
3225 if (!SRpnt) in set_location()
3252 st_release_request(SRpnt); in set_location()
3253 SRpnt = NULL; in set_location()