驱动子系统USB的部件化整改全部完成

Signed-off-by: huyong <huyong72@huawei.com>
Change-Id: I1ea47d060770ec9b98c930bec9f434260e504b20
This commit is contained in:
huyong 2023-05-15 16:13:47 +08:00
parent 7abcd2b3ef
commit 544aa95dd1
12 changed files with 56 additions and 29 deletions

View File

@ -24,11 +24,7 @@ ohos_moduletest_suite("HatsHdfUsbTransferTest") {
]
configs = [ ":hdf_usb" ]
deps = [
"//drivers/peripheral/usb/ddk:libusb_core",
"//drivers/peripheral/usb/hdi_service:libusb_interface_service_1.0",
"//third_party/googletest:gtest_main",
]
deps = [ "//third_party/googletest:gtest_main" ]
external_deps = [
"ability_base:want",
@ -52,7 +48,6 @@ ohos_moduletest_suite("HatsHdfUsbTransferTest") {
config("hdf_usb") {
include_dirs = [
"include",
"//test/xts/hats/hdf/usb/UsbSubscriberTest",
"//utils/system/safwk/native/include",
"../UsbSubscriberTest",
]
}

View File

@ -17,11 +17,8 @@
#include "UsbSubscriberTest.h"
#include "hdf_log.h"
#include "usb_ddk.h"
#include "usb_ddk_interface.h"
#include "securec.h"
#include "usbd_transfer_test.h"
#include "usbd_type.h"
#include "v1_0/iusb_interface.h"
#include "v1_0/usb_types.h"

View File

@ -21,6 +21,20 @@
using OHOS::HDI::Usb::V1_0::UsbDev;
#define USB_DDK_REQ_GET_DESCRIPTOR 0x06
#define USB_DDK_REQ_GET_CONFIGURATION 0x08
#define USB_DDK_REQ_GET_INTERFACE 0x0A
#define USB_DDK_REQ_SYNCH_FRAME 0x0C
const int32_t USB_ENDPOINT_DIR_IN = 0x80;
const int32_t USB_ENDPOINT_DIR_OUT = 0;
typedef enum {
USB_REQUEST_TARGET_DEVICE,
USB_REQUEST_TARGET_INTERFACE,
USB_REQUEST_TARGET_ENDPOINT,
USB_REQUEST_TARGET_OTHER,
} UsbRequestTargetType;
namespace {
class UsbdTransferTest : public testing::Test {
public:

View File

@ -27,8 +27,6 @@ ohos_moduletest_suite("HatsHdfUsbBenchmarkDeviceTest") {
configs = [ ":hdf_usb" ]
deps = [
"//drivers/peripheral/usb/ddk:libusb_core",
"//drivers/peripheral/usb/hdi_service:libusb_interface_service_1.0",
"//third_party/benchmark",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
@ -62,8 +60,6 @@ ohos_moduletest_suite("HatsHdfUsbBenchmarkFunctionTest") {
configs = [ ":hdf_usb" ]
deps = [
"//drivers/peripheral/usb/ddk:libusb_core",
"//drivers/peripheral/usb/hdi_service:libusb_interface_service_1.0",
"//third_party/benchmark",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
@ -97,8 +93,6 @@ ohos_moduletest_suite("HatsHdfUsbBenchmarkRequestTest") {
configs = [ ":hdf_usb" ]
deps = [
"//drivers/peripheral/usb/ddk:libusb_core",
"//drivers/peripheral/usb/hdi_service:libusb_interface_service_1.0",
"//third_party/benchmark",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
@ -131,8 +125,6 @@ ohos_moduletest_suite("HatsHdfUsbBenchmarkTransferTest") {
configs = [ ":hdf_usb" ]
deps = [
"//drivers/peripheral/usb/ddk:libusb_core",
"//drivers/peripheral/usb/hdi_service:libusb_interface_service_1.0",
"//third_party/benchmark",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
@ -159,7 +151,6 @@ ohos_moduletest_suite("HatsHdfUsbBenchmarkTransferTest") {
config("hdf_usb") {
include_dirs = [
"include",
"//test/xts/hats/hdf/usb/UsbSubscriberTest",
"//utils/system/safwk/native/include",
"../UsbSubscriberTest",
]
}

View File

@ -18,7 +18,6 @@
#include "HdfUsbdBenchmarkDeviceTest.h"
#include "hdf_log.h"
#include "usbd_port.h"
#include "v1_0/iusb_interface.h"
using namespace benchmark::internal;

View File

@ -20,8 +20,6 @@
#include "hdf_log.h"
#include "if_system_ability_manager.h"
#include "system_ability_definition.h"
#include "usbd_function.h"
#include "usbd_port.h"
#include "v1_0/iusb_interface.h"
#include "v1_0/usb_types.h"

View File

@ -18,8 +18,6 @@
#include "HdfUsbdBenchmarkRequestTest.h"
#include "hdf_log.h"
#include "usbd_type.h"
#include "usbd_port.h"
#include "v1_0/usb_types.h"
#include "v1_0/iusb_interface.h"

View File

@ -18,11 +18,7 @@
#include "HdfUsbdBenchmarkTransferTest.h"
#include "hdf_log.h"
#include "usb_ddk.h"
#include "usb_ddk_interface.h"
#include "securec.h"
#include "usbd_type.h"
#include "usbd_port.h"
#include "v1_0/iusb_interface.h"
using namespace benchmark::internal;

View File

@ -22,6 +22,10 @@
using OHOS::HDI::Usb::V1_0::UsbDev;
#define DEFAULT_PORT_ID 1
#define POWER_ROLE_SOURCE 1
#define DATA_ROLE_HOST 1
namespace {
class HdfUsbdBenchmarkDeviceTest : public benchmark::Fixture {
public:

View File

@ -18,6 +18,21 @@
#include <benchmark/benchmark.h>
#include <gtest/gtest.h>
#define DEFAULT_PORT_ID 1
#define POWER_ROLE_NONE 0
#define POWER_ROLE_SINK 2
#define POWER_ROLE_SOURCE 1
#define DATA_ROLE_DEVICE 2
#define DATA_ROLE_HOST 1
#define DATA_ROLE_NONE 0
#define PORT_MODE_NONE 0
#define USB_FUNCTION_NONE 0
#define USB_FUNCTION_ACM (1 << 0)
namespace {
class HdfUsbdBenchmarkFunctionTest : public benchmark::Fixture {
public:

View File

@ -23,6 +23,12 @@
using OHOS::HDI::Usb::V1_0::UsbDev;
#define DEFAULT_PORT_ID 1
#define POWER_ROLE_SOURCE 1
#define DATA_ROLE_HOST 1
const int32_t USB_ENDPOINT_DIR_IN = 0x80;
namespace {
class HdfUsbdBenchmarkRequestTest : public benchmark::Fixture {
public:

View File

@ -23,6 +23,20 @@
using OHOS::HDI::Usb::V1_0::UsbDev;
#define DEFAULT_PORT_ID 1
#define POWER_ROLE_SOURCE 1
#define DATA_ROLE_HOST 1
#define USB_DDK_REQ_GET_CONFIGURATION 0x08
const int32_t USB_ENDPOINT_DIR_OUT = 0;
const int32_t USB_ENDPOINT_DIR_IN = 0x80;
typedef enum {
USB_REQUEST_TARGET_INTERFACE,
USB_REQUEST_TARGET_DEVICE,
USB_REQUEST_TARGET_ENDPOINT,
USB_REQUEST_TARGET_OTHER,
} UsbRequestTargetType;
namespace {
class HdfUsbdBenchmarkTransferTest : public benchmark::Fixture {
public: