Skip to content

Commit 652f115

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 Closes #73
1 parent a940502 commit 652f115

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

vwifi.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/netlink.h>
1818
#include <net/sock.h>
1919

20+
2021
MODULE_LICENSE("Dual MIT/GPL");
2122
MODULE_AUTHOR("National Cheng Kung University, Taiwan");
2223
MODULE_DESCRIPTION("virtual cfg80211 driver");
@@ -3167,8 +3168,20 @@ static int vwifi_virtio_init_vqs(struct virtio_device *vdev)
31673168
[VWIFI_VQ_TX] = "tx",
31683169
};
31693170

3171+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
3172+
struct virtqueue_info vqs_info[VWIFI_NUM_VQS];
3173+
for (int i = 0; i < VWIFI_NUM_VQS; i++) {
3174+
vqs_info[i].callback = callbacks[i];
3175+
vqs_info[i].name = names[i];
3176+
vqs_info[i].ctx = false;
3177+
}
3178+
3179+
return virtio_find_vqs(vdev, VWIFI_NUM_VQS, vwifi_vqs, vqs_info, NULL);
3180+
3181+
#else
31703182
return virtio_find_vqs(vdev, VWIFI_NUM_VQS, vwifi_vqs, callbacks, names,
31713183
NULL);
3184+
#endif
31723185
}
31733186

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

0 commit comments

Comments
 (0)