Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jan 2019 03:41:44 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343374 - head/sys/dev/iwm
Message-ID:  <201901240341.x0O3fiVl022176@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu Jan 24 03:41:44 2019
New Revision: 343374
URL: https://svnweb.freebsd.org/changeset/base/343374

Log:
  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)

Modified:
  head/sys/dev/iwm/if_iwm.c

Modified: head/sys/dev/iwm/if_iwm.c
==============================================================================
--- head/sys/dev/iwm/if_iwm.c	Thu Jan 24 03:41:09 2019	(r343373)
+++ head/sys/dev/iwm/if_iwm.c	Thu Jan 24 03:41:44 2019	(r343374)
@@ -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,18 +5861,17 @@ 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901240341.x0O3fiVl022176>