optee_enumerate_devices()
- Enumerate the TA devices.
__optee_enumerate_devices()
- PTA UUID:
- Call
tee_client_open_context()
to open TEE devices with OP-TEE driver. - Prepare session arg (
struct tee_ioctl_open_session_arg
). - Call
tee_client_open_session()
to open session with device enumeration pseudo Trusted Application with the session arg using PTA UUID. - Call
get_devices()
to get the required shared memory size for UUIDs of pseudo TAs. - Shared memory size = sizeof(UUID) * Number of pseudo TAs
- After retrieving the shared memory size, call
tee_shm_alloc_kernel_buf()
to allocate the shared memory buffer for UUIDs of pseudo TAs. - Call
get_devices()
again to get the UUIDs of pseudo TAs. The UUIDs of psuedo TA are stored in the allocated shared memory by OP-TEE. - For each pseudo TA, call
optee_register_device()
to register the device to TEE bus (tee_bus_type
). - This will eventually call
tee_client_device_match()
to match the driver for the TA device based on UUID. Driver’sprobe()
callback will be called if matches. - For example:
optee-rngs
driver (drivers/char/hw_random/optee-rngs.c
). - OP-TEE driver is implemented as a module and is initialized through
module_init()
. OP-TEE driver sets itsbus
totee_bus_type
.
optee_enumerate_devices()c
Loading...