Skip to content

Commit d3114d3

Browse files
authored
Merge pull request #74 from horseface1110/fix-virtio-api-linux-6.11
Fix build error on Linux 6.11: update virtio_find_vqs() to use virtqueue_info
2 parents 62a3dd8 + 800ad32 commit d3114d3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

vwifi.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,8 +3167,23 @@ static int vwifi_virtio_init_vqs(struct virtio_device *vdev)
31673167
[VWIFI_VQ_TX] = "tx",
31683168
};
31693169

3170+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
3171+
struct virtqueue_info vqs_info[VWIFI_NUM_VQS];
3172+
/* Set ctx to false to maintain compatibility with legacy
3173+
* virtio_find_vqs() behavior, which implicitly passed NULL for ctx.
3174+
*/
3175+
for (int i = 0; i < VWIFI_NUM_VQS; i++) {
3176+
vqs_info[i].callback = callbacks[i];
3177+
vqs_info[i].name = names[i];
3178+
vqs_info[i].ctx = false;
3179+
}
3180+
3181+
return virtio_find_vqs(vdev, VWIFI_NUM_VQS, vwifi_vqs, vqs_info, NULL);
3182+
3183+
#else
31703184
return virtio_find_vqs(vdev, VWIFI_NUM_VQS, vwifi_vqs, callbacks, names,
31713185
NULL);
3186+
#endif
31723187
}
31733188

31743189
static void vwifi_virtio_fill_vq(struct virtqueue *vq, u8 vnet_hdr_len)

0 commit comments

Comments
 (0)