1# Copyright (c) 2024 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/peripheral/wlan/wlan.gni") 16 17ohos_shared_library("libchip_controller_chip_interface_service_2.0") { 18 branch_protector_ret = "pac_ret" 19 sanitize = { 20 cfi = true # Enable/disable control flow integrity detection 21 boundary_sanitize = false # Enable boundary san detection 22 cfi_cross_dso = true # Cross-SO CFI Checks 23 integer_overflow = false # Enable integer overflow detection 24 ubsan = false # Enable some Ubsan options 25 cfi_vcall_icall_only = true 26 debug = false 27 } 28 include_dirs = [] 29 30 sources = [ 31 "hdi_sync_util.cpp", 32 "iface_tool.cpp", 33 "iface_util.cpp", 34 "wifi.cpp", 35 "wifi_ap_iface.cpp", 36 "wifi_chip.cpp", 37 "wifi_chip_modes.cpp", 38 "wifi_ext_iface.cpp", 39 "wifi_p2p_iface.cpp", 40 "wifi_sta_iface.cpp", 41 "wifi_vendor_hal.cpp", 42 "wifi_vendor_hal_list.cpp", 43 "wifi_vendor_hal_stubs.cpp", 44 ] 45 46 defines = [ 47 "P2P_NAME=\"$drivers_peripheral_wlan_p2p_name\"", 48 "HAL_SO_NAME=\"$drivers_peripheral_wlan_feature_vendor\"", 49 ] 50 51 external_deps = [ 52 "c_utils:utils", 53 "drivers_interface_wlan:chip_idl_headers_2.0", 54 "hdf_core:libhdf_host", 55 "hdf_core:libhdf_utils", 56 "hilog:libhilog", 57 "init:libbegetutil", 58 "ipc:ipc_single", 59 ] 60 61 deps = [] 62 63 cflags_cc = [ 64 "-fvisibility-inlines-hidden", 65 "-fdata-sections", 66 "-ffunction-sections", 67 "-Os", 68 "-fno-merge-all-constants", 69 "-fno-asynchronous-unwind-tables", 70 "-fno-unwind-tables", 71 ] 72 ldflags = [ 73 "-Wl,--exclude-libs=ALL", 74 "-Wl,--gc-sections", 75 ] 76 install_images = [ chipset_base_dir ] 77 subsystem_name = "hdf" 78 version_script = "libchip_controller_chip_interface_service.map" 79 part_name = "drivers_peripheral_wlan" 80} 81 82ohos_shared_library("libchip_hdi_driver") { 83 branch_protector_ret = "pac_ret" 84 sanitize = { 85 cfi = true # Enable/disable control flow integrity detection 86 boundary_sanitize = false # Enable boundary san detection 87 cfi_cross_dso = true # Cross-SO CFI Checks 88 integer_overflow = false # Enable integer overflow detection 89 ubsan = false # Enable some Ubsan options 90 cfi_vcall_icall_only = true 91 debug = false 92 } 93 include_dirs = [] 94 95 sources = [ "chip_controller_driver.cpp" ] 96 97 if (is_standard_system) { 98 external_deps = [ 99 "c_utils:utils", 100 "hdf_core:libhdf_host", 101 "hdf_core:libhdf_ipc_adapter", 102 "hdf_core:libhdf_utils", 103 "hdf_core:libhdi", 104 "hilog:libhilog", 105 "ipc:ipc_single", 106 ] 107 } else { 108 external_deps = [ 109 "hilog:libhilog", 110 "ipc:ipc_single", 111 ] 112 } 113 114 cflags_cc = [ 115 "-fvisibility-inlines-hidden", 116 "-fdata-sections", 117 "-ffunction-sections", 118 "-Os", 119 "-fno-merge-all-constants", 120 "-fno-asynchronous-unwind-tables", 121 "-fno-unwind-tables", 122 ] 123 ldflags = [ 124 "-Wl,--exclude-libs=ALL", 125 "-Wl,--gc-sections", 126 ] 127 external_deps += [ "drivers_interface_wlan:libchip_stub_2.0" ] 128 129 shlib_type = "hdi" 130 install_images = [ chipset_base_dir ] 131 subsystem_name = "hdf" 132 part_name = "drivers_peripheral_wlan" 133} 134 135if (drivers_peripheral_wlan_feature_vendor == "default") { 136 ohos_shared_library("wifi_hal_default") { 137 include_dirs = [ 138 "../hdi_service", 139 "../wifi_hal", 140 ] 141 sources = [ 142 "../wifi_hal/common.cpp", 143 "../wifi_hal/cpp_bindings.cpp", 144 "../wifi_hal/gscan.cpp", 145 "../wifi_hal/wifi_hal.cpp", 146 "../wifi_hal/wifi_ioctl.cpp", 147 "../wifi_hal/wifi_logger.cpp", 148 "../wifi_hal/wifi_scan.cpp", 149 ] 150 151 if (drivers_peripheral_wlan_feature_emulator) { 152 defines = [ "SUPPORT_EMULATOR" ] 153 } 154 155 if (is_standard_system) { 156 external_deps = [ 157 "c_utils:utils", 158 "drivers_interface_wlan:chip_idl_headers_2.0", 159 "hdf_core:libhdf_ipc_adapter", 160 "hdf_core:libhdf_utils", 161 "hilog:libhilog", 162 "ipc:ipc_single", 163 "libnl:libnl_share", 164 ] 165 } else { 166 external_deps = [ 167 "hilog:libhilog", 168 "ipc:ipc_single", 169 ] 170 } 171 172 install_images = [ chipset_base_dir ] 173 subsystem_name = "hdf" 174 part_name = "drivers_peripheral_wlan" 175 } 176} 177 178group("hdi_chip_service") { 179 deps = [ 180 ":libchip_controller_chip_interface_service_2.0", 181 ":libchip_hdi_driver", 182 ] 183 if (drivers_peripheral_wlan_feature_vendor == "default") { 184 deps += [ ":wifi_hal_default" ] 185 } 186} 187