Skip to content

Commit fab7de1

Browse files
committed
Support Linux 6.11
To align with the virtio subsystem changes introduced in Linux kernel v6.11 API, this commit updates the virtqueue setup logic to use `struct virtqueue_info` and the new `virtio_find_vqs()` interface. The old `virtio_find_vqs()` interface has been reworked and renamed to use `struct virtqueue_info` starting from Linux 6.11, replacing the legacy helpers entirely. Since the original code uses `virtio_find_vqs()` (which internally passes `NULL` for ctx), `ctx` is conservatively set to `false`. ref: Introduce struct virtqueue_info and find_vqs_info() config op torvalds/linux@c502eb8 Rename virtio_find_vqs_info() to virtio_find_vqs torvalds/linux@6c85d6b Remove legacy virtio_find_vqs() and virtio_find_vqs_ctx() helpers torvalds/linux@3e8d51c
1 parent a940502 commit fab7de1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

vwifi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,8 +3167,20 @@ 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+
for (int i = 0; i < VWIFI_NUM_VQS; i++) {
3173+
vqs_info[i].callback = callbacks[i];
3174+
vqs_info[i].name = names[i];
3175+
vqs_info[i].ctx = false;
3176+
}
3177+
3178+
return virtio_find_vqs(vdev, VWIFI_NUM_VQS, vwifi_vqs, vqs_info, NULL);
3179+
3180+
#else
31703181
return virtio_find_vqs(vdev, VWIFI_NUM_VQS, vwifi_vqs, callbacks, names,
31713182
NULL);
3183+
#endif
31723184
}
31733185

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

0 commit comments

Comments
 (0)