/* SPDX-License-Identifier: MIT */ #ifndef __NVKM_FALCON_QMGR_H__ #define __NVKM_FALCON_QMGR_H__ #include <core/falcon.h> #define HDR_SIZE … #define QUEUE_ALIGNMENT … /* max size of the messages we can receive */ #define MSG_BUF_SIZE … /** * struct nvkm_falcon_qmgr_seq - keep track of ongoing commands * * Every time a command is sent, a sequence is assigned to it so the * corresponding message can be matched. Upon receiving the message, a callback * can be called and/or a completion signaled. * * @id: sequence ID * @state: current state * @callback: callback to call upon receiving matching message * @completion: completion to signal after callback is called */ struct nvkm_falcon_qmgr_seq { … }; /* * We can have an arbitrary number of sequences, but realistically we will * probably not use that much simultaneously. */ #define NVKM_FALCON_QMGR_SEQ_NUM … struct nvkm_falcon_qmgr { … }; struct nvkm_falcon_qmgr_seq * nvkm_falcon_qmgr_seq_acquire(struct nvkm_falcon_qmgr *); void nvkm_falcon_qmgr_seq_release(struct nvkm_falcon_qmgr *, struct nvkm_falcon_qmgr_seq *); struct nvkm_falcon_cmdq { … }; struct nvkm_falcon_msgq { … }; #define FLCNQ_PRINTK(q,l,p,f,a...) … #define FLCNQ_DBG(q,f,a...) … #define FLCNQ_ERR(q,f,a...) … #endif