From b7b4bcb48104ba20806e52a5617e0c6b665f19d1 Mon Sep 17 00:00:00 2001 From: charlenechien Date: Sat, 28 Mar 2026 10:45:51 +0800 Subject: [PATCH 1/2] Update README with virtio config and bridge setup instructions Add instructions to disable the virtio network driver so the virtio device can bind to the vwifi driver. Document the expected CONFIG setting in .config and provide menuconfig navigation steps. Also include steps to bring up the bridge device (br0) required for networking setup. --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 24435c2..9c3c2d8 100644 --- a/README.md +++ b/README.md @@ -652,7 +652,10 @@ Enter the top directory of the Linux kernel source and use the following command ```shell $ make menuconfig ``` -The default kernel configuration will work for our testing environment, so just click `save` and we get `.config` on the top directory. +To allow virtio device to be bound to vwifi driver, please ensure the virtio network driver is disabled before you click `save`. By excluding the virtio network driver, you should spot `CONFIG_VIRTIO_NET=n` in the `.config` file on the top directory. +``` +Device Drivers ---> Network device support ---> Virtio network driver ---> no +``` Before building the kernel, please ensure that all the needed packages or libraries have been installed in your machine. @@ -750,6 +753,11 @@ $ sudo ip link set tap1 master br0 $ sudo ip link set tap2 master br0 ``` +Start `bridge` device: +```shell +$ sudo ip link set br0 up +``` + ### Start VM with Qemu Once we have our kernel image and rootfs, we can start running `Qemu`: From 42769bb0f13eabfd3e05ed5952374653c4d773ee Mon Sep 17 00:00:00 2001 From: charlenechien Date: Wed, 1 Apr 2026 23:08:19 +0800 Subject: [PATCH 2/2] Fix build for kernel 6.17 tx power API change Add conditional compilation for kernel >= 6.17 to handle the updated cfg80211 tx power callbacks, which introduce the radio_idx parameter in set_tx_power() and get_tx_power(). Also preserve compatibility with earlier kernels by keeping existing signatures under appropriate LINUX_VERSION_CODE checks, including link_id handling introduced in 6.14. This fixes autobuild failures on newer kernel versions without affecting older versions. --- vwifi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vwifi.c b/vwifi.c index d57a4f3..287e558 100644 --- a/vwifi.c +++ b/vwifi.c @@ -2019,6 +2019,9 @@ static int vwifi_delete_interface(struct vwifi_vif *vif) /* Set transmit power for the virtual interface */ static int vwifi_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) + int radio_idx, +#endif enum nl80211_tx_power_setting type, int mbm) { @@ -2064,6 +2067,9 @@ static int vwifi_set_tx_power(struct wiphy *wiphy, /* Get transmit power from the virtual interface */ static int vwifi_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0) + int radio_idx, +#endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 14, 0) unsigned int link_id, #endif