wifi project status update
August 26, 2021 posted by Martin Husemann
After initial work on the wifi renewal branch went quite fast and smooth, things have slowed down a bit in the last few months.
Most of the slow down was due to me not being available for this type of work for unexpectedly long times - a problem that should be fixed now.
However, there were other obstacles and unexpected issues on the way:
- bpf taps are handled differently in the new stack and some slightly obscure site conditions of this had been overlooked in the initial conversion. To make everything work, changes to our bpf framework were needed (and have landed in -current some time ago now).
- Many wifi drivers seem to be in a, let's say, slightly fragile state. When testing the random collection of wifi hardware that I acquired during this project in -current, many drivers did not work at first try and often I was able to provoke kernel panics quickly. This is not a happy base to start converting drivers from.
- After the great success of usbnet(9) for USB ethernet drivers, core and I agreed to do the same for wifi - the result is called usbwifi(9) and makes conversion of usb drivers a lot easier than other wifi drivers. See the conversion instructions for more details. usbwifi(9) is both quite similar but also quite different to usbnet(9), mostly for two reasons: it interfaces to a totally different stack, and many usb wlan chipsets are more complex than ethernet chipsets (e.g. have support for multiple send queues with different priorities). Developing usbwifi did cost quit some time (initially unplanned), but is expected to amortize over the next few drivers and quickly end up as a net win.
- I have been hitting a bug in the urtwn(4) driver used for inial usbwifi(9) development and still not found it (as of today). It seems to hit randomly and not be caused by the usbwifi(9) conversion - a fact that I found out only recently. So for now I will put this driver aside (after spending *way* too much time on it) and instead work on other usb drivers, returning to the bug every now and then and see if I can spot it. Maybe I can borrow a USB analyzer and get more insight that way.
The current state of driver conversion and what drivers are still open are listed in the wifi driver conversion matrix.
Next steps ahead are:
make another pass over documentation and improve things / fixup for recent changes(done before this blog post got published)- sync the branch with HEAD and keep tracking it more closely
- convert run(4) to usbwifi
- revisit rtwn(4) and decide if/how it should be merged with urtwn(4)
- revisit iwm(4) and make it work fully
- convert all other drivers, starting with the ones I have hardware for
Currently it is not clear if this branch can be merged to HEAD before branching for netbsd-10. We will not delay the netbsd-10 branch for this.
[1 comment]
Posted by Vitaly on September 14, 2021 at 05:20 AM UTC #