Lines Matching refs:device
3 * standard tape device functions for ibm tapes.
39 struct tape_device * device = request->device;
42 BUG_ON(!device);
45 device->cdev_id);
46 rc = tape_cancel_io(device, request);
49 "%i\n", device->cdev_id, rc);
53 tape_std_assign(struct tape_device *device)
67 * The assign command sometimes blocks if the device is assigned
74 rc = tape_do_io_interruptible(device, request);
79 DBF_EVENT(3, "%08x: assign failed - device might be busy\n",
80 device->cdev_id);
82 DBF_EVENT(3, "%08x: Tape assigned\n", device->cdev_id);
92 tape_std_unassign (struct tape_device *device)
97 if (device->tape_state == TS_NOT_OPER) {
98 DBF_EVENT(3, "(%08x): Can't unassign device\n",
99 device->cdev_id);
111 if ((rc = tape_do_io(device, request)) != 0) {
112 DBF_EVENT(3, "%08x: Unassign failed\n", device->cdev_id);
114 DBF_EVENT(3, "%08x: Tape unassigned\n", device->cdev_id);
124 tape_std_display(struct tape_device *device, struct display_struct *disp)
145 rc = tape_do_io_interruptible(device, request);
154 tape_std_read_block_id(struct tape_device *device, __u64 *id)
164 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
168 rc = tape_do_io(device, request);
177 tape_std_terminate_write(struct tape_device *device)
181 if(device->required_tapemarks == 0)
184 DBF_LH(5, "tape%d: terminate write %dxEOF\n", device->first_minor,
185 device->required_tapemarks);
187 rc = tape_mtop(device, MTWEOF, device->required_tapemarks);
191 device->required_tapemarks = 0;
192 return tape_mtop(device, MTBSR, 1);
201 tape_std_mtload(struct tape_device *device, int count)
203 return wait_event_interruptible(device->state_change_wq,
204 (device->medium_state == MS_LOADED));
211 tape_std_mtsetblk(struct tape_device *device, int count)
222 device->char_data.block_size = 0;
225 if (device->char_data.idal_buf != NULL &&
226 device->char_data.idal_buf->size == count)
240 if (device->char_data.idal_buf != NULL)
241 idal_buffer_free(device->char_data.idal_buf);
242 device->char_data.idal_buf = new;
243 device->char_data.block_size = count;
245 DBF_LH(6, "new blocksize is %d\n", device->char_data.block_size);
254 tape_std_mtreset(struct tape_device *device, int count)
257 device->char_data.block_size = 0;
266 tape_std_mtfsf(struct tape_device *device, int mt_count)
277 device->modeset_byte);
282 return tape_do_io_free(device, request);
290 tape_std_mtfsr(struct tape_device *device, int mt_count)
302 device->modeset_byte);
307 rc = tape_do_io(device, request);
322 tape_std_mtbsr(struct tape_device *device, int mt_count)
334 device->modeset_byte);
339 rc = tape_do_io(device, request);
353 tape_std_mtweof(struct tape_device *device, int mt_count)
364 device->modeset_byte);
369 return tape_do_io_free(device, request);
378 tape_std_mtbsfm(struct tape_device *device, int mt_count)
389 device->modeset_byte);
394 return tape_do_io_free(device, request);
402 tape_std_mtbsf(struct tape_device *device, int mt_count)
414 device->modeset_byte);
418 rc = tape_do_io_free(device, request);
420 rc = tape_mtop(device, MTFSR, 1);
433 tape_std_mtfsfm(struct tape_device *device, int mt_count)
445 device->modeset_byte);
449 rc = tape_do_io_free(device, request);
451 rc = tape_mtop(device, MTBSR, 1);
463 tape_std_mtrew(struct tape_device *device, int mt_count)
473 device->modeset_byte);
478 return tape_do_io_free(device, request);
486 tape_std_mtoffl(struct tape_device *device, int mt_count)
495 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
500 return tape_do_io_free(device, request);
507 tape_std_mtnop(struct tape_device *device, int mt_count)
516 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
519 return tape_do_io_free(device, request);
528 tape_std_mteom(struct tape_device *device, int mt_count)
535 if ((rc = tape_mtop(device, MTREW, 1)) < 0)
545 if ((rc = tape_mtop(device, MTFSF, 1)) < 0)
547 if ((rc = tape_mtop(device, MTFSR, 1)) < 0)
551 return tape_mtop(device, MTBSR, 1);
558 tape_std_mtreten(struct tape_device *device, int mt_count)
567 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
572 tape_do_io_interruptible(device, request);
574 return tape_mtop(device, MTREW, 1);
581 tape_std_mterase(struct tape_device *device, int mt_count)
590 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
598 return tape_do_io_free(device, request);
605 tape_std_mtunload(struct tape_device *device, int mt_count)
607 return tape_mtop(device, MTOFFL, mt_count);
615 tape_std_mtcompression(struct tape_device *device, int mt_count)
629 *device->modeset_byte &= ~0x08;
631 *device->modeset_byte |= 0x08;
632 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
635 return tape_do_io_free(device, request);
642 tape_std_read_block(struct tape_device *device, size_t count)
656 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
658 device->char_data.idal_buf);
667 tape_std_read_backward(struct tape_device *device, struct tape_request *request)
675 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
677 device->char_data.idal_buf);
686 tape_std_write_block(struct tape_device *device, size_t count)
696 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte);
698 device->char_data.idal_buf);
707 tape_std_process_eov(struct tape_device *device)
713 if (tape_mtop(device, MTBSR, 1) == 0 &&
714 tape_mtop(device, MTWEOF, 1) == 0) {
715 tape_mtop(device, MTBSR, 1);