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 #include "hdf_usb_entry_test.h"
10 #include "hdf_log.h"
11 #include "usb_test.h"
12 #include "usb_raw_test.h"
13
14 #define HDF_LOG_TAG hdf_usb_entry_test
15
HdfUsbUnitTestEntry(HdfTestMsg * msg)16 int32_t HdfUsbUnitTestEntry(HdfTestMsg *msg)
17 {
18 if (msg == NULL) {
19 return HDF_FAILURE;
20 }
21 dprintf("---%s::command[%u], subCommand[%u]\n", __func__, msg->cmd, msg->subCmd);
22 if (msg->cmd == TEST_USB_HOST_TYPE) {
23 msg->result = UsbTestEntry(msg->subCmd);
24 } else if (msg->cmd == TEST_USB_HOST_RAW_TYPE) {
25 msg->result = UsbRawTestEntry(msg->subCmd);
26 }
27 dprintf("%s::command[%u], subCommand[%u], result:%d\n", __func__, msg->cmd, msg->subCmd, msg->result);
28 return msg->result;
29 }
30