Files
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

55 lines
1.5 KiB
C

/*
* Copyright (c) 2015-2019, MICROTRUST Incorporated
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#include <linux/slab.h>
#include "teei_keymaster.h"
#include "teei_client_transfer_data.h"
#define IMSG_TAG "[tz_driver]"
#include <imsg_log.h>
#include <linux/vmalloc.h>
#define KM_COMMAND_MAGIC 'X'
int send_keymaster_command(void *buffer, unsigned long size)
{
int ret = 0;
struct TEEC_Context context;
struct TEEC_UUID uuid_ta = { 0xc09c9c5d, 0xaa50, 0x4b78,
{ 0xb0, 0xe4, 0x6e, 0xda, 0x61, 0x55, 0x6c, 0x3a } };
/* IMSG_INFO("TEEI start send_keymaster_command\n"); */
if (buffer == NULL || size < 1)
return -1;
memset(&context, 0, sizeof(context));
ret = ut_pf_gp_initialize_context(&context);
if (ret) {
IMSG_ERROR("Failed to initialize keymaster context ,err: %x",
ret);
goto release_1;
}
ret = ut_pf_gp_transfer_user_data(&context, &uuid_ta, KM_COMMAND_MAGIC,
buffer, size);
if (ret) {
IMSG_ERROR("Failed to transfer data,err: %x", ret);
goto release_2;
}
release_2:
ut_pf_gp_finalize_context(&context);
release_1:
/* IMSG_INFO("TEEI end of send_keymaster_command\n"); */
return ret;
}