diff --git a/drivers/crypto/tegra-hv-vse-safety.c b/drivers/crypto/tegra-hv-vse-safety.c index 202845ed..780185ba 100644 --- a/drivers/crypto/tegra-hv-vse-safety.c +++ b/drivers/crypto/tegra-hv-vse-safety.c @@ -396,6 +396,7 @@ struct tegra_virtual_se_addr64_buf_size { struct key_args { uint8_t keyslot[KEYSLOT_SIZE_BYTES]; + uint32_t key_usage; uint32_t key_instance; uint32_t key_grp_id; uint32_t token_id; @@ -1110,6 +1111,7 @@ int tegra_hv_vse_allocate_keyslot(struct tegra_vse_key_slot_ctx *key_slot, ivc_tx->cmd = TEGRA_VIRTUAL_SE_CMD_ALLOC_KEY; memcpy(ivc_tx->keys.keyslot, key_slot->key_id, KEYSLOT_SIZE_BYTES); + ivc_tx->keys.key_usage = key_slot->key_usage; ivc_tx->keys.key_grp_id = key_slot->key_grp_id; ivc_tx->keys.token_id = key_slot->token_id; g_crypto_to_ivc_map[node_id].vse_thread_start = true; diff --git a/drivers/crypto/tegra-hv-vse.h b/drivers/crypto/tegra-hv-vse.h index c34f7fb0..1e3b4a0f 100644 --- a/drivers/crypto/tegra-hv-vse.h +++ b/drivers/crypto/tegra-hv-vse.h @@ -48,6 +48,7 @@ struct tegra_vse_membuf_ctx { struct tegra_vse_key_slot_ctx { uint8_t key_id[KEYSLOT_SIZE_BYTES]; + uint8_t key_usage; uint8_t token_id; uint8_t key_instance_idx; uint32_t key_grp_id; diff --git a/drivers/crypto/tegra-nvvse-cryptodev.c b/drivers/crypto/tegra-nvvse-cryptodev.c index a97c4d25..e2b00b9b 100644 --- a/drivers/crypto/tegra-nvvse-cryptodev.c +++ b/drivers/crypto/tegra-nvvse-cryptodev.c @@ -215,6 +215,7 @@ static int tnvvse_crypto_allocate_key_slot(struct tnvvse_crypto_ctx *ctx, memset(&key_slot_params, 0, sizeof(key_slot_params)); memcpy(key_slot_params.key_id, key_slot_allocate_ctl->key_id, KEYSLOT_SIZE_BYTES); + key_slot_params.key_usage = key_slot_allocate_ctl->key_usage; key_slot_params.token_id = key_slot_allocate_ctl->token_id; key_slot_params.key_grp_id = ctx->key_grp_id; err = tegra_hv_vse_allocate_keyslot(&key_slot_params, ctx->node_id); diff --git a/include/uapi/misc/tegra-nvvse-cryptodev.h b/include/uapi/misc/tegra-nvvse-cryptodev.h index b78609ec..a71a12d7 100644 --- a/include/uapi/misc/tegra-nvvse-cryptodev.h +++ b/include/uapi/misc/tegra-nvvse-cryptodev.h @@ -127,6 +127,8 @@ enum tegra_nvvse_cmac_type { struct tegra_nvvse_allocate_key_slot_ctl { /** [in] Holds the key id */ uint8_t key_id[KEYSLOT_SIZE_BYTES]; + /** [in] Holds the key usage */ + uint8_t key_usage; /** [in] Holds the token id */ uint8_t token_id; /** [out] Holds the Key instance index */