10d163575Sopenharmony_ci# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
20d163575Sopenharmony_ci# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
30d163575Sopenharmony_ci#
40d163575Sopenharmony_ci# Redistribution and use in source and binary forms, with or without modification,
50d163575Sopenharmony_ci# are permitted provided that the following conditions are met:
60d163575Sopenharmony_ci#
70d163575Sopenharmony_ci# 1. Redistributions of source code must retain the above copyright notice, this list of
80d163575Sopenharmony_ci#    conditions and the following disclaimer.
90d163575Sopenharmony_ci#
100d163575Sopenharmony_ci# 2. Redistributions in binary form must reproduce the above copyright notice, this list
110d163575Sopenharmony_ci#    of conditions and the following disclaimer in the documentation and/or other materials
120d163575Sopenharmony_ci#    provided with the distribution.
130d163575Sopenharmony_ci#
140d163575Sopenharmony_ci# 3. Neither the name of the copyright holder nor the names of its contributors may be used
150d163575Sopenharmony_ci#    to endorse or promote products derived from this software without specific prior written
160d163575Sopenharmony_ci#    permission.
170d163575Sopenharmony_ci#
180d163575Sopenharmony_ci# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
190d163575Sopenharmony_ci# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
200d163575Sopenharmony_ci# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
210d163575Sopenharmony_ci# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
220d163575Sopenharmony_ci# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
230d163575Sopenharmony_ci# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
240d163575Sopenharmony_ci# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
250d163575Sopenharmony_ci# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
260d163575Sopenharmony_ci# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
270d163575Sopenharmony_ci# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
280d163575Sopenharmony_ci# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
290d163575Sopenharmony_ci
300d163575Sopenharmony_ciinclude $(LITEOSTOPDIR)/config.mk
310d163575Sopenharmony_ciinclude $(LITEOSTOPDIR)/../../drivers/hdf_core/adapter/khdf/liteos/lite.mk
320d163575Sopenharmony_ci
330d163575Sopenharmony_ciMODULE_NAME := usb_base
340d163575Sopenharmony_ci
350d163575Sopenharmony_ciCONTROLLER_HOST_SRC = controller
360d163575Sopenharmony_ciCORE_SRC = .
370d163575Sopenharmony_ciIMPLEMENTATION_SRC = implementation
380d163575Sopenharmony_ciNet_SRC = net
390d163575Sopenharmony_ciQUIRK_SRC = quirk
400d163575Sopenharmony_ciSERIAL_SRC = serial
410d163575Sopenharmony_ciSTORAGE_SRC = storage
420d163575Sopenharmony_ciINPUT_SRC = input
430d163575Sopenharmony_ciLOCAL_SRCS := $(CORE_SRC)/usb_debug.c  \
440d163575Sopenharmony_ci              $(IMPLEMENTATION_SRC)/bsd_busspace.c  \
450d163575Sopenharmony_ci              $(IMPLEMENTATION_SRC)/usb_busdma_loader.c  \
460d163575Sopenharmony_ci              $(IMPLEMENTATION_SRC)/bsd_kernel.c \
470d163575Sopenharmony_ci              $(IMPLEMENTATION_SRC)/usb_init.c  \
480d163575Sopenharmony_ci              $(IMPLEMENTATION_SRC)/usb_version.c \
490d163575Sopenharmony_ci              $(IMPLEMENTATION_SRC)/usb_btree.c
500d163575Sopenharmony_ci
510d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB), y)
520d163575Sopenharmony_ciLOCAL_SRCS += $(CORE_SRC)/usb_dynamic.c  \
530d163575Sopenharmony_ci              $(CORE_SRC)/usb_parse.c  \
540d163575Sopenharmony_ci              $(CORE_SRC)/usb_error.c  \
550d163575Sopenharmony_ci              $(CORE_SRC)/usb_handle_request.c  \
560d163575Sopenharmony_ci              $(CORE_SRC)/usb_util.c  \
570d163575Sopenharmony_ci              $(CORE_SRC)/usb_lookup.c  \
580d163575Sopenharmony_ci              $(CONTROLLER_HOST_SRC)/usb_controller.c  \
590d163575Sopenharmony_ci              $(QUIRK_SRC)/usb_quirk.c \
600d163575Sopenharmony_ci              $(CORE_SRC)/usb_device.c  \
610d163575Sopenharmony_ci              $(CORE_SRC)/usb_process.c  \
620d163575Sopenharmony_ci              $(CORE_SRC)/usb_hub.c  \
630d163575Sopenharmony_ci              $(CORE_SRC)/usb_request.c  \
640d163575Sopenharmony_ci              $(CORE_SRC)/usb_transfer.c  \
650d163575Sopenharmony_ci              $(CORE_SRC)/usb_dev.c  \
660d163575Sopenharmony_ci              $(CORE_SRC)/usb_mbuf.c  \
670d163575Sopenharmony_ci              $(CORE_SRC)/usb_generic.c \
680d163575Sopenharmony_ci              $(CORE_SRC)/usb_if.c
690d163575Sopenharmony_ciendif
700d163575Sopenharmony_ci
710d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_4G_MODEM), y)
720d163575Sopenharmony_ciLOCAL_SRCS += $(Net_SRC)/if_cdce.c
730d163575Sopenharmony_ciendif
740d163575Sopenharmony_ci
750d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_ETHERNET), y)
760d163575Sopenharmony_ciLOCAL_SRCS += $(Net_SRC)/if_axe.c \
770d163575Sopenharmony_ci              $(Net_SRC)/if_axge.c
780d163575Sopenharmony_ciendif
790d163575Sopenharmony_ci
800d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_RNDIS_HOST), y)
810d163575Sopenharmony_ciLOCAL_SRCS += $(Net_SRC)/if_urndis.c
820d163575Sopenharmony_ciendif
830d163575Sopenharmony_ci
840d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_4G_MODEM), y)
850d163575Sopenharmony_ciLOCAL_SRCS += $(Net_SRC)/usb_eth_drv.c \
860d163575Sopenharmony_ci              $(Net_SRC)/usb_ethernet.c
870d163575Sopenharmony_cielse ifeq ($(LOSCFG_DRIVERS_USB_ETHERNET), y)
880d163575Sopenharmony_ciLOCAL_SRCS += $(Net_SRC)/usb_eth_drv.c \
890d163575Sopenharmony_ci              $(Net_SRC)/usb_ethernet.c
900d163575Sopenharmony_cielse ifeq ($(LOSCFG_DRIVERS_USB_RNDIS_HOST), y)
910d163575Sopenharmony_ciLOCAL_SRCS += $(Net_SRC)/usb_eth_drv.c\
920d163575Sopenharmony_ci              $(Net_SRC)/usb_ethernet.c
930d163575Sopenharmony_ciendif
940d163575Sopenharmony_ci
950d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_4G_MODEM), y)
960d163575Sopenharmony_ciLOCAL_SRCS += $(SERIAL_SRC)/usb_serial.c  \
970d163575Sopenharmony_ci              $(SERIAL_SRC)/u3g.c
980d163575Sopenharmony_cielse ifeq ($(LOSCFG_DRIVERS_USB_SERIAL), y)
990d163575Sopenharmony_ciLOCAL_SRCS += $(SERIAL_SRC)/usb_serial.c  \
1000d163575Sopenharmony_ci              $(SERIAL_SRC)/u3g.c
1010d163575Sopenharmony_ciendif
1020d163575Sopenharmony_ci
1030d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_HOST_EHCI), y)
1040d163575Sopenharmony_ciLOCAL_SRCS += $(CONTROLLER_HOST_SRC)/ehci_pci.c  \
1050d163575Sopenharmony_ci              $(CONTROLLER_HOST_SRC)/ehci.c
1060d163575Sopenharmony_ciendif
1070d163575Sopenharmony_ci
1080d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_HOST_XHCI), y)
1090d163575Sopenharmony_ciLOCAL_SRCS += $(CONTROLLER_HOST_SRC)/xhci.c  \
1100d163575Sopenharmony_ci              $(CONTROLLER_HOST_SRC)/xhci_pci.c
1110d163575Sopenharmony_cielse ifeq ($(LOSCFG_DRIVERS_USB_HOST_XHCI_FOR_PORT2), y)
1120d163575Sopenharmony_ciLOCAL_SRCS += $(CONTROLLER_HOST_SRC)/xhci.c  \
1130d163575Sopenharmony_ci              $(CONTROLLER_HOST_SRC)/xhci_pci.c
1140d163575Sopenharmony_ciendif
1150d163575Sopenharmony_ci
1160d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_WIRELESS), y)
1170d163575Sopenharmony_ciLOCAL_SRCS += $(CORE_SRC)/linux_usb.c
1180d163575Sopenharmony_ciendif
1190d163575Sopenharmony_ci
1200d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_MASS_STORAGE), y)
1210d163575Sopenharmony_ciLOCAL_SRCS += $(STORAGE_SRC)/umass.c
1220d163575Sopenharmony_ciendif
1230d163575Sopenharmony_ci
1240d163575Sopenharmony_ciifeq ($(LOSCFG_DRIVERS_USB_HID_CLASS)_$(LOSCFG_DRIVERS_HDF_INPUT), y_y)
1250d163575Sopenharmony_ciLOCAL_FLAGS += -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/model/input/driver \
1260d163575Sopenharmony_ci               -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/include/core \
1270d163575Sopenharmony_ci               -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/core/common/include/host \
1280d163575Sopenharmony_ci               -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/utils \
1290d163575Sopenharmony_ci               -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/osal \
1300d163575Sopenharmony_ci               -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/ability/sbuf/include \
1310d163575Sopenharmony_ci               -I$(LITEOSTOPDIR)/../../drivers/hdf_core/framework/include/osal \
1320d163575Sopenharmony_ci               -I$(LITEOSTOPDIR)/../../third_party/FreeBSD/sys/dev/evdev
1330d163575Sopenharmony_ci
1340d163575Sopenharmony_ciLOCAL_SRCS += $(INPUT_SRC)/uhid.c  \
1350d163575Sopenharmony_ci              $(CORE_SRC)/usb_hid.c
1360d163575Sopenharmony_ciendif
1370d163575Sopenharmony_ci
1380d163575Sopenharmony_ciinclude $(HDF_DRIVER)
139