Lines Matching full:device

3  *    standard tape device functions for ibm tapes.
40 struct tape_device * device = request->device; in tape_std_assign_timeout() local
43 BUG_ON(!device); in tape_std_assign_timeout()
45 DBF_EVENT(3, "%08x: Assignment timeout. Device busy.\n", in tape_std_assign_timeout()
46 device->cdev_id); in tape_std_assign_timeout()
47 rc = tape_cancel_io(device, request); in tape_std_assign_timeout()
50 "%i\n", device->cdev_id, rc); in tape_std_assign_timeout()
54 tape_std_assign(struct tape_device *device) in tape_std_assign() argument
68 * The assign command sometimes blocks if the device is assigned in tape_std_assign()
75 rc = tape_do_io_interruptible(device, request); in tape_std_assign()
80 DBF_EVENT(3, "%08x: assign failed - device might be busy\n", in tape_std_assign()
81 device->cdev_id); in tape_std_assign()
83 DBF_EVENT(3, "%08x: Tape assigned\n", device->cdev_id); in tape_std_assign()
93 tape_std_unassign (struct tape_device *device) in tape_std_unassign() argument
98 if (device->tape_state == TS_NOT_OPER) { in tape_std_unassign()
99 DBF_EVENT(3, "(%08x): Can't unassign device\n", in tape_std_unassign()
100 device->cdev_id); in tape_std_unassign()
112 if ((rc = tape_do_io(device, request)) != 0) { in tape_std_unassign()
113 DBF_EVENT(3, "%08x: Unassign failed\n", device->cdev_id); in tape_std_unassign()
115 DBF_EVENT(3, "%08x: Tape unassigned\n", device->cdev_id); in tape_std_unassign()
125 tape_std_display(struct tape_device *device, struct display_struct *disp) in tape_std_display() argument
146 rc = tape_do_io_interruptible(device, request); in tape_std_display()
155 tape_std_read_block_id(struct tape_device *device, __u64 *id) in tape_std_read_block_id() argument
165 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_read_block_id()
169 rc = tape_do_io(device, request); in tape_std_read_block_id()
178 tape_std_terminate_write(struct tape_device *device) in tape_std_terminate_write() argument
182 if(device->required_tapemarks == 0) in tape_std_terminate_write()
185 DBF_LH(5, "tape%d: terminate write %dxEOF\n", device->first_minor, in tape_std_terminate_write()
186 device->required_tapemarks); in tape_std_terminate_write()
188 rc = tape_mtop(device, MTWEOF, device->required_tapemarks); in tape_std_terminate_write()
192 device->required_tapemarks = 0; in tape_std_terminate_write()
193 return tape_mtop(device, MTBSR, 1); in tape_std_terminate_write()
202 tape_std_mtload(struct tape_device *device, int count) in tape_std_mtload() argument
204 return wait_event_interruptible(device->state_change_wq, in tape_std_mtload()
205 (device->medium_state == MS_LOADED)); in tape_std_mtload()
212 tape_std_mtsetblk(struct tape_device *device, int count) in tape_std_mtsetblk() argument
223 device->char_data.block_size = 0; in tape_std_mtsetblk()
226 if (device->char_data.idal_buf != NULL && in tape_std_mtsetblk()
227 device->char_data.idal_buf->size == count) in tape_std_mtsetblk()
241 if (device->char_data.idal_buf != NULL) in tape_std_mtsetblk()
242 idal_buffer_free(device->char_data.idal_buf); in tape_std_mtsetblk()
243 device->char_data.idal_buf = new; in tape_std_mtsetblk()
244 device->char_data.block_size = count; in tape_std_mtsetblk()
246 DBF_LH(6, "new blocksize is %d\n", device->char_data.block_size); in tape_std_mtsetblk()
255 tape_std_mtreset(struct tape_device *device, int count) in tape_std_mtreset() argument
258 device->char_data.block_size = 0; in tape_std_mtreset()
267 tape_std_mtfsf(struct tape_device *device, int mt_count) in tape_std_mtfsf() argument
278 device->modeset_byte); in tape_std_mtfsf()
283 return tape_do_io_free(device, request); in tape_std_mtfsf()
291 tape_std_mtfsr(struct tape_device *device, int mt_count) in tape_std_mtfsr() argument
303 device->modeset_byte); in tape_std_mtfsr()
308 rc = tape_do_io(device, request); in tape_std_mtfsr()
323 tape_std_mtbsr(struct tape_device *device, int mt_count) in tape_std_mtbsr() argument
335 device->modeset_byte); in tape_std_mtbsr()
340 rc = tape_do_io(device, request); in tape_std_mtbsr()
354 tape_std_mtweof(struct tape_device *device, int mt_count) in tape_std_mtweof() argument
365 device->modeset_byte); in tape_std_mtweof()
370 return tape_do_io_free(device, request); in tape_std_mtweof()
379 tape_std_mtbsfm(struct tape_device *device, int mt_count) in tape_std_mtbsfm() argument
390 device->modeset_byte); in tape_std_mtbsfm()
395 return tape_do_io_free(device, request); in tape_std_mtbsfm()
403 tape_std_mtbsf(struct tape_device *device, int mt_count) in tape_std_mtbsf() argument
415 device->modeset_byte); in tape_std_mtbsf()
419 rc = tape_do_io_free(device, request); in tape_std_mtbsf()
421 rc = tape_mtop(device, MTFSR, 1); in tape_std_mtbsf()
434 tape_std_mtfsfm(struct tape_device *device, int mt_count) in tape_std_mtfsfm() argument
446 device->modeset_byte); in tape_std_mtfsfm()
450 rc = tape_do_io_free(device, request); in tape_std_mtfsfm()
452 rc = tape_mtop(device, MTBSR, 1); in tape_std_mtfsfm()
464 tape_std_mtrew(struct tape_device *device, int mt_count) in tape_std_mtrew() argument
474 device->modeset_byte); in tape_std_mtrew()
479 return tape_do_io_free(device, request); in tape_std_mtrew()
487 tape_std_mtoffl(struct tape_device *device, int mt_count) in tape_std_mtoffl() argument
496 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_mtoffl()
501 return tape_do_io_free(device, request); in tape_std_mtoffl()
508 tape_std_mtnop(struct tape_device *device, int mt_count) in tape_std_mtnop() argument
517 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_mtnop()
520 return tape_do_io_free(device, request); in tape_std_mtnop()
529 tape_std_mteom(struct tape_device *device, int mt_count) in tape_std_mteom() argument
536 if ((rc = tape_mtop(device, MTREW, 1)) < 0) in tape_std_mteom()
546 if ((rc = tape_mtop(device, MTFSF, 1)) < 0) in tape_std_mteom()
548 if ((rc = tape_mtop(device, MTFSR, 1)) < 0) in tape_std_mteom()
552 return tape_mtop(device, MTBSR, 1); in tape_std_mteom()
559 tape_std_mtreten(struct tape_device *device, int mt_count) in tape_std_mtreten() argument
568 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_mtreten()
573 tape_do_io_interruptible(device, request); in tape_std_mtreten()
575 return tape_mtop(device, MTREW, 1); in tape_std_mtreten()
582 tape_std_mterase(struct tape_device *device, int mt_count) in tape_std_mterase() argument
591 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_mterase()
599 return tape_do_io_free(device, request); in tape_std_mterase()
606 tape_std_mtunload(struct tape_device *device, int mt_count) in tape_std_mtunload() argument
608 return tape_mtop(device, MTOFFL, mt_count); in tape_std_mtunload()
616 tape_std_mtcompression(struct tape_device *device, int mt_count) in tape_std_mtcompression() argument
630 *device->modeset_byte &= ~0x08; in tape_std_mtcompression()
632 *device->modeset_byte |= 0x08; in tape_std_mtcompression()
633 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_mtcompression()
636 return tape_do_io_free(device, request); in tape_std_mtcompression()
643 tape_std_read_block(struct tape_device *device, size_t count) in tape_std_read_block() argument
657 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_read_block()
659 device->char_data.idal_buf); in tape_std_read_block()
668 tape_std_read_backward(struct tape_device *device, struct tape_request *request) in tape_std_read_backward() argument
676 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_read_backward()
678 device->char_data.idal_buf); in tape_std_read_backward()
687 tape_std_write_block(struct tape_device *device, size_t count) in tape_std_write_block() argument
697 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_std_write_block()
699 device->char_data.idal_buf); in tape_std_write_block()
708 tape_std_process_eov(struct tape_device *device) in tape_std_process_eov() argument
714 if (tape_mtop(device, MTBSR, 1) == 0 && in tape_std_process_eov()
715 tape_mtop(device, MTWEOF, 1) == 0) { in tape_std_process_eov()
716 tape_mtop(device, MTBSR, 1); in tape_std_process_eov()