[package]
name = "ax-driver"
version.workspace = true
repository = "https://github.com/rcore-os/tgoskits"
edition.workspace = true
authors = [
    "Yuekai Jia <equation618@gmail.com>",
    "ChengXiang Qi <kuangjux@outlook.com>",
]
description = "ArceOS device drivers"
license.workspace = true

[features]
bus-mmio = []
bus-pci = ["dep:ax-driver-pci", "dep:ax-hal", "dep:ax-config"]
net = ["dep:ax-driver-net", "axplat-dyn?/net"]
block = ["dep:ax-driver-block"]
display = ["dep:ax-driver-display"]
input = ["dep:ax-driver-input"]
vsock = ["ax-driver-vsock"]

# Enabled by features `virtio-*`
virtio = ["dep:ax-driver-virtio", "dep:ax-alloc", "dep:ax-hal", "dep:ax-config"]

# various types of drivers
virtio-blk = ["block", "virtio", "ax-driver-virtio/block"]
virtio-net = ["net", "virtio", "ax-driver-virtio/net"]
virtio-gpu = ["display", "virtio", "ax-driver-virtio/gpu"]
virtio-input = ["input", "virtio", "ax-driver-virtio/input"]
virtio-socket = ["vsock", "virtio", "ax-driver-virtio/socket"]
ramdisk = ["block", "ax-driver-block/ramdisk"]
bcm2835-sdhci = ["block", "ax-driver-block/bcm2835-sdhci"]
sdmmc = ["block", "ax-driver-block/sdmmc", "dep:ax-hal", "dep:ax-config"]
ahci = ["block", "ax-driver-block/ahci", "dep:ax-hal", "dep:ax-config"]
ixgbe = ["net", "ax-driver-net/ixgbe", "dep:ax-alloc", "dep:ax-hal", "dep:ax-dma"]
fxmac = ["net", "ax-driver-net/fxmac", "dep:ax-alloc", "dep:ax-hal", "dep:ax-dma"]
# more devices example: e1000 = ["net", "ax-driver-net/e1000"]

irq = []
dyn = ["dep:ax-errno", "dep:axplat-dyn"]

default = ["bus-pci"]

[dependencies]
ax-alloc = { workspace = true, optional = true }
ax-config = { workspace = true, optional = true }
ax-dma = { workspace = true, optional = true }
ax-driver-base.workspace = true
ax-driver-block = { workspace = true, optional = true }
ax-driver-display = { workspace = true, optional = true }
ax-driver-input = { workspace = true, optional = true }
ax-driver-net = { workspace = true, optional = true }
ax-driver-pci = { workspace = true, optional = true }
ax-driver-virtio = { workspace = true, optional = true }
ax-driver-vsock = { workspace = true, optional = true }
ax-errno = { workspace = true, optional = true }
ax-hal = { workspace = true, optional = true }
cfg-if.workspace = true
ax-crate-interface.workspace = true
log.workspace = true
smallvec = { version = "1.15", features = ["const_generics", "union"] }
axplat-dyn = { workspace = true, optional = true }
