Lines Matching refs:perms

125 	struct ap_perms perms;  member
170 for (i = 0; i < sizeof(zcdndev->perms.ioctlm) / sizeof(long); i++) in ioctlmask_show()
171 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.ioctlm[i]); in ioctlmask_show()
186 rc = ap_parse_mask_str(buf, zcdndev->perms.ioctlm, in ioctlmask_store()
207 for (i = 0; i < sizeof(zcdndev->perms.apm) / sizeof(long); i++) in apmask_show()
208 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.apm[i]); in apmask_show()
223 rc = ap_parse_mask_str(buf, zcdndev->perms.apm, in apmask_store()
244 for (i = 0; i < sizeof(zcdndev->perms.aqm) / sizeof(long); i++) in aqmask_show()
245 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.aqm[i]); in aqmask_show()
260 rc = ap_parse_mask_str(buf, zcdndev->perms.aqm, in aqmask_store()
281 for (i = 0; i < sizeof(zcdndev->perms.adm) / sizeof(long); i++) in admask_show()
282 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.adm[i]); in admask_show()
297 rc = ap_parse_mask_str(buf, zcdndev->perms.adm, in admask_store()
507 struct ap_perms *perms = &ap_perms; in zcrypt_open() local
518 perms = &zcdndev->perms; in zcrypt_open()
520 filp->private_data = (void *)perms; in zcrypt_open()
550 static inline int zcrypt_check_ioctl(struct ap_perms *perms, in zcrypt_check_ioctl() argument
557 if (test_bit_inv(ioctlnr, perms->ioctlm)) in zcrypt_check_ioctl()
568 static inline bool zcrypt_check_card(struct ap_perms *perms, int card) in zcrypt_check_card() argument
570 return test_bit_inv(card, perms->apm) ? true : false; in zcrypt_check_card()
573 static inline bool zcrypt_check_queue(struct ap_perms *perms, int queue) in zcrypt_check_queue() argument
575 return test_bit_inv(queue, perms->aqm) ? true : false; in zcrypt_check_queue()
642 static long zcrypt_rsa_modexpo(struct ap_perms *perms, in zcrypt_rsa_modexpo() argument
689 if (!zcrypt_check_card(perms, zc->card->id)) in zcrypt_rsa_modexpo()
705 if (!zcrypt_check_queue(perms, in zcrypt_rsa_modexpo()
747 static long zcrypt_rsa_crt(struct ap_perms *perms, in zcrypt_rsa_crt() argument
794 if (!zcrypt_check_card(perms, zc->card->id)) in zcrypt_rsa_crt()
810 if (!zcrypt_check_queue(perms, in zcrypt_rsa_crt()
852 static long _zcrypt_send_cprb(u32 xflags, struct ap_perms *perms, in _zcrypt_send_cprb() argument
882 if (perms != &ap_perms && tdom < AP_DOMAINS) { in _zcrypt_send_cprb()
884 if (!test_bit_inv(tdom, perms->adm)) { in _zcrypt_send_cprb()
918 if (!zcrypt_check_card(perms, zc->card->id)) in _zcrypt_send_cprb()
936 if (!zcrypt_check_queue(perms, in _zcrypt_send_cprb()
1039 static long _zcrypt_send_ep11_cprb(u32 xflags, struct ap_perms *perms, in _zcrypt_send_ep11_cprb() argument
1086 if (perms != &ap_perms && domain < AUTOSEL_DOM) { in _zcrypt_send_ep11_cprb()
1088 if (!test_bit_inv(domain, perms->adm)) { in _zcrypt_send_ep11_cprb()
1114 if (!zcrypt_check_card(perms, zc->card->id)) in _zcrypt_send_ep11_cprb()
1133 if (!zcrypt_check_queue(perms, in _zcrypt_send_ep11_cprb()
1483 static int icarsamodexpo_ioctl(struct ap_perms *perms, unsigned long arg) in icarsamodexpo_ioctl() argument
1495 rc = zcrypt_rsa_modexpo(perms, &tr, &mex); in icarsamodexpo_ioctl()
1501 rc = zcrypt_rsa_modexpo(perms, &tr, &mex); in icarsamodexpo_ioctl()
1512 static int icarsacrt_ioctl(struct ap_perms *perms, unsigned long arg) in icarsacrt_ioctl() argument
1524 rc = zcrypt_rsa_crt(perms, &tr, &crt); in icarsacrt_ioctl()
1530 rc = zcrypt_rsa_crt(perms, &tr, &crt); in icarsacrt_ioctl()
1541 static int zsecsendcprb_ioctl(struct ap_perms *perms, unsigned long arg) in zsecsendcprb_ioctl() argument
1554 rc = _zcrypt_send_cprb(xflags, perms, &tr, &xcrb); in zsecsendcprb_ioctl()
1560 rc = _zcrypt_send_cprb(xflags, perms, &tr, &xcrb); in zsecsendcprb_ioctl()
1572 static int zsendep11cprb_ioctl(struct ap_perms *perms, unsigned long arg) in zsendep11cprb_ioctl() argument
1585 rc = _zcrypt_send_ep11_cprb(xflags, perms, &tr, &xcrb); in zsendep11cprb_ioctl()
1591 rc = _zcrypt_send_ep11_cprb(xflags, perms, &tr, &xcrb); in zsendep11cprb_ioctl()
1606 struct ap_perms *perms = in zcrypt_unlocked_ioctl() local
1609 rc = zcrypt_check_ioctl(perms, cmd); in zcrypt_unlocked_ioctl()
1615 return icarsamodexpo_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1617 return icarsacrt_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1619 return zsecsendcprb_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1621 return zsendep11cprb_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1745 static long trans_modexpo32(struct ap_perms *perms, struct file *filp, in trans_modexpo32() argument
1764 rc = zcrypt_rsa_modexpo(perms, &tr, &mex64); in trans_modexpo32()
1770 rc = zcrypt_rsa_modexpo(perms, &tr, &mex64); in trans_modexpo32()
1792 static long trans_modexpo_crt32(struct ap_perms *perms, struct file *filp, in trans_modexpo_crt32() argument
1814 rc = zcrypt_rsa_crt(perms, &tr, &crt64); in trans_modexpo_crt32()
1820 rc = zcrypt_rsa_crt(perms, &tr, &crt64); in trans_modexpo_crt32()
1850 static long trans_xcrb32(struct ap_perms *perms, struct file *filp, in trans_xcrb32() argument
1884 rc = _zcrypt_send_cprb(xflags, perms, &tr, &xcrb64); in trans_xcrb32()
1890 rc = _zcrypt_send_cprb(xflags, perms, &tr, &xcrb64); in trans_xcrb32()
1906 struct ap_perms *perms = in zcrypt_compat_ioctl() local
1909 rc = zcrypt_check_ioctl(perms, cmd); in zcrypt_compat_ioctl()
1914 return trans_modexpo32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()
1916 return trans_modexpo_crt32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()
1918 return trans_xcrb32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()