Lines Matching full:request

56 static void __tape_34xx_medium_sense(struct tape_request *request)  in __tape_34xx_medium_sense()  argument
58 struct tape_device *device = request->device; in __tape_34xx_medium_sense()
61 if (request->rc == 0) { in __tape_34xx_medium_sense()
62 sense = request->cpdata; in __tape_34xx_medium_sense()
81 request->rc); in __tape_34xx_medium_sense()
82 tape_free_request(request); in __tape_34xx_medium_sense()
87 struct tape_request *request; in tape_34xx_medium_sense() local
90 request = tape_alloc_request(1, 32); in tape_34xx_medium_sense()
91 if (IS_ERR(request)) { in tape_34xx_medium_sense()
93 return PTR_ERR(request); in tape_34xx_medium_sense()
96 request->op = TO_MSEN; in tape_34xx_medium_sense()
97 tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); in tape_34xx_medium_sense()
98 rc = tape_do_io_interruptible(device, request); in tape_34xx_medium_sense()
99 __tape_34xx_medium_sense(request); in tape_34xx_medium_sense()
105 struct tape_request *request; in tape_34xx_medium_sense_async() local
107 request = tape_alloc_request(1, 32); in tape_34xx_medium_sense_async()
108 if (IS_ERR(request)) { in tape_34xx_medium_sense_async()
113 request->op = TO_MSEN; in tape_34xx_medium_sense_async()
114 tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata); in tape_34xx_medium_sense_async()
115 request->callback = (void *) __tape_34xx_medium_sense; in tape_34xx_medium_sense_async()
116 request->callback_data = NULL; in tape_34xx_medium_sense_async()
117 tape_do_io_async(device, request); in tape_34xx_medium_sense_async()
175 tape_34xx_done(struct tape_request *request) in tape_34xx_done() argument
177 DBF_EVENT(6, "%s done\n", tape_op_verbose[request->op]); in tape_34xx_done()
179 switch (request->op) { in tape_34xx_done()
186 tape_34xx_delete_sbid_from(request->device, 0); in tape_34xx_done()
195 tape_34xx_erp_failed(struct tape_request *request, int rc) in tape_34xx_erp_failed() argument
198 tape_op_verbose[request->op], rc); in tape_34xx_erp_failed()
203 tape_34xx_erp_succeeded(struct tape_request *request) in tape_34xx_erp_succeeded() argument
206 tape_op_verbose[request->op]); in tape_34xx_erp_succeeded()
207 return tape_34xx_done(request); in tape_34xx_erp_succeeded()
211 tape_34xx_erp_retry(struct tape_request *request) in tape_34xx_erp_retry() argument
213 DBF_EVENT(3, "xerp retr %s\n", tape_op_verbose[request->op]); in tape_34xx_erp_retry()
218 * This function is called, when no request is outstanding and we get an
242 struct tape_request *request) in tape_34xx_erp_read_opposite() argument
244 if (request->op == TO_RFO) { in tape_34xx_erp_read_opposite()
247 * *correctly*. We transform the request to a read backward in tape_34xx_erp_read_opposite()
250 tape_std_read_backward(device, request); in tape_34xx_erp_read_opposite()
251 return tape_34xx_erp_retry(request); in tape_34xx_erp_read_opposite()
258 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_read_opposite()
262 tape_34xx_erp_bug(struct tape_device *device, struct tape_request *request, in tape_34xx_erp_bug() argument
265 if (request->op != TO_ASSIGN) { in tape_34xx_erp_bug()
268 tape_dump_sense_dbf(device, request, irb); in tape_34xx_erp_bug()
270 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_bug()
278 tape_34xx_erp_overrun(struct tape_device *device, struct tape_request *request, in tape_34xx_erp_overrun() argument
284 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_overrun()
286 return tape_34xx_erp_bug(device, request, irb, -1); in tape_34xx_erp_overrun()
294 struct tape_request *request, struct irb *irb) in tape_34xx_erp_sequence() argument
302 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_erp_sequence()
308 return tape_34xx_erp_bug(device, request, irb, -2); in tape_34xx_erp_sequence()
317 tape_34xx_unit_check(struct tape_device *device, struct tape_request *request, in tape_34xx_unit_check() argument
331 request->op == TO_DSE || in tape_34xx_unit_check()
332 request->op == TO_WRI || in tape_34xx_unit_check()
333 request->op == TO_WTM in tape_34xx_unit_check()
336 return tape_34xx_erp_failed(request, -EACCES); in tape_34xx_unit_check()
338 return tape_34xx_erp_bug(device, request, irb, -3); in tape_34xx_unit_check()
362 switch (request->op) { in tape_34xx_unit_check()
373 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
375 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
385 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
389 return tape_34xx_erp_failed(request, 0); in tape_34xx_unit_check()
398 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
400 return tape_34xx_erp_failed(request, 0); in tape_34xx_unit_check()
406 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
421 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
427 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
435 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
441 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
444 return tape_34xx_erp_read_opposite(device, request); in tape_34xx_unit_check()
449 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
454 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
459 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
465 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
471 return tape_34xx_erp_overrun(device, request, irb); in tape_34xx_unit_check()
474 return tape_34xx_erp_sequence(device, request, irb); in tape_34xx_unit_check()
486 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
495 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
502 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
510 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
517 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
523 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
529 if (request->op == TO_RUN) { in tape_34xx_unit_check()
532 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
535 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
541 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
544 if (request->op == TO_DSE) in tape_34xx_unit_check()
545 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
547 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
556 return tape_34xx_erp_failed(request, -EMEDIUMTYPE); in tape_34xx_unit_check()
561 return tape_34xx_erp_failed(request, -EACCES); in tape_34xx_unit_check()
566 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
575 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
583 if (request->op == TO_RUN) in tape_34xx_unit_check()
584 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
585 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
596 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
600 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
602 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
610 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
616 if (request->op==TO_WRI || in tape_34xx_unit_check()
617 request->op==TO_DSE || in tape_34xx_unit_check()
618 request->op==TO_WTM) in tape_34xx_unit_check()
619 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_unit_check()
620 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
623 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
627 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
633 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
641 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
648 switch(request->op) { in tape_34xx_unit_check()
653 return tape_34xx_done(request); in tape_34xx_unit_check()
659 return tape_34xx_erp_failed(request, -ENOMEDIUM); in tape_34xx_unit_check()
662 if (request->op != TO_BLOCK && request->op != TO_LBL) in tape_34xx_unit_check()
664 return tape_34xx_erp_bug(device, request, in tape_34xx_unit_check()
666 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
671 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
679 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
685 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
687 /* Log sense data and retry request. */ in tape_34xx_unit_check()
688 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
693 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
698 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
706 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
712 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
720 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
722 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
732 return tape_34xx_erp_failed(request, -ENOBUFS); in tape_34xx_unit_check()
735 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
743 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
751 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
754 if (request->op == TO_RUN) { in tape_34xx_unit_check()
757 return tape_34xx_erp_succeeded(request); in tape_34xx_unit_check()
759 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
762 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
765 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
770 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
775 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
781 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
789 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
794 return tape_34xx_erp_retry(request); in tape_34xx_unit_check()
797 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
802 return tape_34xx_erp_failed(request, -EIO); in tape_34xx_unit_check()
807 return tape_34xx_erp_failed(request, -EMEDIUMTYPE); in tape_34xx_unit_check()
812 return tape_34xx_erp_failed(request, -EMEDIUMTYPE); in tape_34xx_unit_check()
824 return tape_34xx_erp_bug(device, request, irb, sense[3]); in tape_34xx_unit_check()
832 tape_34xx_irq(struct tape_device *device, struct tape_request *request, in tape_34xx_irq() argument
835 if (request == NULL) in tape_34xx_irq()
840 (request->op == TO_WRI)) { in tape_34xx_irq()
842 return tape_34xx_erp_failed(request, -ENOSPC); in tape_34xx_irq()
846 return tape_34xx_unit_check(device, request, irb); in tape_34xx_irq()
853 if (request->op == TO_BSB || request->op == TO_FSB) in tape_34xx_irq()
854 request->rescnt++; in tape_34xx_irq()
858 return tape_34xx_done(request); in tape_34xx_irq()
862 tape_dump_sense_dbf(device, request, irb); in tape_34xx_irq()
1089 struct tape_request *request; in tape_34xx_mtseek() local
1096 request = tape_alloc_request(3, 4); in tape_34xx_mtseek()
1097 if (IS_ERR(request)) in tape_34xx_mtseek()
1098 return PTR_ERR(request); in tape_34xx_mtseek()
1101 request->op = TO_LBL; in tape_34xx_mtseek()
1102 bid = (struct tape_34xx_block_id *) request->cpdata; in tape_34xx_mtseek()
1108 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_34xx_mtseek()
1109 tape_ccw_cc(request->cpaddr + 1, LOCATE, 4, request->cpdata); in tape_34xx_mtseek()
1110 tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL); in tape_34xx_mtseek()
1113 return tape_do_io_free(device, request); in tape_34xx_mtseek()