• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//drivers/adapter/uhdf2/uhdf.gni")
16
17config("usbd_private_config") {
18  include_dirs = []
19}
20
21config("usbd_public_config") {
22  default_config_path =
23      "//device/soc/$device_company/common/hal/usb/$device_name/include"
24  if (device_company == "hihope") {
25    default_config_path = "//device/$device_company/$device_name/usb/include"
26  } else if (device_company == "openharmony") {
27    default_config_path = "//device/hihope/rk3568/usb/include"
28  }
29
30  include_dirs = [
31    "include",
32    "//drivers/peripheral/usb/hal/client/include",
33    "//drivers/peripheral/usb/ddk/common/include",
34    "//drivers/peripheral/usb/ddk/host/include",
35    "//drivers/peripheral/usb/interfaces/ddk/common",
36    "//drivers/peripheral/usb/interfaces/ddk/host",
37    "//drivers/peripheral/usb/interfaces/ddk/device",
38    "//drivers/peripheral/usb/gadget/function/include",
39    "//drivers/framework/model/usb/include",
40    default_config_path,
41  ]
42}
43
44ohos_shared_library("usbd") {
45  sources = [
46    "src/usbd.c",
47    "src/usbd_dispatcher.c",
48    "src/usbd_function.c",
49    "src/usbd_port.c",
50    "src/usbd_publisher.c",
51  ]
52
53  configs = [ ":usbd_private_config" ]
54
55  public_configs = [ ":usbd_public_config" ]
56
57  deps = [ "//drivers/peripheral/usb/ddk:libusb_core" ]
58
59  external_deps = [
60    "device_driver_framework:libhdf_host",
61    "device_driver_framework:libhdf_ipc_adapter",
62    "device_driver_framework:libhdf_utils",
63    "device_driver_framework:libhdi",
64    "hiviewdfx_hilog_native:libhilog",
65    "startup_l2:syspara",
66    "utils_base:utils",
67  ]
68
69  install_images = [ chipset_base_dir ]
70  subsystem_name = "hdf"
71  part_name = "usb_device_driver"
72}
73