diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 9237309d3f3e..627fdaa1fab8 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -2589,8 +2589,6 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, *first_ucode_section = last_read_idx; - iwm_enable_interrupts(sc); - if (iwm_nic_lock(sc)) { if (cpu == 1) IWM_WRITE(sc, IWM_FH_UCODE_LOAD_STATUS, 0xFFFF); @@ -2762,6 +2760,7 @@ iwm_start_fw(struct iwm_softc *sc, const struct iwm_fw_img *fw) * RF-Kill switch is toggled, we will find out after having loaded * the firmware and return the proper value to the caller. */ + IWM_WRITE(sc, IWM_CSR_INT, 0xFFFFFFFF); iwm_enable_fw_load_int(sc); /* really make sure rfkill handshake bits are cleared */ @@ -2775,6 +2774,9 @@ iwm_start_fw(struct iwm_softc *sc, const struct iwm_fw_img *fw) else ret = iwm_pcie_load_given_ucode(sc, fw); + if (ret == 0) + iwm_enable_interrupts(sc); + /* XXX re-check RF-Kill state */ out: @@ -3032,11 +3034,19 @@ iwm_run_init_ucode(struct iwm_softc *sc, int justnvm) goto error; } + ret = iwm_sf_update(sc, NULL, TRUE); + if (ret) { + device_printf(sc->sc_dev, + "failed to update smart fifo state: %d\n", ret); + goto error; + } + /* Send TX valid antennas before triggering calibrations */ - ret = iwm_send_tx_ant_cfg(sc, iwm_get_valid_tx_ant(sc)); + uint8_t ant = iwm_get_valid_tx_ant(sc); + ret = iwm_send_tx_ant_cfg(sc, ant); if (ret) { device_printf(sc->sc_dev, - "failed to send antennas before calibration: %d\n", ret); + "failed to send antennas (%u) before calibration: %d\n", ant, ret); goto error; }