iwlagn: reclaim the packets in transport layer
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / iwl-helpers.h
index 9d91552d13c1d5cf311ca9ac12a903ccef965573..f744fdc39a4d501a543a75a71457b78dcb94c04d 100644 (file)
@@ -90,6 +90,9 @@ static inline void iwl_wake_queue(struct iwl_priv *priv,
        u8 ac = queue & 3;
        u8 hwq = (queue >> 2) & 0x1f;
 
+       if (unlikely(!priv->mac80211_registered))
+               return;
+
        if (test_and_clear_bit(hwq, priv->queue_stopped))
                if (atomic_dec_return(&priv->queue_stop_count[ac]) <= 0)
                        ieee80211_wake_queue(priv->hw, ac);
@@ -102,6 +105,9 @@ static inline void iwl_stop_queue(struct iwl_priv *priv,
        u8 ac = queue & 3;
        u8 hwq = (queue >> 2) & 0x1f;
 
+       if (unlikely(!priv->mac80211_registered))
+               return;
+
        if (!test_and_set_bit(hwq, priv->queue_stopped))
                if (atomic_inc_return(&priv->queue_stop_count[ac]) > 0)
                        ieee80211_stop_queue(priv->hw, ac);
@@ -132,33 +138,12 @@ static inline void iwl_wake_any_queue(struct iwl_priv *priv,
 
 #define ieee80211_wake_queue DO_NOT_USE_ieee80211_wake_queue
 
-static inline void iwl_disable_interrupts(struct iwl_priv *priv)
-{
-       clear_bit(STATUS_INT_ENABLED, &priv->status);
-
-       /* disable interrupts from uCode/NIC to host */
-       iwl_write32(priv, CSR_INT_MASK, 0x00000000);
-
-       /* acknowledge/clear/reset any interrupts still pending
-        * from uCode or flow handler (Rx/Tx DMA) */
-       iwl_write32(priv, CSR_INT, 0xffffffff);
-       iwl_write32(priv, CSR_FH_INT_STATUS, 0xffffffff);
-       IWL_DEBUG_ISR(priv, "Disabled interrupts\n");
-}
-
 static inline void iwl_enable_rfkill_int(struct iwl_priv *priv)
 {
        IWL_DEBUG_ISR(priv, "Enabling rfkill interrupt\n");
        iwl_write32(priv, CSR_INT_MASK, CSR_INT_BIT_RF_KILL);
 }
 
-static inline void iwl_enable_interrupts(struct iwl_priv *priv)
-{
-       IWL_DEBUG_ISR(priv, "Enabling interrupts\n");
-       set_bit(STATUS_INT_ENABLED, &priv->status);
-       iwl_write32(priv, CSR_INT_MASK, priv->inta_mask);
-}
-
 /**
  * iwl_beacon_time_mask_low - mask of lower 32 bit of beacon time
  * @priv -- pointer to iwl_priv data structure
This page took 0.031028 seconds and 5 git commands to generate.