Lines Matching refs:request
55 static void __tape_34xx_medium_sense(struct tape_request *request) in __tape_34xx_medium_sense() argument
57 struct tape_device *device = request->device; in __tape_34xx_medium_sense()
60 if (request->rc == 0) { in __tape_34xx_medium_sense()
61 sense = request->cpdata; in __tape_34xx_medium_sense()
80 request->rc); in __tape_34xx_medium_sense()
81 tape_free_request(request); in __tape_34xx_medium_sense()
86 struct tape_request *request; in tape_34xx_medium_sense() local
89 request = tape_alloc_request(1, 32); in tape_34xx_medium_sense()
90 if (IS_ERR(request)) { in tape_34xx_medium_sense()
92 return PTR_ERR(request); in tape_34xx_medium_sense()
95 request->op = TO_MSEN; in tape_34xx_medium_sense()
96 tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); in tape_34xx_medium_sense()
97 rc = tape_do_io_interruptible(device, request); in tape_34xx_medium_sense()
98 __tape_34xx_medium_sense(request); in tape_34xx_medium_sense()
104 struct tape_request *request; in tape_34xx_medium_sense_async() local
106 request = tape_alloc_request(1, 32); in tape_34xx_medium_sense_async()
107 if (IS_ERR(request)) { in tape_34xx_medium_sense_async()
112 request->op = TO_MSEN; in tape_34xx_medium_sense_async()
113 tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); in tape_34xx_medium_sense_async()
114 request->callback = (void *) __tape_34xx_medium_sense; in tape_34xx_medium_sense_async()
115 request->callback_data = NULL; in tape_34xx_medium_sense_async()
116 tape_do_io_async(device, request); in tape_34xx_medium_sense_async()
174 tape_34xx_done(struct tape_request *request) in tape_34xx_done() argument
176 DBF_EVENT(6, "%s done\n", tape_op_verbose[request->op]); in tape_34xx_done()
178 switch (request->op) { in tape_34xx_done()
185 tape_34xx_delete_sbid_from(request->device, 0); in tape_34xx_done()
194 tape_34xx_erp_failed(struct tape_request *request, int rc) in tape_34xx_erp_failed() argument
197 tape_op_verbose[request->op], rc); in tape_34xx_erp_failed()
202 tape_34xx_erp_succeeded(struct tape_request *request) in tape_34xx_erp_succeeded() argument
205 tape_op_verbose[request->op]); in tape_34xx_erp_succeeded()
206 return tape_34xx_done(request); in tape_34xx_erp_succeeded()
210 tape_34xx_erp_retry(struct tape_request *request) in tape_34xx_erp_retry() argument
212 DBF_EVENT(3, "xerp retr %s\n", tape_op_verbose[request->op]); in tape_34xx_erp_retry()
241 struct tape_request *request) in tape_34xx_erp_read_opposite() argument
243 if (request->op == TO_RFO) { in tape_34xx_erp_read_opposite()
249 tape_std_read_backward(device, request); in tape_34xx_erp_read_opposite()
250 return tape_34xx_erp_retry(request); in tape_34xx_erp_read_opposite()
257 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_read_opposite()
261 tape_34xx_erp_bug(struct tape_device *device, struct tape_request *request, in tape_34xx_erp_bug() argument
264 if (request->op != TO_ASSIGN) { in tape_34xx_erp_bug()
267 tape_dump_sense_dbf(device, request, irb); in tape_34xx_erp_bug()
269 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_bug()
277 tape_34xx_erp_overrun(struct tape_device *device, struct tape_request *request, in tape_34xx_erp_overrun() argument
283 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_overrun()
285 return tape_34xx_erp_bug(device, request, irb, -1); in tape_34xx_erp_overrun()
293 struct tape_request *request, struct irb *irb) in tape_34xx_erp_sequence() argument
301 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_sequence()
307 return tape_34xx_erp_bug(device, request, irb, -2); in tape_34xx_erp_sequence()
316 tape_34xx_unit_check(struct tape_device *device, struct tape_request *request, in tape_34xx_unit_check() argument
330 request->op == TO_DSE || in tape_34xx_unit_check()
331 request->op == TO_WRI || in tape_34xx_unit_check()
332 request->op == TO_WTM in tape_34xx_unit_check()
335 return tape_34xx_erp_failed(request, -EACCES); in tape_34xx_unit_check()
337 return tape_34xx_erp_bug(device, request, irb, -3); in tape_34xx_unit_check()
361 switch (request->op) { in tape_34xx_unit_check()
372 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
374 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
384 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
388 return tape_34xx_erp_failed(request, 0); in tape_34xx_unit_check()
397 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
399 return tape_34xx_erp_failed(request, 0); in tape_34xx_unit_check()
405 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
420 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
426 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
434 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
440 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
443 return tape_34xx_erp_read_opposite(device, request); in tape_34xx_unit_check()
448 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
453 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
458 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
464 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
470 return tape_34xx_erp_overrun(device, request, irb); in tape_34xx_unit_check()
473 return tape_34xx_erp_sequence(device, request, irb); in tape_34xx_unit_check()
485 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
494 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
501 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
509 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
516 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
522 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
528 if (request->op == TO_RUN) { in tape_34xx_unit_check()
531 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
534 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
540 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
543 if (request->op == TO_DSE) in tape_34xx_unit_check()
544 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
546 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
555 return tape_34xx_erp_failed(request, -EMEDIUMTYPE); in tape_34xx_unit_check()
560 return tape_34xx_erp_failed(request, -EACCES); in tape_34xx_unit_check()
565 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
574 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
582 if (request->op == TO_RUN) in tape_34xx_unit_check()
583 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
584 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
595 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
599 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
601 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
609 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
615 if (request->op==TO_WRI || in tape_34xx_unit_check()
616 request->op==TO_DSE || in tape_34xx_unit_check()
617 request->op==TO_WTM) in tape_34xx_unit_check()
618 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
619 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
622 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
626 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
632 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
640 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
647 switch(request->op) { in tape_34xx_unit_check()
652 return tape_34xx_done(request); in tape_34xx_unit_check()
658 return tape_34xx_erp_failed(request, -ENOMEDIUM); in tape_34xx_unit_check()
661 if (request->op != TO_BLOCK && request->op != TO_LBL) in tape_34xx_unit_check()
663 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
665 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
670 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
678 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
684 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
687 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
692 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
697 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
705 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
711 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
719 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
721 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
731 return tape_34xx_erp_failed(request, -ENOBUFS); in tape_34xx_unit_check()
734 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
742 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
750 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
753 if (request->op == TO_RUN) { in tape_34xx_unit_check()
756 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
758 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
761 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
764 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
769 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
774 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
778 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
781 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
790 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
795 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
798 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
803 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
808 return tape_34xx_erp_failed(request, -EMEDIUMTYPE); in tape_34xx_unit_check()
813 return tape_34xx_erp_failed(request, -EMEDIUMTYPE); in tape_34xx_unit_check()
825 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
833 tape_34xx_irq(struct tape_device *device, struct tape_request *request, in tape_34xx_irq() argument
836 if (request == NULL) in tape_34xx_irq()
841 (request->op == TO_WRI)) { in tape_34xx_irq()
843 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_irq()
847 return tape_34xx_unit_check(device, request, irb); in tape_34xx_irq()
854 if (request->op == TO_BSB || request->op == TO_FSB) in tape_34xx_irq()
855 request->rescnt++; in tape_34xx_irq()
859 return tape_34xx_done(request); in tape_34xx_irq()
863 tape_dump_sense_dbf(device, request, irb); in tape_34xx_irq()
1090 struct tape_request *request; in tape_34xx_mtseek() local
1097 request = tape_alloc_request(3, 4); in tape_34xx_mtseek()
1098 if (IS_ERR(request)) in tape_34xx_mtseek()
1099 return PTR_ERR(request); in tape_34xx_mtseek()
1102 request->op = TO_LBL; in tape_34xx_mtseek()
1103 bid = (struct tape_34xx_block_id *) request->cpdata; in tape_34xx_mtseek()
1109 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_34xx_mtseek()
1110 tape_ccw_cc(request->cpaddr + 1, LOCATE, 4, request->cpdata); in tape_34xx_mtseek()
1111 tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL); in tape_34xx_mtseek()
1114 return tape_do_io_free(device, request); in tape_34xx_mtseek()