| # |
| # Copyright (c) 2018 The Fuchsia Authors. |
| # |
| # Permission to use, copy, modify, and/or distribute this software for any |
| # purpose with or without fee is hereby granted, provided that the above |
| # copyright notice and this permission notice appear in all copies. |
| # |
| # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| |
| import("//build/cipd.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/package.gni") |
| |
| # By default, targets are only visible here and to subdirectories. |
| visibility = [ "./*" ] |
| |
| # The brcmfmac driver can be built with support for different system buses |
| # (SDIO, and simulated-firmware), and different configurations will require |
| # different support. To facilitate consolidating all the potentially messy |
| # conditional compilation in one place, "bus.cc" is conditionally compiled based |
| # on the values of the preprocessor #defines: |
| # |
| # * CONFIG_BRCMFMAC_SDIO |
| # * CONFIG_BRCMFMAC_SIM |
| # |
| # These #defines are applied as public_configs entries on the targets, |
| # respectively: |
| # |
| # * :sdio |
| # * :sim |
| # |
| # Thus a target that depends on one of the above targets, can include "bus.cc" |
| # in its sources and will then conditionally compile it with the set of |
| # preprocessor #defines set by the targets it depends on. |
| # |
| # See the targets ":driver_module" and ":driver_test" to see how this is done. |
| |
| source_set("debug") { |
| sources = [ |
| "debug.cc", |
| ] |
| public = [ |
| "debug.h", |
| ] |
| public_deps = [ |
| "//zircon/public/lib/ddk", |
| "//zircon/system/public", |
| ] |
| } |
| |
| source_set("linuxisms") { |
| sources = [ |
| "linuxisms.cc", |
| "netbuf.cc", |
| "workqueue.cc", |
| ] |
| public = [ |
| "linuxisms.h", |
| "netbuf.h", |
| "workqueue.h", |
| ] |
| deps = [ |
| ":debug", |
| "//zircon/public/lib/sync", |
| ] |
| public_deps = [ |
| "//zircon/system/public", |
| ] |
| } |
| |
| source_set("core") { |
| sources = [ |
| # "bus.cc" is not included here; see top-of-file comment. |
| "bcdc.cc", |
| "bits.cc", |
| "bits.h", |
| "btcoex.cc", |
| "btcoex.h", |
| "cfg80211.cc", |
| "cfg80211.h", |
| "chip.cc", |
| "common.cc", |
| "core.cc", |
| "d11.cc", |
| "device.cc", |
| "feature.cc", |
| "feature.h", |
| "fweh.cc", |
| "fwil.cc", |
| "fwsignal.cc", |
| "fwsignal.h", |
| "p2p.cc", |
| "p2p.h", |
| "pno.cc", |
| "pno.h", |
| "proto.cc", |
| "proto.h", |
| "timer.cc", |
| "utils.cc", |
| ] |
| public = [ |
| "bcdc.h", |
| "brcm_hw_ids.h", |
| "brcmu_d11.h", |
| "brcmu_utils.h", |
| "brcmu_wifi.h", |
| "bus.h", |
| "chip.h", |
| "common.h", |
| "core.h", |
| "device.h", |
| "fweh.h", |
| "fwil.h", |
| "fwil_types.h", |
| "soc.h", |
| "timer.h", |
| ] |
| deps = [ |
| ":debug", |
| "//src/connectivity/wlan/lib/common/cpp:common", |
| "//zircon/public/banjo/ddk.hw.wlan.wlaninfo", |
| "//zircon/public/lib/ddk", |
| ] |
| public_deps = [ |
| ":linuxisms", |
| "//garnet/lib/wlan/protocol", |
| |
| # TODO: we should try to refactor Device so this isn't required outside of the :sim target |
| "//src/connectivity/wlan/drivers/testing/lib/sim-env:simenv", |
| "//zircon/public/banjo/ddk.protocol.ethernet", |
| "//zircon/public/banjo/ddk.protocol.wlanphyimpl", |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/async-loop", |
| "//zircon/public/lib/ddktl", |
| "//zircon/public/lib/sync", |
| "//zircon/system/public", |
| ] |
| friend = [ "test/*" ] |
| } |
| |
| source_set("firmware") { |
| sources = [ |
| "firmware.cc", |
| ] |
| public = [ |
| "firmware.h", |
| ] |
| deps = [ |
| ":debug", |
| "//zircon/public/lib/ddk", |
| "//zircon/system/public", |
| ] |
| public_deps = [ |
| ":core", |
| ":linuxisms", |
| ] |
| } |
| |
| config("config_sdio") { |
| defines = [ "CONFIG_BRCMFMAC_SDIO=1" ] |
| } |
| |
| source_set("sdio") { |
| sources = [ |
| "bcmsdh.cc", |
| "sdio.cc", |
| ] |
| public = [ |
| "sdio.h", |
| ] |
| deps = [ |
| ":debug", |
| "//zircon/public/banjo/ddk.protocol.composite", |
| "//zircon/public/lib/broadcom", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/trace-driver", |
| "//zircon/system/public", |
| ] |
| public_deps = [ |
| ":core", |
| ":firmware", |
| ":linuxisms", |
| "//zircon/public/banjo/ddk.protocol.gpio", |
| "//zircon/public/banjo/ddk.protocol.sdio", |
| "//zircon/public/lib/ddk", |
| ] |
| public_configs = [ ":config_sdio" ] |
| } |
| |
| config("config_sim") { |
| defines = [ "CONFIG_BRCMFMAC_SIM=1" ] |
| } |
| |
| source_set("sim") { |
| sources = [ |
| "sim-fw/sim_fw.cc", |
| "sim-fw/sim_hw.cc", |
| "sim-fw/sim_hw.h", |
| "sim.cc", |
| ] |
| public = [ |
| "sim-fw/sim_fw.h", |
| "sim.h", |
| ] |
| deps = [ |
| ":core", |
| ":debug", |
| "//src/connectivity/wlan/drivers/testing/lib/sim-device", |
| "//zircon/public/lib/ddk", |
| "//zircon/system/public", |
| ] |
| public_deps = [ |
| ":core", |
| ] |
| public_configs = [ ":config_sim" ] |
| } |
| |
| driver_module("driver_module") { |
| output_name = "brcmfmac" |
| sources = [ |
| # bus.cc is included here. See top-of-file comment. |
| "binding.cc", |
| "bus.cc", |
| ] |
| deps = [ |
| ":core", |
| ":debug", |
| ":sdio", |
| "//zircon/public/lib/driver", |
| ] |
| configs -= [ "//build/config/fuchsia:no_cpp_standard_library" ] |
| configs += [ "//build/config/fuchsia:static_cpp_standard_library" ] |
| } |
| |
| source_set("driver_test") { |
| testonly = true |
| sources = [ |
| # bus.cc is included here. See top-of-file comment. |
| "bus.cc", |
| ] |
| deps = [ |
| ":core", |
| ":debug", |
| ":sim", |
| ] |
| } |
| |
| if (internal_access) { |
| # Firmware files from git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git |
| copy("brcmfmac-firmware-copy") { |
| sources = [ |
| "firmware/brcmfmac43242a.bin", |
| "firmware/brcmfmac43455-sdio.bin", |
| "firmware/brcmfmac43455-sdio.txt", |
| "firmware/brcmfmac4356-pcie.bin", |
| "firmware/brcmfmac4356-sdio.bin", |
| "firmware/brcmfmac4356-sdio.txt", |
| "firmware/brcmfmac4359-sdio.bin", |
| "firmware/brcmfmac4359-sdio.txt", |
| ] |
| outputs = [ |
| "$root_out_dir/firmware/brcmfmac/{{source_file_part}}", |
| ] |
| } |
| } |
| |
| package("brcmfmac") { |
| deprecated_system_image = true |
| deps = [ |
| ":driver_module", |
| ] |
| drivers = [ |
| { |
| name = "brcmfmac.so" |
| }, |
| ] |
| if (internal_access) { |
| deps += [ |
| # The copy step has to be in the shared-library toolchain to use the |
| # expected output directory, since we treat firmware blobs as if they |
| # were libraries which always use the shared-library toolchain to build. |
| ":brcmfmac-firmware-copy($shlib_toolchain)", |
| ] |
| libraries = [ |
| { |
| name = "firmware/brcmfmac/brcmfmac4356-pcie.bin" |
| }, |
| { |
| name = "firmware/brcmfmac/brcmfmac4356-sdio.bin" |
| }, |
| { |
| name = "firmware/brcmfmac/brcmfmac4356-sdio.txt" |
| }, |
| { |
| name = "firmware/brcmfmac/brcmfmac4359-sdio.bin" |
| }, |
| { |
| name = "firmware/brcmfmac/brcmfmac4359-sdio.txt" |
| }, |
| { |
| name = "firmware/brcmfmac/brcmfmac43455-sdio.bin" |
| }, |
| { |
| name = "firmware/brcmfmac/brcmfmac43455-sdio.txt" |
| }, |
| { |
| name = "firmware/brcmfmac/brcmfmac43242a.bin" |
| }, |
| ] |
| } |
| visibility += [ "*" ] |
| } |