rt2x00: remove data_queue_desc struct
authorGabor Juhos <juhosg@openwrt.org>
Tue, 4 Jun 2013 11:40:50 +0000 (13:40 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 12 Jun 2013 18:59:38 +0000 (14:59 -0400)
If the queue_init callback is implemented
by a driver it gets used instead of the
data_queue_desc based initialization.

The queue_init callback is implemented for
each drivers now, so the old initialization
method is not used anymore. Remove the unused
data_queue_desc structure and all of the
related code.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2x00.h
drivers/net/wireless/rt2x00/rt2x00queue.c
drivers/net/wireless/rt2x00/rt2x00queue.h

index 2d2db6472c048327fa10d4e73b83cdc7eb56f68b..2a17f7e4ed5e33cc055439201ade519d127247c3 100644 (file)
@@ -649,10 +649,6 @@ struct rt2x00_ops {
        const unsigned int rf_size;
        const unsigned int tx_queues;
        const unsigned int extra_tx_headroom;
-       const struct data_queue_desc *rx;
-       const struct data_queue_desc *tx;
-       const struct data_queue_desc *bcn;
-       const struct data_queue_desc *atim;
        void (*queue_init)(struct data_queue *queue);
        const struct rt2x00lib_ops *lib;
        const void *drv;
index 2a99ff1714ac494a9e10986aabc24ba12aefb759..c4f1e2b8dc8e03ec69e38393e5b15e91f3ce5a9f 100644 (file)
@@ -1276,33 +1276,6 @@ void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev)
        }
 }
 
-static const struct data_queue_desc *
-rt2x00queue_get_qdesc_by_qid(struct rt2x00_dev *rt2x00dev,
-                            enum data_queue_qid qid)
-{
-       switch (qid) {
-       case QID_RX:
-               return rt2x00dev->ops->rx;
-
-       case QID_AC_BE:
-       case QID_AC_BK:
-       case QID_AC_VO:
-       case QID_AC_VI:
-               return rt2x00dev->ops->tx;
-
-       case QID_BEACON:
-               return rt2x00dev->ops->bcn;
-
-       case QID_ATIM:
-               return rt2x00dev->ops->atim;
-
-       default:
-               break;
-       }
-
-       return NULL;
-}
-
 static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
                             struct data_queue *queue, enum data_queue_qid qid)
 {
@@ -1317,20 +1290,7 @@ static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
        queue->cw_min = 5;
        queue->cw_max = 10;
 
-       if (rt2x00dev->ops->queue_init) {
-               rt2x00dev->ops->queue_init(queue);
-       } else {
-               const struct data_queue_desc *qdesc;
-
-               qdesc = rt2x00queue_get_qdesc_by_qid(rt2x00dev, qid);
-               BUG_ON(!qdesc);
-
-               queue->limit = qdesc->entry_num;
-               queue->data_size = qdesc->data_size;
-               queue->desc_size = qdesc->desc_size;
-               queue->winfo_size = qdesc->winfo_size;
-               queue->priv_size = qdesc->priv_size;
-       }
+       rt2x00dev->ops->queue_init(queue);
 
        queue->threshold = DIV_ROUND_UP(queue->limit, 10);
 }
index 2cf4903ce112a68726a439171f1704ee90c7d5e8..ebe11722497995a88d941acaa9749cef8fb83e39 100644 (file)
@@ -488,25 +488,6 @@ struct data_queue {
        unsigned short usb_maxpacket;
 };
 
-/**
- * struct data_queue_desc: Data queue description
- *
- * The information in this structure is used by drivers
- * to inform rt2x00lib about the creation of the data queue.
- *
- * @entry_num: Maximum number of entries for a queue.
- * @data_size: Maximum data size for the frames in this queue.
- * @desc_size: Hardware descriptor size for the data in this queue.
- * @priv_size: Size of per-queue_entry private data.
- */
-struct data_queue_desc {
-       unsigned short entry_num;
-       unsigned short data_size;
-       unsigned char  desc_size;
-       unsigned char  winfo_size;
-       unsigned short priv_size;
-};
-
 /**
  * queue_end - Return pointer to the last queue (HELPER MACRO).
  * @__dev: Pointer to &struct rt2x00_dev