• Home
  • Raw
  • Download

Lines Matching refs:device

102 static int crypt_supported(struct tape_device *device)  in crypt_supported()  argument
104 return TAPE390_CRYPT_SUPPORTED(TAPE_3590_CRYPT_INFO(device)); in crypt_supported()
107 static int crypt_enabled(struct tape_device *device) in crypt_enabled() argument
109 return TAPE390_CRYPT_ON(TAPE_3590_CRYPT_INFO(device)); in crypt_enabled()
200 static int tape_3592_kekl_query(struct tape_device *device, in tape_3592_kekl_query() argument
225 rc = tape_do_io(device, request); in tape_3592_kekl_query()
241 static int tape_3592_ioctl_kekl_query(struct tape_device *device, in tape_3592_ioctl_kekl_query() argument
248 if (!crypt_supported(device)) in tape_3592_ioctl_kekl_query()
250 if (!crypt_enabled(device)) in tape_3592_ioctl_kekl_query()
255 rc = tape_3592_kekl_query(device, ext_kekls); in tape_3592_ioctl_kekl_query()
268 static int tape_3590_mttell(struct tape_device *device, int mt_count);
273 static int tape_3592_kekl_set(struct tape_device *device, in tape_3592_kekl_set() argument
284 if (tape_3590_mttell(device, 0) != 0) in tape_3592_kekl_set()
298 return tape_do_io_free(device, request); in tape_3592_kekl_set()
304 static int tape_3592_ioctl_kekl_set(struct tape_device *device, in tape_3592_ioctl_kekl_set() argument
311 if (!crypt_supported(device)) in tape_3592_ioctl_kekl_set()
313 if (!crypt_enabled(device)) in tape_3592_ioctl_kekl_set()
322 rc = tape_3592_kekl_set(device, ext_kekls); in tape_3592_ioctl_kekl_set()
331 static struct tape_request *__tape_3592_enable_crypt(struct tape_device *device) in __tape_3592_enable_crypt() argument
337 if (!crypt_supported(device)) in __tape_3592_enable_crypt()
359 static int tape_3592_enable_crypt(struct tape_device *device) in tape_3592_enable_crypt() argument
363 request = __tape_3592_enable_crypt(device); in tape_3592_enable_crypt()
366 return tape_do_io_free(device, request); in tape_3592_enable_crypt()
369 static void tape_3592_enable_crypt_async(struct tape_device *device) in tape_3592_enable_crypt_async() argument
373 request = __tape_3592_enable_crypt(device); in tape_3592_enable_crypt_async()
375 tape_do_io_async_free(device, request); in tape_3592_enable_crypt_async()
381 static struct tape_request *__tape_3592_disable_crypt(struct tape_device *device) in __tape_3592_disable_crypt() argument
387 if (!crypt_supported(device)) in __tape_3592_disable_crypt()
407 static int tape_3592_disable_crypt(struct tape_device *device) in tape_3592_disable_crypt() argument
411 request = __tape_3592_disable_crypt(device); in tape_3592_disable_crypt()
414 return tape_do_io_free(device, request); in tape_3592_disable_crypt()
417 static void tape_3592_disable_crypt_async(struct tape_device *device) in tape_3592_disable_crypt_async() argument
421 request = __tape_3592_disable_crypt(device); in tape_3592_disable_crypt_async()
423 tape_do_io_async_free(device, request); in tape_3592_disable_crypt_async()
429 static int tape_3592_ioctl_crypt_set(struct tape_device *device, in tape_3592_ioctl_crypt_set() argument
435 if (!crypt_supported(device)) in tape_3592_ioctl_crypt_set()
442 return tape_3592_enable_crypt(device); in tape_3592_ioctl_crypt_set()
444 return tape_3592_disable_crypt(device); in tape_3592_ioctl_crypt_set()
447 static int tape_3590_sense_medium(struct tape_device *device);
452 static int tape_3592_ioctl_crypt_query(struct tape_device *device, in tape_3592_ioctl_crypt_query() argument
456 if (!crypt_supported(device)) in tape_3592_ioctl_crypt_query()
458 tape_3590_sense_medium(device); in tape_3592_ioctl_crypt_query()
459 if (copy_to_user((char __user *) arg, &TAPE_3590_CRYPT_INFO(device), in tape_3592_ioctl_crypt_query()
460 sizeof(TAPE_3590_CRYPT_INFO(device)))) in tape_3592_ioctl_crypt_query()
470 tape_3590_ioctl(struct tape_device *device, unsigned int cmd, unsigned long arg) in tape_3590_ioctl() argument
479 return tape_std_display(device, &disp); in tape_3590_ioctl()
482 return tape_3592_ioctl_kekl_set(device, arg); in tape_3590_ioctl()
484 return tape_3592_ioctl_kekl_query(device, arg); in tape_3590_ioctl()
486 return tape_3592_ioctl_crypt_set(device, arg); in tape_3590_ioctl()
488 return tape_3592_ioctl_crypt_query(device, arg); in tape_3590_ioctl()
497 static int tape_3590_sense_medium(struct tape_device *device) in tape_3590_sense_medium() argument
506 return tape_do_io_free(device, request); in tape_3590_sense_medium()
509 static void tape_3590_sense_medium_async(struct tape_device *device) in tape_3590_sense_medium_async() argument
518 tape_do_io_async_free(device, request); in tape_3590_sense_medium_async()
525 tape_3590_mttell(struct tape_device *device, int mt_count) in tape_3590_mttell() argument
530 rc = tape_std_read_block_id(device, &block_id); in tape_3590_mttell()
540 tape_3590_mtseek(struct tape_device *device, int count) in tape_3590_mtseek() argument
549 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_3590_mtseek()
553 return tape_do_io_free(device, request); in tape_3590_mtseek()
561 tape_3590_read_opposite(struct tape_device *device, in tape_3590_read_opposite() argument
572 tape_ccw_cc(request->cpaddr, MODE_SET_DB, 1, device->modeset_byte); in tape_3590_read_opposite()
573 data = device->discdata; in tape_3590_read_opposite()
575 device->char_data.idal_buf); in tape_3590_read_opposite()
597 static void tape_3590_read_attmsg_async(struct tape_device *device) in tape_3590_read_attmsg_async() argument
612 tape_do_io_async_free(device, request); in tape_3590_read_attmsg_async()
623 struct tape_device *device; member
636 tape_3590_sense_medium_async(p->device); in tape_3590_work_handler()
639 tape_3590_read_attmsg_async(p->device); in tape_3590_work_handler()
642 tape_3592_enable_crypt_async(p->device); in tape_3590_work_handler()
645 tape_3592_disable_crypt_async(p->device); in tape_3590_work_handler()
651 tape_put_device(p->device); in tape_3590_work_handler()
656 tape_3590_schedule_work(struct tape_device *device, enum tape_op op) in tape_3590_schedule_work() argument
665 p->device = tape_get_device(device); in tape_3590_schedule_work()
672 static void tape_3590_med_state_set(struct tape_device *device, in tape_3590_med_state_set() argument
677 c_info = &TAPE_3590_CRYPT_INFO(device); in tape_3590_med_state_set()
684 tape_med_state_set(device, MS_UNLOADED); in tape_3590_med_state_set()
685 TAPE_3590_CRYPT_INFO(device).medium_status = 0; in tape_3590_med_state_set()
689 tape_med_state_set(device, MS_LOADED); in tape_3590_med_state_set()
692 tape_med_state_set(device, MS_UNKNOWN); in tape_3590_med_state_set()
710 tape_3590_done(struct tape_device *device, struct tape_request *request) in tape_3590_done() argument
729 tape_med_state_set(device, MS_LOADED); in tape_3590_done()
732 tape_med_state_set(device, MS_UNLOADED); in tape_3590_done()
733 tape_3590_schedule_work(device, TO_CRYPT_OFF); in tape_3590_done()
736 tape_3590_med_state_set(device, request->cpdata); in tape_3590_done()
739 TAPE_3590_CRYPT_INFO(device).status in tape_3590_done()
741 *(device->modeset_byte) |= 0x03; in tape_3590_done()
744 TAPE_3590_CRYPT_INFO(device).status in tape_3590_done()
746 *(device->modeset_byte) &= ~0x03; in tape_3590_done()
768 tape_3590_erp_succeded(struct tape_device *device, struct tape_request *request) in tape_3590_erp_succeded() argument
772 return tape_3590_done(device, request); in tape_3590_erp_succeded()
779 tape_3590_erp_failed(struct tape_device *device, struct tape_request *request, in tape_3590_erp_failed() argument
784 tape_dump_sense_dbf(device, request, irb); in tape_3590_erp_failed()
792 tape_3590_erp_retry(struct tape_device *device, struct tape_request *request, in tape_3590_erp_retry() argument
796 tape_dump_sense_dbf(device, request, irb); in tape_3590_erp_retry()
804 tape_3590_unsolicited_irq(struct tape_device *device, struct irb *irb) in tape_3590_unsolicited_irq() argument
811 DBF_EVENT(3, "unsol.irq! tape ready: %08x\n", device->cdev_id); in tape_3590_unsolicited_irq()
813 tape_3590_schedule_work(device, TO_READ_ATTMSG); in tape_3590_unsolicited_irq()
815 DBF_EVENT(3, "unsol.irq! dev end: %08x\n", device->cdev_id); in tape_3590_unsolicited_irq()
816 tape_dump_sense_dbf(device, NULL, irb); in tape_3590_unsolicited_irq()
819 tape_3590_schedule_work(device, TO_MSEN); in tape_3590_unsolicited_irq()
827 tape_3590_erp_basic(struct tape_device *device, struct tape_request *request, in tape_3590_erp_basic() argument
836 return tape_3590_erp_failed(device, request, irb, rc); in tape_3590_erp_basic()
838 return tape_3590_erp_succeded(device, request); in tape_3590_erp_basic()
840 return tape_3590_erp_retry(device, request, irb); in tape_3590_erp_basic()
842 return tape_3590_erp_failed(device, request, irb, rc); in tape_3590_erp_basic()
853 tape_3590_erp_read_buf_log(struct tape_device *device, in tape_3590_erp_read_buf_log() argument
860 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_erp_read_buf_log()
867 tape_3590_erp_swap(struct tape_device *device, struct tape_request *request, in tape_3590_erp_swap() argument
876 dev_warn (&device->cdev->dev, "The tape medium must be loaded into a " in tape_3590_erp_swap()
878 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_erp_swap()
885 tape_3590_erp_long_busy(struct tape_device *device, in tape_3590_erp_long_busy() argument
896 tape_3590_erp_special_interrupt(struct tape_device *device, in tape_3590_erp_special_interrupt() argument
899 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_erp_special_interrupt()
906 tape_3590_erp_read_alternate(struct tape_device *device, in tape_3590_erp_read_alternate() argument
918 data = device->discdata; in tape_3590_erp_read_alternate()
921 device->cdev_id); in tape_3590_erp_read_alternate()
925 device->cdev_id); in tape_3590_erp_read_alternate()
928 tape_3590_read_opposite(device, request); in tape_3590_erp_read_alternate()
929 return tape_3590_erp_retry(device, request, irb); in tape_3590_erp_read_alternate()
936 tape_3590_erp_read_opposite(struct tape_device *device, in tape_3590_erp_read_opposite() argument
945 tape_3590_read_opposite(device, request); in tape_3590_erp_read_opposite()
946 return tape_3590_erp_retry(device, request, irb); in tape_3590_erp_read_opposite()
949 return tape_3590_erp_failed(device, request, irb, -EIO); in tape_3590_erp_read_opposite()
952 return tape_3590_erp_failed(device, request, irb, -EIO); in tape_3590_erp_read_opposite()
960 tape_3590_print_mim_msg_f0(struct tape_device *device, struct irb *irb) in tape_3590_print_mim_msg_f0() argument
1012 dev_warn (&device->cdev->dev, "Tape media information: exception %s, " in tape_3590_print_mim_msg_f0()
1024 tape_3590_print_io_sim_msg_f1(struct tape_device *device, struct irb *irb) in tape_3590_print_io_sim_msg_f1() argument
1124 dev_warn (&device->cdev->dev, "I/O subsystem information: exception" in tape_3590_print_io_sim_msg_f1()
1135 tape_3590_print_dev_sim_msg_f2(struct tape_device *device, struct irb *irb) in tape_3590_print_dev_sim_msg_f2() argument
1236 dev_warn (&device->cdev->dev, "Device subsystem information: exception" in tape_3590_print_dev_sim_msg_f2()
1247 tape_3590_print_era_msg(struct tape_device *device, struct irb *irb) in tape_3590_print_era_msg() argument
1256 dev_warn (&device->cdev->dev, "The tape unit has " in tape_3590_print_era_msg()
1260 dev_warn (&device->cdev->dev, "The tape unit has " in tape_3590_print_era_msg()
1267 dev_warn (&device->cdev->dev, "MIM SEV=%i, MC=%02x, ES=%x/%x, " in tape_3590_print_era_msg()
1272 tape_3590_print_mim_msg_f0(device, irb); in tape_3590_print_era_msg()
1277 dev_warn (&device->cdev->dev, "IOSIM SEV=%i, DEVTYPE=3590/%02x," in tape_3590_print_era_msg()
1279 sense->fmt.f71.sev, device->cdev->id.dev_model, in tape_3590_print_era_msg()
1283 tape_3590_print_io_sim_msg_f1(device, irb); in tape_3590_print_era_msg()
1288 dev_warn (&device->cdev->dev, "DEVSIM SEV=%i, DEVTYPE=3590/%02x" in tape_3590_print_era_msg()
1290 sense->fmt.f71.sev, device->cdev->id.dev_model, in tape_3590_print_era_msg()
1294 tape_3590_print_dev_sim_msg_f2(device, irb); in tape_3590_print_era_msg()
1301 dev_warn (&device->cdev->dev, "The tape unit has issued an unknown " in tape_3590_print_era_msg()
1305 static int tape_3590_crypt_error(struct tape_device *device, in tape_3590_crypt_error() argument
1317 return tape_3590_erp_basic(device, request, irb, -EKEYREJECTED); in tape_3590_crypt_error()
1320 return tape_3590_erp_basic(device, request, irb, -ENOTCONN); in tape_3590_crypt_error()
1322 dev_err (&device->cdev->dev, "The tape unit failed to obtain the " in tape_3590_crypt_error()
1325 return tape_3590_erp_basic(device, request, irb, -ENOKEY); in tape_3590_crypt_error()
1334 tape_3590_unit_check(struct tape_device *device, struct tape_request *request, in tape_3590_unit_check() argument
1351 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1352 return tape_3590_erp_read_buf_log(device, request, irb); in tape_3590_unit_check()
1355 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1356 return tape_3590_erp_read_alternate(device, request, irb); in tape_3590_unit_check()
1360 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1361 return tape_3590_erp_special_interrupt(device, request, irb); in tape_3590_unit_check()
1363 return tape_3590_crypt_error(device, request, irb); in tape_3590_unit_check()
1367 device->cdev_id); in tape_3590_unit_check()
1368 return tape_3590_erp_basic(device, request, irb, -ENOSPC); in tape_3590_unit_check()
1371 device->cdev_id); in tape_3590_unit_check()
1372 return tape_3590_erp_basic(device, request, irb, -ENOSPC); in tape_3590_unit_check()
1374 DBF_EVENT(2, "(%08x): End of Data Mark\n", device->cdev_id); in tape_3590_unit_check()
1375 return tape_3590_erp_basic(device, request, irb, -ENOSPC); in tape_3590_unit_check()
1379 device->cdev_id); in tape_3590_unit_check()
1380 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_unit_check()
1383 device->cdev_id); in tape_3590_unit_check()
1384 tape_med_state_set(device, MS_UNLOADED); in tape_3590_unit_check()
1385 tape_3590_schedule_work(device, TO_CRYPT_OFF); in tape_3590_unit_check()
1386 return tape_3590_erp_basic(device, request, irb, 0); in tape_3590_unit_check()
1393 tape_med_state_set(device, MS_UNLOADED); in tape_3590_unit_check()
1394 tape_3590_schedule_work(device, TO_CRYPT_OFF); in tape_3590_unit_check()
1395 return tape_3590_erp_basic(device, request, irb, -ENOMEDIUM); in tape_3590_unit_check()
1398 DBF_EVENT(6, "(%08x): LONG BUSY\n", device->cdev_id); in tape_3590_unit_check()
1399 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1400 return tape_3590_erp_basic(device, request, irb, -EBUSY); in tape_3590_unit_check()
1402 DBF_EVENT(6, "(%08x): Crypto LONG BUSY\n", device->cdev_id); in tape_3590_unit_check()
1403 return tape_3590_erp_long_busy(device, request, irb); in tape_3590_unit_check()
1408 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1409 return tape_3590_erp_swap(device, request, irb); in tape_3590_unit_check()
1413 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1414 return tape_3590_erp_read_opposite(device, request, in tape_3590_unit_check()
1417 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_unit_check()
1424 tape_3590_print_era_msg(device, irb); in tape_3590_unit_check()
1425 return tape_3590_erp_swap(device, request, irb); in tape_3590_unit_check()
1429 return tape_3590_erp_basic(device, request, irb, -EMEDIUMTYPE); in tape_3590_unit_check()
1433 tape_med_state_set(device, MS_UNLOADED); in tape_3590_unit_check()
1434 tape_3590_schedule_work(device, TO_CRYPT_OFF); in tape_3590_unit_check()
1435 return tape_3590_erp_basic(device, request, irb, -ENOMEDIUM); in tape_3590_unit_check()
1438 return tape_3590_erp_basic(device, request, irb, -EMEDIUMTYPE); in tape_3590_unit_check()
1441 return tape_3590_erp_basic(device, request, irb, -EPERM); in tape_3590_unit_check()
1443 dev_warn (&device->cdev->dev, "A different host has privileged" in tape_3590_unit_check()
1445 return tape_3590_erp_basic(device, request, irb, -EPERM); in tape_3590_unit_check()
1447 return tape_3590_erp_basic(device, request, irb, -EIO); in tape_3590_unit_check()
1455 tape_3590_irq(struct tape_device *device, struct tape_request *request, in tape_3590_irq() argument
1459 return tape_3590_unsolicited_irq(device, irb); in tape_3590_irq()
1466 return tape_3590_erp_failed(device, request, irb, -ENOSPC); in tape_3590_irq()
1470 return tape_3590_unit_check(device, request, irb); in tape_3590_irq()
1480 return tape_3590_done(device, request); in tape_3590_irq()
1494 tape_dump_sense_dbf(device, request, irb); in tape_3590_irq()
1499 static int tape_3590_read_dev_chars(struct tape_device *device, in tape_3590_read_dev_chars() argument
1511 rc = tape_do_io(device, request); in tape_3590_read_dev_chars()
1522 tape_3590_setup_device(struct tape_device *device) in tape_3590_setup_device() argument
1533 device->discdata = data; in tape_3590_setup_device()
1540 rc = tape_3590_read_dev_chars(device, rdc_data); in tape_3590_setup_device()
1545 rc = tape_std_assign(device); in tape_3590_setup_device()
1550 tape_3592_disable_crypt(device); in tape_3590_setup_device()
1555 rc = tape_3590_sense_medium(device); in tape_3590_setup_device()
1573 tape_3590_cleanup_device(struct tape_device *device) in tape_3590_cleanup_device() argument
1576 tape_std_unassign(device); in tape_3590_cleanup_device()
1578 kfree(device->discdata); in tape_3590_cleanup_device()
1579 device->discdata = NULL; in tape_3590_cleanup_device()