| # Copyright 2021 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/components.gni") |
| import("//build/drivers.gni") |
| import("//build/test.gni") |
| |
| config("wlansoftmac_config") { |
| include_dirs = [ "." ] |
| } |
| |
| driver_bind_rules("wlansoftmac-bind") { |
| rules = "meta/wlansoftmac.bind" |
| bind_output = "wlansoftmac.bindbc" |
| tests = "meta/bind_tests.json" |
| deps = [ "//sdk/fidl/fuchsia.wlan.softmac:fuchsia.wlan.softmac_bindlib" ] |
| } |
| |
| source_set("source_set") { |
| sources = [ |
| "softmac_bridge.cc", |
| "softmac_bridge.h", |
| "softmac_driver.cc", |
| "softmac_driver.h", |
| "softmac_ifc_bridge.cc", |
| "softmac_ifc_bridge.h", |
| ] |
| |
| public_deps = [ |
| ":wlansoftmac-bind", |
| "//sdk/banjo/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_banjo_cpp", |
| "//sdk/fidl/fuchsia.wlan.softmac:fuchsia.wlan.softmac_cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/component/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//sdk/lib/fidl_driver", |
| "//src/connectivity/wlan/drivers/lib/fidl-bridge/cpp:dfv2", |
| "//src/connectivity/wlan/drivers/lib/log/cpp:dfv2", |
| "//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding:wlansoftmac-c", |
| "//src/connectivity/wlan/lib/common/cpp:common", |
| "//src/devices/lib/dev-operation", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/sync:sync-cpp", |
| "//zircon/system/ulib/trace-engine", |
| ] |
| } |
| |
| fuchsia_cc_driver("wlansoftmac_driver-driver") { |
| output_name = "wlansoftmac" |
| deps = [ ":source_set" ] |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_driver_component("wlansoftmac_driver") { |
| component_name = "wlansoftmac" |
| deps = [ ":wlansoftmac_driver-driver" ] |
| info = "meta/wlansoftmac.json" |
| manifest = "meta/wlansoftmac.cml" |
| } |
| |
| fuchsia_driver_package("wlansoftmac") { |
| package_name = "wlansoftmac" |
| driver_components = [ ":wlansoftmac_driver" ] |
| } |
| |
| test("good-driver-tests") { |
| sources = [ |
| "tests/custom_environment.h", |
| "tests/fake_wlansoftmac_server.h", |
| "tests/good_driver_tests.cc", |
| ] |
| |
| deps = [ |
| ":source_set", |
| "//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme_cpp", |
| "//sdk/lib/driver/testing/cpp", |
| "//src/devices/bind/fuchsia:fuchsia_cpp", |
| "//src/devices/bind/fuchsia.ethernet:fuchsia.ethernet_cpp", |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| fuchsia_unittest_package("wlansoftmac-good-driver-tests") { |
| deps = [ ":good-driver-tests" ] |
| } |
| |
| test("bad-driver-tests") { |
| sources = [ |
| "tests/bad_driver_tests.cc", |
| "tests/custom_environment.h", |
| "tests/fake_wlansoftmac_server.h", |
| ] |
| |
| deps = [ |
| ":source_set", |
| "//sdk/fidl/fuchsia.wlan.sme:fuchsia.wlan.sme_cpp", |
| "//sdk/lib/driver/testing/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| fuchsia_unittest_package("wlansoftmac-bad-driver-tests") { |
| deps = [ ":bad-driver-tests" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":wlansoftmac-bad-driver-tests", |
| ":wlansoftmac-bind_test", |
| ":wlansoftmac-good-driver-tests", |
| ] |
| } |