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()
359 static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) in st_chk_result() argument
361 int result = SRpnt->result; in st_chk_result()
371 st_analyze_sense(SRpnt, cmdstatp); in st_chk_result()
382 SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2], in st_chk_result()
383 SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]); in st_chk_result()
386 SRpnt->sense, SCSI_SENSE_BUFFERSIZE); in st_chk_result()
399 SRpnt->cmd[0] != MODE_SENSE && in st_chk_result()
400 SRpnt->cmd[0] != TEST_UNIT_READY) { in st_chk_result()
403 SRpnt->sense, SCSI_SENSE_BUFFERSIZE); in st_chk_result()
410 STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & in st_chk_result()
413 STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & in st_chk_result()
425 && SRpnt->cmd[0] != WRITE_6 in st_chk_result()
426 && SRpnt->cmd[0] != WRITE_FILEMARKS in st_chk_result()
434 if (SRpnt->cmd[0] == READ_6) in st_chk_result()
436 else if (SRpnt->cmd[0] == WRITE_6) in st_chk_result()
518 struct st_request *SRpnt = req->end_io_data; in st_scsi_execute_end() local
520 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute_end()
523 STp->buffer->cmdstat.midlevel_result = SRpnt->result = rq->result; in st_scsi_execute_end()
528 tmp = SRpnt->bio; in st_scsi_execute_end()
530 memcpy(SRpnt->sense, rq->sense, SCSI_SENSE_BUFFERSIZE); in st_scsi_execute_end()
531 if (SRpnt->waiting) in st_scsi_execute_end()
532 complete(SRpnt->waiting); in st_scsi_execute_end()
538 static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd, in st_scsi_execute() argument
544 struct rq_map_data *mdata = &SRpnt->stp->buffer->map_data; in st_scsi_execute()
546 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute()
548 req = blk_get_request(SRpnt->stp->device->request_queue, in st_scsi_execute()
578 SRpnt->bio = req->bio; in st_scsi_execute()
584 req->end_io_data = SRpnt; in st_scsi_execute()
594 st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd, in st_do_scsi() argument
612 if (!SRpnt) { in st_do_scsi()
613 SRpnt = st_allocate_request(STp); in st_do_scsi()
614 if (!SRpnt) in st_do_scsi()
621 (STp->buffer)->last_SRpnt = SRpnt; in st_do_scsi()
625 SRpnt->waiting = waiting; in st_do_scsi()
639 memcpy(SRpnt->cmd, cmd, sizeof(SRpnt->cmd)); in st_do_scsi()
643 ret = st_scsi_execute(SRpnt, cmd, direction, NULL, bytes, timeout, in st_do_scsi()
651 SRpnt->waiting = NULL; in st_do_scsi()
652 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in st_do_scsi()
655 return SRpnt; in st_do_scsi()
669 struct st_request *SRpnt; in write_behind_check() local
683 SRpnt = STbuffer->last_SRpnt; in write_behind_check()
685 SRpnt->waiting = NULL; in write_behind_check()
687 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in write_behind_check()
688 st_release_request(SRpnt); in write_behind_check()
729 struct st_request *SRpnt; in cross_eof() local
744 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in cross_eof()
747 if (!SRpnt) in cross_eof()
750 st_release_request(SRpnt); in cross_eof()
751 SRpnt = NULL; in cross_eof()
768 struct st_request *SRpnt; in st_flush_write_buffer() local
789 SRpnt = st_do_scsi(NULL, STp, cmd, transfer, DMA_TO_DEVICE, in st_flush_write_buffer()
792 if (!SRpnt) in st_flush_write_buffer()
821 st_release_request(SRpnt); in st_flush_write_buffer()
822 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()
2000 st_release_request(SRpnt); in read_tape()
2001 SRpnt = *aSRpnt = NULL; in read_tape()
2101 struct st_request *SRpnt = NULL; in st_read() local
2173 special = read_tape(STp, count - total, &SRpnt); in st_read()
2227 if (SRpnt != NULL) { in st_read()
2228 st_release_request(SRpnt); in st_read()
2229 SRpnt = NULL; in st_read()
2479 struct st_request *SRpnt; in read_mode_page() local
2488 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_FROM_DEVICE, in read_mode_page()
2490 if (SRpnt == NULL) in read_mode_page()
2493 st_release_request(SRpnt); in read_mode_page()
2505 struct st_request *SRpnt; in write_mode_page() local
2522 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_TO_DEVICE, in write_mode_page()
2524 if (SRpnt == NULL) in write_mode_page()
2527 st_release_request(SRpnt); in write_mode_page()
2606 struct st_request *SRpnt; in do_load_unload() local
2643 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in do_load_unload()
2645 if (!SRpnt) in do_load_unload()
2649 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()