blob: 88efc0fda3946efd49a0c7f4f5c6e994b7fa6fa8 [file] [log] [blame]
Jeremy Kerr3d36ee22019-05-30 11:15:37 +08001/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
2
Jeremy Kerr18925112019-03-13 15:43:08 +08003#ifndef _MCTP_TESTS_TEST_UTILS_H
4#define _MCTP_TESTS_TEST_UTILS_H
5
6#include <libmctp.h>
Przemyslaw Czarnowskiff25d7e2020-03-26 11:39:37 +01007#include <container_of.h>
Jeremy Kerr1a4ec3c2019-09-03 11:01:50 +08008
Jeremy Kerr18925112019-03-13 15:43:08 +08009/* test binding implementation */
10
11/* standard binding interface */
12struct mctp_binding_test *mctp_binding_test_init(void);
Andrew Jeffery5c5673b2020-03-10 23:23:58 +103013void mctp_binding_test_destroy(struct mctp_binding_test *test);
Jeremy Kerr18925112019-03-13 15:43:08 +080014void mctp_binding_test_register_bus(struct mctp_binding_test *binding,
Andrew Jeffery69eda312022-09-30 14:22:32 +093015 struct mctp *mctp, mctp_eid_t eid);
Jeremy Kerr18925112019-03-13 15:43:08 +080016
17/* internal test binding interface */
Andrew Jeffery69eda312022-09-30 14:22:32 +093018void mctp_binding_test_rx_raw(struct mctp_binding_test *test, void *buf,
19 size_t len);
Jeremy Kerr18925112019-03-13 15:43:08 +080020
21/* gerneral utility functions */
22
23/* create a MCTP stack, and add a test binding, using the specified EID */
24void mctp_test_stack_init(struct mctp **mctp,
Andrew Jeffery69eda312022-09-30 14:22:32 +093025 struct mctp_binding_test **binding, mctp_eid_t eid);
Jeremy Kerr18925112019-03-13 15:43:08 +080026
27#endif /* _MCTP_TESTS_TEST_UTILS_H */