blob: 9da12b1ee04253f3b28a31cde61d31cfaf8d9526 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/bind/bind.gni")
import("//build/cipd.gni")
import("//build/components.gni")
import("//build/drivers.gni")
import("//build/test.gni")
import("//build/testing/cc_test_executable.gni")
driver_bind_rules("bcm_hci_bind") {
rules = "meta/bcm_hci.bind"
bind_output = "bt-hci-broadcom.bindbc"
tests = "meta/bind_tests.json"
deps = [
"//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_bindlib",
]
}
source_set("common") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [
"bt_hci_broadcom.cc",
"bt_hci_broadcom.h",
"packets.h",
]
deps = [
":bcm_hci_bind",
"//sdk/lib/async-default",
"//sdk/lib/async-loop:async-loop-cpp",
"//sdk/lib/async-loop:async-loop-default",
"//sdk/lib/fidl",
"//src/devices/lib/driver:driver_runtime",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/sync:sync-cpp",
]
public_deps = [
"//sdk/fidl/fuchsia.driver.compat:fuchsia.driver.compat_cpp",
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp",
"//sdk/fidl/fuchsia.hardware.bluetooth:fuchsia.hardware.bluetooth_cpp",
"//sdk/fidl/fuchsia.hardware.serialimpl:fuchsia.hardware.serialimpl_cpp",
"//sdk/lib/driver/compat/cpp",
"//sdk/lib/driver/component/cpp",
"//sdk/lib/driver/devfs/cpp:cpp",
"//src/lib/ddk",
"//src/lib/ddktl",
]
# TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
fuchsia_cc_driver("bt-hci-broadcom-driver") {
output_name = "bt-hci-broadcom"
deps = [ ":common" ]
}
fuchsia_driver_component("bt-hci-broadcom") {
component_name = "bt-hci-broadcom"
deps = [ ":bt-hci-broadcom-driver" ]
info = "meta/bt-hci-broadcom-info.json"
manifest = "meta/bt-hci-broadcom.cml"
}
# This is the firmware for VIM3 board only
resource("broadcom-firmware") {
sources = [
"//prebuilt/connectivity/bluetooth/firmware/broadcom/vim3/BCM4359C0.hcd",
]
outputs = [ "lib/firmware/{{source_file_part}}" ]
}
# This package is only referenced by vim3.gni for now.
fuchsia_driver_package("broadcom") {
driver_components = [ ":bt-hci-broadcom" ]
if (internal_access) {
deps = [ ":broadcom-firmware" ]
}
}
cc_test_executable("tests_executable") {
testonly = true
output_name = "bt-hci-broadcom-tests"
sources = [ "bt_hci_broadcom_unittest.cc" ]
deps = [
":common",
"//sdk/lib/async_patterns/testing/cpp:cpp",
"//sdk/lib/component/outgoing/cpp",
"//sdk/lib/driver/testing/cpp",
"//sdk/lib/fdio",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/lib/fxl/test:gtest_main",
"//src/storage/lib/vfs/cpp",
"//third_party/googletest:gtest",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/sync:sync-cpp",
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zx",
]
}
fuchsia_unittest_package("bt-hci-broadcom-tests") {
deps = [ ":tests_executable" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
}
group("tests") {
testonly = true
deps = [
":bcm_hci_bind_test",
":bt-hci-broadcom-tests",
]
}