rt2x00: fix HT TX descriptor settings regression
[cascardo/linux.git] / drivers / net / wireless / rt2x00 / rt2x00mac.c
index 20c6ecc..2183e79 100644 (file)
@@ -46,7 +46,7 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev,
 
        skb = dev_alloc_skb(data_length + rt2x00dev->hw->extra_tx_headroom);
        if (unlikely(!skb)) {
-               WARNING(rt2x00dev, "Failed to create RTS/CTS frame.\n");
+               rt2x00_warn(rt2x00dev, "Failed to create RTS/CTS frame\n");
                return -ENOMEM;
        }
 
@@ -90,10 +90,10 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev,
                                  frag_skb->data, data_length, tx_info,
                                  (struct ieee80211_rts *)(skb->data));
 
-       retval = rt2x00queue_write_tx_frame(queue, skb, true);
+       retval = rt2x00queue_write_tx_frame(queue, skb, NULL, true);
        if (retval) {
                dev_kfree_skb_any(skb);
-               WARNING(rt2x00dev, "Failed to send RTS/CTS frame.\n");
+               rt2x00_warn(rt2x00dev, "Failed to send RTS/CTS frame\n");
        }
 
        return retval;
@@ -126,9 +126,9 @@ void rt2x00mac_tx(struct ieee80211_hw *hw,
 
        queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
        if (unlikely(!queue)) {
-               ERROR(rt2x00dev,
-                     "Attempt to send packet over invalid queue %d.\n"
-                     "Please file bug report to %s.\n", qid, DRV_PROJECT);
+               rt2x00_err(rt2x00dev,
+                          "Attempt to send packet over invalid queue %d\n"
+                          "Please file bug report to %s\n", qid, DRV_PROJECT);
                goto exit_free_skb;
        }
 
@@ -151,7 +151,7 @@ void rt2x00mac_tx(struct ieee80211_hw *hw,
                        goto exit_fail;
        }
 
-       if (unlikely(rt2x00queue_write_tx_frame(queue, skb, false)))
+       if (unlikely(rt2x00queue_write_tx_frame(queue, skb, control->sta, false)))
                goto exit_fail;
 
        /*
@@ -382,11 +382,11 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
         * of different types, but has no a separate filter for PS Poll frames,
         * FIF_CONTROL flag implies FIF_PSPOLL.
         */
-       if (!test_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags)) {
+       if (!rt2x00_has_cap_control_filters(rt2x00dev)) {
                if (*total_flags & FIF_CONTROL || *total_flags & FIF_PSPOLL)
                        *total_flags |= FIF_CONTROL | FIF_PSPOLL;
        }
-       if (!test_bit(CAPABILITY_CONTROL_FILTER_PSPOLL, &rt2x00dev->cap_flags)) {
+       if (!rt2x00_has_cap_control_filter_pspoll(rt2x00dev)) {
                if (*total_flags & FIF_CONTROL)
                        *total_flags |= FIF_PSPOLL;
        }
@@ -469,7 +469,7 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
                return 0;
 
-       if (!test_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags))
+       if (!rt2x00_has_cap_hw_crypto(rt2x00dev))
                return -EOPNOTSUPP;
 
        /*
@@ -731,9 +731,10 @@ int rt2x00mac_conf_tx(struct ieee80211_hw *hw,
        queue->aifs = params->aifs;
        queue->txop = params->txop;
 
-       DEBUG(rt2x00dev,
-             "Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d, TXop: %d.\n",
-             queue_idx, queue->cw_min, queue->cw_max, queue->aifs, queue->txop);
+       rt2x00_dbg(rt2x00dev,
+                  "Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d, TXop: %d\n",
+                  queue_idx, queue->cw_min, queue->cw_max, queue->aifs,
+                  queue->txop);
 
        return 0;
 }
@@ -748,11 +749,14 @@ void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw)
 }
 EXPORT_SYMBOL_GPL(rt2x00mac_rfkill_poll);
 
-void rt2x00mac_flush(struct ieee80211_hw *hw, bool drop)
+void rt2x00mac_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
 {
        struct rt2x00_dev *rt2x00dev = hw->priv;
        struct data_queue *queue;
 
+       if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
+               return;
+
        tx_queue_for_each(rt2x00dev, queue)
                rt2x00queue_flush_queue(queue, drop);
 }