On Sun, Feb 18, 2024 at 11:21:15AM -1000, Todd Carson wrote:
>
> Thanks for the pointers; updated diff below to set the MAC in
> bwfm_init() if preinit has already run.
>
> Works on boot with "lladdr random" as the first line in hostname.bwfm0,
> and also changing the lladdr after boot with ifconfig.
>
Committed, thank you Todd.
> diff /usr/src
> commit - 6c24eb55e021991196003dc7f0a643e806b14295
> path + /usr/src
> blob - dfa7a1973d2ab6be7e4b2fbd869b38c441d4eae0
> file + sys/dev/ic/bwfm.c
> --- sys/dev/ic/bwfm.c
> +++ sys/dev/ic/bwfm.c
> @@ -451,6 +451,16 @@ bwfm_init(struct ifnet *ifp)
> return;
> }
> sc->sc_initialized = 1;
> + } else {
> + /* Update MAC in case the upper layers changed it. */
> + IEEE80211_ADDR_COPY(ic->ic_myaddr,
> + ((struct arpcom *)ifp)->ac_enaddr);
> + if (bwfm_fwvar_var_set_data(sc, "cur_etheraddr",
> + ic->ic_myaddr, sizeof(ic->ic_myaddr))) {
> + printf("%s: could not write MAC address\n",
> + DEVNAME(sc));
> + return;
> + }
> }
>
> /* Select default channel */
>