Re: Rebuilding brcmfmac Wi-Fi driver with the help of AI

From: Vladimir Varankin <vladimir_at_varank.in>
Date: Thu, 12 Mar 2026 08:56:16 UTC
> Given the workflow, prompts, AI models to use, etc. are in place AND you
have
> a physical Raspberry Pi 4, how long would it take to vibe-port
brcmfmac43455-sdio
> wifi driver? The complication it is attached via SDIO interface, not PCI!

That'd be fun thing to try. I've forgotten that RPi4 comes with
a broadcom chip.
Will find some time to spin up a testing stand, and will see how that goes.

>  C/Zig split rationale - at the end 94.7% of code is in C, 4.7% in Zig.
Would you still
> go for anything in Zig again?

Initially I was sold by Zig's promise of interoperability with C [1].

Given that I'm more comfortable with Zig compiler's promises, the thinking
was that
understanding the details will be simpler for me, when the majority of code
is generated
by AIs. In practice this didn't work out: the interoperability has number
of corner cases,
that, as an example, doesn't "just work" with kernel's linker.

So it's not Zig the language was the issue. But the extra supporting layers
needed
to make it work required more involvement than I (naively) hoped it will be.

Although, it works, I'm willing to rewrite Zig's chunk back to C, just to
avoid it to be an easy
target to latch on in the critics of the approach.

[1]:
https://ziglang.org/learn/overview/#integration-with-c-libraries-without-ffibindings

On Wed, 11 Mar 2026 at 16:16, Bugs Beastie <bugsbeastie@gmail.com> wrote:

> Mar 10, 2026 20:33:53 Vladimir Varankin <vladimir@varank.in>:
>
> > I recently wrote a blog post [1] sharing my experience of rebuilding
> > a Wi-Fi driver for BCM4350 for FreeBSD with the help of agenting AI
> > tooling.
> >
> Omitting any comments about AI usege,...cool and impressive! :)
>
> Very practical question:
> Given the workflow, prompts, AI models to use, etc. are in place AND you
> have a physical Raspberry Pi 4, how long would it take to vibe-port
> brcmfmac43455-sdio wifi driver? The complication it is attached via SDIO
> interface, not PCI!
>
> Question out of curiosity:
> C/Zig split rationale - at the end 94.7% of code is in C, 4.7% in Zig.
> Would you still go for anything in Zig again?
>
> > I'm aware that different groups of people have different opinions about
> > the topic of using AI in software development. Still I think this was
> > a fairly interesting experiment, and I'm curious to hear the opinion
> > on the approach and the results, from people close to in-tree drivers
> > development.
> >
> > The GitHub repository [2] includes documentation about the testing
> > approach, recorded decisions and know issues (which I'm — still with
> > the help of AI agents — addressing in my spare time).
> >
> > P.S. Just to be absolute clear: I'm not proposing or suggesting to
> > upstream the code of this driver. Neither do I think that in the current
> > state the AIs can vibe-code something reliable in one go. But I do think,
> > the tooling can be a huge multiplier for building, testing, explaining,
> > reviewing, etc large bodies of complex code.
> >
> > Cheers,
> > V.
> >
> > [1]: https://vladimir.varank.in/notes/2026/02/freebsd-brcmfmac/
> > [2]: https://github.com/narqo/freebsd-brcmfmac
> >
> > --
> > Vladimir Varankin
> > vladimir@varank.in
>
>
>

-- 
Vladimir Varankin
vladimir@varank.in