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 <waddlesplash@gmail.com> (Haiku)
Obtained from:	DragonFlyBSD (e8560f8dc58df12a7c79a6bb4e6ccb156e001085)
This commit is contained in:
Kyle Evans 2019-01-24 03:41:44 +00:00
parent 95d69da4e0
commit aa0972c6ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343374

View File

@ -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.