> Date: Wed, 11 Oct 2023 10:10:58 +0200
> From: Stefan Sperling <s...@openbsd.org>
> 
> On Tue, Oct 10, 2023 at 11:41:39PM +0200, Mark Kettenis wrote:
> > The firmware for the BCM4388 has yet another version of the "escan"
> > command.  But we can treat it the same as v2 since it just added a new
> > parameter in place of some padding.  We just set that new parameter to
> > zero, which doesn't change anything.
> > 
> > As a bonus this adds some missing htole16() calls.
> > 
> > This is the equivalent of:
> > 
> > https://github.com/AsahiLinux/linux/commit/399ef7b1cb9094c1c64e0f9ad6caa5c4d114009f
> > 
> > ok?
> 
> > @@ -274,8 +275,10 @@ bwfm_preinit(struct bwfm_softc *sc)
> >             nmode = 0;
> >     if (bwfm_fwvar_var_get_int(sc, "vhtmode", &vhtmode))
> >             vhtmode = 0;
> > -   if (bwfm_fwvar_var_get_int(sc, "scan_ver", &sc->sc_scan_ver))
> > -           sc->sc_scan_ver = 0;
> > +   if (bwfm_fwvar_var_get_data(sc, "scan_ver", &scan_ver,
> > +       sizeof(scan_ver)))
> > +           scan_ver.scan_ver_major = 0;
> > +   sc->sc_scan_ver = letoh16(scan_ver.scan_ver_major);
> 
> Perhaps check whether firmware reports a supported scan command version,
> and fail or print a warning when it doesn't?
> That might make future firmware upgrades a bit easier in case the vendor
> changes this again.

It does seem that new versions of firmware interfaces are only
introduced together with new silicon.  So I don't think that is really
necessary.  The Linux code doesn't do this.

> Either way, ok by me.

Thanks

Reply via email to