Andrew Jeffery | 4fe996c | 2018-02-27 12:16:48 +1030 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 */ |
| 2 | /* Copyright (C) 2018 IBM Corp. */ |
Andrew Jeffery | 5ab4e3e | 2017-04-12 14:23:24 +0930 | [diff] [blame] | 3 | |
| 4 | #ifndef TEST_MBOX_H |
| 5 | #define TEST_MBOX_H |
| 6 | |
| 7 | #include <stddef.h> |
| 8 | #include <stdint.h> |
| 9 | |
Andrew Jeffery | ca1dfc9 | 2018-03-22 16:49:40 +1030 | [diff] [blame] | 10 | #include "common.h" |
Andrew Jeffery | 26558db | 2018-08-10 00:22:38 +0930 | [diff] [blame] | 11 | #include "mboxd.h" |
Andrew Jeffery | 457a6e5 | 2018-08-08 11:21:08 +0930 | [diff] [blame] | 12 | #include "transport_mbox.h" |
Andrew Jeffery | 5ab4e3e | 2017-04-12 14:23:24 +0930 | [diff] [blame] | 13 | |
| 14 | #include "tmpf.h" |
| 15 | |
| 16 | struct mbox_context *mbox_create_test_context(int n_windows, size_t len); |
Evan Lojewski | f1e547c | 2019-03-14 14:34:33 +1030 | [diff] [blame] | 17 | struct mbox_context *mbox_create_frontend_context(int n_windows, size_t len); |
Andrew Jeffery | 5ab4e3e | 2017-04-12 14:23:24 +0930 | [diff] [blame] | 18 | |
| 19 | int mbox_set_mtd_data(struct mbox_context *context, const void *data, |
| 20 | size_t len); |
| 21 | |
| 22 | void mbox_dump(struct mbox_context *context); |
| 23 | |
Andrew Jeffery | ca1dfc9 | 2018-03-22 16:49:40 +1030 | [diff] [blame] | 24 | void mbox_rspcpy(struct mbox_context *context, struct mbox_msg *msg); |
| 25 | |
Andrew Jeffery | 5ab4e3e | 2017-04-12 14:23:24 +0930 | [diff] [blame] | 26 | int mbox_cmp(struct mbox_context *context, const uint8_t *expected, size_t len); |
| 27 | |
| 28 | int mbox_command_write(struct mbox_context *context, const uint8_t *command, |
| 29 | size_t len); |
| 30 | |
| 31 | int mbox_command_dispatch(struct mbox_context *context, const uint8_t *command, |
| 32 | size_t len); |
| 33 | |
| 34 | /* Helpers */ |
Andrew Jeffery | ee7af88 | 2018-03-01 11:57:50 +1030 | [diff] [blame] | 35 | void dump_buf(const void *buf, size_t len); |
Andrew Jeffery | 5ab4e3e | 2017-04-12 14:23:24 +0930 | [diff] [blame] | 36 | |
| 37 | #endif /* TEST_MBOX_H */ |