diff options
author | 2019-07-25 01:46:14 +0000 | |
---|---|---|
committer | 2019-07-25 01:46:14 +0000 | |
commit | 1df5edf44bc647e7013040417985fd5970eb21c3 (patch) | |
tree | e608123591f4a98f417975c5a9bfb4a30f5412d8 /sys/dev/pci | |
parent | vinvalbuf(9): tlseep -> tsleep_nsec(9); ok millert@ (diff) | |
download | wireguard-openbsd-1df5edf44bc647e7013040417985fd5970eb21c3.tar.xz wireguard-openbsd-1df5edf44bc647e7013040417985fd5970eb21c3.zip |
ipw, iwi, iwm, iwn, wpi(4): tsleep -> tsleep_nsec(9); ok stsp@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_ipw.c | 8 | ||||
-rw-r--r-- | sys/dev/pci/if_iwi.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_iwm.c | 16 | ||||
-rw-r--r-- | sys/dev/pci/if_iwn.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_wpi.c | 8 |
5 files changed, 26 insertions, 24 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 9897738a8a8..cd0d354d12f 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.122 2018/04/26 12:50:07 pirofti Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.123 2019/07/25 01:46:14 cheloha Exp $ */ /*- * Copyright (c) 2004-2008 @@ -1113,7 +1113,7 @@ ipw_cmd(struct ipw_softc *sc, uint32_t type, void *data, uint32_t len) DPRINTFN(2, ("sending command type=%u,len=%u\n", type, len)); /* wait at most one second for command to complete */ - error = tsleep(&sc->cmd, 0, "ipwcmd", hz); + error = tsleep_nsec(&sc->cmd, 0, "ipwcmd", SEC_TO_NSEC(1)); splx(s); return error; @@ -1577,7 +1577,7 @@ ipw_load_firmware(struct ipw_softc *sc, u_char *fw, int size) CSR_WRITE_4(sc, IPW_CSR_CTL, tmp | IPW_CTL_ALLOW_STANDBY); /* wait at most one second for firmware initialization to complete */ - if ((error = tsleep(sc, 0, "ipwinit", hz)) != 0) { + if ((error = tsleep_nsec(sc, 0, "ipwinit", SEC_TO_NSEC(1))) != 0) { printf("%s: timeout waiting for firmware initialization to " "complete\n", sc->sc_dev.dv_xname); return error; @@ -1704,7 +1704,7 @@ ipw_auth_and_assoc(void *arg1) #if 1 /* wait at most one second for card to be disabled */ s = splnet(); - error = tsleep(sc, 0, "ipwdis", hz); + error = tsleep_nsec(sc, 0, "ipwdis", SEC_TO_NSEC(1)); splx(s); if (error != 0) { printf("%s: timeout waiting for disabled state\n", diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 92dbe404acf..bdb48274251 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.139 2019/04/25 01:52:13 kevlo Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.140 2019/07/25 01:46:14 cheloha Exp $ */ /*- * Copyright (c) 2004-2008 @@ -1228,7 +1228,7 @@ iwi_cmd(struct iwi_softc *sc, uint8_t type, void *data, uint8_t len, int async) CSR_WRITE_4(sc, IWI_CSR_CMD_WIDX, sc->cmdq.next); } - return async ? 0 : tsleep(sc, PCATCH, "iwicmd", hz); + return async ? 0 : tsleep_nsec(sc, PCATCH, "iwicmd", SEC_TO_NSEC(1)); } /* ARGSUSED */ @@ -1748,7 +1748,7 @@ iwi_load_firmware(struct iwi_softc *sc, const char *data, int size) CSR_WRITE_4(sc, IWI_CSR_CTL, tmp | IWI_CTL_ALLOW_STANDBY); /* wait at most one second for firmware initialization to complete */ - if ((error = tsleep(sc, PCATCH, "iwiinit", hz)) != 0) { + if ((error = tsleep_nsec(sc, PCATCH, "iwiinit", SEC_TO_NSEC(1))) != 0) { printf("%s: timeout waiting for firmware initialization to " "complete\n", sc->sc_dev.dv_xname); goto fail5; diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index ab46b036dfb..7add1e9e682 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.242 2019/06/26 21:01:20 kn Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.243 2019/07/25 01:46:14 cheloha Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -594,7 +594,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) return 0; while (fw->fw_status == IWM_FW_STATUS_INPROGRESS) - tsleep(&sc->sc_fw, 0, "iwmfwp", 0); + tsleep_nsec(&sc->sc_fw, 0, "iwmfwp", INFSLP); fw->fw_status = IWM_FW_STATUS_INPROGRESS; if (fw->fw_rawdata != NULL) @@ -2970,7 +2970,7 @@ iwm_firmware_load_chunk(struct iwm_softc *sc, uint32_t dst_addr, /* Wait for this segment to load. */ err = 0; while (!sc->sc_fw_chunk_done) { - err = tsleep(&sc->sc_fw, 0, "iwmfw", hz); + err = tsleep_nsec(&sc->sc_fw, 0, "iwmfw", SEC_TO_NSEC(1)); if (err) break; } @@ -3139,7 +3139,7 @@ iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) /* wait for the firmware to load */ for (w = 0; !sc->sc_uc.uc_intr && w < 10; w++) { - err = tsleep(&sc->sc_uc, 0, "iwmuc", hz/10); + err = tsleep_nsec(&sc->sc_uc, 0, "iwmuc", MSEC_TO_NSEC(100)); } if (err || !sc->sc_uc.uc_ok) printf("%s: could not load firmware\n", DEVNAME(sc)); @@ -3284,7 +3284,8 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justnvm) * notifications from the firmware. */ while ((sc->sc_init_complete & wait_flags) != wait_flags) { - err = tsleep(&sc->sc_init_complete, 0, "iwminit", 2*hz); + err = tsleep_nsec(&sc->sc_init_complete, 0, "iwminit", + SEC_TO_NSEC(2)); if (err) break; } @@ -3981,7 +3982,7 @@ iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd *hcmd) IWM_WRITE(sc, IWM_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); if (!async) { - err = tsleep(desc, PCATCH, "iwmcmd", hz); + err = tsleep_nsec(desc, PCATCH, "iwmcmd", SEC_TO_NSEC(1)); if (err == 0) { /* if hardware is no longer up, return error */ if (generation != sc->sc_generation) { @@ -6524,7 +6525,8 @@ iwm_init(struct ifnet *ifp) * Wait until the transition to SCAN state has completed. */ do { - err = tsleep(&ic->ic_state, PCATCH, "iwminit", hz); + err = tsleep_nsec(&ic->ic_state, PCATCH, "iwminit", + SEC_TO_NSEC(1)); if (generation != sc->sc_generation) return ENXIO; if (err) diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index e6818d039cd..520d6ce8425 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.210 2019/04/29 09:00:16 stsp Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.211 2019/07/25 01:46:15 cheloha Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -3470,7 +3470,7 @@ iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); - return async ? 0 : tsleep(desc, PCATCH, "iwncmd", hz); + return async ? 0 : tsleep_nsec(desc, PCATCH, "iwncmd", SEC_TO_NSEC(1)); } int @@ -5542,7 +5542,7 @@ iwn5000_query_calibration(struct iwn_softc *sc) /* Wait at most two seconds for calibration to complete. */ if (!(sc->sc_flags & IWN_FLAG_CALIB_DONE)) - error = tsleep(sc, PCATCH, "iwncal", 2 * hz); + error = tsleep_nsec(sc, PCATCH, "iwncal", SEC_TO_NSEC(2)); return error; } @@ -5879,7 +5879,7 @@ iwn4965_load_firmware(struct iwn_softc *sc) IWN_WRITE(sc, IWN_RESET, 0); /* Wait at most one second for first alive notification. */ - if ((error = tsleep(sc, PCATCH, "iwninit", hz)) != 0) { + if ((error = tsleep_nsec(sc, PCATCH, "iwninit", SEC_TO_NSEC(1))) != 0) { printf("%s: timeout waiting for adapter to initialize\n", sc->sc_dev.dv_xname); return error; @@ -5946,7 +5946,7 @@ iwn5000_load_firmware_section(struct iwn_softc *sc, uint32_t dst, iwn_nic_unlock(sc); /* Wait at most five seconds for FH DMA transfer to complete. */ - return tsleep(sc, PCATCH, "iwninit", 5 * hz); + return tsleep_nsec(sc, PCATCH, "iwninit", SEC_TO_NSEC(5)); } int @@ -6508,7 +6508,7 @@ iwn_hw_init(struct iwn_softc *sc) return error; } /* Wait at most one second for firmware alive notification. */ - if ((error = tsleep(sc, PCATCH, "iwninit", hz)) != 0) { + if ((error = tsleep_nsec(sc, PCATCH, "iwninit", SEC_TO_NSEC(1))) != 0) { printf("%s: timeout waiting for adapter to initialize\n", sc->sc_dev.dv_xname); return error; diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index c959a156526..b67bcfd77b1 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.144 2018/04/28 16:05:56 phessler Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.145 2019/07/25 01:46:15 cheloha Exp $ */ /*- * Copyright (c) 2006-2008 @@ -2100,7 +2100,7 @@ wpi_cmd(struct wpi_softc *sc, int code, const void *buf, int size, int async) ring->cur = (ring->cur + 1) % WPI_TX_RING_COUNT; WPI_WRITE(sc, WPI_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); - return async ? 0 : tsleep(cmd, PCATCH, "wpicmd", hz); + return async ? 0 : tsleep_nsec(cmd, PCATCH, "wpicmd", SEC_TO_NSEC(1)); } /* @@ -2917,7 +2917,7 @@ wpi_load_firmware(struct wpi_softc *sc) WPI_WRITE(sc, WPI_RESET, 0); /* Wait at most one second for first alive notification. */ - if ((error = tsleep(sc, PCATCH, "wpiinit", hz)) != 0) { + if ((error = tsleep_nsec(sc, PCATCH, "wpiinit", SEC_TO_NSEC(1))) != 0) { printf("%s: timeout waiting for adapter to initialize\n", sc->sc_dev.dv_xname); return error; @@ -3199,7 +3199,7 @@ wpi_hw_init(struct wpi_softc *sc) return error; } /* Wait at most one second for firmware alive notification. */ - if ((error = tsleep(sc, PCATCH, "wpiinit", hz)) != 0) { + if ((error = tsleep_nsec(sc, PCATCH, "wpiinit", SEC_TO_NSEC(1))) != 0) { printf("%s: timeout waiting for adapter to initialize\n", sc->sc_dev.dv_xname); return error; |