From 6939bfb23307b049666dc01561473797bc621408 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Tue, 20 Jun 2017 13:52:41 +0000 Subject: Remove the IWM_FLAG_HW_INITED flag from iwm(4). This flag was redundant. The IFF_RUNNING flag in struct ifnet serves the same purpose. ok mpi@ kettenis@ deraadt@ --- sys/dev/pci/if_iwm.c | 10 ++-------- sys/dev/pci/if_iwmvar.h | 7 +++---- 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index d25dbc9695b..23a19cf5e37 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.197 2017/06/16 08:45:34 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.198 2017/06/20 13:52:40 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -6106,9 +6106,6 @@ iwm_init(struct ifnet *ifp) struct ieee80211com *ic = &sc->sc_ic; int err, generation; - if (sc->sc_flags & IWM_FLAG_HW_INITED) { - return 0; - } sc->sc_generation++; err = iwm_init_hw(sc); @@ -6135,8 +6132,6 @@ iwm_init(struct ifnet *ifp) return err; } while (ic->ic_state != IEEE80211_S_SCAN); - sc->sc_flags |= IWM_FLAG_HW_INITED; - return 0; } @@ -6214,7 +6209,6 @@ iwm_stop(struct ifnet *ifp, int disable) struct ieee80211com *ic = &sc->sc_ic; struct iwm_node *in = (void *)ic->ic_bss; - sc->sc_flags &= ~IWM_FLAG_HW_INITED; sc->sc_generation++; ic->ic_scan_lock = IEEE80211_SCAN_UNLOCKED; ifp->if_flags &= ~IFF_RUNNING; @@ -7450,7 +7444,7 @@ iwm_init_task(void *arg1) } s = splnet(); - if (sc->sc_flags & IWM_FLAG_HW_INITED) + if (ifp->if_flags & IFF_RUNNING) iwm_stop(ifp, 0); if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == IFF_UP) iwm_init(ifp); diff --git a/sys/dev/pci/if_iwmvar.h b/sys/dev/pci/if_iwmvar.h index 23f27c91019..69f3331e393 100644 --- a/sys/dev/pci/if_iwmvar.h +++ b/sys/dev/pci/if_iwmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwmvar.h,v 1.28 2017/06/14 16:56:04 stsp Exp $ */ +/* $OpenBSD: if_iwmvar.h,v 1.29 2017/06/20 13:52:40 stsp Exp $ */ /* * Copyright (c) 2014 genua mbh @@ -280,9 +280,8 @@ struct iwm_rx_ring { }; #define IWM_FLAG_USE_ICT 0x01 -#define IWM_FLAG_HW_INITED 0x02 -#define IWM_FLAG_RFKILL 0x04 -#define IWM_FLAG_SCANNING 0x08 +#define IWM_FLAG_RFKILL 0x02 +#define IWM_FLAG_SCANNING 0x04 struct iwm_ucode_status { uint32_t uc_error_event_table; -- cgit v1.2.3