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

Commit 3485e76e authored by Luca Coelho's avatar Luca Coelho
Browse files

iwlwifi: define minimum valid address for umac_error_event_table in cfg



We now have two different minimum valid values for
umac_error_event_table.  To avoid hardcoding the minimum value in the
driver, add a value to cfg where it can be read from.

Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent fb5b2846
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -165,7 +165,8 @@ static const struct iwl_tt_params iwl8000_tt_params = {
	.thermal_params = &iwl8000_tt_params,				\
	.thermal_params = &iwl8000_tt_params,				\
	.apmg_not_supported = true,					\
	.apmg_not_supported = true,					\
	.nvm_type = IWL_NVM_EXT,					\
	.nvm_type = IWL_NVM_EXT,					\
	.dbgc_supported = true
	.dbgc_supported = true,						\
	.min_umac_error_event_table = 0x800000


#define IWL_DEVICE_8000							\
#define IWL_DEVICE_8000							\
	IWL_DEVICE_8000_COMMON,						\
	IWL_DEVICE_8000_COMMON,						\
+2 −1
Original line number Original line Diff line number Diff line
@@ -149,7 +149,8 @@ static const struct iwl_tt_params iwl9000_tt_params = {
	.mac_addr_from_csr = true,					\
	.mac_addr_from_csr = true,					\
	.rf_id = true,							\
	.rf_id = true,							\
	.nvm_type = IWL_NVM_EXT,					\
	.nvm_type = IWL_NVM_EXT,					\
	.dbgc_supported = true
	.dbgc_supported = true,						\
	.min_umac_error_event_table = 0x800000


const struct iwl_cfg iwl9160_2ac_cfg = {
const struct iwl_cfg iwl9160_2ac_cfg = {
	.name = "Intel(R) Dual Band Wireless AC 9160",
	.name = "Intel(R) Dual Band Wireless AC 9160",
+2 −1
Original line number Original line Diff line number Diff line
@@ -135,7 +135,8 @@ static const struct iwl_ht_params iwl_a000_ht_params = {
	.gen2 = true,							\
	.gen2 = true,							\
	.nvm_type = IWL_NVM_EXT,					\
	.nvm_type = IWL_NVM_EXT,					\
	.dbgc_supported = true,						\
	.dbgc_supported = true,						\
	.tx_cmd_queue_size = 32
	.tx_cmd_queue_size = 32,					\
	.min_umac_error_event_table = 0x400000


const struct iwl_cfg iwla000_2ac_cfg_hr = {
const struct iwl_cfg iwla000_2ac_cfg_hr = {
	.name = "Intel(R) Dual Band Wireless AC a000",
	.name = "Intel(R) Dual Band Wireless AC a000",
+1 −0
Original line number Original line Diff line number Diff line
@@ -396,6 +396,7 @@ struct iwl_cfg {
	u8 max_vht_ampdu_exponent;
	u8 max_vht_ampdu_exponent;
	u8 ucode_api_max;
	u8 ucode_api_max;
	u8 ucode_api_min;
	u8 ucode_api_min;
	u32 min_umac_error_event_table;
};
};


/*
/*
+11 −6
Original line number Original line Diff line number Diff line
@@ -176,6 +176,7 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
	struct iwl_lmac_alive *lmac1;
	struct iwl_lmac_alive *lmac1;
	struct iwl_lmac_alive *lmac2 = NULL;
	struct iwl_lmac_alive *lmac2 = NULL;
	u16 status;
	u16 status;
	u32 umac_error_event_table;


	if (iwl_rx_packet_payload_len(pkt) == sizeof(*palive)) {
	if (iwl_rx_packet_payload_len(pkt) == sizeof(*palive)) {
		palive = (void *)pkt->data;
		palive = (void *)pkt->data;
@@ -198,18 +199,22 @@ static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
	mvm->sf_space.addr = le32_to_cpu(lmac1->st_fwrd_addr);
	mvm->sf_space.addr = le32_to_cpu(lmac1->st_fwrd_addr);
	mvm->sf_space.size = le32_to_cpu(lmac1->st_fwrd_size);
	mvm->sf_space.size = le32_to_cpu(lmac1->st_fwrd_size);


	mvm->umac_error_event_table = le32_to_cpu(umac->error_info_addr);
	umac_error_event_table = le32_to_cpu(umac->error_info_addr);


	if (mvm->umac_error_event_table <
	if (!umac_error_event_table) {
	    (mvm->trans->cfg->device_family == IWL_DEVICE_FAMILY_A000 ?
		mvm->support_umac_log = false;
	     0x400000 : 0x800000))
	} else if (umac_error_event_table >=
		   mvm->trans->cfg->min_umac_error_event_table) {
		mvm->support_umac_log = true;
		mvm->umac_error_event_table = umac_error_event_table;
	} else {
		IWL_ERR(mvm,
		IWL_ERR(mvm,
			"Not valid error log pointer 0x%08X for %s uCode\n",
			"Not valid error log pointer 0x%08X for %s uCode\n",
			mvm->umac_error_event_table,
			mvm->umac_error_event_table,
			(mvm->fwrt.cur_fw_img == IWL_UCODE_INIT) ?
			(mvm->fwrt.cur_fw_img == IWL_UCODE_INIT) ?
			"Init" : "RT");
			"Init" : "RT");
	else
		mvm->support_umac_log = false;
		mvm->support_umac_log = true;
	}


	alive_data->scd_base_addr = le32_to_cpu(lmac1->scd_base_ptr);
	alive_data->scd_base_addr = le32_to_cpu(lmac1->scd_base_ptr);
	alive_data->valid = status == IWL_ALIVE_STATUS_OK;
	alive_data->valid = status == IWL_ALIVE_STATUS_OK;