/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright (C) 2018 IBM Corp. */

#ifndef PROTOCOL_H
#define PROTOCOL_H

struct mbox_context;

/*
 * The GET_MBOX_INFO command is special as it can change the interface based on
 * negotiation. As such we need to accommodate all response types
 */
struct protocol_get_info {
	struct {
		uint8_t api_version;
	} req;
	struct {
		uint8_t api_version;
		union {
			struct {
				uint16_t read_window_size;
				uint16_t write_window_size;
			} v1;
			struct {
				uint8_t block_size_shift;
				uint16_t timeout;
			} v2;
		};
	} resp;
};

struct protocol_get_flash_info {
	struct {
		union {
			struct {
				uint32_t flash_size;
				uint32_t erase_size;
			} v1;
			struct {
				uint16_t flash_size;
				uint16_t erase_size;
			} v2;
		};
	} resp;
};

struct protocol_create_window {
	struct {
		uint16_t offset;
		uint16_t size;
		uint8_t id;
		bool ro;
	} req;
	struct {
		uint16_t lpc_address;
		uint16_t size;
		uint16_t offset;
	} resp;
};

struct protocol_ops {
	int (*reset)(struct mbox_context *context);
	int (*get_info)(struct mbox_context *context,
			struct protocol_get_info *io);
	int (*get_flash_info)(struct mbox_context *context,
			      struct protocol_get_flash_info *io);
	int (*create_window)(struct mbox_context *context,
			     struct protocol_create_window *io);
};

int protocol_init(struct mbox_context *context);
void protocol_free(struct mbox_context *context);

int protocol_negotiate_version(struct mbox_context *context, uint8_t requested);

/* Protocol v1 */
int protocol_v1_reset(struct mbox_context *context);
int protocol_v1_get_info(struct mbox_context *context,
			 struct protocol_get_info *io);
int protocol_v1_get_flash_info(struct mbox_context *context,
			       struct protocol_get_flash_info *io);
int protocol_v1_create_window(struct mbox_context *context,
			      struct protocol_create_window *io);

/* Protocol v2 */
int protocol_v2_get_info(struct mbox_context *context,
			 struct protocol_get_info *io);
int protocol_v2_get_flash_info(struct mbox_context *context,
			       struct protocol_get_flash_info *io);
int protocol_v2_create_window(struct mbox_context *context,
			      struct protocol_create_window *io);

#endif /* PROTOCOL_H */
