Skip to content

Wi-Fi hardware passthrough#262

Draft
dreamliner787-9 wants to merge 2 commits into
mainfrom
wifi
Draft

Wi-Fi hardware passthrough#262
dreamliner787-9 wants to merge 2 commits into
mainfrom
wifi

Conversation

@dreamliner787-9

@dreamliner787-9 dreamliner787-9 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

This is far from being ready but opening a PR so I don't forget about it.

Edit: after some thoughts, perhaps it would be better if we fold #180 into this as well.

Comment thread examples/wifi/board/rpi4b_4gb/Image Outdated
@aaurandt

aaurandt commented Jun 9, 2026

Copy link
Copy Markdown

I am currently trying this example and had a few comments:

  • In the overlay.dts the DMA controller is re-routed to only use channel 0, but the .system file still passes through all DMA channel interrupts from 0 to 10.
  • I also believe the ethernet mapping and interrupts can be removed if you edit Buildroot to not search for eth0 with the BR2_SYSTEM_DHCP property in Buildroot (i.e., delete text entirely or change to "wlan0" if you overlay the rootfs with a proper etc/wpa_supplicant.conf).

@dreamliner787-9

Copy link
Copy Markdown
Collaborator Author

In the overlay.dts the DMA controller is re-routed to only use channel 0, but the .system file still passes through all DMA channel interrupts from 0 to 10.

Ah yes that was from my debugging attempt. I'll remove them once I figure out why removing irqpoll broke the demo.

I also believe the ethernet mapping and interrupts can be removed if you edit Buildroot to not search for eth0 with the BR2_SYSTEM_DHCP property in Buildroot (i.e., delete text entirely or change to "wlan0" if you overlay the rootfs with a proper etc/wpa_supplicant.conf).

Ah thanks for the tip!

Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
@terryzbai

Copy link
Copy Markdown
Contributor

Link #62.

@aaurandt

aaurandt commented Jun 10, 2026

Copy link
Copy Markdown

I was getting boot errors with emmc2 that were congesting my user-space console; I was able to just remove this and still access WiFi through passthrough. In the overlay.dts I included the following:

emmc2bus {
		mmc@7e340000 {
			status = "disabled";
		};
	};

I then removed the mapping in the .system file for this bus.

@dreamliner787-9

dreamliner787-9 commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

I was getting boot errors with emmc2 that were congesting my user-space console; I was able to just remove this and still access WiFi through passthrough. In the overlay.dts I included the following:

emmc2bus {
		mmc@7e340000 {
			status = "disabled";
		};
	};

I then removed the mapping in the .system file for this bus.

Cool! Thanks for the feedback, I'll make sure to incorporate it in my example. I'm glad that it is working for you, please let me know if you run into other problems with libvmm.

@aaurandt

Copy link
Copy Markdown

One solution to being able to remove irqpoll from this demo is to remove the dma-controller. Here are my updates to the overlay.dts:

dma-controller@7e007000 {
            status = "disabled";
        };

mmcnr@7e300000 {
          /delete-property/ dmas;
          /delete-property/ dma-names;
        };

Then you can also remove the memory mapping and interrupts for the dma-controller from the .system file and vmm.c file.

From what I am observing, the interrupts are getting stuck when trying to load the driver using DMA. Disabling DMA forces PIO, which succeeds. In my user-land kernel boot, I now see the message mmc-bcm2835 fe300000.mmcnr: mmc-bcm2835: Unable to initialise DMA channel. Falling back to PIO.

@dreamliner787-9

Copy link
Copy Markdown
Collaborator Author

One solution to being able to remove irqpoll from this demo is to remove the dma-controller. Here are my updates to the overlay.dts:

dma-controller@7e007000 {
            status = "disabled";
        };

mmcnr@7e300000 {
          /delete-property/ dmas;
          /delete-property/ dma-names;
        };

Then you can also remove the memory mapping and interrupts for the dma-controller from the .system file and vmm.c file.

From what I am observing, the interrupts are getting stuck when trying to load the driver using DMA. Disabling DMA forces PIO, which succeeds. In my user-land kernel boot, I now see the message mmc-bcm2835 fe300000.mmcnr: mmc-bcm2835: Unable to initialise DMA channel. Falling back to PIO.

So that would require the CPU to manually shuffle data to and from the WiFi card? That isn't great for performance, I think there is a bug in our VGIC code somewhere. I'll investigate this and see if we can keep the DMA controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants