iwl3945: Getting rid of the *39_rxon iwl_priv fields
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / iwlwifi / iwl-rx.c
index c5f1aa0feac8c49ecb635e44b7b89e1c98681158..c8865d0b90671f42f63825eca8af0f12a3f8bb17 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Copyright(c) 2003 - 2008 Intel Corporation. All rights reserved.
+ * Copyright(c) 2003 - 2009 Intel Corporation. All rights reserved.
  *
  * Portions of this file are derived from the ipw3945 project, as well
  * as portions of the ieee80211 subsystem header files.
@@ -125,9 +125,10 @@ EXPORT_SYMBOL(iwl_rx_queue_space);
  */
 int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
 {
-       u32 reg = 0;
-       int ret = 0;
        unsigned long flags;
+       u32 rx_wrt_ptr_reg = priv->hw_params.rx_wrt_ptr_reg;
+       u32 reg;
+       int ret = 0;
 
        spin_lock_irqsave(&q->lock, flags);
 
@@ -149,15 +150,14 @@ int iwl_rx_queue_update_write_ptr(struct iwl_priv *priv, struct iwl_rx_queue *q)
                        goto exit_unlock;
 
                /* Device expects a multiple of 8 */
-               iwl_write_direct32(priv, FH_RSCSR_CHNL0_WPTR,
-                                    q->write & ~0x7);
+               iwl_write_direct32(priv, rx_wrt_ptr_reg, q->write & ~0x7);
                iwl_release_nic_access(priv);
 
        /* Else device is assumed to be awake */
-       } else
+       } else {
                /* Device expects a multiple of 8 */
-               iwl_write32(priv, FH_RSCSR_CHNL0_WPTR, q->write & ~0x7);
-
+               iwl_write32(priv, rx_wrt_ptr_reg, q->write & ~0x7);
+       }
 
        q->need_update = 0;
 
@@ -262,8 +262,7 @@ void iwl_rx_allocate(struct iwl_priv *priv)
                rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
                                     GFP_KERNEL);
                if (!rxb->skb) {
-                       printk(KERN_CRIT DRV_NAME
-                                  "Can not allocate SKB buffers\n");
+                       IWL_CRIT(priv, "Can not allocate SKB buffers\n");
                        /* We don't reschedule replenish work here -- we will
                         * call the restock method and if it still needs
                         * more buffers it will schedule replenish */
@@ -773,10 +772,10 @@ static void iwl_update_rx_stats(struct iwl_priv *priv, u16 fc, u16 len)
 /*
  * returns non-zero if packet should be dropped
  */
-static int iwl_set_decrypted_flag(struct iwl_priv *priv,
-                                     struct ieee80211_hdr *hdr,
-                                     u32 decrypt_res,
-                                     struct ieee80211_rx_status *stats)
+int iwl_set_decrypted_flag(struct iwl_priv *priv,
+                          struct ieee80211_hdr *hdr,
+                          u32 decrypt_res,
+                          struct ieee80211_rx_status *stats)
 {
        u16 fc = le16_to_cpu(hdr->frame_control);
 
@@ -816,6 +815,7 @@ static int iwl_set_decrypted_flag(struct iwl_priv *priv,
        }
        return 0;
 }
+EXPORT_SYMBOL(iwl_set_decrypted_flag);
 
 static u32 iwl_translate_rx_status(struct iwl_priv *priv, u32 decrypt_in)
 {
@@ -895,7 +895,7 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv,
                rx_start = (struct iwl_rx_phy_res *)&priv->last_phy_res[1];
 
        if (!rx_start) {
-               IWL_ERROR("MPDU frame without a PHY data\n");
+               IWL_ERR(priv, "MPDU frame without a PHY data\n");
                return;
        }
        if (include_phy) {
@@ -1021,7 +1021,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
        }
 
        if (!rx_start) {
-               IWL_ERROR("MPDU frame without a PHY data\n");
+               IWL_ERR(priv, "MPDU frame without a PHY data\n");
                return;
        }