diff --git a/virtio_pci_common.c b/virtio_pci_common.c index 318e73a..056787c 100644 --- a/virtio_pci_common.c +++ b/virtio_pci_common.c @@ -72,7 +72,7 @@ int vp_find_vqs(struct virtio_device *, unsigned nvqs, { return 0; } -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) && LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], const bool *ctx, @@ -80,10 +80,10 @@ int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, { return 0; } -#else /* 6.11 changed the API...grrrrr. */ +#elif LINUX_VERSION_CODE >= KERNEL_VERSION (6,11,0) +/* 6.11 changed the API...grrrrr. */ int vp_find_vqs(struct virtio_device *vdev, unsigned int nvqs, - struct virtqueue *vqs[], - struct virtqueue_info vqs_info[], + struct virtqueue *vqs[], struct virtqueue_info vqs_info[], struct irq_affinity *desc) { return 0; diff --git a/virtio_pci_common.h b/virtio_pci_common.h index d161151..8f6ded7 100644 --- a/virtio_pci_common.h +++ b/virtio_pci_common.h @@ -140,11 +140,17 @@ int vp_find_vqs(struct virtio_device *vdev, unsigned nvqs, int vp_find_vqs(struct virtio_device *, unsigned nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], struct irq_affinity *desc); -#else -int vp_find_vqs(struct virtio_device *, unsigned nvqs, +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) && LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0) +int vp_find_vqs(struct virtio_device *, unsigned int nvqs, struct virtqueue *vqs[], vq_callback_t *callbacks[], const char * const names[], const bool *ctx, struct irq_affinity *desc); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6,11,0) +int vp_find_vqs(struct virtio_device *, unsigned int, + struct virtqueue *[], struct virtqueue_info [], + struct irq_affinity *); +#else +#error missing kernel version check #endif const char *vp_bus_name(struct virtio_device *vdev);