Lines Matching full:device

3  *    tape device discipline for 3590 tapes.
38 * - Read Device (buffered) log: BRA
62 [0x40] = "Device Intervention",
84 [0x90] = "Device fenced",
85 [0x91] = "Device Path fenced",
103 static int crypt_supported(struct tape_device *device) in crypt_supported() argument
105 return TAPE390_CRYPT_SUPPORTED(TAPE_3590_CRYPT_INFO(device)); in crypt_supported()
108 static int crypt_enabled(struct tape_device *device) in crypt_enabled() argument
110 return TAPE390_CRYPT_ON(TAPE_3590_CRYPT_INFO(device)); in crypt_enabled()
201 static int tape_3592_kekl_query(struct tape_device *device, in tape_3592_kekl_query() argument
226 rc = tape_do_io(device, request); in tape_3592_kekl_query()
242 static int tape_3592_ioctl_kekl_query(struct tape_device *device, in tape_3592_ioctl_kekl_query() argument
249 if (!crypt_supported(device)) in tape_3592_ioctl_kekl_query()
251 if (!crypt_enabled(device)) in tape_3592_ioctl_kekl_query()
256 rc = tape_3592_kekl_query(device, ext_kekls); in tape_3592_ioctl_kekl_query()
269 static int tape_3590_mttell(struct tape_device *device, int mt_count);
274 static int tape_3592_kekl_set(struct tape_device *device, in tape_3592_kekl_set() argument
285 if (tape_3590_mttell(device, 0) != 0) in tape_3592_kekl_set()
299 return tape_do_io_free(device, request); in tape_3592_kekl_set()
305 static int tape_3592_ioctl_kekl_set(struct tape_device *device, in tape_3592_ioctl_kekl_set() argument
312 if (!crypt_supported(device)) in tape_3592_ioctl_kekl_set()
314 if (!crypt_enabled(device)) in tape_3592_ioctl_kekl_set()
323 rc = tape_3592_kekl_set(device, ext_kekls); in tape_3592_ioctl_kekl_set()
332 static struct tape_request *__tape_3592_enable_crypt(struct tape_device *device) in __tape_3592_enable_crypt() argument
338 if (!crypt_supported(device)) in __tape_3592_enable_crypt()
360 static int tape_3592_enable_crypt(struct tape_device *device) in tape_3592_enable_crypt() argument
364 request = __tape_3592_enable_crypt(device); in tape_3592_enable_crypt()
367 return tape_do_io_free(device, request); in tape_3592_enable_crypt()
370 static void tape_3592_enable_crypt_async(struct tape_device *device) in tape_3592_enable_crypt_async() argument
374 request = __tape_3592_enable_crypt(device); in tape_3592_enable_crypt_async()
376 tape_do_io_async_free(device, request); in tape_3592_enable_crypt_async()
382 static struct tape_request *__tape_3592_disable_crypt(struct tape_device *device) in __tape_3592_disable_crypt() argument
388 if (!crypt_supported(device)) in __tape_3592_disable_crypt()
408 static int tape_3592_disable_crypt(struct tape_device *device) in tape_3592_disable_crypt() argument
412 request = __tape_3592_disable_crypt(device); in tape_3592_disable_crypt()
415 return tape_do_io_free(device, request); in tape_3592_disable_crypt()
418 static void tape_3592_disable_crypt_async(struct tape_device *device) in tape_3592_disable_crypt_async() argument
422 request = __tape_3592_disable_crypt(device); in tape_3592_disable_crypt_async()
424 tape_do_io_async_free(device, request); in tape_3592_disable_crypt_async()
430 static int tape_3592_ioctl_crypt_set(struct tape_device *device, in tape_3592_ioctl_crypt_set() argument
436 if (!crypt_supported(device)) in tape_3592_ioctl_crypt_set()
443 return tape_3592_enable_crypt(device); in tape_3592_ioctl_crypt_set()
445 return tape_3592_disable_crypt(device); in tape_3592_ioctl_crypt_set()
448 static int tape_3590_sense_medium(struct tape_device *device);
453 static int tape_3592_ioctl_crypt_query(struct tape_device *device, in tape_3592_ioctl_crypt_query() argument
457 if (!crypt_supported(device)) in tape_3592_ioctl_crypt_query()
459 tape_3590_sense_medium(device); in tape_3592_ioctl_crypt_query()
460 if (copy_to_user((char __user *) arg, &TAPE_3590_CRYPT_INFO(device), in tape_3592_ioctl_crypt_query()
461 sizeof(TAPE_3590_CRYPT_INFO(device)))) in tape_3592_ioctl_crypt_query()
471 tape_3590_ioctl(struct tape_device *device, unsigned int cmd, unsigned long arg) in tape_3590_ioctl() argument
480 return tape_std_display(device, &disp); in tape_3590_ioctl()
483 return tape_3592_ioctl_kekl_set(device, arg); in tape_3590_ioctl()
485 return tape_3592_ioctl_kekl_query(device, arg); in tape_3590_ioctl()
487 return tape_3592_ioctl_crypt_set(device, arg); in tape_3590_ioctl()
489 return tape_3592_ioctl_crypt_query(device, arg); in tape_3590_ioctl()
498 static int tape_3590_sense_medium(struct tape_device *device) in tape_3590_sense_medium() argument
507 return tape_do_io_free(device, request); in tape_3590_sense_medium()
510 static void tape_3590_sense_medium_async(struct tape_device *device) in tape_3590_sense_medium_async() argument
519 tape_do_io_async_free(device, request); in tape_3590_sense_medium_async()
526 tape_3590_mttell(struct tape_device *device, int mt_count) in tape_3590_mttell() argument
531 rc = tape_std_read_block_id(device, &block_id); in tape_3590_mttell()
541 tape_3590_mtseek(struct tape_device *device, int count) in tape_3590_mtseek() argument
550 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_3590_mtseek()
554 return tape_do_io_free(device, request); in tape_3590_mtseek()
562 tape_3590_read_opposite(struct tape_device *device, in tape_3590_read_opposite() argument
573 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_3590_read_opposite()
574 data = device->discdata; in tape_3590_read_opposite()
576 device->char_data.idal_buf); in tape_3590_read_opposite()
585 * in device state.
598 static void tape_3590_read_attmsg_async(struct tape_device *device) in tape_3590_read_attmsg_async() argument
613 tape_do_io_async_free(device, request); in tape_3590_read_attmsg_async()
624 struct tape_device *device; member
637 tape_3590_sense_medium_async(p->device); in tape_3590_work_handler()
640 tape_3590_read_attmsg_async(p->device); in tape_3590_work_handler()
643 tape_3592_enable_crypt_async(p->device); in tape_3590_work_handler()
646 tape_3592_disable_crypt_async(p->device); in tape_3590_work_handler()
652 tape_put_device(p->device); in tape_3590_work_handler()
657 tape_3590_schedule_work(struct tape_device *device, enum tape_op op) in tape_3590_schedule_work() argument
666 p->device = tape_get_device(device); in tape_3590_schedule_work()
678 tape_3590_bread(struct tape_device *device, struct request *req) in tape_3590_bread() argument
701 ccw = tape_ccw_cc(ccw, MODE_SET_DB, 1, device->modeset_byte); in tape_3590_bread()
746 tape_3590_check_locate(struct tape_device *device, struct tape_request *request) in tape_3590_check_locate() argument
751 if (*start_block != device->blk_data.block_position) { in tape_3590_check_locate()
753 *start_block += device->bof; in tape_3590_check_locate()
759 static void tape_3590_med_state_set(struct tape_device *device, in tape_3590_med_state_set() argument
764 c_info = &TAPE_3590_CRYPT_INFO(device); in tape_3590_med_state_set()
771 tape_med_state_set(device, MS_UNLOADED); in tape_3590_med_state_set()
772 TAPE_3590_CRYPT_INFO(device).medium_status = 0; in tape_3590_med_state_set()
776 tape_med_state_set(device, MS_LOADED); in tape_3590_med_state_set()
779 tape_med_state_set(device, MS_UNKNOWN); in tape_3590_med_state_set()
793 * The done handler is called at device/channel end and wakes up the sleeping
797 tape_3590_done(struct tape_device *device, struct tape_request *request) in tape_3590_done() argument
816 tape_med_state_set(device, MS_LOADED); in tape_3590_done()
819 tape_med_state_set(device, MS_UNLOADED); in tape_3590_done()
820 tape_3590_schedule_work(device, TO_CRYPT_OFF); in tape_3590_done()
823 tape_3590_med_state_set(device, request->cpdata); in tape_3590_done()
826 TAPE_3590_CRYPT_INFO(device).status in tape_3590_done()
828 *(device->modeset_byte) |= 0x03; in tape_3590_done()
831 TAPE_3590_CRYPT_INFO(device).status in tape_3590_done()
833 *(device->modeset_byte) &= ~0x03; in tape_3590_done()
855 tape_3590_erp_succeded(struct tape_device *device, struct tape_request *request) in tape_3590_erp_succeded() argument
859 return tape_3590_done(device, request); in tape_3590_erp_succeded()
866 tape_3590_erp_failed(struct tape_device *device, struct tape_request *request, in tape_3590_erp_failed() argument
871 tape_dump_sense_dbf(device, request, irb); in tape_3590_erp_failed()
879 tape_3590_erp_retry(struct tape_device *device, struct tape_request *request, in tape_3590_erp_retry() argument
883 tape_dump_sense_dbf(device, request, irb); in tape_3590_erp_retry()
891 tape_3590_unsolicited_irq(struct tape_device *device, struct irb *irb) in tape_3590_unsolicited_irq() argument
897 /* Device Ready */ in tape_3590_unsolicited_irq()
898 DBF_EVENT(3, "unsol.irq! tape ready: %08x\n", device->cdev_id); in tape_3590_unsolicited_irq()
900 tape_3590_schedule_work(device, TO_READ_ATTMSG); in tape_3590_unsolicited_irq()
902 DBF_EVENT(3, "unsol.irq! dev end: %08x\n", device->cdev_id); in tape_3590_unsolicited_irq()
903 tape_dump_sense_dbf(device, NULL, irb); in tape_3590_unsolicited_irq()
906 tape_3590_schedule_work(device, TO_MSEN); in tape_3590_unsolicited_irq()
914 tape_3590_erp_basic(struct tape_device *device, struct tape_request *request, in tape_3590_erp_basic() argument
923 return tape_3590_erp_failed(device, request, irb, rc); in tape_3590_erp_basic()
925 return tape_3590_erp_succeded(device, request); in tape_3590_erp_basic()
927 return tape_3590_erp_retry(device, request, irb); in tape_3590_erp_basic()
929 return tape_3590_erp_failed(device, request, irb, rc); in tape_3590_erp_basic()
937 * RDL: Read Device (buffered) log
940 tape_3590_erp_read_buf_log(struct tape_device *device, in tape_3590_erp_read_buf_log() argument
947 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_erp_read_buf_log()
954 tape_3590_erp_swap(struct tape_device *device, struct tape_request *request, in tape_3590_erp_swap() argument
963 dev_warn (&device->cdev->dev, "The tape medium must be loaded into a " in tape_3590_erp_swap()
965 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_erp_swap()
972 tape_3590_erp_long_busy(struct tape_device *device, in tape_3590_erp_long_busy() argument
975 DBF_EVENT(6, "Device is busy\n"); in tape_3590_erp_long_busy()
983 tape_3590_erp_special_interrupt(struct tape_device *device, in tape_3590_erp_special_interrupt() argument
986 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_erp_special_interrupt()
993 tape_3590_erp_read_alternate(struct tape_device *device, in tape_3590_erp_read_alternate() argument
1000 * supported by the device in tape_3590_erp_read_alternate()
1005 data = device->discdata; in tape_3590_erp_read_alternate()
1008 device->cdev_id); in tape_3590_erp_read_alternate()
1012 device->cdev_id); in tape_3590_erp_read_alternate()
1015 tape_3590_read_opposite(device, request); in tape_3590_erp_read_alternate()
1016 return tape_3590_erp_retry(device, request, irb); in tape_3590_erp_read_alternate()
1023 tape_3590_erp_read_opposite(struct tape_device *device, in tape_3590_erp_read_opposite() argument
1032 tape_3590_read_opposite(device, request); in tape_3590_erp_read_opposite()
1033 return tape_3590_erp_retry(device, request, irb); in tape_3590_erp_read_opposite()
1036 return tape_3590_erp_failed(device, request, irb, -EIO); in tape_3590_erp_read_opposite()
1039 return tape_3590_erp_failed(device, request, irb, -EIO); in tape_3590_erp_read_opposite()
1047 tape_3590_print_mim_msg_f0(struct tape_device *device, struct irb *irb) in tape_3590_print_mim_msg_f0() argument
1099 dev_warn (&device->cdev->dev, "Tape media information: exception %s, " in tape_3590_print_mim_msg_f0()
1111 tape_3590_print_io_sim_msg_f1(struct tape_device *device, struct irb *irb) in tape_3590_print_io_sim_msg_f1() argument
1137 snprintf(exception, BUFSIZE, "CU Exception on device path " in tape_3590_print_io_sim_msg_f1()
1186 snprintf(service, BUFSIZE, "Repair will disable device" in tape_3590_print_io_sim_msg_f1()
1189 snprintf(service, BUFSIZE, "Repair will disable device" in tape_3590_print_io_sim_msg_f1()
1211 dev_warn (&device->cdev->dev, "I/O subsystem information: exception" in tape_3590_print_io_sim_msg_f1()
1219 * Print an Device Subsystem Service Information Message (message code f2)
1222 tape_3590_print_dev_sim_msg_f2(struct tape_device *device, struct irb *irb) in tape_3590_print_dev_sim_msg_f2() argument
1271 snprintf(service, BUFSIZE, "Repair will not impact device " in tape_3590_print_dev_sim_msg_f2()
1323 dev_warn (&device->cdev->dev, "Device subsystem information: exception" in tape_3590_print_dev_sim_msg_f2()
1334 tape_3590_print_era_msg(struct tape_device *device, struct irb *irb) in tape_3590_print_era_msg() argument
1343 dev_warn (&device->cdev->dev, "The tape unit has " in tape_3590_print_era_msg()
1347 dev_warn (&device->cdev->dev, "The tape unit has " in tape_3590_print_era_msg()
1354 dev_warn (&device->cdev->dev, "MIM SEV=%i, MC=%02x, ES=%x/%x, " in tape_3590_print_era_msg()
1359 tape_3590_print_mim_msg_f0(device, irb); in tape_3590_print_era_msg()
1364 dev_warn (&device->cdev->dev, "IOSIM SEV=%i, DEVTYPE=3590/%02x," in tape_3590_print_era_msg()
1366 sense->fmt.f71.sev, device->cdev->id.dev_model, in tape_3590_print_era_msg()
1370 tape_3590_print_io_sim_msg_f1(device, irb); in tape_3590_print_era_msg()
1374 /* Standard Device Service Information Message */ in tape_3590_print_era_msg()
1375 dev_warn (&device->cdev->dev, "DEVSIM SEV=%i, DEVTYPE=3590/%02x" in tape_3590_print_era_msg()
1377 sense->fmt.f71.sev, device->cdev->id.dev_model, in tape_3590_print_era_msg()
1381 tape_3590_print_dev_sim_msg_f2(device, irb); in tape_3590_print_era_msg()
1388 dev_warn (&device->cdev->dev, "The tape unit has issued an unknown " in tape_3590_print_era_msg()
1392 static int tape_3590_crypt_error(struct tape_device *device, in tape_3590_crypt_error() argument
1404 return tape_3590_erp_basic(device, request, irb, -EKEYREJECTED); in tape_3590_crypt_error()
1407 return tape_3590_erp_basic(device, request, irb, -ENOTCONN); in tape_3590_crypt_error()
1409 dev_err (&device->cdev->dev, "The tape unit failed to obtain the " in tape_3590_crypt_error()
1412 return tape_3590_erp_basic(device, request, irb, -ENOKEY); in tape_3590_crypt_error()
1421 tape_3590_unit_check(struct tape_device *device, struct tape_request *request, in tape_3590_unit_check() argument
1429 * Recovery for block device requests. Set the block_position in tape_3590_unit_check()
1432 device->blk_data.block_position = -1; in tape_3590_unit_check()
1434 return tape_3590_erp_failed(device, request, irb, -EIO); in tape_3590_unit_check()
1436 return tape_3590_erp_retry(device, request, irb); in tape_3590_unit_check()
1452 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1453 return tape_3590_erp_read_buf_log(device, request, irb); in tape_3590_unit_check()
1456 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1457 return tape_3590_erp_read_alternate(device, request, irb); in tape_3590_unit_check()
1461 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1462 return tape_3590_erp_special_interrupt(device, request, irb); in tape_3590_unit_check()
1464 return tape_3590_crypt_error(device, request, irb); in tape_3590_unit_check()
1468 device->cdev_id); in tape_3590_unit_check()
1469 return tape_3590_erp_basic(device, request, irb, -ENOSPC); in tape_3590_unit_check()
1472 device->cdev_id); in tape_3590_unit_check()
1473 return tape_3590_erp_basic(device, request, irb, -ENOSPC); in tape_3590_unit_check()
1475 DBF_EVENT(2, "(%08x): End of Data Mark\n", device->cdev_id); in tape_3590_unit_check()
1476 return tape_3590_erp_basic(device, request, irb, -ENOSPC); in tape_3590_unit_check()
1480 device->cdev_id); in tape_3590_unit_check()
1481 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_unit_check()
1484 device->cdev_id); in tape_3590_unit_check()
1485 tape_med_state_set(device, MS_UNLOADED); in tape_3590_unit_check()
1486 tape_3590_schedule_work(device, TO_CRYPT_OFF); in tape_3590_unit_check()
1487 return tape_3590_erp_basic(device, request, irb, 0); in tape_3590_unit_check()
1492 * "device intervention" is not very meaningfull in tape_3590_unit_check()
1494 tape_med_state_set(device, MS_UNLOADED); in tape_3590_unit_check()
1495 tape_3590_schedule_work(device, TO_CRYPT_OFF); in tape_3590_unit_check()
1496 return tape_3590_erp_basic(device, request, irb, -ENOMEDIUM); in tape_3590_unit_check()
1497 case 0x4012: /* Device Long Busy */ in tape_3590_unit_check()
1499 DBF_EVENT(6, "(%08x): LONG BUSY\n", device->cdev_id); in tape_3590_unit_check()
1500 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1501 return tape_3590_erp_basic(device, request, irb, -EBUSY); in tape_3590_unit_check()
1503 DBF_EVENT(6, "(%08x): Crypto LONG BUSY\n", device->cdev_id); in tape_3590_unit_check()
1504 return tape_3590_erp_long_busy(device, request, irb); in tape_3590_unit_check()
1509 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1510 return tape_3590_erp_swap(device, request, irb); in tape_3590_unit_check()
1514 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1515 return tape_3590_erp_read_opposite(device, request, in tape_3590_unit_check()
1518 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_unit_check()
1525 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1526 return tape_3590_erp_swap(device, request, irb); in tape_3590_unit_check()
1530 return tape_3590_erp_basic(device, request, irb, -EMEDIUMTYPE); in tape_3590_unit_check()
1534 tape_med_state_set(device, MS_UNLOADED); in tape_3590_unit_check()
1535 tape_3590_schedule_work(device, TO_CRYPT_OFF); in tape_3590_unit_check()
1536 return tape_3590_erp_basic(device, request, irb, -ENOMEDIUM); in tape_3590_unit_check()
1539 return tape_3590_erp_basic(device, request, irb, -EMEDIUMTYPE); in tape_3590_unit_check()
1542 return tape_3590_erp_basic(device, request, irb, -EPERM); in tape_3590_unit_check()
1544 dev_warn (&device->cdev->dev, "A different host has privileged" in tape_3590_unit_check()
1546 return tape_3590_erp_basic(device, request, irb, -EPERM); in tape_3590_unit_check()
1548 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_unit_check()
1556 tape_3590_irq(struct tape_device *device, struct tape_request *request, in tape_3590_irq() argument
1560 return tape_3590_unsolicited_irq(device, irb); in tape_3590_irq()
1567 return tape_3590_erp_failed(device, request, irb, -ENOSPC); in tape_3590_irq()
1571 return tape_3590_unit_check(device, request, irb); in tape_3590_irq()
1581 return tape_3590_done(device, request); in tape_3590_irq()
1595 tape_dump_sense_dbf(device, request, irb); in tape_3590_irq()
1600 static int tape_3590_read_dev_chars(struct tape_device *device, in tape_3590_read_dev_chars() argument
1612 rc = tape_do_io(device, request); in tape_3590_read_dev_chars()
1620 * Setup device function
1623 tape_3590_setup_device(struct tape_device *device) in tape_3590_setup_device() argument
1629 DBF_EVENT(6, "3590 device setup\n"); in tape_3590_setup_device()
1634 device->discdata = data; in tape_3590_setup_device()
1641 rc = tape_3590_read_dev_chars(device, rdc_data); in tape_3590_setup_device()
1643 DBF_LH(3, "Read device characteristics failed!\n"); in tape_3590_setup_device()
1646 rc = tape_std_assign(device); in tape_3590_setup_device()
1651 tape_3592_disable_crypt(device); in tape_3590_setup_device()
1653 DBF_EVENT(6, "Device has NO crypto support\n"); in tape_3590_setup_device()
1656 rc = tape_3590_sense_medium(device); in tape_3590_setup_device()
1671 * Cleanup device function
1674 tape_3590_cleanup_device(struct tape_device *device) in tape_3590_cleanup_device() argument
1677 tape_std_unassign(device); in tape_3590_cleanup_device()
1679 kfree(device->discdata); in tape_3590_cleanup_device()
1680 device->discdata = NULL; in tape_3590_cleanup_device()
1808 MODULE_DESCRIPTION("Linux on zSeries channel attached 3590 tape device driver");