-/* $OpenBSD: if_ixl.c,v 1.88 2023/07/19 20:22:05 jan Exp $ */
+/* $OpenBSD: if_ixl.c,v 1.89 2023/09/29 19:44:47 bluhm Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
KERNEL_ASSERT_LOCKED();
+ mtx_enter(&sc->sc_link_state_mtx);
ifm->ifm_status = sc->sc_media_status;
ifm->ifm_active = sc->sc_media_active;
+ mtx_leave(&sc->sc_link_state_mtx);
}
static void
return;
}
- KERNEL_LOCK();
link_state = ixl_set_link_status(sc, iaq);
- KERNEL_UNLOCK();
mtx_enter(&sc->sc_link_state_mtx);
if (ifp->if_link_state != link_state) {
ifp->if_link_state = link_state;
{
const struct ixl_aq_link_status *status;
const struct ixl_phy_type *itype;
-
- KERNEL_ASSERT_LOCKED();
-
uint64_t ifm_active = IFM_ETHER;
uint64_t ifm_status = IFM_AVALID;
int link_state = LINK_STATE_DOWN;
baudrate = ixl_search_link_speed(status->link_speed);
done:
+ mtx_enter(&sc->sc_link_state_mtx);
sc->sc_media_active = ifm_active;
sc->sc_media_status = ifm_status;
sc->sc_ac.ac_if.if_baudrate = baudrate;
+ mtx_leave(&sc->sc_link_state_mtx);
return (link_state);
}