Jeremy Kerr | 3d36ee2 | 2019-05-30 11:15:37 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ |
| 2 | |
Jeremy Kerr | 1892511 | 2019-03-13 15:43:08 +0800 | [diff] [blame] | 3 | #ifndef _MCTP_TESTS_TEST_UTILS_H |
| 4 | #define _MCTP_TESTS_TEST_UTILS_H |
| 5 | |
| 6 | #include <libmctp.h> |
Przemyslaw Czarnowski | ff25d7e | 2020-03-26 11:39:37 +0100 | [diff] [blame] | 7 | #include <container_of.h> |
Jeremy Kerr | 1a4ec3c | 2019-09-03 11:01:50 +0800 | [diff] [blame] | 8 | |
Jeremy Kerr | 1892511 | 2019-03-13 15:43:08 +0800 | [diff] [blame] | 9 | /* test binding implementation */ |
| 10 | |
| 11 | /* standard binding interface */ |
| 12 | struct mctp_binding_test *mctp_binding_test_init(void); |
Andrew Jeffery | 5c5673b | 2020-03-10 23:23:58 +1030 | [diff] [blame] | 13 | void mctp_binding_test_destroy(struct mctp_binding_test *test); |
Jeremy Kerr | 1892511 | 2019-03-13 15:43:08 +0800 | [diff] [blame] | 14 | void mctp_binding_test_register_bus(struct mctp_binding_test *binding, |
Andrew Jeffery | 69eda31 | 2022-09-30 14:22:32 +0930 | [diff] [blame] | 15 | struct mctp *mctp, mctp_eid_t eid); |
Jeremy Kerr | 1892511 | 2019-03-13 15:43:08 +0800 | [diff] [blame] | 16 | |
| 17 | /* internal test binding interface */ |
Andrew Jeffery | 69eda31 | 2022-09-30 14:22:32 +0930 | [diff] [blame] | 18 | void mctp_binding_test_rx_raw(struct mctp_binding_test *test, void *buf, |
| 19 | size_t len); |
Jeremy Kerr | 1892511 | 2019-03-13 15:43:08 +0800 | [diff] [blame] | 20 | |
| 21 | /* gerneral utility functions */ |
| 22 | |
| 23 | /* create a MCTP stack, and add a test binding, using the specified EID */ |
| 24 | void mctp_test_stack_init(struct mctp **mctp, |
Andrew Jeffery | 69eda31 | 2022-09-30 14:22:32 +0930 | [diff] [blame] | 25 | struct mctp_binding_test **binding, mctp_eid_t eid); |
Jeremy Kerr | 1892511 | 2019-03-13 15:43:08 +0800 | [diff] [blame] | 26 | |
| 27 | #endif /* _MCTP_TESTS_TEST_UTILS_H */ |