xref: /openbmc/phosphor-mboxd/test/mbox.h (revision 30bcf84c932a579532e5f8417af549494e11b6e9)
1 /* SPDX-License-Identifier: Apache-2.0 */
2 /* Copyright (C) 2018 IBM Corp. */
3 
4 #ifndef TEST_MBOX_H
5 #define TEST_MBOX_H
6 
7 #include <stddef.h>
8 #include <stdint.h>
9 
10 #include "common.h"
11 #include "mbox.h"
12 #include "mboxd_msg.h"
13 
14 #include "tmpf.h"
15 
16 struct mbox_context *mbox_create_test_context(int n_windows, size_t len);
17 
18 int mbox_set_mtd_data(struct mbox_context *context, const void *data,
19 		size_t len);
20 
21 void mbox_dump(struct mbox_context *context);
22 
23 void mbox_rspcpy(struct mbox_context *context, struct mbox_msg *msg);
24 
25 int mbox_cmp(struct mbox_context *context, const uint8_t *expected, size_t len);
26 
27 int mbox_command_write(struct mbox_context *context, const uint8_t *command,
28 		size_t len);
29 
30 int mbox_command_dispatch(struct mbox_context *context, const uint8_t *command,
31 	size_t len);
32 
33 /* Helpers */
34 void dump_buf(const void *buf, size_t len);
35 
36 #endif /* TEST_MBOX_H */
37