blob: d0d1e6b08819df348edbac365bb27f39260a5fdd [file]
# Copyright 2026 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("//build/bazel/rules/bind:driver_bind_bytecode.bzl", "driver_bind_bytecode")
load("//build/bazel/rules/bind:driver_bind_bytecode_test.bzl", "driver_bind_bytecode_test")
load("//build/bazel/rules/drivers:cc_driver.bzl", "cc_driver")
load("//build/bazel/rules/drivers:dml_outputs.bzl", "dml_outputs")
load("//build/bazel/rules/drivers:driver_component.bzl", "driver_component")
load("//build/bazel/rules/packages:fx_package.bzl", "fx_package")
package(default_applicable_licenses = ["//:license"])
dml_outputs(
name = "ums-function-dml",
dml = "meta/ums-function.dml",
driver_name = "ums-function",
includes = ["//sdk/lib/driver/dml:usb.constants.dml"],
)
driver_bind_bytecode(
name = "usb_ums_bind",
bind_output = "ums-function.bindbc",
dml = ":ums-function-dml",
deps = [
"//src/devices/bind/fuchsia.usb",
],
)
driver_bind_bytecode_test(
name = "usb_ums_bind_test",
bytecode = ":usb_ums_bind",
test_specification = "meta/bind_tests.json",
)
cc_driver(
name = "ums-function-driver",
srcs = [
"ums-function.cc",
"ums-function.h",
],
build_flags = [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
],
output_name = "ums-function",
deps = [
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_cpp",
"//sdk/fidl/fuchsia.hardware.usb.descriptor:fuchsia.hardware.usb.descriptor_cpp",
"//sdk/fidl/fuchsia.hardware.usb.endpoint:fuchsia.hardware.usb.endpoint_cpp",
"//sdk/fidl/fuchsia.hardware.usb.function:fuchsia.hardware.usb.function_cpp",
"//sdk/fidl/fuchsia.hardware.usb.request:fuchsia.hardware.usb.request_cpp",
# Required in Bazel because usb-fidl-dfv2-compat-logging headers
# include <lib/driver/compat/cpp/logging.h> without depending on :logging.
"//sdk/lib/driver/compat/cpp:logging",
"//sdk/lib/driver/component/cpp",
"//sdk/lib/driver/logging/cpp",
"//src/devices/block/lib/common",
"//src/devices/block/lib/scsi",
"//src/devices/usb/lib/usb:descriptors",
"//src/devices/usb/lib/usb:ums",
"//src/devices/usb/lib/usb:usb-fidl-dfv2-compat-logging",
"//src/devices/usb/lib/usb-endpoint:usb-endpoint-client-dfv2-compat-logging",
"//zircon/system/ulib/zx",
],
)
driver_component(
name = "ums-function",
dml = ":ums-function-dml",
visibility = [
"//src/devices/block:__subpackages__",
"//src/devices/bundles:__pkg__",
],
deps = [
":ums-function-driver",
":usb_ums_bind",
],
)
fx_package(
name = "package",
package_name = "ums-function",
components = [":ums-function"],
package_repository_name = "fuchsia.com",
visibility = ["//bundles/assembly:__subpackages__"],
)