Esempio n. 1
0
void iwl_trans_pcie_gen2_fw_alive(struct iwl_trans *trans, u32 scd_addr)
{
	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);

	iwl_pcie_reset_ict(trans);

	/* make sure all queue are not stopped/used */
	memset(trans_pcie->queue_stopped, 0, sizeof(trans_pcie->queue_stopped));
	memset(trans_pcie->queue_used, 0, sizeof(trans_pcie->queue_used));

	/* now that we got alive we can free the fw image & the context info.
	 * paging memory cannot be freed included since FW will still use it
	 */
	iwl_pcie_ctxt_info_free(trans);
}
Esempio n. 2
0
static int iwl_pci_resume(struct device *device)
{
	struct pci_dev *pdev = to_pci_dev(device);
	struct iwl_trans *trans = pci_get_drvdata(pdev);
	bool hw_rfkill;

	/* Before you put code here, think about WoWLAN. You cannot check here
	 * whether WoWLAN is enabled or not, and your code will run even if
	 * WoWLAN is enabled - the NIC may be alive.
	 */

	/*
	 * We disable the RETRY_TIMEOUT register (0x41) to keep
	 * PCI Tx retries from interfering with C3 CPU state.
	 */
	pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00);

	if (!trans->op_mode)
		return 0;

	/*
	 * On suspend, ict is disabled, and the interrupt mask
	 * gets cleared. Reconfigure them both in case of d0i3
	 * image. Otherwise, only enable rfkill interrupt (in
	 * order to keep track of the rfkill status)
	 */
	if (trans->wowlan_d0i3) {
		iwl_pcie_reset_ict(trans);
		iwl_enable_interrupts(trans);
	} else {
		iwl_enable_rfkill_int(trans);
	}

	hw_rfkill = iwl_is_rfkill_set(trans);
	iwl_trans_pcie_rf_kill(trans, hw_rfkill);

	return 0;
}