/* SPDX-License-Identifier: GPL-2.0 */
//
// Copyright (c) 2021 MediaTek Inc.


#ifndef __RPMSG_INTERNAL_H__
#define __RPMSG_INTERNAL_H__

#define SHMCT_CMD_SHARE         0x1
#define SHMCT_CMD_RECLAIM       0x2
#define SHMCT_CMD_ACK_SHARE     0x3
#define SHMCT_CMD_ACK_RECLAIM   0x4
#define SHMCT_CMD_ACK		0x5
#define SHMCT_CMD_MAX           0x6

/* Error macros. */
#define SHMCT_SUCCESS                 0
#define SHMCT_ERROR_BASE              -2000
#define SHMCT_ERR_FAILED             (SHMCT_ERROR_BASE - 1)
#define SHMCT_ERR_NOT_INITED         (SHMCT_ERROR_BASE - 2)
#define SHMCT_ERR_NOT_SUPPORT        (SHMCT_ERROR_BASE - 3)
#define SHMCT_ERR_INVALID_HANDLE     (SHMCT_ERROR_BASE - 4)
#define SHMCT_ERR_INVALID_PARAMETER  (SHMCT_ERROR_BASE - 5)
#define SHMCT_ERR_RESOURCES          (SHMCT_ERROR_BASE - 6)

#define SHMCT_MAX_STR_SIZE	16

struct shmctrl_buf_info {
	u8 name[SHMCT_MAX_STR_SIZE];
	u32 dma_addr;
	u32 len;
};

struct shmctrl_msg {
	u32 cmd;
	u32 err;
	u64 host_hdl;
	struct shmctrl_buf_info info;
};

#endif
