From 99734c2b9bcfaa2c6c79dbe1b3508243814e6fcf Mon Sep 17 00:00:00 2001 From: kn Date: Mon, 1 Apr 2019 10:31:47 +0000 Subject: Fix interrupt handler to set RUNNING flag when RF switch is enabled With an UP and RUNNING interface, turning off the hardware kill switch removes the RUNNING flag and powers down the device. Iff still UP, switching it back would not reset the flag accordingly. Fix this in analogy to sys/dev/pci/if_iwn.c revision 1.204 by scheduling iwm_init() unconditionally on both hardware kill switch edges; it'll take care of everything else. Tested with iwm0 at pci2 dev 0 function 0 "Intel Dual Band Wireless AC 7260" rev 0xbb, msi iwm0: hw rev 0x140, fw ver 16.242414.0 OK deraadt stsp --- sys/dev/pci/if_iwm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'sys/dev/pci') diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index a11b6ca5230..0b3998abe7d 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.237 2019/02/27 07:47:57 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.238 2019/04/01 10:31:46 kn Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -7339,11 +7339,10 @@ iwm_intr(void *arg) if (r1 & IWM_CSR_INT_BIT_RF_KILL) { handled |= IWM_CSR_INT_BIT_RF_KILL; - if (iwm_check_rfkill(sc)) { - task_add(systq, &sc->init_task); - rv = 1; - goto out; - } + iwm_check_rfkill(sc); + task_add(systq, &sc->init_task); + rv = 1; + goto out_ena; } if (r1 & IWM_CSR_INT_BIT_SW_ERR) { -- cgit v1.2.3