-/* $OpenBSD: if_iwx.c,v 1.90 2021/08/13 13:13:11 stsp Exp $ */
+/* $OpenBSD: if_iwx.c,v 1.91 2021/08/16 14:54:50 kevlo Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
return;
}
- if (iwx_prepare_card_hw(sc) != 0) {
- printf("%s: could not initialize hardware\n",
- DEVNAME(sc));
- return;
- }
-
- /*
- * In order to recognize C step the driver should read the
- * chip version id located at the AUX bus MISC address.
- */
- IWX_SETBITS(sc, IWX_CSR_GP_CNTRL,
- IWX_CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
- DELAY(2);
-
- err = iwx_poll_bit(sc, IWX_CSR_GP_CNTRL,
- IWX_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
- IWX_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
- 25000);
- if (!err) {
- printf("%s: Failed to wake up the nic\n", DEVNAME(sc));
- return;
- }
-
- if (iwx_nic_lock(sc)) {
- uint32_t hw_step = iwx_read_prph(sc, IWX_WFPM_CTRL_REG);
- hw_step |= IWX_ENABLE_WFPM;
- iwx_write_prph(sc, IWX_WFPM_CTRL_REG, hw_step);
- hw_step = iwx_read_prph(sc, IWX_AUX_MISC_REG);
- hw_step = (hw_step >> IWX_HW_STEP_LOCATION_BITS) & 0xF;
- if (hw_step == 0x3)
- sc->sc_hw_rev = (sc->sc_hw_rev & 0xFFFFFFF3) |
- (IWX_SILICON_C_STEP << 2);
- iwx_nic_unlock(sc);
- } else {
- printf("%s: Failed to lock the nic\n", DEVNAME(sc));
- return;
- }
-
/* Allocate DMA memory for loading firmware. */
err = iwx_dma_contig_alloc(sc->sc_dmat, &sc->ctxt_info_dma,
sizeof(struct iwx_context_info), 0);
-/* $OpenBSD: if_iwxreg.h,v 1.29 2021/07/29 12:01:45 stsp Exp $ */
+/* $OpenBSD: if_iwxreg.h,v 1.30 2021/08/16 14:54:50 kevlo Exp $ */
/*-
* Based on BSD-licensed source modules in the Linux iwlwifi driver,
#define IWX_WFPM_AUX_CTL_AUX_IF_MAC_OWNER_MSK 0x08000000
#define IWX_ENABLE_WFPM 0x80000000
-#define IWX_AUX_MISC_REG 0xa200b0
-#define IWX_HW_STEP_LOCATION_BITS 24
-
#define IWX_AUX_MISC_MASTER1_EN 0xa20818
#define IWX_AUX_MISC_MASTER1_EN_SBE_MSK 0x1
#define IWX_AUX_MISC_MASTER1_SMPHR_STATUS 0xa20800