Skip to content

Commit

Permalink
if_iwm - The iwm_prepare_card_hw() in iwm_attach() is only needed on …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
ivadasz committed Nov 6, 2016
1 parent ca21082 commit e8560f8
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions sys/dev/netif/iwm/if_iwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1962,8 +1962,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
Expand Down Expand Up @@ -5923,19 +5921,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.
Expand Down

0 comments on commit e8560f8

Please sign in to comment.