Lines Matching refs:perms
120 struct ap_perms perms; member
165 for (i = 0; i < sizeof(zcdndev->perms.ioctlm) / sizeof(long); i++) in ioctlmask_show()
166 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.ioctlm[i]); in ioctlmask_show()
181 rc = ap_parse_mask_str(buf, zcdndev->perms.ioctlm, in ioctlmask_store()
202 for (i = 0; i < sizeof(zcdndev->perms.apm) / sizeof(long); i++) in apmask_show()
203 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.apm[i]); in apmask_show()
218 rc = ap_parse_mask_str(buf, zcdndev->perms.apm, in apmask_store()
239 for (i = 0; i < sizeof(zcdndev->perms.aqm) / sizeof(long); i++) in aqmask_show()
240 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.aqm[i]); in aqmask_show()
255 rc = ap_parse_mask_str(buf, zcdndev->perms.aqm, in aqmask_store()
276 for (i = 0; i < sizeof(zcdndev->perms.adm) / sizeof(long); i++) in admask_show()
277 n += sysfs_emit_at(buf, n, "%016lx", zcdndev->perms.adm[i]); in admask_show()
292 rc = ap_parse_mask_str(buf, zcdndev->perms.adm, in admask_store()
502 struct ap_perms *perms = &ap_perms; in zcrypt_open() local
513 perms = &zcdndev->perms; in zcrypt_open()
515 filp->private_data = (void *)perms; in zcrypt_open()
545 static inline int zcrypt_check_ioctl(struct ap_perms *perms, in zcrypt_check_ioctl() argument
552 if (test_bit_inv(ioctlnr, perms->ioctlm)) in zcrypt_check_ioctl()
563 static inline bool zcrypt_check_card(struct ap_perms *perms, int card) in zcrypt_check_card() argument
565 return test_bit_inv(card, perms->apm) ? true : false; in zcrypt_check_card()
568 static inline bool zcrypt_check_queue(struct ap_perms *perms, int queue) in zcrypt_check_queue() argument
570 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()
741 static long zcrypt_rsa_crt(struct ap_perms *perms, in zcrypt_rsa_crt() argument
787 if (!zcrypt_check_card(perms, zc->card->id)) in zcrypt_rsa_crt()
803 if (!zcrypt_check_queue(perms, in zcrypt_rsa_crt()
845 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()
1027 static long _zcrypt_send_ep11_cprb(bool userspace, struct ap_perms *perms, in _zcrypt_send_ep11_cprb() argument
1074 if (perms != &ap_perms && domain < AUTOSEL_DOM) { in _zcrypt_send_ep11_cprb()
1076 if (!test_bit_inv(domain, perms->adm)) { in _zcrypt_send_ep11_cprb()
1102 if (!zcrypt_check_card(perms, zc->card->id)) in _zcrypt_send_ep11_cprb()
1121 if (!zcrypt_check_queue(perms, in _zcrypt_send_ep11_cprb()
1463 static int icarsamodexpo_ioctl(struct ap_perms *perms, unsigned long arg) in icarsamodexpo_ioctl() argument
1475 rc = zcrypt_rsa_modexpo(perms, &tr, &mex); in icarsamodexpo_ioctl()
1481 rc = zcrypt_rsa_modexpo(perms, &tr, &mex); in icarsamodexpo_ioctl()
1492 static int icarsacrt_ioctl(struct ap_perms *perms, unsigned long arg) in icarsacrt_ioctl() argument
1504 rc = zcrypt_rsa_crt(perms, &tr, &crt); in icarsacrt_ioctl()
1510 rc = zcrypt_rsa_crt(perms, &tr, &crt); in icarsacrt_ioctl()
1521 static int zsecsendcprb_ioctl(struct ap_perms *perms, unsigned long arg) in zsecsendcprb_ioctl() argument
1533 rc = _zcrypt_send_cprb(true, perms, &tr, &xcrb); in zsecsendcprb_ioctl()
1539 rc = _zcrypt_send_cprb(true, perms, &tr, &xcrb); in zsecsendcprb_ioctl()
1551 static int zsendep11cprb_ioctl(struct ap_perms *perms, unsigned long arg) in zsendep11cprb_ioctl() argument
1563 rc = _zcrypt_send_ep11_cprb(true, perms, &tr, &xcrb); in zsendep11cprb_ioctl()
1569 rc = _zcrypt_send_ep11_cprb(true, perms, &tr, &xcrb); in zsendep11cprb_ioctl()
1584 struct ap_perms *perms = in zcrypt_unlocked_ioctl() local
1587 rc = zcrypt_check_ioctl(perms, cmd); in zcrypt_unlocked_ioctl()
1593 return icarsamodexpo_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1595 return icarsacrt_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1597 return zsecsendcprb_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1599 return zsendep11cprb_ioctl(perms, arg); in zcrypt_unlocked_ioctl()
1721 static long trans_modexpo32(struct ap_perms *perms, struct file *filp, in trans_modexpo32() argument
1740 rc = zcrypt_rsa_modexpo(perms, &tr, &mex64); in trans_modexpo32()
1746 rc = zcrypt_rsa_modexpo(perms, &tr, &mex64); in trans_modexpo32()
1768 static long trans_modexpo_crt32(struct ap_perms *perms, struct file *filp, in trans_modexpo_crt32() argument
1790 rc = zcrypt_rsa_crt(perms, &tr, &crt64); in trans_modexpo_crt32()
1796 rc = zcrypt_rsa_crt(perms, &tr, &crt64); in trans_modexpo_crt32()
1826 static long trans_xcrb32(struct ap_perms *perms, struct file *filp, in trans_xcrb32() argument
1859 rc = _zcrypt_send_cprb(true, perms, &tr, &xcrb64); in trans_xcrb32()
1865 rc = _zcrypt_send_cprb(true, perms, &tr, &xcrb64); in trans_xcrb32()
1881 struct ap_perms *perms = in zcrypt_compat_ioctl() local
1884 rc = zcrypt_check_ioctl(perms, cmd); in zcrypt_compat_ioctl()
1889 return trans_modexpo32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()
1891 return trans_modexpo_crt32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()
1893 return trans_xcrb32(perms, filp, cmd, arg); in zcrypt_compat_ioctl()