/linux-4.1.27/drivers/s390/crypto/ |
H A D | ap_bus.c | 59 static int __ap_poll_device(struct ap_device *ap_dev, unsigned long *flags); 63 static void ap_reset(struct ap_device *ap_dev); 621 * @ap_dev: Pointer to an AP device. 625 static void ap_increase_queue_count(struct ap_device *ap_dev) ap_increase_queue_count() argument 627 int timeout = ap_dev->drv->request_timeout; ap_increase_queue_count() 629 ap_dev->queue_count++; ap_increase_queue_count() 630 if (ap_dev->queue_count == 1) { ap_increase_queue_count() 631 mod_timer(&ap_dev->timeout, jiffies + timeout); ap_increase_queue_count() 632 ap_dev->reset = AP_RESET_ARMED; ap_increase_queue_count() 638 * @ap_dev: Pointer to an AP device. 643 static void ap_decrease_queue_count(struct ap_device *ap_dev) ap_decrease_queue_count() argument 645 int timeout = ap_dev->drv->request_timeout; ap_decrease_queue_count() 647 ap_dev->queue_count--; ap_decrease_queue_count() 648 if (ap_dev->queue_count > 0) ap_decrease_queue_count() 649 mod_timer(&ap_dev->timeout, jiffies + timeout); ap_decrease_queue_count() 656 ap_dev->reset = AP_RESET_IGNORE; ap_decrease_queue_count() 665 struct ap_device *ap_dev = to_ap_dev(dev); ap_hwtype_show() local 666 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->device_type); ap_hwtype_show() 674 struct ap_device *ap_dev = to_ap_dev(dev); ap_raw_hwtype_show() local 676 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->raw_hwtype); ap_raw_hwtype_show() 684 struct ap_device *ap_dev = to_ap_dev(dev); ap_depth_show() local 685 return snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->queue_depth); ap_depth_show() 693 struct ap_device *ap_dev = to_ap_dev(dev); ap_request_count_show() local 696 spin_lock_bh(&ap_dev->lock); ap_request_count_show() 697 rc = snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->total_request_count); ap_request_count_show() 698 spin_unlock_bh(&ap_dev->lock); ap_request_count_show() 707 struct ap_device *ap_dev = to_ap_dev(dev); ap_requestq_count_show() local 710 spin_lock_bh(&ap_dev->lock); ap_requestq_count_show() 711 rc = snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->requestq_count); ap_requestq_count_show() 712 spin_unlock_bh(&ap_dev->lock); ap_requestq_count_show() 721 struct ap_device *ap_dev = to_ap_dev(dev); ap_pendingq_count_show() local 724 spin_lock_bh(&ap_dev->lock); ap_pendingq_count_show() 725 rc = snprintf(buf, PAGE_SIZE, "%d\n", ap_dev->pendingq_count); ap_pendingq_count_show() 726 spin_unlock_bh(&ap_dev->lock); ap_pendingq_count_show() 743 struct ap_device *ap_dev = to_ap_dev(dev); ap_functions_show() local 744 return snprintf(buf, PAGE_SIZE, "0x%08X\n", ap_dev->functions); ap_functions_show() 773 struct ap_device *ap_dev = to_ap_dev(dev); ap_bus_match() local 783 (id->dev_type != ap_dev->device_type)) ap_bus_match() 800 struct ap_device *ap_dev = to_ap_dev(dev); ap_uevent() local 803 if (!ap_dev) ap_uevent() 807 retval = add_uevent_var(env, "DEV_TYPE=%04X", ap_dev->device_type); ap_uevent() 812 retval = add_uevent_var(env, "MODALIAS=ap:t%02X", ap_dev->device_type); ap_uevent() 819 struct ap_device *ap_dev = to_ap_dev(dev); ap_bus_suspend() local 839 spin_lock_bh(&ap_dev->lock); ap_bus_suspend() 840 __ap_poll_device(ap_dev, &flags); ap_bus_suspend() 841 spin_unlock_bh(&ap_dev->lock); ap_bus_suspend() 844 spin_lock_bh(&ap_dev->lock); ap_bus_suspend() 845 ap_dev->unregistered = 1; ap_bus_suspend() 846 spin_unlock_bh(&ap_dev->lock); ap_bus_suspend() 853 struct ap_device *ap_dev = to_ap_dev(dev); ap_bus_resume() local 893 if (AP_QID_QUEUE(ap_dev->qid) != ap_domain_index) { ap_bus_resume() 894 spin_lock_bh(&ap_dev->lock); ap_bus_resume() 895 ap_dev->qid = AP_MKQID(AP_QID_DEVICE(ap_dev->qid), ap_bus_resume() 897 spin_unlock_bh(&ap_dev->lock); ap_bus_resume() 914 struct ap_device *ap_dev = to_ap_dev(dev); ap_device_probe() local 918 ap_dev->drv = ap_drv; ap_device_probe() 921 list_add(&ap_dev->list, &ap_device_list); ap_device_probe() 924 rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; ap_device_probe() 927 list_del_init(&ap_dev->list); ap_device_probe() 935 * @ap_dev: Pointer to the AP device 939 static void __ap_flush_queue(struct ap_device *ap_dev) __ap_flush_queue() argument 943 list_for_each_entry_safe(ap_msg, next, &ap_dev->pendingq, list) { __ap_flush_queue() 945 ap_dev->pendingq_count--; __ap_flush_queue() 946 ap_msg->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV)); __ap_flush_queue() 948 list_for_each_entry_safe(ap_msg, next, &ap_dev->requestq, list) { __ap_flush_queue() 950 ap_dev->requestq_count--; __ap_flush_queue() 951 ap_msg->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV)); __ap_flush_queue() 955 void ap_flush_queue(struct ap_device *ap_dev) ap_flush_queue() argument 957 spin_lock_bh(&ap_dev->lock); ap_flush_queue() 958 __ap_flush_queue(ap_dev); ap_flush_queue() 959 spin_unlock_bh(&ap_dev->lock); ap_flush_queue() 965 struct ap_device *ap_dev = to_ap_dev(dev); ap_device_remove() local 966 struct ap_driver *ap_drv = ap_dev->drv; ap_device_remove() 968 ap_flush_queue(ap_dev); ap_device_remove() 969 del_timer_sync(&ap_dev->timeout); ap_device_remove() 971 list_del_init(&ap_dev->list); ap_device_remove() 974 ap_drv->remove(ap_dev); ap_device_remove() 975 spin_lock_bh(&ap_dev->lock); ap_device_remove() 976 atomic_sub(ap_dev->queue_count, &ap_poll_requests); ap_device_remove() 977 spin_unlock_bh(&ap_dev->lock); ap_device_remove() 1289 * @ap_dev: pointer to the AP device. 1293 static int ap_probe_device_type(struct ap_device *ap_dev) ap_probe_device_type() argument 1353 status = __ap_send(ap_dev->qid, 0x0102030405060708ULL, ap_probe_device_type() 1363 status = __ap_recv(ap_dev->qid, &psmid, reply, 4096); ap_probe_device_type() 1371 ap_dev->device_type = AP_DEVICE_TYPE_PCICC; ap_probe_device_type() 1373 ap_dev->device_type = AP_DEVICE_TYPE_PCICA; ap_probe_device_type() 1404 struct ap_device *ap_dev = to_ap_dev(dev); ap_device_release() local 1406 kfree(ap_dev); ap_device_release() 1411 struct ap_device *ap_dev; ap_scan_bus() local 1438 ap_dev = to_ap_dev(dev); ap_scan_bus() 1439 spin_lock_bh(&ap_dev->lock); ap_scan_bus() 1440 if (rc || ap_dev->unregistered) { ap_scan_bus() 1441 spin_unlock_bh(&ap_dev->lock); ap_scan_bus() 1442 if (ap_dev->unregistered) ap_scan_bus() 1448 spin_unlock_bh(&ap_dev->lock); ap_scan_bus() 1457 ap_dev = kzalloc(sizeof(*ap_dev), GFP_KERNEL); ap_scan_bus() 1458 if (!ap_dev) ap_scan_bus() 1460 ap_dev->qid = qid; ap_scan_bus() 1461 ap_dev->queue_depth = queue_depth; ap_scan_bus() 1462 ap_dev->unregistered = 1; ap_scan_bus() 1463 spin_lock_init(&ap_dev->lock); ap_scan_bus() 1464 INIT_LIST_HEAD(&ap_dev->pendingq); ap_scan_bus() 1465 INIT_LIST_HEAD(&ap_dev->requestq); ap_scan_bus() 1466 INIT_LIST_HEAD(&ap_dev->list); ap_scan_bus() 1467 setup_timer(&ap_dev->timeout, ap_request_timeout, ap_scan_bus() 1468 (unsigned long) ap_dev); ap_scan_bus() 1472 if (ap_probe_device_type(ap_dev)) { ap_scan_bus() 1473 kfree(ap_dev); ap_scan_bus() 1478 ap_dev->device_type = device_type; ap_scan_bus() 1480 ap_dev->raw_hwtype = device_type; ap_scan_bus() 1484 ap_dev->functions = device_functions; ap_scan_bus() 1486 ap_dev->functions = 0u; ap_scan_bus() 1488 ap_dev->device.bus = &ap_bus_type; ap_scan_bus() 1489 ap_dev->device.parent = ap_root_device; ap_scan_bus() 1490 if (dev_set_name(&ap_dev->device, "card%02x", ap_scan_bus() 1491 AP_QID_DEVICE(ap_dev->qid))) { ap_scan_bus() 1492 kfree(ap_dev); ap_scan_bus() 1495 ap_dev->device.release = ap_device_release; ap_scan_bus() 1496 rc = device_register(&ap_dev->device); ap_scan_bus() 1498 put_device(&ap_dev->device); ap_scan_bus() 1502 rc = sysfs_create_group(&ap_dev->device.kobj, ap_scan_bus() 1505 spin_lock_bh(&ap_dev->lock); ap_scan_bus() 1506 ap_dev->unregistered = 0; ap_scan_bus() 1507 spin_unlock_bh(&ap_dev->lock); ap_scan_bus() 1510 device_unregister(&ap_dev->device); ap_scan_bus() 1554 * @ap_dev: pointer to the AP device 1560 static int ap_poll_read(struct ap_device *ap_dev, unsigned long *flags) ap_poll_read() argument 1565 if (ap_dev->queue_count <= 0) ap_poll_read() 1567 status = __ap_recv(ap_dev->qid, &ap_dev->reply->psmid, ap_poll_read() 1568 ap_dev->reply->message, ap_dev->reply->length); ap_poll_read() 1572 ap_decrease_queue_count(ap_dev); ap_poll_read() 1573 list_for_each_entry(ap_msg, &ap_dev->pendingq, list) { ap_poll_read() 1574 if (ap_msg->psmid != ap_dev->reply->psmid) ap_poll_read() 1577 ap_dev->pendingq_count--; ap_poll_read() 1578 ap_msg->receive(ap_dev, ap_msg, ap_dev->reply); ap_poll_read() 1581 if (ap_dev->queue_count > 0) ap_poll_read() 1587 atomic_sub(ap_dev->queue_count, &ap_poll_requests); ap_poll_read() 1588 ap_dev->queue_count = 0; ap_poll_read() 1589 list_splice_init(&ap_dev->pendingq, &ap_dev->requestq); ap_poll_read() 1590 ap_dev->requestq_count += ap_dev->pendingq_count; ap_poll_read() 1591 ap_dev->pendingq_count = 0; ap_poll_read() 1603 * @ap_dev: pointer to the AP device 1609 static int ap_poll_write(struct ap_device *ap_dev, unsigned long *flags) ap_poll_write() argument 1614 if (ap_dev->requestq_count <= 0 || ap_poll_write() 1615 ap_dev->queue_count >= ap_dev->queue_depth) ap_poll_write() 1618 ap_msg = list_entry(ap_dev->requestq.next, struct ap_message, list); ap_poll_write() 1619 status = __ap_send(ap_dev->qid, ap_msg->psmid, ap_poll_write() 1624 ap_increase_queue_count(ap_dev); ap_poll_write() 1625 list_move_tail(&ap_msg->list, &ap_dev->pendingq); ap_poll_write() 1626 ap_dev->requestq_count--; ap_poll_write() 1627 ap_dev->pendingq_count++; ap_poll_write() 1628 if (ap_dev->queue_count < ap_dev->queue_depth && ap_poll_write() 1629 ap_dev->requestq_count > 0) ap_poll_write() 1649 * @ap_dev: pointer to the bus device 1657 static inline int ap_poll_queue(struct ap_device *ap_dev, unsigned long *flags) ap_poll_queue() argument 1661 rc = ap_poll_read(ap_dev, flags); ap_poll_queue() 1664 return ap_poll_write(ap_dev, flags); ap_poll_queue() 1669 * @ap_dev: pointer to the AP device 1674 static int __ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg) __ap_queue_message() argument 1678 if (list_empty(&ap_dev->requestq) && __ap_queue_message() 1679 ap_dev->queue_count < ap_dev->queue_depth) { __ap_queue_message() 1680 status = __ap_send(ap_dev->qid, ap_msg->psmid, __ap_queue_message() 1685 list_add_tail(&ap_msg->list, &ap_dev->pendingq); __ap_queue_message() 1687 ap_dev->pendingq_count++; __ap_queue_message() 1688 ap_increase_queue_count(ap_dev); __ap_queue_message() 1689 ap_dev->total_request_count++; __ap_queue_message() 1693 list_add_tail(&ap_msg->list, &ap_dev->requestq); __ap_queue_message() 1694 ap_dev->requestq_count++; __ap_queue_message() 1695 ap_dev->total_request_count++; __ap_queue_message() 1699 ap_msg->receive(ap_dev, ap_msg, ERR_PTR(-EINVAL)); __ap_queue_message() 1702 ap_msg->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV)); __ap_queue_message() 1706 list_add_tail(&ap_msg->list, &ap_dev->requestq); __ap_queue_message() 1707 ap_dev->requestq_count++; __ap_queue_message() 1708 ap_dev->total_request_count++; __ap_queue_message() 1715 void ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg) ap_queue_message() argument 1724 spin_lock_bh(&ap_dev->lock); ap_queue_message() 1725 if (!ap_dev->unregistered) { ap_queue_message() 1727 rc = ap_poll_queue(ap_dev, &flags); ap_queue_message() 1729 rc = __ap_queue_message(ap_dev, ap_msg); ap_queue_message() 1733 ap_dev->unregistered = 1; ap_queue_message() 1735 ap_msg->receive(ap_dev, ap_msg, ERR_PTR(-ENODEV)); ap_queue_message() 1738 spin_unlock_bh(&ap_dev->lock); ap_queue_message() 1740 device_unregister(&ap_dev->device); ap_queue_message() 1746 * @ap_dev: The AP device that has the message queued 1754 void ap_cancel_message(struct ap_device *ap_dev, struct ap_message *ap_msg) ap_cancel_message() argument 1758 spin_lock_bh(&ap_dev->lock); ap_cancel_message() 1760 list_for_each_entry(tmp, &ap_dev->pendingq, list) ap_cancel_message() 1762 ap_dev->pendingq_count--; ap_cancel_message() 1765 ap_dev->requestq_count--; ap_cancel_message() 1769 spin_unlock_bh(&ap_dev->lock); ap_cancel_message() 1787 * @ap_dev: Pointer to the AP device 1792 static void ap_reset(struct ap_device *ap_dev) ap_reset() argument 1796 ap_dev->reset = AP_RESET_IGNORE; ap_reset() 1797 atomic_sub(ap_dev->queue_count, &ap_poll_requests); ap_reset() 1798 ap_dev->queue_count = 0; ap_reset() 1799 list_splice_init(&ap_dev->pendingq, &ap_dev->requestq); ap_reset() 1800 ap_dev->requestq_count += ap_dev->pendingq_count; ap_reset() 1801 ap_dev->pendingq_count = 0; ap_reset() 1802 rc = ap_init_queue(ap_dev->qid); ap_reset() 1804 ap_dev->unregistered = 1; ap_reset() 1809 static int __ap_poll_device(struct ap_device *ap_dev, unsigned long *flags) __ap_poll_device() argument 1811 if (!ap_dev->unregistered) { __ap_poll_device() 1812 if (ap_poll_queue(ap_dev, flags)) __ap_poll_device() 1813 ap_dev->unregistered = 1; __ap_poll_device() 1814 if (ap_dev->reset == AP_RESET_DO) __ap_poll_device() 1815 ap_reset(ap_dev); __ap_poll_device() 1831 struct ap_device *ap_dev; ap_poll_all() local 1842 list_for_each_entry(ap_dev, &ap_device_list, list) { ap_poll_all() 1843 spin_lock(&ap_dev->lock); ap_poll_all() 1844 __ap_poll_device(ap_dev, &flags); ap_poll_all() 1845 spin_unlock(&ap_dev->lock); ap_poll_all() 1868 struct ap_device *ap_dev; ap_poll_thread() local 1890 list_for_each_entry(ap_dev, &ap_device_list, list) { ap_poll_thread() 1891 spin_lock(&ap_dev->lock); ap_poll_thread() 1892 __ap_poll_device(ap_dev, &flags); ap_poll_thread() 1893 spin_unlock(&ap_dev->lock); ap_poll_thread() 1939 struct ap_device *ap_dev = (struct ap_device *) data; ap_request_timeout() local 1941 if (ap_dev->reset == AP_RESET_ARMED) { ap_request_timeout() 1942 ap_dev->reset = AP_RESET_DO; ap_request_timeout()
|
H A D | zcrypt_cex4.c | 56 static int zcrypt_cex4_probe(struct ap_device *ap_dev); 57 static void zcrypt_cex4_remove(struct ap_device *ap_dev); 69 * @ap_dev: pointer to the AP device. 71 static int zcrypt_cex4_probe(struct ap_device *ap_dev) zcrypt_cex4_probe() argument 76 switch (ap_dev->device_type) { zcrypt_cex4_probe() 79 if (ap_test_bit(&ap_dev->functions, AP_FUNC_ACCEL)) { zcrypt_cex4_probe() 83 if (ap_dev->device_type == AP_DEVICE_TYPE_CEX4) { zcrypt_cex4_probe() 92 if (ap_test_bit(&ap_dev->functions, AP_FUNC_MEX4K) && zcrypt_cex4_probe() 93 ap_test_bit(&ap_dev->functions, AP_FUNC_CRT4K)) { zcrypt_cex4_probe() 107 } else if (ap_test_bit(&ap_dev->functions, AP_FUNC_COPRO)) { zcrypt_cex4_probe() 111 if (ap_dev->device_type == AP_DEVICE_TYPE_CEX4) { zcrypt_cex4_probe() 125 } else if (ap_test_bit(&ap_dev->functions, AP_FUNC_EP11)) { zcrypt_cex4_probe() 129 if (ap_dev->device_type == AP_DEVICE_TYPE_CEX4) { zcrypt_cex4_probe() 148 zdev->ap_dev = ap_dev; zcrypt_cex4_probe() 150 ap_dev->reply = &zdev->reply; zcrypt_cex4_probe() 151 ap_dev->private = zdev; zcrypt_cex4_probe() 155 ap_dev->private = NULL; zcrypt_cex4_probe() 165 static void zcrypt_cex4_remove(struct ap_device *ap_dev) zcrypt_cex4_remove() argument 167 struct zcrypt_device *zdev = ap_dev->private; zcrypt_cex4_remove()
|
H A D | zcrypt_cex2a.c | 72 static int zcrypt_cex2a_probe(struct ap_device *ap_dev); 73 static void zcrypt_cex2a_remove(struct ap_device *ap_dev); 85 * @ap_dev: pointer to the AP device. 87 static int zcrypt_cex2a_probe(struct ap_device *ap_dev) zcrypt_cex2a_probe() argument 92 switch (ap_dev->device_type) { zcrypt_cex2a_probe() 114 if (ap_test_bit(&ap_dev->functions, AP_FUNC_MEX4K) && zcrypt_cex2a_probe() 115 ap_test_bit(&ap_dev->functions, AP_FUNC_CRT4K)) { zcrypt_cex2a_probe() 127 zdev->ap_dev = ap_dev; zcrypt_cex2a_probe() 129 ap_dev->reply = &zdev->reply; zcrypt_cex2a_probe() 130 ap_dev->private = zdev; zcrypt_cex2a_probe() 133 ap_dev->private = NULL; zcrypt_cex2a_probe() 144 static void zcrypt_cex2a_remove(struct ap_device *ap_dev) zcrypt_cex2a_remove() argument 146 struct zcrypt_device *zdev = ap_dev->private; zcrypt_cex2a_remove()
|
H A D | zcrypt_pcixcc.c | 83 static int zcrypt_pcixcc_probe(struct ap_device *ap_dev); 84 static void zcrypt_pcixcc_remove(struct ap_device *ap_dev); 96 * @ap_dev: pointer to the AP device. 98 static int zcrypt_pcixcc_mcl(struct ap_device *ap_dev) zcrypt_pcixcc_mcl() argument 179 rc = ap_send(ap_dev->qid, 0x0102030405060708ULL, msg, sizeof(msg)); zcrypt_pcixcc_mcl() 186 rc = ap_recv(ap_dev->qid, &psmid, reply, 4096); zcrypt_pcixcc_mcl() 210 * @ap_dev: pointer to the AP device. 214 static int zcrypt_pcixcc_rng_supported(struct ap_device *ap_dev) zcrypt_pcixcc_rng_supported() argument 230 rng_type6CPRB_msgX(ap_dev, &ap_msg, 4); zcrypt_pcixcc_rng_supported() 231 rc = ap_send(ap_dev->qid, 0x0102030405060708ULL, ap_msg.message, zcrypt_pcixcc_rng_supported() 239 rc = ap_recv(ap_dev->qid, &psmid, ap_msg.message, 4096); zcrypt_pcixcc_rng_supported() 265 * @ap_dev: pointer to the AP device. 267 static int zcrypt_pcixcc_probe(struct ap_device *ap_dev) zcrypt_pcixcc_probe() argument 275 zdev->ap_dev = ap_dev; zcrypt_pcixcc_probe() 277 switch (ap_dev->device_type) { zcrypt_pcixcc_probe() 279 rc = zcrypt_pcixcc_mcl(ap_dev); zcrypt_pcixcc_probe() 319 rc = zcrypt_pcixcc_rng_supported(ap_dev); zcrypt_pcixcc_probe() 330 ap_dev->reply = &zdev->reply; zcrypt_pcixcc_probe() 331 ap_dev->private = zdev; zcrypt_pcixcc_probe() 338 ap_dev->private = NULL; zcrypt_pcixcc_probe() 348 static void zcrypt_pcixcc_remove(struct ap_device *ap_dev) zcrypt_pcixcc_remove() argument 350 struct zcrypt_device *zdev = ap_dev->private; zcrypt_pcixcc_remove()
|
H A D | zcrypt_api.c | 105 ZCRYPT_DBF_DEV(DBF_INFO, zdev, "dev%04xo%dman", zdev->ap_dev->qid, zcrypt_online_store() 108 ap_flush_queue(zdev->ap_dev); zcrypt_online_store() 258 rc = sysfs_create_group(&zdev->ap_dev->device.kobj, zcrypt_device_register() 262 get_device(&zdev->ap_dev->device); zcrypt_device_register() 266 ZCRYPT_DBF_DEV(DBF_INFO, zdev, "dev%04xo%dreg", zdev->ap_dev->qid, zcrypt_device_register() 284 sysfs_remove_group(&zdev->ap_dev->device.kobj, zcrypt_device_register() 286 put_device(&zdev->ap_dev->device); zcrypt_device_register() 307 sysfs_remove_group(&zdev->ap_dev->device.kobj, zcrypt_device_unregister() 309 put_device(&zdev->ap_dev->device); zcrypt_device_unregister() 443 get_device(&zdev->ap_dev->device); zcrypt_rsa_modexpo() 446 if (try_module_get(zdev->ap_dev->drv->driver.owner)) { zcrypt_rsa_modexpo() 450 module_put(zdev->ap_dev->drv->driver.owner); zcrypt_rsa_modexpo() 456 put_device(&zdev->ap_dev->device); zcrypt_rsa_modexpo() 528 get_device(&zdev->ap_dev->device); zcrypt_rsa_crt() 531 if (try_module_get(zdev->ap_dev->drv->driver.owner)) { zcrypt_rsa_crt() 535 module_put(zdev->ap_dev->drv->driver.owner); zcrypt_rsa_crt() 541 put_device(&zdev->ap_dev->device); zcrypt_rsa_crt() 560 AP_QID_DEVICE(zdev->ap_dev->qid) != xcRB->user_defined)) zcrypt_send_cprb() 563 get_device(&zdev->ap_dev->device); zcrypt_send_cprb() 566 if (try_module_get(zdev->ap_dev->drv->driver.owner)) { zcrypt_send_cprb() 570 module_put(zdev->ap_dev->drv->driver.owner); zcrypt_send_cprb() 576 put_device(&zdev->ap_dev->device); zcrypt_send_cprb() 642 if (!is_desired_ep11dev(zdev->ap_dev->qid, ep11_dev_list) && zcrypt_send_ep11_cprb() 647 get_device(&zdev->ap_dev->device); zcrypt_send_ep11_cprb() 650 if (try_module_get(zdev->ap_dev->drv->driver.owner)) { zcrypt_send_ep11_cprb() 654 module_put(zdev->ap_dev->drv->driver.owner); zcrypt_send_ep11_cprb() 660 put_device(&zdev->ap_dev->device); zcrypt_send_ep11_cprb() 679 get_device(&zdev->ap_dev->device); zcrypt_rng() 682 if (try_module_get(zdev->ap_dev->drv->driver.owner)) { zcrypt_rng() 686 module_put(zdev->ap_dev->drv->driver.owner); zcrypt_rng() 691 put_device(&zdev->ap_dev->device); zcrypt_rng() 707 status[AP_QID_DEVICE(zdev->ap_dev->qid)] = zcrypt_status_mask() 719 spin_lock(&zdev->ap_dev->lock); zcrypt_qdepth_mask() 720 qdepth[AP_QID_DEVICE(zdev->ap_dev->qid)] = zcrypt_qdepth_mask() 721 zdev->ap_dev->pendingq_count + zcrypt_qdepth_mask() 722 zdev->ap_dev->requestq_count; zcrypt_qdepth_mask() 723 spin_unlock(&zdev->ap_dev->lock); zcrypt_qdepth_mask() 735 spin_lock(&zdev->ap_dev->lock); zcrypt_perdev_reqcnt() 736 reqcnt[AP_QID_DEVICE(zdev->ap_dev->qid)] = zcrypt_perdev_reqcnt() 737 zdev->ap_dev->total_request_count; zcrypt_perdev_reqcnt() 738 spin_unlock(&zdev->ap_dev->lock); zcrypt_perdev_reqcnt() 750 spin_lock(&zdev->ap_dev->lock); zcrypt_pendingq_count() 751 pendingq_count += zdev->ap_dev->pendingq_count; zcrypt_pendingq_count() 752 spin_unlock(&zdev->ap_dev->lock); zcrypt_pendingq_count() 765 spin_lock(&zdev->ap_dev->lock); zcrypt_requestq_count() 766 requestq_count += zdev->ap_dev->requestq_count; zcrypt_requestq_count() 767 spin_unlock(&zdev->ap_dev->lock); zcrypt_requestq_count() 1263 if (AP_QID_DEVICE(zdev->ap_dev->qid) == index) { zcrypt_disable_card() 1265 ap_flush_queue(zdev->ap_dev); zcrypt_disable_card() 1277 if (AP_QID_DEVICE(zdev->ap_dev->qid) == index) { zcrypt_enable_card()
|
H A D | zcrypt_pcica.c | 63 static int zcrypt_pcica_probe(struct ap_device *ap_dev); 64 static void zcrypt_pcica_remove(struct ap_device *ap_dev); 206 zdev->ap_dev->qid); convert_type84() 208 zdev->ap_dev->qid, zdev->online, t84h->code); convert_type84() 234 zdev->ap_dev->qid); convert_response() 236 zdev->ap_dev->qid, zdev->online); convert_response() 245 * @ap_dev: pointer to the AP device 249 static void zcrypt_pcica_receive(struct ap_device *ap_dev, zcrypt_pcica_receive() argument 303 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_pcica_modexpo() 310 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_pcica_modexpo() 342 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_pcica_modexpo_crt() 349 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_pcica_modexpo_crt() 366 * @ap_dev: pointer to the AP device. 368 static int zcrypt_pcica_probe(struct ap_device *ap_dev) zcrypt_pcica_probe() argument 376 zdev->ap_dev = ap_dev; zcrypt_pcica_probe() 385 ap_dev->reply = &zdev->reply; zcrypt_pcica_probe() 386 ap_dev->private = zdev; zcrypt_pcica_probe() 393 ap_dev->private = NULL; zcrypt_pcica_probe() 402 static void zcrypt_pcica_remove(struct ap_device *ap_dev) zcrypt_pcica_remove() argument 404 struct zcrypt_device *zdev = ap_dev->private; zcrypt_pcica_remove()
|
H A D | zcrypt_error.h | 115 zdev->ap_dev->qid); convert_error() 117 zdev->ap_dev->qid, zdev->online, ehdr->reply_code); convert_error() 126 zdev->ap_dev->qid); convert_error() 128 zdev->ap_dev->qid, zdev->online, ehdr->reply_code); convert_error() 133 zdev->ap_dev->qid); convert_error() 135 zdev->ap_dev->qid, zdev->online, ehdr->reply_code); convert_error()
|
H A D | zcrypt_pcicc.c | 75 static int zcrypt_pcicc_probe(struct ap_device *ap_dev); 76 static void zcrypt_pcicc_remove(struct ap_device *ap_dev); 223 msg->cprb.usage_domain[0]= AP_QID_QUEUE(zdev->ap_dev->qid); ICAMEX_msg_to_type6MEX_msg() 286 msg->cprb.usage_domain[0] = AP_QID_QUEUE(zdev->ap_dev->qid); ICACRT_msg_to_type6CRT_msg() 379 zdev->ap_dev->qid); convert_type86() 381 zdev->ap_dev->qid, zdev->online, convert_type86() 437 zdev->ap_dev->qid); convert_response() 439 zdev->ap_dev->qid, zdev->online); convert_response() 448 * @ap_dev: pointer to the AP device 452 static void zcrypt_pcicc_receive(struct ap_device *ap_dev, zcrypt_pcicc_receive() argument 509 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_pcicc_modexpo() 516 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_pcicc_modexpo() 549 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_pcicc_modexpo_crt() 556 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_pcicc_modexpo_crt() 573 * @ap_dev: pointer to the AP device. 575 static int zcrypt_pcicc_probe(struct ap_device *ap_dev) zcrypt_pcicc_probe() argument 583 zdev->ap_dev = ap_dev; zcrypt_pcicc_probe() 592 ap_dev->reply = &zdev->reply; zcrypt_pcicc_probe() 593 ap_dev->private = zdev; zcrypt_pcicc_probe() 600 ap_dev->private = NULL; zcrypt_pcicc_probe() 609 static void zcrypt_pcicc_remove(struct ap_device *ap_dev) zcrypt_pcicc_remove() argument 611 struct zcrypt_device *zdev = ap_dev->private; zcrypt_pcicc_remove()
|
H A D | zcrypt_msgtype6.c | 207 msg->cprbx.domain = AP_QID_QUEUE(zdev->ap_dev->qid); ICAMEX_msg_to_type6MEX_msgX() 275 msg->cprbx.domain = AP_QID_QUEUE(zdev->ap_dev->qid); ICACRT_msg_to_type6CRT_msgX() 463 AP_QID_QUEUE(zdev->ap_dev->qid); xcrb_msg_to_type6_ep11cprb_msgx() 481 AP_QID_QUEUE(zdev->ap_dev->qid); xcrb_msg_to_type6_ep11cprb_msgx() 575 zdev->ap_dev->qid); convert_type86_ica() 577 zdev->ap_dev->qid, zdev->online, convert_type86_ica() 718 zdev->ap_dev->qid); convert_response_ica() 720 zdev->ap_dev->qid, zdev->online); convert_response_ica() 750 zdev->ap_dev->qid); convert_response_xcrb() 752 zdev->ap_dev->qid, zdev->online); convert_response_xcrb() 776 zdev->ap_dev->qid); convert_response_ep11_xcrb() 778 zdev->ap_dev->qid, zdev->online); convert_response_ep11_xcrb() 803 zdev->ap_dev->qid); convert_response_rng() 805 zdev->ap_dev->qid, zdev->online); convert_response_rng() 814 * @ap_dev: pointer to the AP device 818 static void zcrypt_msgtype6_receive(struct ap_device *ap_dev, zcrypt_msgtype6_receive() argument 865 * @ap_dev: pointer to the AP device 869 static void zcrypt_msgtype6_receive_ep11(struct ap_device *ap_dev, zcrypt_msgtype6_receive_ep11() argument 936 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_modexpo() 943 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_modexpo() 977 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_modexpo_crt() 984 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_modexpo_crt() 1018 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_send_cprb() 1024 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_send_cprb() 1058 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_send_ep11_cprb() 1063 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_send_ep11_cprb() 1095 rng_type6CPRB_msgX(zdev->ap_dev, &ap_msg, ZCRYPT_RNG_BUFFER_SIZE); zcrypt_msgtype6_rng() 1097 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_rng() 1103 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_msgtype6_rng()
|
H A D | zcrypt_msgtype50.c | 339 zdev->ap_dev->qid); convert_type80() 341 zdev->ap_dev->qid, zdev->online, t80h->code); convert_type80() 371 zdev->ap_dev->qid); convert_response() 373 zdev->ap_dev->qid, zdev->online); convert_response() 382 * @ap_dev: pointer to the AP device 386 static void zcrypt_cex2a_receive(struct ap_device *ap_dev, zcrypt_cex2a_receive() argument 404 if (ap_dev->device_type == AP_DEVICE_TYPE_CEX2A) zcrypt_cex2a_receive() 450 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_cex2a_modexpo() 457 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_cex2a_modexpo() 494 ap_queue_message(zdev->ap_dev, &ap_msg); zcrypt_cex2a_modexpo_crt() 501 ap_cancel_message(zdev->ap_dev, &ap_msg); zcrypt_cex2a_modexpo_crt()
|
H A D | zcrypt_msgtype6.h | 122 * @ap_dev: AP device pointer 125 static inline void rng_type6CPRB_msgX(struct ap_device *ap_dev, rng_type6CPRB_msgX() argument 159 msg->cprbx.domain = AP_QID_QUEUE(ap_dev->qid); rng_type6CPRB_msgX()
|
H A D | ap_bus.h | 235 void ap_queue_message(struct ap_device *ap_dev, struct ap_message *ap_msg); 236 void ap_cancel_message(struct ap_device *ap_dev, struct ap_message *ap_msg); 237 void ap_flush_queue(struct ap_device *ap_dev);
|
H A D | zcrypt_api.h | 105 struct ap_device *ap_dev; /* The "real" ap device. */ member in struct:zcrypt_device
|