From d7b3c49cb9e1a166b75ae7328bd8d697543ef039 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Thu, 14 Nov 2024 09:39:53 +0000 Subject: use down->up hammer to handle ENETRESET in ice_ioctl; can be refined later --- sys/dev/pci/if_ice.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/if_ice.c b/sys/dev/pci/if_ice.c index 73da4071116..c7a9b530c02 100644 --- a/sys/dev/pci/if_ice.c +++ b/sys/dev/pci/if_ice.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ice.c,v 1.4 2024/11/14 09:38:51 stsp Exp $ */ +/* $OpenBSD: if_ice.c,v 1.5 2024/11/14 09:39:52 stsp Exp $ */ /* Copyright (c) 2024, Intel Corporation * All rights reserved. @@ -13345,15 +13345,6 @@ ice_down(struct ice_softc *sc) return 0; } -int -ice_iff(struct ice_softc *sc) -{ - /* Configure promiscuous mode */ - ice_if_promisc_set(sc); - - return 0; -} - int ice_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { @@ -13389,7 +13380,12 @@ ice_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } if (error == ENETRESET) { - error = ice_iff(sc); + error = 0; + if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == + (IFF_UP | IFF_RUNNING)) { + ice_down(sc); + error = ice_up(sc); + } } splx(s); -- cgit v1.2.3