| # 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. |
| |
| load( |
| "@fuchsia_sdk//fuchsia:defs.bzl", |
| "fuchsia_bind_library", |
| "fuchsia_cc_driver", |
| "fuchsia_component_manifest", |
| "fuchsia_driver_bind_bytecode", |
| "fuchsia_driver_component", |
| "fuchsia_package", |
| ) |
| load( |
| "@fuchsia_sdk//fuchsia:licenses.bzl", |
| "fuchsia_licenses_collection", |
| "fuchsia_licenses_spdx", |
| ) |
| |
| package( |
| default_applicable_licenses = ["//:license_fuchsia"], |
| default_visibility = ["//visibility:public"], |
| ) |
| |
| # TODO(https://fxbug.dev/328828649): Remove this when fuchsia.hardware.sysmem is in the sdk. |
| fuchsia_bind_library( |
| name = "sysmem_bindlib", |
| srcs = [ |
| "sysmem_lib.bind", |
| ], |
| ) |
| |
| fuchsia_driver_bind_bytecode( |
| name = "iwlwifi_bind_bytecode", |
| output = "iwlwifi.bindbc", |
| rules = "iwlwifi.bind", |
| deps = [ |
| "@fuchsia_sdk//bind/fuchsia.acpi", |
| "@fuchsia_sdk//bind/fuchsia.pci", |
| "@fuchsia_sdk//fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_bindlib", |
| # TODO(https://fxbug.dev/328828649): Remove this when fuchsia.hardware.sysmem is in the sdk. |
| ":sysmem_bindlib", |
| # TODO(https://fxbug.dev/328828649): Use this when fuchsia.hardware.sysmem is in the sdk. |
| #"@fuchsia_sdk//fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_bindlib", |
| ], |
| ) |
| |
| cc_library( |
| name = "driver_inspector", |
| srcs = [ |
| "driver-inspector.cc", |
| ], |
| hdrs = [ |
| "driver-inspector.h", |
| ], |
| deps = [ |
| "@fuchsia_sdk//pkg/inspect", |
| "@fuchsia_sdk//pkg/inspect_component_cpp", |
| ], |
| ) |
| |
| cc_library( |
| name = "platform", |
| srcs = [ |
| "compiler.cc", |
| "debug.cc", |
| "ieee80211.cc", |
| "io_buffer.cc", |
| "irq.cc", |
| "memory.cc", |
| "module.cc", |
| "pci-fidl.cc", |
| "rcu.cc", |
| "stats.cc", |
| "task.cc", |
| "task-internal.cc", |
| "time.cc", |
| "tkip.c", |
| ], |
| hdrs = [ |
| "compiler.h", |
| "debug.h", |
| "ieee80211.h", |
| "io_buffer.h", |
| "irq.h", |
| "kernel.h", |
| "memory.h", |
| "module.h", |
| "pci-fidl.h", |
| "pci.h", |
| "rcu.h", |
| "regulatory.h", |
| "stats.h", |
| "task-internal.h", |
| "task.h", |
| "time.h", |
| "tkip.h", |
| "banjo/ieee80211.h", |
| "banjo/associnfo.h", |
| "banjo/common.h", |
| "banjo/softmac.h", |
| "banjo/wlanphyimpl.h", |
| "banjo/pci.h", |
| |
| # Probably added by me |
| "align.h", |
| ], |
| defines = [ |
| "CONFIG_IWLMVM=1", |
| "CPTCFG_IWL_TIMEOUT_FACTOR=1", |
| "CPTCFG_IWLMVM=1", |
| "CPTCFG_IWLWIFI_D0I3_DEFAULT_DISABLE=", |
| ], |
| deps = [ |
| ":driver_inspector", |
| ":rcu_manager", |
| "//third_party/driver-lib/wlan", |
| "//third_party/driver-lib/log/cpp:dfv2", |
| "@fuchsia_sdk//fidl/fuchsia.wlan.softmac:fuchsia.wlan.softmac_cpp_driver", |
| "@fuchsia_sdk//pkg/mmio", |
| "@fuchsia_sdk//fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_cpp_wire", |
| |
| # Needed only for library purposes (channel and ieee includes) |
| # "@fuchsia_sdk//fidl/fuchsia.hardware.wlan.associnfo:fuchsia.hardware.wlan.associnfo_cpp_driver", |
| ], |
| ) |
| |
| # Support for RCU synchronization. |
| cc_library( |
| name = "rcu_manager", |
| srcs = ["rcu-manager.cc"], |
| hdrs = ["rcu-manager.h"], |
| deps = [ |
| "@fuchsia_sdk//pkg/async", |
| "@fuchsia_sdk//pkg/async-cpp", |
| ], |
| ) |
| |
| cc_library( |
| name = "iwlwifi_device", |
| srcs = [ |
| "mvm-mlme.cc", |
| "mvm-sta.cc", |
| "pcie-iwlwifi-driver.cc", |
| "wlanphyimpl-device.cc", |
| "wlansoftmac-device.cc", |
| ], |
| hdrs = [ |
| "mvm-mlme.h", |
| "mvm-sta.h", |
| "pcie-iwlwifi-driver.h", |
| "scoped_utils.h", |
| "wlanphyimpl-device.h", |
| "wlansoftmac-device.h", |
| ], |
| copts = ["-Ithird_party/iwlwifi"], |
| deps = [ |
| ":driver_inspector", |
| ":platform", |
| ":rcu_manager", |
| "@fuchsia_sdk//fidl/fuchsia.wlan.common:fuchsia.wlan.common_cpp_driver", |
| "@fuchsia_sdk//fidl/fuchsia.wlan.phyimpl:fuchsia.wlan.phyimpl_cpp_driver", |
| "@fuchsia_sdk//fidl/fuchsia.wlan.ieee80211:fuchsia.wlan.ieee80211_cpp_driver", |
| "@fuchsia_sdk//fidl/fuchsia.wlan.softmac:fuchsia.wlan.softmac_cpp_driver", |
| "@fuchsia_sdk//fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_cpp", |
| "@fuchsia_sdk//pkg/sync", |
| "//third_party/iwlwifi:core", |
| "//third_party/iwlwifi/mvm", |
| "//third_party/iwlwifi/pcie", |
| "//third_party/iwlwifi/cfg", |
| |
| # These might not be needed once we have cpp/driver support |
| "@fuchsia_sdk//pkg/fidl_driver_transport", |
| "@fuchsia_sdk//pkg/fidl_driver", |
| "@fuchsia_sdk//pkg/fidl_driver_natural", |
| |
| # Needed for pcie-iwlwifi-driver.cc/h |
| "@fuchsia_sdk//fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp", |
| "@fuchsia_sdk//fidl/fuchsia.wlan.softmac:fuchsia.wlan.softmac_bindlib_cc", |
| "@fuchsia_sdk//fidl/fuchsia.wlan.phyimpl:fuchsia.wlan.phyimpl_bindlib_cc", |
| "@fuchsia_sdk//pkg/async-loop-cpp", |
| "@fuchsia_sdk//pkg/async-loop-default", |
| "@fuchsia_sdk//pkg/driver_outgoing_cpp", |
| "@fuchsia_sdk//pkg/driver_component_cpp", |
| ], |
| ) |
| |
| #TODO: need to switch back to fuchsia_cc_driver once it supports the following |
| #linker flags. |
| fuchsia_cc_driver( |
| name = "iwlwifi_driver", |
| srcs = [ |
| # Needed to export the driver framework symbols. |
| "pcie-iwlwifi-driver.cc", |
| ], |
| deps = [ |
| ":iwlwifi_device", |
| ], |
| ) |
| |
| fuchsia_component_manifest( |
| name = "iwlwifi_manifest", |
| src = "meta/iwlwifi.cml", |
| ) |
| |
| fuchsia_driver_component( |
| name = "iwlwifi_component", |
| bind_bytecode = ":iwlwifi_bind_bytecode", |
| driver_lib = ":iwlwifi_driver", |
| manifest = ":iwlwifi_manifest", |
| ) |
| |
| fuchsia_package( |
| name = "iwlwifi_pkg", |
| package_name = "iwlwifi", |
| components = [":iwlwifi_component"], |
| disable_repository_name = "fuchsia.com", |
| fuchsia_api_level = "15", |
| resources = [ |
| "//third_party/iwlwifi/firmwares:iwlwifi-firmware-iwlwifi-8265-31", |
| "//third_party/iwlwifi/firmwares:iwlwifi-firmware-iwlwifi-QuZ-a0-hr-b0-71", |
| ], |
| visibility = ["//visibility:public"], |
| ) |
| |
| fuchsia_licenses_collection( |
| name = "iwlwifi_pkg_licenses_collection", |
| root_target = ":iwlwifi_pkg", |
| ) |
| |
| fuchsia_licenses_spdx( |
| name = "iwlwifi_licenses.spdx.json", |
| document_namespace = "https://fuchsia.googlesource.com/drivers/wlan/intel/iwlwifi/", |
| licenses = ":iwlwifi_pkg_licenses_collection", |
| licenses_cross_refs_base_url = "https://fuchsia.googlesource.com/drivers/wlan/intel/iwlwifi/+/refs/heads/main/", |
| root_package_homepage = "https://fuchsia.googlesource.com/drivers/wlan/intel/iwlwifi/", |
| root_package_name = "iwlwifi", |
| ) |