From 22ef3ec934cc3e6ba0dfb24ba632c359da1c706f Mon Sep 17 00:00:00 2001 From: kevans Date: Thu, 24 Jan 2019 03:41:44 +0000 Subject: [PATCH] if_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on 8K hw. * Doing the iwm_prepare_card_hw() call in iwm_attach() only on Family 8000 hardware matches the code in Linux iwlwifi. * While there remove DEFAULT_MAX_TX_POWER definition which is unused, and has a value different from IWL_DEFAULT_MAX_TX_POWER in iwlwifi. Submitted by: Augustin Cavalier (Haiku) Obtained from: DragonFlyBSD (e8560f8dc58df12a7c79a6bb4e6ccb156e001085) --- sys/dev/iwm/if_iwm.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index f2769c26371a..bec08779a4a6 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -1912,8 +1912,6 @@ enum nvm_sku_bits { #define IWM_NVM_RF_CFG_TX_ANT_MSK_8000(x) ((x >> 24) & 0xF) #define IWM_NVM_RF_CFG_RX_ANT_MSK_8000(x) ((x >> 28) & 0xF) -#define DEFAULT_MAX_TX_POWER 16 - /** * enum iwm_nvm_channel_flags - channel flags in NVM * @IWM_NVM_CHANNEL_VALID: channel is usable for this SKU/geo @@ -5863,19 +5861,18 @@ iwm_attach(device_t dev) * "dash" value). To keep hw_rev backwards compatible - we'll store it * in the old format. */ - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) - sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) | - (IWM_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2); - - if (iwm_prepare_card_hw(sc) != 0) { - device_printf(dev, "could not initialize hardware\n"); - goto fail; - } - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { int ret; uint32_t hw_step; + sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) | + (IWM_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2); + + if (iwm_prepare_card_hw(sc) != 0) { + device_printf(dev, "could not initialize hardware\n"); + goto fail; + } + /* * In order to recognize C step the driver should read the * chip version id located at the AUX bus MISC address.