-/* $OpenBSD: if_iwm.c,v 1.395 2022/03/19 10:26:52 stsp Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.396 2022/03/19 14:50:01 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = IC2IFP(ic);
int err;
- static int attached;
err = iwm_prepare_card_hw(sc);
if (err) {
return err;
}
- if (attached) {
+ if (sc->attached) {
/* Update MAC in case the upper layers changed it. */
IEEE80211_ADDR_COPY(sc->sc_ic.ic_myaddr,
((struct arpcom *)ifp)->ac_enaddr);
return err;
/* Print version info and MAC address on first successful fw load. */
- attached = 1;
+ sc->attached = 1;
printf("%s: hw rev 0x%x, fw ver %s, address %s\n",
DEVNAME(sc), sc->sc_hw_rev & IWM_CSR_HW_REV_TYPE_MSK,
sc->sc_fwver, ether_sprintf(sc->sc_nvm.hw_addr));
-/* $OpenBSD: if_iwmvar.h,v 1.76 2022/03/19 10:26:52 stsp Exp $ */
+/* $OpenBSD: if_iwmvar.h,v 1.77 2022/03/19 14:50:01 stsp Exp $ */
/*
* Copyright (c) 2014 genua mbh <info@genua.de>
struct ieee80211com sc_ic;
int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int);
int sc_newstate_pending;
+ int attached;
struct ieee80211_amrr sc_amrr;
struct timeout sc_calib_to;
-/* $OpenBSD: if_iwx.c,v 1.137 2022/03/14 15:08:50 stsp Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.138 2022/03/19 14:50:01 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
struct ieee80211com *ic = &sc->sc_ic;
struct ifnet *ifp = IC2IFP(ic);
int err;
- static int attached;
err = iwx_prepare_card_hw(sc);
if (err) {
return err;
}
- if (attached) {
+ if (sc->attached) {
/* Update MAC in case the upper layers changed it. */
IEEE80211_ADDR_COPY(sc->sc_ic.ic_myaddr,
((struct arpcom *)ifp)->ac_enaddr);
return err;
/* Print version info and MAC address on first successful fw load. */
- attached = 1;
+ sc->attached = 1;
printf("%s: hw rev 0x%x, fw ver %s, address %s\n",
DEVNAME(sc), sc->sc_hw_rev & IWX_CSR_HW_REV_TYPE_MSK,
sc->sc_fwver, ether_sprintf(sc->sc_nvm.hw_addr));
-/* $OpenBSD: if_iwxvar.h,v 1.30 2022/03/14 15:08:50 stsp Exp $ */
+/* $OpenBSD: if_iwxvar.h,v 1.31 2022/03/19 14:50:01 stsp Exp $ */
/*
* Copyright (c) 2014 genua mbh <info@genua.de>
struct ieee80211com sc_ic;
int (*sc_newstate)(struct ieee80211com *, enum ieee80211_state, int);
int sc_newstate_pending;
+ int attached;
struct task init_task; /* NB: not reference-counted */
struct refcnt task_refs;