Lines Matching refs:SRpnt

325 static void st_analyze_sense(struct st_request *SRpnt, struct st_cmdstatus *s)  in st_analyze_sense()  argument
328 const u8 *sense = SRpnt->sense; in st_analyze_sense()
330 s->have_sense = scsi_normalize_sense(SRpnt->sense, in st_analyze_sense()
358 static int st_chk_result(struct scsi_tape *STp, struct st_request * SRpnt) in st_chk_result() argument
360 int result = SRpnt->result; in st_chk_result()
370 st_analyze_sense(SRpnt, cmdstatp); in st_chk_result()
381 SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2], in st_chk_result()
382 SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]); in st_chk_result()
385 SRpnt->sense, SCSI_SENSE_BUFFERSIZE); in st_chk_result()
398 SRpnt->cmd[0] != MODE_SENSE && in st_chk_result()
399 SRpnt->cmd[0] != TEST_UNIT_READY) { in st_chk_result()
402 SRpnt->sense, SCSI_SENSE_BUFFERSIZE); in st_chk_result()
409 STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & in st_chk_result()
412 STp->cleaning_req |= ((SRpnt->sense[STp->cln_mode] & in st_chk_result()
424 && SRpnt->cmd[0] != WRITE_6 in st_chk_result()
425 && SRpnt->cmd[0] != WRITE_FILEMARKS in st_chk_result()
433 if (SRpnt->cmd[0] == READ_6) in st_chk_result()
435 else if (SRpnt->cmd[0] == WRITE_6) in st_chk_result()
476 struct st_request *SRpnt = req->end_io_data; in st_scsi_execute_end() local
477 struct scsi_tape *STp = SRpnt->stp; in st_scsi_execute_end()
480 STp->buffer->cmdstat.midlevel_result = SRpnt->result = req->errors; in st_scsi_execute_end()
483 tmp = SRpnt->bio; in st_scsi_execute_end()
484 if (SRpnt->waiting) in st_scsi_execute_end()
485 complete(SRpnt->waiting); in st_scsi_execute_end()
491 static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd, in st_scsi_execute() argument
496 struct rq_map_data *mdata = &SRpnt->stp->buffer->map_data; in st_scsi_execute()
500 req = blk_get_request(SRpnt->stp->device->request_queue, write, in st_scsi_execute()
519 SRpnt->bio = req->bio; in st_scsi_execute()
523 req->sense = SRpnt->sense; in st_scsi_execute()
527 req->end_io_data = SRpnt; in st_scsi_execute()
537 st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd, in st_do_scsi() argument
555 if (!SRpnt) { in st_do_scsi()
556 SRpnt = st_allocate_request(STp); in st_do_scsi()
557 if (!SRpnt) in st_do_scsi()
564 (STp->buffer)->last_SRpnt = SRpnt; in st_do_scsi()
568 SRpnt->waiting = waiting; in st_do_scsi()
582 memcpy(SRpnt->cmd, cmd, sizeof(SRpnt->cmd)); in st_do_scsi()
586 ret = st_scsi_execute(SRpnt, cmd, direction, NULL, bytes, timeout, in st_do_scsi()
594 SRpnt->waiting = NULL; in st_do_scsi()
595 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in st_do_scsi()
598 return SRpnt; in st_do_scsi()
612 struct st_request *SRpnt; in write_behind_check() local
626 SRpnt = STbuffer->last_SRpnt; in write_behind_check()
628 SRpnt->waiting = NULL; in write_behind_check()
630 (STp->buffer)->syscall_result = st_chk_result(STp, SRpnt); in write_behind_check()
631 st_release_request(SRpnt); in write_behind_check()
672 struct st_request *SRpnt; in cross_eof() local
687 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in cross_eof()
690 if (!SRpnt) in cross_eof()
693 st_release_request(SRpnt); in cross_eof()
694 SRpnt = NULL; in cross_eof()
711 struct st_request *SRpnt; in st_flush_write_buffer() local
732 SRpnt = st_do_scsi(NULL, STp, cmd, transfer, DMA_TO_DEVICE, in st_flush_write_buffer()
735 if (!SRpnt) in st_flush_write_buffer()
764 st_release_request(SRpnt); in st_flush_write_buffer()
765 SRpnt = NULL; in st_flush_write_buffer()
916 struct st_request *SRpnt = NULL; in test_ready() local
924 SRpnt = st_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, in test_ready()
927 if (!SRpnt) { in test_ready()
974 if (SRpnt != NULL) in test_ready()
975 st_release_request(SRpnt); in test_ready()
990 struct st_request *SRpnt = NULL; in check_tape() local
1057 SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, DMA_FROM_DEVICE, in check_tape()
1060 if (!SRpnt) { in check_tape()
1065 if (!SRpnt->result && !STp->buffer->cmdstat.have_sense) { in check_tape()
1084 SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, DMA_FROM_DEVICE, in check_tape()
1087 if (!SRpnt) { in check_tape()
1126 st_release_request(SRpnt); in check_tape()
1127 SRpnt = NULL; in check_tape()
1290 struct st_request *SRpnt; in st_flush() local
1331 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in st_flush()
1334 if (!SRpnt) { in st_flush()
1346 st_release_request(SRpnt); in st_flush()
1347 SRpnt = NULL; in st_flush()
1356 st_release_request(SRpnt); in st_flush()
1357 SRpnt = NULL; in st_flush()
1575 struct st_request *SRpnt = NULL; in st_write() local
1720 SRpnt = st_do_scsi(SRpnt, STp, cmd, transfer, DMA_TO_DEVICE, in st_write()
1723 if (!SRpnt) { in st_write()
1731 SRpnt = NULL; /* Prevent releasing this request! */ in st_write()
1831 if (SRpnt != NULL) in st_write()
1832 st_release_request(SRpnt); in st_write()
1850 struct st_request *SRpnt; in read_tape() local
1889 SRpnt = *aSRpnt; in read_tape()
1890 SRpnt = st_do_scsi(SRpnt, STp, cmd, bytes, DMA_FROM_DEVICE, in read_tape()
1894 *aSRpnt = SRpnt; in read_tape()
1895 if (!SRpnt) in read_tape()
1908 SRpnt->sense[0], SRpnt->sense[1], in read_tape()
1909 SRpnt->sense[2], SRpnt->sense[3], in read_tape()
1910 SRpnt->sense[4], SRpnt->sense[5], in read_tape()
1911 SRpnt->sense[6], SRpnt->sense[7]); in read_tape()
1943 st_release_request(SRpnt); in read_tape()
1944 SRpnt = *aSRpnt = NULL; in read_tape()
2044 struct st_request *SRpnt = NULL; in st_read() local
2116 special = read_tape(STp, count - total, &SRpnt); in st_read()
2170 if (SRpnt != NULL) { in st_read()
2171 st_release_request(SRpnt); in st_read()
2172 SRpnt = NULL; in st_read()
2422 struct st_request *SRpnt; in read_mode_page() local
2431 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_FROM_DEVICE, in read_mode_page()
2433 if (SRpnt == NULL) in read_mode_page()
2436 st_release_request(SRpnt); in read_mode_page()
2448 struct st_request *SRpnt; in write_mode_page() local
2465 SRpnt = st_do_scsi(NULL, STp, cmd, cmd[4], DMA_TO_DEVICE, in write_mode_page()
2467 if (SRpnt == NULL) in write_mode_page()
2470 st_release_request(SRpnt); in write_mode_page()
2549 struct st_request *SRpnt; in do_load_unload() local
2586 SRpnt = st_do_scsi(NULL, STp, cmd, 0, DMA_NONE, in do_load_unload()
2588 if (!SRpnt) in do_load_unload()
2592 st_release_request(SRpnt); in do_load_unload()
2647 struct st_request *SRpnt; in st_int_ioctl() local
2901 SRpnt = st_do_scsi(NULL, STp, cmd, datalen, direction, in st_int_ioctl()
2903 if (!SRpnt) in st_int_ioctl()
2909 st_release_request(SRpnt); in st_int_ioctl()
2910 SRpnt = NULL; in st_int_ioctl()
3024 st_release_request(SRpnt); in st_int_ioctl()
3025 SRpnt = NULL; in st_int_ioctl()
3034 st_release_request(SRpnt); in st_int_ioctl()
3035 SRpnt = NULL; in st_int_ioctl()
3050 struct st_request *SRpnt; in get_location() local
3064 SRpnt = st_do_scsi(NULL, STp, scmd, 20, DMA_FROM_DEVICE, in get_location()
3067 if (!SRpnt) in get_location()
3096 st_release_request(SRpnt); in get_location()
3097 SRpnt = NULL; in get_location()
3113 struct st_request *SRpnt; in set_location() local
3169 SRpnt = st_do_scsi(NULL, STp, scmd, 0, DMA_NONE, in set_location()
3171 if (!SRpnt) in set_location()
3198 st_release_request(SRpnt); in set_location()
3199 SRpnt = NULL; in set_location()