Mirrors the TEE_DESC_PRIVILEGED bit of struct tee_desc:flags into struct tee_ioctl_version_data:gen_caps as TEE_GEN_CAP_PRIVILEGED in tee_ioctl_version()
Unified · Split
| @@ -90,8 +90,13 @@ static int tee_ioctl_version(struct tee_context *ctx, · 89 unmodified lines | ||
| 90 | 90 | struct tee_ioctl_version_data vers; |
| 91 | 91 | |
| 92 | 92 | ctx->teedev->desc->ops->get_version(ctx->teedev, &vers); |
| 93 | + | |
| 94 | + if (ctx->teedev->desc->flags & TEE_DESC_PRIVILEGED) | |
| 95 | + vers.gen_caps |= TEE_GEN_CAP_PRIVILEGED; | |
| 96 | + | |
| 93 | 97 | if (copy_to_user(uvers, &vers, sizeof(vers))) |
| 94 | 98 | return -EFAULT; |
| 99 | + | |
| 95 | 100 | return 0; |
| 96 | 101 | } |
| 97 | 102 | |
| @@ -49,6 +49,7 @@ · 48 unmodified lines | ||
| 49 | 49 | #define TEE_MAX_ARG_SIZE 1024 |
| 50 | 50 | |
| 51 | 51 | #define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */ |
| 52 | +#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */ | |
| 52 | 53 | |
| 53 | 54 | /* |
| 54 | 55 | * TEE Implementation ID |