nuttx-mirror/drivers/virtio
wangmingrong1 eed302b8bb virtio: Add virtio version check
In the source code of qemu or linux, there is a check for the virtio version
/* Check device version */
priv->version = readl(priv->base + VIRTIO_MMIO_VERSION);
if (priv->version < 1 || priv->version > 2) {
	debug("(%s): version %d not supported!\n",
	udev->name, priv->version);
	return 0;
}
/* Check device ID */
uc_priv->device = readl(priv->base + VIRTIO_MMIO_DEVICE_ID);
if (uc_priv->device == 0) {
	/*
	* virtio-mmio device with an ID 0 is a (dummy) placeholder
	* with no function. End probing now with no error reported.
	*/
	return 0;
}

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2024-12-04 19:49:26 +08:00
..
CMakeLists.txt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
Kconfig virtio-serial: support custom the virtio serial device name 2024-10-06 08:37:53 +08:00
Make.defs drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-blk.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-blk.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-gpu.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-gpu.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-input.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-input.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-mmio.c virtio: Add virtio version check 2024-12-04 19:49:26 +08:00
virtio-net.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-net.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-pci-legacy.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-pci-modern.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-pci.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-pci.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-rng.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-rng.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-rpmb.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-rpmb.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-serial.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-serial.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-snd.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio-snd.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
virtio.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00