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

Commit 83730058 authored by Haim Dreyfuss's avatar Haim Dreyfuss Committed by Luca Coelho
Browse files

iwlwifi: pcie: separate between SW and HW MSIX configuration



The MSIX configuration flow includes two different stages:
configuring the HW by writing to the IVAR table and configuring the SW
to reflect the HW configuration.
The HW configuration is needed on each HW reset,
whereas the SW configuration is only needed during the init flow.

Signed-off-by: default avatarHaim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 7ca00409
Loading
Loading
Loading
Loading
+14 −5
Original line number Original line Diff line number Diff line
@@ -1147,7 +1147,7 @@ static void iwl_pcie_map_rx_causes(struct iwl_trans *trans)
		iwl_write8(trans, CSR_MSIX_RX_IVAR(1), val);
		iwl_write8(trans, CSR_MSIX_RX_IVAR(1), val);
}
}


static void iwl_pcie_init_msix(struct iwl_trans_pcie *trans_pcie)
static void iwl_pcie_conf_msix_hw(struct iwl_trans_pcie *trans_pcie)
{
{
	struct iwl_trans *trans = trans_pcie->trans;
	struct iwl_trans *trans = trans_pcie->trans;


@@ -1170,12 +1170,20 @@ static void iwl_pcie_init_msix(struct iwl_trans_pcie *trans_pcie)
	iwl_pcie_map_rx_causes(trans);
	iwl_pcie_map_rx_causes(trans);


	iwl_pcie_map_non_rx_causes(trans);
	iwl_pcie_map_non_rx_causes(trans);
}

static void iwl_pcie_init_msix(struct iwl_trans_pcie *trans_pcie)
{
	struct iwl_trans *trans = trans_pcie->trans;

	iwl_pcie_conf_msix_hw(trans_pcie);


	trans_pcie->fh_init_mask =
	if (!trans_pcie->msix_enabled)
		~iwl_read32(trans, CSR_MSIX_FH_INT_MASK_AD);
		return;

	trans_pcie->fh_init_mask = ~iwl_read32(trans, CSR_MSIX_FH_INT_MASK_AD);
	trans_pcie->fh_mask = trans_pcie->fh_init_mask;
	trans_pcie->fh_mask = trans_pcie->fh_init_mask;
	trans_pcie->hw_init_mask =
	trans_pcie->hw_init_mask = ~iwl_read32(trans, CSR_MSIX_HW_INT_MASK_AD);
		~iwl_read32(trans, CSR_MSIX_HW_INT_MASK_AD);
	trans_pcie->hw_mask = trans_pcie->hw_init_mask;
	trans_pcie->hw_mask = trans_pcie->hw_init_mask;
}
}


@@ -1675,6 +1683,7 @@ static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power)
	iwl_pcie_apm_init(trans);
	iwl_pcie_apm_init(trans);


	iwl_pcie_init_msix(trans_pcie);
	iwl_pcie_init_msix(trans_pcie);

	/* From now on, the op_mode will be kept updated about RF kill state */
	/* From now on, the op_mode will be kept updated about RF kill state */
	iwl_enable_rfkill_int(trans);
	iwl_enable_rfkill_int(trans);