Skip to content

Fix build error on Linux 6.11: update virtio_find_vqs() to use virtqueue_info #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions vwifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3167,8 +3167,23 @@ static int vwifi_virtio_init_vqs(struct virtio_device *vdev)
[VWIFI_VQ_TX] = "tx",
};

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
struct virtqueue_info vqs_info[VWIFI_NUM_VQS];
/* Set ctx to false to maintain compatibility with legacy
* virtio_find_vqs() behavior, which implicitly passed NULL for ctx.
*/
for (int i = 0; i < VWIFI_NUM_VQS; i++) {
vqs_info[i].callback = callbacks[i];
vqs_info[i].name = names[i];
vqs_info[i].ctx = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a brief comment for .ctx = false, following the project's comment style, to clarify its intended usage for future maintainers.

}

return virtio_find_vqs(vdev, VWIFI_NUM_VQS, vwifi_vqs, vqs_info, NULL);

#else
return virtio_find_vqs(vdev, VWIFI_NUM_VQS, vwifi_vqs, callbacks, names,
NULL);
#endif
}

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