Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102812
b: refs/heads/master
c: 46315e0
h: refs/heads/master
v: v3
  • Loading branch information
Tomas Winkler authored and John W. Linville committed Jun 3, 2008
1 parent 74218b8 commit 6928be4
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f118a91d16127e461cc8c17c529306910f13a8b1
refs/heads/master: 46315e012236af887cf442fd494a91b1d36858b9
60 changes: 25 additions & 35 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,39 +579,6 @@ static void iwl4965_nic_config(struct iwl_priv *priv)
spin_unlock_irqrestore(&priv->lock, flags);
}

int iwl4965_hw_nic_stop_master(struct iwl_priv *priv)
{
int rc = 0;
u32 reg_val;
unsigned long flags;

spin_lock_irqsave(&priv->lock, flags);

/* set stop master bit */
iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);

reg_val = iwl_read32(priv, CSR_GP_CNTRL);

if (CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE ==
(reg_val & CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE))
IWL_DEBUG_INFO("Card in power save, master is already "
"stopped\n");
else {
rc = iwl_poll_bit(priv, CSR_RESET,
CSR_RESET_REG_FLAG_MASTER_DISABLED,
CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
if (rc < 0) {
spin_unlock_irqrestore(&priv->lock, flags);
return rc;
}
}

spin_unlock_irqrestore(&priv->lock, flags);
IWL_DEBUG_INFO("stop master\n");

return rc;
}

/**
* iwl4965_hw_txq_ctx_stop - Stop all Tx DMA channels, free Tx queue memory
*/
Expand Down Expand Up @@ -642,11 +609,34 @@ void iwl4965_hw_txq_ctx_stop(struct iwl_priv *priv)
iwl_hw_txq_ctx_free(priv);
}

static int iwl4965_apm_stop_master(struct iwl_priv *priv)
{
int ret = 0;
unsigned long flags;

spin_lock_irqsave(&priv->lock, flags);

/* set stop master bit */
iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);

ret = iwl_poll_bit(priv, CSR_RESET,
CSR_RESET_REG_FLAG_MASTER_DISABLED,
CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
if (ret < 0)
goto out;

out:
spin_unlock_irqrestore(&priv->lock, flags);
IWL_DEBUG_INFO("stop master\n");

return ret;
}

static void iwl4965_apm_stop(struct iwl_priv *priv)
{
unsigned long flags;

iwl4965_hw_nic_stop_master(priv);
iwl4965_apm_stop_master(priv);

spin_lock_irqsave(&priv->lock, flags);

Expand All @@ -663,7 +653,7 @@ static int iwl4965_apm_reset(struct iwl_priv *priv)
int ret = 0;
unsigned long flags;

iwl4965_hw_nic_stop_master(priv);
iwl4965_apm_stop_master(priv);

spin_lock_irqsave(&priv->lock, flags);

Expand Down
29 changes: 27 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,31 @@ static const u16 iwl5000_default_queue_to_tx_fifo[] = {
IWL_TX_FIFO_HCCA_2
};

/* FIXME: same implementation as 4965 */
static int iwl5000_apm_stop_master(struct iwl_priv *priv)
{
int ret = 0;
unsigned long flags;

spin_lock_irqsave(&priv->lock, flags);

/* set stop master bit */
iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);

ret = iwl_poll_bit(priv, CSR_RESET,
CSR_RESET_REG_FLAG_MASTER_DISABLED,
CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
if (ret < 0)
goto out;

out:
spin_unlock_irqrestore(&priv->lock, flags);
IWL_DEBUG_INFO("stop master\n");

return ret;
}


static int iwl5000_apm_init(struct iwl_priv *priv)
{
int ret = 0;
Expand Down Expand Up @@ -105,7 +130,7 @@ static void iwl5000_apm_stop(struct iwl_priv *priv)
{
unsigned long flags;

iwl4965_hw_nic_stop_master(priv);
iwl5000_apm_stop_master(priv);

spin_lock_irqsave(&priv->lock, flags);

Expand All @@ -124,7 +149,7 @@ static int iwl5000_apm_reset(struct iwl_priv *priv)
int ret = 0;
unsigned long flags;

iwl4965_hw_nic_stop_master(priv);
iwl5000_apm_stop_master(priv);

spin_lock_irqsave(&priv->lock, flags);

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,6 @@ extern void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv);
extern void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv);
extern int iwl4965_hw_rxq_stop(struct iwl_priv *priv);
extern int iwl4965_hw_set_hw_params(struct iwl_priv *priv);
extern int iwl4965_hw_nic_stop_master(struct iwl_priv *priv);
extern void iwl4965_hw_txq_ctx_stop(struct iwl_priv *priv);
extern int iwl4965_hw_get_temperature(struct iwl_priv *priv);
extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv,
Expand Down

0 comments on commit 6928be4

Please sign in to comment.