Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4fb06283 authored by Eran Harary's avatar Eran Harary Committed by Emmanuel Grumbach
Browse files

iwlwifi: 8000: fallback to default NVM file



Set a default NVM in case the userspace specifies a file
that doesn't match the hardware version. This allows not
to change the boot scripts when someone replaces the device
with a newer hardware step.

Signed-off-by: default avatarEran Harary <eran.harary@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 25870cb7
Loading
Loading
Loading
Loading
+22 −24
Original line number Original line Diff line number Diff line
@@ -6,7 +6,7 @@
 * GPL LICENSE SUMMARY
 * GPL LICENSE SUMMARY
 *
 *
 * Copyright(c) 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2014 Intel Mobile Communications GmbH
 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
 * BSD LICENSE
 * BSD LICENSE
 *
 *
 * Copyright(c) 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2014 Intel Mobile Communications GmbH
 * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
@@ -139,7 +139,9 @@ static const struct iwl_ht_params iwl8000_ht_params = {
	.dccm2_offset = IWL8260_DCCM2_OFFSET,				\
	.dccm2_offset = IWL8260_DCCM2_OFFSET,				\
	.dccm2_len = IWL8260_DCCM2_LEN,					\
	.dccm2_len = IWL8260_DCCM2_LEN,					\
	.smem_offset = IWL8260_SMEM_OFFSET,				\
	.smem_offset = IWL8260_SMEM_OFFSET,				\
	.smem_len = IWL8260_SMEM_LEN
	.smem_len = IWL8260_SMEM_LEN,					\
	.default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B,	\
	.default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C


const struct iwl_cfg iwl8260_2n_cfg = {
const struct iwl_cfg iwl8260_2n_cfg = {
	.name = "Intel(R) Dual Band Wireless N 8260",
	.name = "Intel(R) Dual Band Wireless N 8260",
@@ -177,8 +179,6 @@ const struct iwl_cfg iwl8260_2ac_sdio_cfg = {
	.ht_params = &iwl8000_ht_params,
	.ht_params = &iwl8000_ht_params,
	.nvm_ver = IWL8000_NVM_VERSION,
	.nvm_ver = IWL8000_NVM_VERSION,
	.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
	.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
	.default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B,
	.default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C,
	.max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
	.max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
	.disable_dummy_notification = true,
	.disable_dummy_notification = true,
	.max_ht_ampdu_exponent  = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
	.max_ht_ampdu_exponent  = MAX_HT_AMPDU_EXPONENT_8260_SDIO,
@@ -192,8 +192,6 @@ const struct iwl_cfg iwl4165_2ac_sdio_cfg = {
	.ht_params = &iwl8000_ht_params,
	.ht_params = &iwl8000_ht_params,
	.nvm_ver = IWL8000_NVM_VERSION,
	.nvm_ver = IWL8000_NVM_VERSION,
	.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
	.nvm_calib_ver = IWL8000_TX_POWER_VERSION,
	.default_nvm_file_B_step = DEFAULT_NVM_FILE_FAMILY_8000B,
	.default_nvm_file_C_step = DEFAULT_NVM_FILE_FAMILY_8000C,
	.max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
	.max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO,
	.bt_shared_single_ant = true,
	.bt_shared_single_ant = true,
	.disable_dummy_notification = true,
	.disable_dummy_notification = true,
+4 −4
Original line number Original line Diff line number Diff line
@@ -6,7 +6,7 @@
 * GPL LICENSE SUMMARY
 * GPL LICENSE SUMMARY
 *
 *
 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
 * BSD LICENSE
 * BSD LICENSE
 *
 *
 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
@@ -583,9 +583,9 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic)
		kfree(nvm_buffer);
		kfree(nvm_buffer);
	}
	}


	/* load external NVM if configured */
	/* Only if PNVM selected in the mod param - load external NVM  */
	if (mvm->nvm_file_name) {
	if (mvm->nvm_file_name) {
		/* read External NVM file - take the default */
		/* read External NVM file from the mod param */
		ret = iwl_mvm_read_external_nvm(mvm);
		ret = iwl_mvm_read_external_nvm(mvm);
		if (ret) {
		if (ret) {
			/* choose the nvm_file name according to the
			/* choose the nvm_file name according to the
+7 −10
Original line number Original line Diff line number Diff line
@@ -6,7 +6,7 @@
 * GPL LICENSE SUMMARY
 * GPL LICENSE SUMMARY
 *
 *
 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
 * BSD LICENSE
 * BSD LICENSE
 *
 *
 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
 * All rights reserved.
 * All rights reserved.
 *
 *
 * Redistribution and use in source and binary forms, with or without
 * Redistribution and use in source and binary forms, with or without
@@ -517,15 +517,12 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,


	min_backoff = calc_min_backoff(trans, cfg);
	min_backoff = calc_min_backoff(trans, cfg);
	iwl_mvm_tt_initialize(mvm, min_backoff);
	iwl_mvm_tt_initialize(mvm, min_backoff);
	/* set the nvm_file_name according to priority */

	if (iwlwifi_mod_params.nvm_file) {
	if (iwlwifi_mod_params.nvm_file)
		mvm->nvm_file_name = iwlwifi_mod_params.nvm_file;
		mvm->nvm_file_name = iwlwifi_mod_params.nvm_file;
	} else if (trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) {
		if (CSR_HW_REV_STEP(trans->hw_rev) == SILICON_B_STEP)
			mvm->nvm_file_name = mvm->cfg->default_nvm_file_B_step;
	else
	else
			mvm->nvm_file_name = mvm->cfg->default_nvm_file_C_step;
		IWL_DEBUG_EEPROM(mvm->trans->dev,
	}
				 "working without external nvm file\n");


	if (WARN(cfg->no_power_up_nic_in_init && !mvm->nvm_file_name,
	if (WARN(cfg->no_power_up_nic_in_init && !mvm->nvm_file_name,
		 "not allowing power-up and not having nvm_file\n"))
		 "not allowing power-up and not having nvm_file\n"))