1 /*
2  * Copyright (c) 2020-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 SDIO_TEST_H
10 #define SDIO_TEST_H
11 
12 #include "hdf_device_desc.h"
13 #include "platform_if.h"
14 #include "sdio_if.h"
15 
16 enum SdioTestCmd {
17     SDIO_DISABLE_FUNC_01 = 0,
18     SDIO_ENABLE_FUNC_01,
19     SDIO_SET_BLOCK_SIZE_01,
20     SDIO_INCR_ADDR_READ_AND_WRITE_BYTES_01,
21     SDIO_FIXED_ADDR_READ_AND_WRITE_BYTES_01,
22     SDIO_FUNC0_READ_AND_WRITE_BYTES_01,
23     SDIO_SET_AND_GET_COMMON_INFO_01,
24 };
25 
26 struct SdioTester {
27     struct IDeviceIoService service;
28     struct HdfDeviceObject *device;
29     int32_t (*TestEntry)(struct SdioTester *tester, int32_t cmd);
30     struct SdioFunctionConfig config;
31     uint32_t busNum;
32     DevHandle handle;
33 };
34 
GetSdioTest(void)35 static inline struct SdioTester *GetSdioTest(void)
36 {
37     return (struct SdioTester *)DevSvcManagerClntGetService("SDIO_TEST");
38 }
39 
40 #endif /* SDIO_TEST_H */
41