|
@@ -150,7 +150,6 @@ static void iwl_pcie_apm_config(struct iwl_trans *trans)
|
|
|
*/
|
|
|
static int iwl_pcie_apm_init(struct iwl_trans *trans)
|
|
|
{
|
|
|
- struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
|
|
|
int ret = 0;
|
|
|
IWL_DEBUG_INFO(trans, "Init card's basic functions\n");
|
|
|
|
|
@@ -223,7 +222,7 @@ static int iwl_pcie_apm_init(struct iwl_trans *trans)
|
|
|
/* Clear the interrupt in APMG if the NIC is in RFKILL */
|
|
|
iwl_write_prph(trans, APMG_RTC_INT_STT_REG, APMG_RTC_INT_STT_RFKILL);
|
|
|
|
|
|
- set_bit(STATUS_DEVICE_ENABLED, &trans_pcie->status);
|
|
|
+ set_bit(STATUS_DEVICE_ENABLED, &trans->status);
|
|
|
|
|
|
out:
|
|
|
return ret;
|
|
@@ -249,10 +248,9 @@ static int iwl_pcie_apm_stop_master(struct iwl_trans *trans)
|
|
|
|
|
|
static void iwl_pcie_apm_stop(struct iwl_trans *trans)
|
|
|
{
|
|
|
- struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
|
|
|
IWL_DEBUG_INFO(trans, "Stop card, put in low power state\n");
|
|
|
|
|
|
- clear_bit(STATUS_DEVICE_ENABLED, &trans_pcie->status);
|
|
|
+ clear_bit(STATUS_DEVICE_ENABLED, &trans->status);
|
|
|
|
|
|
/* Stop device's DMA activity */
|
|
|
iwl_pcie_apm_stop_master(trans);
|
|
@@ -582,7 +580,6 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans,
|
|
|
static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
|
|
|
const struct fw_img *fw, bool run_in_rfkill)
|
|
|
{
|
|
|
- struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
|
|
|
int ret;
|
|
|
bool hw_rfkill;
|
|
|
|
|
@@ -592,16 +589,16 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
|
|
|
return -EIO;
|
|
|
}
|
|
|
|
|
|
- clear_bit(STATUS_FW_ERROR, &trans_pcie->status);
|
|
|
+ clear_bit(STATUS_FW_ERROR, &trans->status);
|
|
|
|
|
|
iwl_enable_rfkill_int(trans);
|
|
|
|
|
|
/* If platform's RF_KILL switch is NOT set to KILL */
|
|
|
hw_rfkill = iwl_is_rfkill_set(trans);
|
|
|
if (hw_rfkill)
|
|
|
- set_bit(STATUS_RFKILL, &trans_pcie->status);
|
|
|
+ set_bit(STATUS_RFKILL, &trans->status);
|
|
|
else
|
|
|
- clear_bit(STATUS_RFKILL, &trans_pcie->status);
|
|
|
+ clear_bit(STATUS_RFKILL, &trans->status);
|
|
|
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
|
|
|
if (hw_rfkill && !run_in_rfkill)
|
|
|
return -ERFKILL;
|
|
@@ -658,7 +655,7 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
|
|
|
* restart. So don't process again if the device is
|
|
|
* already dead.
|
|
|
*/
|
|
|
- if (test_bit(STATUS_DEVICE_ENABLED, &trans_pcie->status)) {
|
|
|
+ if (test_bit(STATUS_DEVICE_ENABLED, &trans->status)) {
|
|
|
iwl_pcie_tx_stop(trans);
|
|
|
iwl_pcie_rx_stop(trans);
|
|
|
|
|
@@ -686,11 +683,11 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
|
|
|
iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
|
|
|
|
|
|
/* clear all status bits */
|
|
|
- clear_bit(STATUS_HCMD_ACTIVE, &trans_pcie->status);
|
|
|
- clear_bit(STATUS_INT_ENABLED, &trans_pcie->status);
|
|
|
- clear_bit(STATUS_DEVICE_ENABLED, &trans_pcie->status);
|
|
|
- clear_bit(STATUS_TPOWER_PMI, &trans_pcie->status);
|
|
|
- clear_bit(STATUS_RFKILL, &trans_pcie->status);
|
|
|
+ clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status);
|
|
|
+ clear_bit(STATUS_INT_ENABLED, &trans->status);
|
|
|
+ clear_bit(STATUS_DEVICE_ENABLED, &trans->status);
|
|
|
+ clear_bit(STATUS_TPOWER_PMI, &trans->status);
|
|
|
+ clear_bit(STATUS_RFKILL, &trans->status);
|
|
|
|
|
|
/*
|
|
|
* Even if we stop the HW, we still want the RF kill
|
|
@@ -706,9 +703,9 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
|
|
|
*/
|
|
|
hw_rfkill = iwl_is_rfkill_set(trans);
|
|
|
if (hw_rfkill)
|
|
|
- set_bit(STATUS_RFKILL, &trans_pcie->status);
|
|
|
+ set_bit(STATUS_RFKILL, &trans->status);
|
|
|
else
|
|
|
- clear_bit(STATUS_RFKILL, &trans_pcie->status);
|
|
|
+ clear_bit(STATUS_RFKILL, &trans->status);
|
|
|
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
|
|
|
}
|
|
|
|
|
@@ -794,7 +791,6 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,
|
|
|
|
|
|
static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
|
|
|
{
|
|
|
- struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
|
|
|
bool hw_rfkill;
|
|
|
int err;
|
|
|
|
|
@@ -816,9 +812,9 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
|
|
|
|
|
|
hw_rfkill = iwl_is_rfkill_set(trans);
|
|
|
if (hw_rfkill)
|
|
|
- set_bit(STATUS_RFKILL, &trans_pcie->status);
|
|
|
+ set_bit(STATUS_RFKILL, &trans->status);
|
|
|
else
|
|
|
- clear_bit(STATUS_RFKILL, &trans_pcie->status);
|
|
|
+ clear_bit(STATUS_RFKILL, &trans->status);
|
|
|
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
|
|
|
|
|
|
return 0;
|
|
@@ -924,12 +920,10 @@ void iwl_trans_pcie_free(struct iwl_trans *trans)
|
|
|
|
|
|
static void iwl_trans_pcie_set_pmi(struct iwl_trans *trans, bool state)
|
|
|
{
|
|
|
- struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
|
|
|
-
|
|
|
if (state)
|
|
|
- set_bit(STATUS_TPOWER_PMI, &trans_pcie->status);
|
|
|
+ set_bit(STATUS_TPOWER_PMI, &trans->status);
|
|
|
else
|
|
|
- clear_bit(STATUS_TPOWER_PMI, &trans_pcie->status);
|
|
|
+ clear_bit(STATUS_TPOWER_PMI, &trans->status);
|
|
|
}
|
|
|
|
|
|
static bool iwl_trans_pcie_grab_nic_access(struct iwl_trans *trans, bool silent,
|