mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
virtio/virtio-pci: improve debug logging and fix comments
- Replace pciXXX() debug calls with vrtXXX() for consistency - Add additional debug logging for better traceability - Fix minor comment typos Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
committed by
Alan C. Assis
parent
effdb88710
commit
5c835881b2
@@ -177,7 +177,7 @@ virtio_pci_legacy_get_queue_len(FAR struct virtio_pci_device_s *vpdev,
|
|||||||
(uintptr_t)(vpdev->ioaddr + VIRTIO_PCI_QUEUE_NUM), &num);
|
(uintptr_t)(vpdev->ioaddr + VIRTIO_PCI_QUEUE_NUM), &num);
|
||||||
if (num == 0)
|
if (num == 0)
|
||||||
{
|
{
|
||||||
pcierr("Queue is not available num=%d\n", num);
|
vrterr("Queue is not available num=%d\n", num);
|
||||||
}
|
}
|
||||||
|
|
||||||
return num;
|
return num;
|
||||||
@@ -430,7 +430,7 @@ virtio_pci_legacy_init_device(FAR struct virtio_pci_device_s *vpdev)
|
|||||||
|
|
||||||
if (dev->revision != VIRTIO_PCI_ABI_VERSION)
|
if (dev->revision != VIRTIO_PCI_ABI_VERSION)
|
||||||
{
|
{
|
||||||
pcierr("Virtio_pci: expected ABI version %d, got %u\n",
|
vrterr("Virtio_pci: expected ABI version %d, got %u\n",
|
||||||
VIRTIO_PCI_ABI_VERSION, dev->revision);
|
VIRTIO_PCI_ABI_VERSION, dev->revision);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
@@ -458,10 +458,11 @@ int virtio_pci_legacy_probe(FAR struct pci_device_s *dev)
|
|||||||
FAR struct virtio_device *vdev = &vpdev->vdev;
|
FAR struct virtio_device *vdev = &vpdev->vdev;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* We only own devices >= 0x1000 and <= 0x107f: leave the rest. */
|
/* We only own devices >= 0x1000 and <= 0x103f: leave the rest. */
|
||||||
|
|
||||||
if (dev->device < 0x1000 || dev->device > 0x103f)
|
if (dev->device < 0x1000 || dev->device > 0x103f)
|
||||||
{
|
{
|
||||||
|
vrtwarn("Device id 0x%04x not supported\n", dev->device);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,7 +473,7 @@ int virtio_pci_legacy_probe(FAR struct pci_device_s *dev)
|
|||||||
ret = virtio_pci_legacy_init_device(vpdev);
|
ret = virtio_pci_legacy_init_device(vpdev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
pcierr("Virtio pci legacy device init failed, ret=%d\n", ret);
|
vrterr("Virtio pci legacy device init failed, ret=%d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -714,6 +714,7 @@ int virtio_pci_modern_probe(FAR struct pci_device_s *dev)
|
|||||||
|
|
||||||
if (dev->device < 0x1000 || dev->device > 0x107f)
|
if (dev->device < 0x1000 || dev->device > 0x107f)
|
||||||
{
|
{
|
||||||
|
vrtwarn("Device id 0x%04x not supported\n", dev->device);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,12 +723,9 @@ int virtio_pci_modern_probe(FAR struct pci_device_s *dev)
|
|||||||
vdev->role = VIRTIO_DEV_DRIVER;
|
vdev->role = VIRTIO_DEV_DRIVER;
|
||||||
|
|
||||||
ret = virtio_pci_init_device(vpdev);
|
ret = virtio_pci_init_device(vpdev);
|
||||||
if (ret < 0)
|
if (ret < 0 && ret != -ENODEV)
|
||||||
{
|
{
|
||||||
if (ret != -ENODEV)
|
vrterr("Virtio pci modern device init failed, ret=%d\n", ret);
|
||||||
{
|
|
||||||
pcierr("Virtio pci modern device init failed, ret=%d\n", ret);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ static int virtio_pci_probe(FAR struct pci_device_s *dev)
|
|||||||
|
|
||||||
if (dev->device < 0x1000 || dev->device > 0x107f)
|
if (dev->device < 0x1000 || dev->device > 0x107f)
|
||||||
{
|
{
|
||||||
pcierr("Pci device id err, id=%d\n", dev->device);
|
vrterr("Pci device id err, id=%d\n", dev->device);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ static int virtio_pci_probe(FAR struct pci_device_s *dev)
|
|||||||
ret = virtio_pci_legacy_probe(dev);
|
ret = virtio_pci_legacy_probe(dev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
vrterr("Virtio pci legacy probe failed\n");
|
vrterr("Virtio pci legacy probe failed %d\n", ret);
|
||||||
goto err_with_enable;
|
goto err_with_enable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -421,7 +421,7 @@ int virtio_pci_create_virtqueues(FAR struct virtio_device *vdev,
|
|||||||
(wdparm_t)vpdev);
|
(wdparm_t)vpdev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
pcierr("Wd_start failed: %d\n", ret);
|
vrterr("Wd_start failed: %d\n", ret);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user