Lines Matching full:request

57 static void __tape_34xx_medium_sense(struct tape_request *request)  in __tape_34xx_medium_sense()  argument
59 struct tape_device *device = request->device; in __tape_34xx_medium_sense()
62 if (request->rc == 0) { in __tape_34xx_medium_sense()
63 sense = request->cpdata; in __tape_34xx_medium_sense()
82 request->rc); in __tape_34xx_medium_sense()
83 tape_free_request(request); in __tape_34xx_medium_sense()
88 struct tape_request *request; in tape_34xx_medium_sense() local
91 request = tape_alloc_request(1, 32); in tape_34xx_medium_sense()
92 if (IS_ERR(request)) { in tape_34xx_medium_sense()
94 return PTR_ERR(request); in tape_34xx_medium_sense()
97 request->op = TO_MSEN; in tape_34xx_medium_sense()
98 tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); in tape_34xx_medium_sense()
99 rc = tape_do_io_interruptible(device, request); in tape_34xx_medium_sense()
100 __tape_34xx_medium_sense(request); in tape_34xx_medium_sense()
106 struct tape_request *request; in tape_34xx_medium_sense_async() local
108 request = tape_alloc_request(1, 32); in tape_34xx_medium_sense_async()
109 if (IS_ERR(request)) { in tape_34xx_medium_sense_async()
114 request->op = TO_MSEN; in tape_34xx_medium_sense_async()
115 tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); in tape_34xx_medium_sense_async()
116 request->callback = (void *) __tape_34xx_medium_sense; in tape_34xx_medium_sense_async()
117 request->callback_data = NULL; in tape_34xx_medium_sense_async()
118 tape_do_io_async(device, request); in tape_34xx_medium_sense_async()
176 tape_34xx_done(struct tape_request *request) in tape_34xx_done() argument
178 DBF_EVENT(6, "%s done\n", tape_op_verbose[request->op]); in tape_34xx_done()
180 switch (request->op) { in tape_34xx_done()
187 tape_34xx_delete_sbid_from(request->device, 0); in tape_34xx_done()
196 tape_34xx_erp_failed(struct tape_request *request, int rc) in tape_34xx_erp_failed() argument
199 tape_op_verbose[request->op], rc); in tape_34xx_erp_failed()
204 tape_34xx_erp_succeeded(struct tape_request *request) in tape_34xx_erp_succeeded() argument
207 tape_op_verbose[request->op]); in tape_34xx_erp_succeeded()
208 return tape_34xx_done(request); in tape_34xx_erp_succeeded()
212 tape_34xx_erp_retry(struct tape_request *request) in tape_34xx_erp_retry() argument
214 DBF_EVENT(3, "xerp retr %s\n", tape_op_verbose[request->op]); in tape_34xx_erp_retry()
219 * This function is called, when no request is outstanding and we get an
243 struct tape_request *request) in tape_34xx_erp_read_opposite() argument
245 if (request->op == TO_RFO) { in tape_34xx_erp_read_opposite()
248 * *correctly*. We transform the request to a read backward in tape_34xx_erp_read_opposite()
251 tape_std_read_backward(device, request); in tape_34xx_erp_read_opposite()
252 return tape_34xx_erp_retry(request); in tape_34xx_erp_read_opposite()
259 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_read_opposite()
263 tape_34xx_erp_bug(struct tape_device *device, struct tape_request *request, in tape_34xx_erp_bug() argument
266 if (request->op != TO_ASSIGN) { in tape_34xx_erp_bug()
269 tape_dump_sense_dbf(device, request, irb); in tape_34xx_erp_bug()
271 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_bug()
279 tape_34xx_erp_overrun(struct tape_device *device, struct tape_request *request, in tape_34xx_erp_overrun() argument
285 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_overrun()
287 return tape_34xx_erp_bug(device, request, irb, -1); in tape_34xx_erp_overrun()
295 struct tape_request *request, struct irb *irb) in tape_34xx_erp_sequence() argument
303 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_sequence()
309 return tape_34xx_erp_bug(device, request, irb, -2); in tape_34xx_erp_sequence()
318 tape_34xx_unit_check(struct tape_device *device, struct tape_request *request, in tape_34xx_unit_check() argument
332 request->op == TO_DSE || in tape_34xx_unit_check()
333 request->op == TO_WRI || in tape_34xx_unit_check()
334 request->op == TO_WTM in tape_34xx_unit_check()
337 return tape_34xx_erp_failed(request, -EACCES); in tape_34xx_unit_check()
339 return tape_34xx_erp_bug(device, request, irb, -3); in tape_34xx_unit_check()
363 switch (request->op) { in tape_34xx_unit_check()
374 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
376 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
386 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
390 return tape_34xx_erp_failed(request, 0); in tape_34xx_unit_check()
399 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
401 return tape_34xx_erp_failed(request, 0); in tape_34xx_unit_check()
407 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
422 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
428 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
436 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
442 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
445 return tape_34xx_erp_read_opposite(device, request); in tape_34xx_unit_check()
450 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
455 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
460 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
466 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
472 return tape_34xx_erp_overrun(device, request, irb); in tape_34xx_unit_check()
475 return tape_34xx_erp_sequence(device, request, irb); in tape_34xx_unit_check()
487 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
496 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
503 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
511 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
518 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
524 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
530 if (request->op == TO_RUN) { in tape_34xx_unit_check()
533 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
536 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
542 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
545 if (request->op == TO_DSE) in tape_34xx_unit_check()
546 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
548 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
557 return tape_34xx_erp_failed(request, -EMEDIUMTYPE); in tape_34xx_unit_check()
562 return tape_34xx_erp_failed(request, -EACCES); in tape_34xx_unit_check()
567 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
576 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
584 if (request->op == TO_RUN) in tape_34xx_unit_check()
585 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
586 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
597 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
601 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
603 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
611 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
617 if (request->op==TO_WRI || in tape_34xx_unit_check()
618 request->op==TO_DSE || in tape_34xx_unit_check()
619 request->op==TO_WTM) in tape_34xx_unit_check()
620 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
621 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
624 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
628 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
634 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
642 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
649 switch(request->op) { in tape_34xx_unit_check()
654 return tape_34xx_done(request); in tape_34xx_unit_check()
660 return tape_34xx_erp_failed(request, -ENOMEDIUM); in tape_34xx_unit_check()
663 if (request->op != TO_BLOCK && request->op != TO_LBL) in tape_34xx_unit_check()
665 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
667 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
672 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
680 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
686 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
688 /* Log sense data and retry request. */ in tape_34xx_unit_check()
689 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
694 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
699 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
707 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
713 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
721 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
723 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
733 return tape_34xx_erp_failed(request, -ENOBUFS); in tape_34xx_unit_check()
736 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
744 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
752 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
755 if (request->op == TO_RUN) { in tape_34xx_unit_check()
758 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
760 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
763 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
766 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
771 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
776 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
782 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()