blob: e0adc2eb0f0bf88a32d7c6e74cca665354d32647 [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/drivers.gni")
bind_library("fuchsia.intel.e1000") {
source = "fuchsia.intel.e1000.bind"
}
driver_bind_rules("e1000_bind") {
rules = "e1000.bind"
tests = "bind-tests.json"
deps = [
":fuchsia.intel.e1000",
"//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_bindlib",
"//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_bindlib",
"//src/devices/bind/fuchsia.acpi",
"//src/devices/bind/fuchsia.pci",
]
}
source_set("e1000_third_party") {
sources = [
"e1000_80003es2lan.c",
"e1000_82540.c",
"e1000_82541.c",
"e1000_82542.c",
"e1000_82543.c",
"e1000_82571.c",
"e1000_82575.c",
"e1000_api.c",
"e1000_base.c",
"e1000_i210.c",
"e1000_ich8lan.c",
"e1000_mac.c",
"e1000_manage.c",
"e1000_mbx.c",
"e1000_nvm.c",
"e1000_phy.c",
"e1000_vf.c",
]
deps = [ ":e1000_osdep" ]
configs += [
"//build/config:Wno-conversion",
"//build/config:Wno-implicit-fallthrough",
]
}
source_set("e1000_osdep") {
sources = [ "e1000_osdep.cc" ]
public_deps = [
"//src/devices/pci/lib/device-protocol-pci",
"//src/devices/pci/lib/pci",
]
}
# Generate two source sets, one for the driver and one for tests. The tests need a define to mock
# certain behavior.
e1000_variants = [
{
variant_name = "e1000_core"
defines = []
},
{
variant_name = "e1000_core_test"
defines = [ "E1000_TEST" ]
testonly = true
},
]
foreach(variant, e1000_variants) {
source_set(variant.variant_name) {
forward_variables_from(variant,
[
"defines",
"testonly",
])
output_name = "e1000"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [
"fuchsia.cc",
"log.cc",
"rings.cc",
"support.cc",
]
public_deps = [
"//sdk/fidl/fuchsia.hardware.network.driver:fuchsia.hardware.network.driver_cpp",
"//src/devices/pci/lib/pci",
"//src/lib/vmo_store",
]
deps = [
":e1000_bind",
":e1000_osdep",
"//sdk/fidl/fuchsia.driver.compat:fuchsia.driver.compat_cpp",
"//sdk/lib/driver/compat/cpp",
"//sdk/lib/driver/compat/cpp:logging",
"//sdk/lib/driver/component/cpp",
"//sdk/lib/syslog/structured_backend",
"//src/connectivity/network/drivers/network-device/device:shared_lock",
"//src/devices/lib/mmio",
"//src/devices/pci/lib/device-protocol-pci",
"//zircon/system/public",
]
}
}
fuchsia_driver("e1000-driver") {
output_name = "e1000"
deps = [
":e1000_core",
":e1000_third_party",
]
}
fuchsia_driver_component("e1000") {
component_name = "e1000"
deps = [ ":e1000-driver" ]
info = "e1000-info.json"
manifest = "meta/e1000.cml"
}
fuchsia_driver_package("package") {
package_name = "e1000"
driver_components = [ ":e1000" ]
}
group("tests") {
testonly = true
deps = [
":e1000_bind_test",
"test:e1000-test",
]
}