May 14, 2024

The FreeBSD Foundation is actively investing in enhancing FreeBSD’s driver capabilities in important areas identified by the community. Users have emphasized that top priorities should include better wireless support for increased stability, faster speeds, and support for the latest wireless chipsets. In this post, you’ll learn about some of the recent work towards meeting these objectives.

The iwlwifi package is a driver that enables support for Intel Wi-Fi chipsets on FreeBSD, based on the Intel source code of the Linux driver module with the same name. In November 2023, Cheng Cui began a six-month contract to work with long-term Foundation contractor Björn Zeeb to improve the driver. 

Getting started  

Cheng Cui’s initial work involved thorough planning and collaboration to identify the optimal hardware setup. The FreeBSD Foundation secured two Beelink SER5 AMD Mini PCs as the primary testbed. Cheng navigated through various installation challenges, documenting his findings and solutions in FreeBSD/doc commits ba54c352daba and in stable/14 commit 404b91dac415, which became part of the community’s knowledge base.

Testing iwlwifi

To maximize efficiency in debugging, Cheng and Björn decided to utilize FreeBSD as Virtual Machines (VMs) rather than on bare metal setups. This approach leveraged bhyve, FreeBSD’s native hypervisor, enhancing the debugging capabilities via better console support and was accomplished by setting up an Ubuntu Linux VM to monitor wireless traffic, ensuring the same iwlwifi driver (using passthru) could be used for comparative analyses and more effective problem-solving.

Debugging, patches, and driver enhancements

Cheng has successfully resolved multiple critical problem reports (PRs), including PRs 271979, 273985, 274382, and 275710. To identify a workaround for PR 274382, Cheng used a methodical (and novel) approach that involved isolating signals with aluminum foil-wrapped cardboard. He conducted rigorous testing and debugging, which has led to the resolution of these issues. 

Cheng has also reviewed patches that have significantly improved system stability for FreeBSD versions, particularly version 13.3-RELEASE and the upcoming 14.1.

These patches, implemented by Björn Zeeb, included D43512, D43635, D43646, and D43647. Cheng’s main focus with these patches was his assistance with enabling hardware-supported cryptographic features, which resulted in complex debugging scenarios (and with Cheng subsequently creating PR 277095 and PR 277100, related to LKPI_80211_HW_CRYPTO) with assistance from Adrian Chadd and others, a situation that is still ongoing. 

His commitment to examining these patches and filing the PRs was crucial in developing support for multiple fields, resolving data encryption issues, and ensuring reliable connections after associating with access points.

Cheng’s work also improved support for 802.11n standards, resulting in the successful resolution of PR 276083. To achieve this, he had to demonstrate a deep understanding of domain-specific knowledge and acquire new debugging techniques like Driver API tracing in Linux. Despite facing significant challenges, Cheng persevered and fixed the issue, ultimately contributing to the project’s advancement.

Collaboration and impact

Cheng was new to wireless development when he joined the iwlwifi project. Despite his lack of experience in this particular area, he made significant contributions to the project. He had to learn many new things, but his dedication and effort helped advance the project. His contributions demonstrate the spirit of the FreeBSD Project community and how individual efforts can significantly impact technological progress.

During his development efforts, Cheng Cui also played a vital role in ensuring the successful release of FreeBSD 13.3 by providing valuable assistance in reproducing user-reported issues and testing the subsequent fixes. This helped improve the operating system’s reliability and performance. 

Contribute to the FreeBSD Project

Whether you’re mentoring, promoting FreeBSD, or participating in forums and mailing lists, your efforts drive innovation and growth of the Project. Support the FreeBSD project today by joining our vibrant community and helping build our long-standing and growing open source ecosystem! Enhance FreeBSD by improving documentation, addressing bug reports, submitting code, and engaging in discussions. Every contribution, big or small, helps evolve FreeBSD into a more stable, secure, and performant open source operating system.