1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef I3C_TEST_H 10 #define I3C_TEST_H 11 12 #include "i3c_if.h" 13 14 #ifdef __cplusplus 15 #if __cplusplus 16 extern "C" { 17 #endif 18 #endif /* __cplusplus */ 19 20 struct I3cTestConfig { 21 uint16_t busId; 22 uint16_t devAddr; 23 uint16_t regAddr; 24 uint16_t regLen; 25 uint16_t bufSize; 26 }; 27 28 struct I3cTester { 29 struct I3cTestConfig config; 30 DevHandle handle; 31 uint16_t total; 32 uint16_t fails; 33 }; 34 35 enum I3cTestCmd { 36 I3C_TEST_CMD_TRANSFER = 0, 37 I3C_TEST_CMD_SET_CONFIG, 38 I3C_TEST_CMD_GET_CONFIG, 39 I3C_TEST_CMD_REQUEST_IBI, 40 I3C_TEST_CMD_FREE_IBI, 41 I3C_TEST_CMD_MULTI_THREAD, 42 I3C_TEST_CMD_RELIABILITY, 43 I3C_TEST_CMD_SETUP_ALL, 44 I3C_TEST_CMD_TEARDOWN_ALL, 45 I3C_TEST_CMD_SETUP_SINGLE, 46 I3C_TEST_CMD_TEARDOWN_SINGLE, 47 I3C_TEST_CMD_MAX, 48 }; 49 50 int32_t I3cTestExecute(int cmd); 51 int32_t I3cTestSetUpSingle(void); 52 int32_t I3cTestTearDownSingle(void); 53 54 #ifdef __cplusplus 55 #if __cplusplus 56 } 57 #endif 58 #endif /* __cplusplus */ 59 60 #endif /* I3C_TEST_H */ 61