-/* $OpenBSD: if_iwx.c,v 1.112 2021/09/30 09:27:47 stsp Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.113 2021/10/02 07:39:52 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
generation = ++sc->sc_generation;
- KASSERT(sc->task_refs.refs == 0);
- refcnt_init(&sc->task_refs);
-
err = iwx_preinit(sc);
if (err)
return err;
err = iwx_init_hw(sc);
if (err) {
if (generation == sc->sc_generation)
- iwx_stop(ifp);
+ iwx_stop_device(sc);
return err;
}
if (sc->sc_nvm.sku_cap_11n_enable)
iwx_setup_ht_rates(sc);
+ KASSERT(sc->task_refs.refs == 0);
+ refcnt_init(&sc->task_refs);
ifq_clr_oactive(&ifp->if_snd);
ifp->if_flags |= IFF_RUNNING;
struct ifnet *ifp = &sc->sc_ic.ic_if;
int err;
- refcnt_init(&sc->task_refs);
-
err = iwx_start_hw(sc);
if (err)
return err;
if (err)
return err;
+ refcnt_init(&sc->task_refs);
ifq_clr_oactive(&ifp->if_snd);
ifp->if_flags |= IFF_RUNNING;