Lines Matching refs:perms
122 struct ap_perms perms; member
167 for (i = 0; i < sizeof(zcdndev->perms.ioctlm) / sizeof(long); i++) in ioctlmask_show()
168 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.ioctlm[i]); in ioctlmask_show()
183 rc = ap_parse_mask_str(buf, zcdndev->perms.ioctlm, in ioctlmask_store()
204 for (i = 0; i < sizeof(zcdndev->perms.apm) / sizeof(long); i++) in apmask_show()
205 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.apm[i]); in apmask_show()
220 rc = ap_parse_mask_str(buf, zcdndev->perms.apm, in apmask_store()
241 for (i = 0; i < sizeof(zcdndev->perms.aqm) / sizeof(long); i++) in aqmask_show()
242 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.aqm[i]); in aqmask_show()
257 rc = ap_parse_mask_str(buf, zcdndev->perms.aqm, in aqmask_store()
278 for (i = 0; i < sizeof(zcdndev->perms.adm) / sizeof(long); i++) in admask_show()
279 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.adm[i]); in admask_show()
294 rc = ap_parse_mask_str(buf, zcdndev->perms.adm, in admask_store()
504 struct ap_perms *perms = &ap_perms; in zcrypt_open() local
515 perms = &zcdndev->perms; in zcrypt_open()
517 filp->private_data = (void *)perms; in zcrypt_open()
547 static inline int zcrypt_check_ioctl(struct ap_perms *perms, in zcrypt_check_ioctl() argument
554 if (test_bit_inv(ioctlnr, perms->ioctlm)) in zcrypt_check_ioctl()
565 static inline bool zcrypt_check_card(struct ap_perms *perms, int card) in zcrypt_check_card() argument
567 return test_bit_inv(card, perms->apm) ? true : false; in zcrypt_check_card()
570 static inline bool zcrypt_check_queue(struct ap_perms *perms, int queue) in zcrypt_check_queue() argument
572 return test_bit_inv(queue, perms->aqm) ? true : false; in zcrypt_check_queue()
637 static long zcrypt_rsa_modexpo(struct ap_perms *perms, in zcrypt_rsa_modexpo() argument
683 if (!zcrypt_check_card(perms, zc->card->id)) in zcrypt_rsa_modexpo()
699 if (!zcrypt_check_queue(perms, in zcrypt_rsa_modexpo()
742 static long zcrypt_rsa_crt(struct ap_perms *perms, in zcrypt_rsa_crt() argument
788 if (!zcrypt_check_card(perms, zc->card->id)) in zcrypt_rsa_crt()
804 if (!zcrypt_check_queue(perms, in zcrypt_rsa_crt()
847 static long _zcrypt_send_cprb(bool userspace, struct ap_perms *perms, in _zcrypt_send_cprb() argument
870 if (perms != &ap_perms && tdom < AP_DOMAINS) { in _zcrypt_send_cprb()
872 if (!test_bit_inv(tdom, perms->adm)) { in _zcrypt_send_cprb()
906 if (!zcrypt_check_card(perms, zc->card->id)) in _zcrypt_send_cprb()
924 if (!zcrypt_check_queue(perms, in _zcrypt_send_cprb()
1004 static long _zcrypt_send_ep11_cprb(bool userspace, struct ap_perms *perms, in _zcrypt_send_ep11_cprb() argument
1049 if (perms != &ap_perms && domain < AUTOSEL_DOM) { in _zcrypt_send_ep11_cprb()
1051 if (!test_bit_inv(domain, perms->adm)) { in _zcrypt_send_ep11_cprb()
1077 if (!zcrypt_check_card(perms, zc->card->id)) in _zcrypt_send_ep11_cprb()
1096 if (!zcrypt_check_queue(perms, in _zcrypt_send_ep11_cprb()
1421 static int icarsamodexpo_ioctl(struct ap_perms *perms, unsigned long arg) in icarsamodexpo_ioctl() argument
1433 rc = zcrypt_rsa_modexpo(perms, &tr, &mex); in icarsamodexpo_ioctl()
1440 rc = zcrypt_rsa_modexpo(perms, &tr, &mex); in icarsamodexpo_ioctl()
1453 static int icarsacrt_ioctl(struct ap_perms *perms, unsigned long arg) in icarsacrt_ioctl() argument
1465 rc = zcrypt_rsa_crt(perms, &tr, &crt); in icarsacrt_ioctl()
1472 rc = zcrypt_rsa_crt(perms, &tr, &crt); in icarsacrt_ioctl()
1485 static int zsecsendcprb_ioctl(struct ap_perms *perms, unsigned long arg) in zsecsendcprb_ioctl() argument
1497 rc = _zcrypt_send_cprb(true, perms, &tr, &xcrb); in zsecsendcprb_ioctl()
1504 rc = _zcrypt_send_cprb(true, perms, &tr, &xcrb); in zsecsendcprb_ioctl()
1518 static int zsendep11cprb_ioctl(struct ap_perms *perms, unsigned long arg) in zsendep11cprb_ioctl() argument
1530 rc = _zcrypt_send_ep11_cprb(true, perms, &tr, &xcrb); in zsendep11cprb_ioctl()
1537 rc = _zcrypt_send_ep11_cprb(true, perms, &tr, &xcrb); in zsendep11cprb_ioctl()
1554 struct ap_perms *perms = in zcrypt_unlocked_ioctl() local
1557 rc = zcrypt_check_ioctl(perms, cmd); in zcrypt_unlocked_ioctl()
1563 return icarsamodexpo_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1565 return icarsacrt_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1567 return zsecsendcprb_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1569 return zsendep11cprb_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1691 static long trans_modexpo32(struct ap_perms *perms, struct file *filp, in trans_modexpo32() argument
1710 rc = zcrypt_rsa_modexpo(perms, &tr, &mex64); in trans_modexpo32()
1717 rc = zcrypt_rsa_modexpo(perms, &tr, &mex64); in trans_modexpo32()
1741 static long trans_modexpo_crt32(struct ap_perms *perms, struct file *filp, in trans_modexpo_crt32() argument
1763 rc = zcrypt_rsa_crt(perms, &tr, &crt64); in trans_modexpo_crt32()
1770 rc = zcrypt_rsa_crt(perms, &tr, &crt64); in trans_modexpo_crt32()
1802 static long trans_xcrb32(struct ap_perms *perms, struct file *filp, in trans_xcrb32() argument
1835 rc = _zcrypt_send_cprb(true, perms, &tr, &xcrb64); in trans_xcrb32()
1842 rc = _zcrypt_send_cprb(true, perms, &tr, &xcrb64); in trans_xcrb32()
1860 struct ap_perms *perms = in zcrypt_compat_ioctl() local
1863 rc = zcrypt_check_ioctl(perms, cmd); in zcrypt_compat_ioctl()
1868 return trans_modexpo32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()
1870 return trans_modexpo_crt32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()
1872 return trans_xcrb32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()