• Shannon Nelson's avatar
    virtio: allow caller to override device id in vp_modern · a37c0191
    Shannon Nelson authored
    To add a bit of vendor flexibility with various virtio based devices,
    allow the caller to check for a different device id.  This adds a function
    pointer field to struct virtio_pci_modern_device to specify an override
    device id check.  If defined by the driver, this function will be called
    to check that the PCI device is the vendor's expected device, and will
    return the found device id to be stored in mdev->id.device.  This allows
    vendors with alternative vendor device ids to use this library on their
    own device BAR.
    
    Note: A lot of the diff in this is simply indenting the existing code
    into an else block.
    Signed-off-by: default avatarShannon Nelson <shannon.nelson@amd.com>
    Acked-by: default avatarJason Wang <jasowang@redhat.com>
    Message-Id: <20230519215632.12343-2-shannon.nelson@amd.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    a37c0191
virtio_pci_modern_dev.c 20.8 KB