aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2011-07-07 11:20:01 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-07-21 10:27:45 -0400
commit56d90f4c8ac186a708e6af290d23857ea901ba05 (patch)
treead02c112eeb1539f978ccfbc3a58cff8ac2c5fe6
parentd931998669c3e0e917bd9983880f3498c27de0af (diff)
iwlagn: add kick_nic API to transport layer
kick_nic means to remove the RESET bit from the embedded CPU Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ucode.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h5
4 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
index aebd5c71f9d..89363007ede 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
@@ -494,8 +494,7 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
494 return ret; 494 return ret;
495 } 495 }
496 496
497 /* Remove all resets to allow NIC to operate */ 497 trans_kick_nic(priv);
498 iwl_write32(priv, CSR_RESET, 0);
499 498
500 /* 499 /*
501 * Some things may run in the background now, but we 500 * Some things may run in the background now, but we
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index fddc2362764..d6d6fe92c47 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1245,6 +1245,7 @@ struct iwl_trans;
1245 * @send_cmd_pdu:send a host command: flags can be CMD_* 1245 * @send_cmd_pdu:send a host command: flags can be CMD_*
1246 * @get_tx_cmd: returns a pointer to a new Tx cmd for the upper layer use 1246 * @get_tx_cmd: returns a pointer to a new Tx cmd for the upper layer use
1247 * @tx: send an skb 1247 * @tx: send an skb
1248 * @kick_nic: remove the RESET from the embedded CPU and let it run
1248 * @sync_irq: the upper layer will typically disable interrupt and call this 1249 * @sync_irq: the upper layer will typically disable interrupt and call this
1249 * handler. After this handler returns, it is guaranteed that all 1250 * handler. After this handler returns, it is guaranteed that all
1250 * the ISR / tasklet etc... have finished running and the transport 1251 * the ISR / tasklet etc... have finished running and the transport
@@ -1271,6 +1272,8 @@ struct iwl_trans_ops {
1271 struct iwl_tx_cmd *tx_cmd, int txq_id, __le16 fc, bool ampdu, 1272 struct iwl_tx_cmd *tx_cmd, int txq_id, __le16 fc, bool ampdu,
1272 struct iwl_rxon_context *ctx); 1273 struct iwl_rxon_context *ctx);
1273 1274
1275 void (*kick_nic)(struct iwl_priv *priv);
1276
1274 void (*sync_irq)(struct iwl_priv *priv); 1277 void (*sync_irq)(struct iwl_priv *priv);
1275 void (*free)(struct iwl_priv *priv); 1278 void (*free)(struct iwl_priv *priv);
1276}; 1279};
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.c b/drivers/net/wireless/iwlwifi/iwl-trans.c
index 7c748f65c86..639b4692e45 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.c
@@ -952,6 +952,12 @@ static int iwl_trans_tx(struct iwl_priv *priv, struct sk_buff *skb,
952 return 0; 952 return 0;
953} 953}
954 954
955static void iwl_trans_kick_nic(struct iwl_priv *priv)
956{
957 /* Remove all resets to allow NIC to operate */
958 iwl_write32(priv, CSR_RESET, 0);
959}
960
955static void iwl_trans_sync_irq(struct iwl_priv *priv) 961static void iwl_trans_sync_irq(struct iwl_priv *priv)
956{ 962{
957 /* wait to make sure we flush pending tasklet*/ 963 /* wait to make sure we flush pending tasklet*/
@@ -980,6 +986,7 @@ static const struct iwl_trans_ops trans_ops = {
980 986
981 .get_tx_cmd = iwl_trans_get_tx_cmd, 987 .get_tx_cmd = iwl_trans_get_tx_cmd,
982 .tx = iwl_trans_tx, 988 .tx = iwl_trans_tx,
989 .kick_nic = iwl_trans_kick_nic,
983 990
984 .sync_irq = iwl_trans_sync_irq, 991 .sync_irq = iwl_trans_sync_irq,
985 .free = iwl_trans_free, 992 .free = iwl_trans_free,
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 16cdb89b02f..9a950492ca7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -119,6 +119,11 @@ static inline int trans_tx(struct iwl_priv *priv, struct sk_buff *skb,
119 return priv->trans.ops->tx(priv, skb, tx_cmd, txq_id, fc, ampdu, ctx); 119 return priv->trans.ops->tx(priv, skb, tx_cmd, txq_id, fc, ampdu, ctx);
120} 120}
121 121
122static inline void trans_kick_nic(struct iwl_priv *priv)
123{
124 priv->trans.ops->kick_nic(priv);
125}
126
122static inline void trans_sync_irq(struct iwl_priv *priv) 127static inline void trans_sync_irq(struct iwl_priv *priv)
123{ 128{
124 priv->trans.ops->sync_irq(priv); 129 priv->trans.ops->sync_irq(priv);