diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-07-07 13:37:26 +0200 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-07-16 16:39:28 +0200 |
commit | ab6cf8e816bad473a1496f2006bea3a3849c2519 (patch) | |
tree | 924e71788ca5a299714fa520fc841b4d3aba11fb /drivers/net/wireless/iwlwifi/iwl-trans.c | |
parent | iwlagn: move tx transport functions to iwl-trans-tx-pcie.c (diff) | |
download | linux-ab6cf8e816bad473a1496f2006bea3a3849c2519.tar.xz linux-ab6cf8e816bad473a1496f2006bea3a3849c2519.zip |
iwlagn: move iwlagn_stop_device to transport layer
Since iwlagn_stop_device was the only caller to the rx_stop / tx_stop,
these two don't need to be API any more.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c index 6b7cb73442bf..8d4555404799 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans.c @@ -611,6 +611,46 @@ static int iwl_trans_tx_stop(struct iwl_priv *priv) return 0; } +static void iwl_trans_stop_device(struct iwl_priv *priv) +{ + unsigned long flags; + + /* stop and reset the on-board processor */ + iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET); + + /* tell the device to stop sending interrupts */ + spin_lock_irqsave(&priv->lock, flags); + iwl_disable_interrupts(priv); + spin_unlock_irqrestore(&priv->lock, flags); + trans_sync_irq(priv); + + /* device going down, Stop using ICT table */ + iwl_disable_ict(priv); + + /* + * If a HW restart happens during firmware loading, + * then the firmware loading might call this function + * and later it might be called again due to the + * restart. So don't process again if the device is + * already dead. + */ + if (test_bit(STATUS_DEVICE_ENABLED, &priv->status)) { + iwl_trans_tx_stop(priv); + iwl_trans_rx_stop(priv); + + /* Power-down device's busmaster DMA clocks */ + iwl_write_prph(priv, APMG_CLK_DIS_REG, + APMG_CLK_VAL_DMA_CLK_RQT); + udelay(5); + } + + /* Make sure (redundant) we've released our request to stay awake */ + iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); + + /* Stop the device, and put it in low power state */ + iwl_apm_stop(priv); +} + static struct iwl_tx_cmd *iwl_trans_get_tx_cmd(struct iwl_priv *priv, int txq_id) { @@ -779,13 +819,13 @@ static void iwl_trans_free(struct iwl_priv *priv) static const struct iwl_trans_ops trans_ops = { .rx_init = iwl_trans_rx_init, - .rx_stop = iwl_trans_rx_stop, .rx_free = iwl_trans_rx_free, .tx_init = iwl_trans_tx_init, - .tx_stop = iwl_trans_tx_stop, .tx_free = iwl_trans_tx_free, + .stop_device = iwl_trans_stop_device, + .send_cmd = iwl_send_cmd, .send_cmd_pdu = iwl_send_cmd_pdu, |