-/* $OpenBSD: if_ix.c,v 1.186 2022/06/27 15:11:23 jan Exp $ */
+/* $OpenBSD: if_ix.c,v 1.187 2022/08/05 13:57:16 bluhm Exp $ */
/******************************************************************************
struct ifnet *ifp = &sc->arpcom.ac_if;
int link_state = LINK_STATE_DOWN;
+ splassert(IPL_NET);
+ KERNEL_ASSERT_LOCKED();
+
ixgbe_check_link(&sc->hw, &sc->link_speed, &sc->link_up, 0);
ifp->if_baudrate = 0;
-/* $OpenBSD: if_ixl.c,v 1.83 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_ixl.c,v 1.84 2022/08/05 13:57:16 bluhm Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
{
struct ixl_softc *sc = ifp->if_softc;
- NET_ASSERT_LOCKED();
+ KERNEL_ASSERT_LOCKED();
ifm->ifm_status = sc->sc_media_status;
ifm->ifm_active = sc->sc_media_active;
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:
- /* NET_ASSERT_LOCKED() except during attach */
sc->sc_media_active = ifm_active;
sc->sc_media_status = ifm_status;
sc->sc_ac.ac_if.if_baudrate = baudrate;
-/* $OpenBSD: if.c,v 1.660 2022/07/29 08:23:40 visa Exp $ */
+/* $OpenBSD: if.c,v 1.661 2022/08/05 13:57:16 bluhm Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
error = ((*ifp->if_ioctl)(ifp, cmd, data));
break;
+ case SIOCSIFMEDIA:
+ if ((error = suser(p)) != 0)
+ break;
+ /* FALLTHROUGH */
+ case SIOCGIFMEDIA:
+ /* net lock is not needed */
+ error = ((*ifp->if_ioctl)(ifp, cmd, data));
+ break;
+
case SIOCSETKALIVE:
case SIOCDIFPHYADDR:
case SIOCSLIFPHYADDR:
case SIOCSLIFPHYECN:
case SIOCADDMULTI:
case SIOCDELMULTI:
- case SIOCSIFMEDIA:
case SIOCSVNETID:
case SIOCDVNETID:
case SIOCSVNETFLOWID:
-/* $OpenBSD: if_media.c,v 1.36 2022/07/14 13:46:25 bluhm Exp $ */
+/* $OpenBSD: if_media.c,v 1.37 2022/08/05 13:57:16 bluhm Exp $ */
/* $NetBSD: if_media.c,v 1.10 2000/03/13 23:52:39 soren Exp $ */
/*-
/*
* Get list of available media and current media on interface.
*/
- case SIOCGIFMEDIA:
+ case SIOCGIFMEDIA:
{
struct ifmediareq *ifmr = (struct ifmediareq *) ifr;
size_t nwords;