blob: a030b7de9ccd37ddcc619facfb343cd3be4abce0 [file] [log] [blame]
Andrew Jeffery4fe996c2018-02-27 12:16:48 +10301/* SPDX-License-Identifier: Apache-2.0 */
2/* Copyright (C) 2018 IBM Corp. */
Andrew Jeffery5ab4e3e2017-04-12 14:23:24 +09303
4#ifndef TEST_MBOX_H
5#define TEST_MBOX_H
6
7#include <stddef.h>
8#include <stdint.h>
9
Andrew Jefferyca1dfc92018-03-22 16:49:40 +103010#include "common.h"
Andrew Jeffery26558db2018-08-10 00:22:38 +093011#include "mboxd.h"
Andrew Jeffery457a6e52018-08-08 11:21:08 +093012#include "transport_mbox.h"
Andrew Jeffery5ab4e3e2017-04-12 14:23:24 +093013
14#include "tmpf.h"
15
16struct mbox_context *mbox_create_test_context(int n_windows, size_t len);
Evan Lojewskif1e547c2019-03-14 14:34:33 +103017struct mbox_context *mbox_create_frontend_context(int n_windows, size_t len);
Andrew Jeffery5ab4e3e2017-04-12 14:23:24 +093018
19int mbox_set_mtd_data(struct mbox_context *context, const void *data,
20 size_t len);
21
22void mbox_dump(struct mbox_context *context);
23
Andrew Jefferyca1dfc92018-03-22 16:49:40 +103024void mbox_rspcpy(struct mbox_context *context, struct mbox_msg *msg);
25
Andrew Jeffery5ab4e3e2017-04-12 14:23:24 +093026int mbox_cmp(struct mbox_context *context, const uint8_t *expected, size_t len);
27
28int mbox_command_write(struct mbox_context *context, const uint8_t *command,
29 size_t len);
30
31int mbox_command_dispatch(struct mbox_context *context, const uint8_t *command,
32 size_t len);
33
34/* Helpers */
Andrew Jefferyee7af882018-03-01 11:57:50 +103035void dump_buf(const void *buf, size_t len);
Andrew Jeffery5ab4e3e2017-04-12 14:23:24 +093036
37#endif /* TEST_MBOX_H */