STRUCT OPTEE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct optee(9) β€” the main service struct, bestie

okay so this is struct optee, from the Kernel API Manual, and it's basically the main character of the OP-TEE driver. it's giving "central hub energy" β€” everything that talks to secure world kind of routes through here. let's get into it 🫢


✨ SYNOPSIS ✨

like, here's literally the whole struct, character for character, no cap:

struct optee {
    struct tee_device *supp_teedev;
    struct tee_device *teedev;
    const struct optee_ops *ops;
    struct tee_context *ctx;
    union {
      struct optee_smc smc;
      struct optee_ffa ffa;
    };
    struct optee_shm_arg_cache shm_arg_cache;
    struct optee_call_queue call_queue;
    struct optee_notif notif;
    struct optee_supp supp;
    struct tee_shm_pool *pool;
    struct mutex rpmb_dev_mutex;
    struct rpmb_dev *rpmb_dev;
    struct notifier_block rpmb_intf;
    unsigned int rpc_param_count;
    bool scan_bus_done;
    bool rpmb_scan_bus_done;
    bool in_kernel_rpmb_routing;
    struct work_struct scan_bus_work;
    struct work_struct rpmb_scan_bus_work;
    struct optee_revision revision;
 };

πŸŽ€ Members πŸŽ€

okay, member-by-member tour, let's go:

  • supp_teedev β€” the supplicant device. it's the one that handles requests coming from secure world, iykyk πŸ’…
  • teedev β€” the client device. this is the one the outside world talks to.
  • ops β€” internal callbacks, aka the different ways to reach secure world. like, different routes, same destination ✨
  • ctx β€” the driver's internal TEE context.
  • {unnamed_union} β€” an anonymous union, living its anonymous little life. we don't name it, we just respect it 🫢
  • smc β€” specific to SMC ABI. that's its whole personality.
  • ffa β€” specific to FF-A ABI. also just vibing in the union.
  • shm_arg_cache β€” shared memory cache argument. caching queen πŸ‘‘
  • call_queue β€” the queue of threads waiting to call invoke_fn. yes there's a line, please respect it 🌸
  • notif β€” notification synchronization struct.
  • supp β€” supplicant synchronization struct for RPC to supplicant. say that five times fast 😭
  • pool β€” shared memory pool.
  • rpmb_dev_mutex β€” a mutex protecting rpmb_dev. bodyguard behavior, honestly πŸ›‘οΈ
  • rpmb_dev β€” the current RPMB device, or NULL. very much "sometimes here, sometimes not" πŸ’€
  • rpmb_intf β€” the RPMB notifier block.
  • rpc_param_count β€” if it's > 0, the number of RPC parameters to make room for. zero means don't bother, bestie.
  • scan_bus_done β€” a flag for whether device registation was already done. (yes, "registation" β€” that's exactly how the original spells it, preserving it fr fr πŸ™ˆ)
  • rpmb_scan_bus_done β€” flag for whether device registation of RPMB dependent devices was already done. same spelling situation, same energy.
  • scan_bus_work β€” the workq to scan the optee bus and register optee drivers. busy little bee 🐝
  • rpmb_scan_bus_work β€” workq to for an RPMB device and to scan optee bus and register RPMB dependent optee drivers. (again, verbatim from the source β€” "workq to for" is iconic and we're not touching it πŸ’–)
  • revision β€” the OP-TEE OS revision. the lore. the backstory. ⭐

🌈 SEE ALSO 🌈

go check these out, they're all connected, it's giving cinematic universe:

  • Kernel file ./drivers/tee/optee/optee_private.h
  • struct optee_call_waiter(9)
  • struct optee_call_queue(9)
  • struct optee_supp(9)
  • struct optee_pcpu(9)
  • struct optee_smc(9)
  • struct optee_ffa(9)
  • struct optee_revision(9)
  • struct optee_ops(9)

lowkey important: this page is from ./drivers/tee/optee, dated October 2026, and it's struct optee(9) β€” so if you ever need to cite it or find it again, that's your receipt 🧾✨

k byeee, go read the header file, mwah πŸ’œπŸ¦‹

πŸ“¦ where this page comes from