iwlagn: add kick_nic API to transport layer
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 7 Jul 2011 15:20:01 +0000 (18:20 +0300)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Thu, 21 Jul 2011 14:27:45 +0000 (07:27 -0700)
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>
drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-trans.c
drivers/net/wireless/iwlwifi/iwl-trans.h

index aebd5c71f9da8af42925824eaec4294888e942a9..89363007ede0284881527f2d5b04c48fff1d9a8c 100644 (file)
@@ -494,8 +494,7 @@ int iwlagn_load_ucode_wait_alive(struct iwl_priv *priv,
                return ret;
        }
 
-       /* Remove all resets to allow NIC to operate */
-       iwl_write32(priv, CSR_RESET, 0);
+       trans_kick_nic(priv);
 
        /*
         * Some things may run in the background now, but we
index fddc23627644283647b81c4d3c335e162654a90a..d6d6fe92c474126e597bbf33d3fec358e0256a7a 100644 (file)
@@ -1245,6 +1245,7 @@ struct iwl_trans;
  * @send_cmd_pdu:send a host command: flags can be CMD_*
  * @get_tx_cmd: returns a pointer to a new Tx cmd for the upper layer use
  * @tx: send an skb
+ * @kick_nic: remove the RESET from the embedded CPU and let it run
  * @sync_irq: the upper layer will typically disable interrupt and call this
  *            handler. After this handler returns, it is guaranteed that all
  *            the ISR / tasklet etc... have finished running and the transport
@@ -1271,6 +1272,8 @@ struct iwl_trans_ops {
                struct iwl_tx_cmd *tx_cmd, int txq_id, __le16 fc, bool ampdu,
                struct iwl_rxon_context *ctx);
 
+       void (*kick_nic)(struct iwl_priv *priv);
+
        void (*sync_irq)(struct iwl_priv *priv);
        void (*free)(struct iwl_priv *priv);
 };
index 7c748f65c86f3938941b2ac1e9b85f87a425bde2..639b4692e45909e20e89ffd9c613b579e77304e5 100644 (file)
@@ -952,6 +952,12 @@ static int iwl_trans_tx(struct iwl_priv *priv, struct sk_buff *skb,
        return 0;
 }
 
+static void iwl_trans_kick_nic(struct iwl_priv *priv)
+{
+       /* Remove all resets to allow NIC to operate */
+       iwl_write32(priv, CSR_RESET, 0);
+}
+
 static void iwl_trans_sync_irq(struct iwl_priv *priv)
 {
        /* wait to make sure we flush pending tasklet*/
@@ -980,6 +986,7 @@ static const struct iwl_trans_ops trans_ops = {
 
        .get_tx_cmd = iwl_trans_get_tx_cmd,
        .tx = iwl_trans_tx,
+       .kick_nic = iwl_trans_kick_nic,
 
        .sync_irq = iwl_trans_sync_irq,
        .free = iwl_trans_free,
index 16cdb89b02fc4f0979d60cb71da469cbeb916d81..9a950492ca7369da8cff5a18dbb7f7d2a5211ad0 100644 (file)
@@ -119,6 +119,11 @@ static inline int trans_tx(struct iwl_priv *priv, struct sk_buff *skb,
        return priv->trans.ops->tx(priv, skb, tx_cmd, txq_id, fc, ampdu, ctx);
 }
 
+static inline void trans_kick_nic(struct iwl_priv *priv)
+{
+       priv->trans.ops->kick_nic(priv);
+}
+
 static inline void trans_sync_irq(struct iwl_priv *priv)
 {
        priv->trans.ops->sync_irq(priv);
This page took 0.038039 seconds and 5 git commands to generate.