]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/rt2x00/rt2x00.h
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / net / wireless / rt2x00 / rt2x00.h
index ab43e7ca2a231000ba0d40489860f950883be16d..84aaf393da43a06144b838d820e78f3cf866e068 100644 (file)
@@ -66,7 +66,7 @@
 
 #ifdef CONFIG_RT2X00_DEBUG
 #define DEBUG_PRINTK(__dev, __kernlvl, __lvl, __msg, __args...)        \
-       DEBUG_PRINTK_MSG(__dev, __kernlvl, __lvl, __msg, ##__args);
+       DEBUG_PRINTK_MSG(__dev, __kernlvl, __lvl, __msg, ##__args)
 #else
 #define DEBUG_PRINTK(__dev, __kernlvl, __lvl, __msg, __args...)        \
        do { } while (0)
@@ -347,28 +347,16 @@ struct link {
        struct delayed_work watchdog_work;
 };
 
+enum rt2x00_delayed_flags {
+       DELAYED_UPDATE_BEACON,
+};
+
 /*
  * Interface structure
  * Per interface configuration details, this structure
  * is allocated as the private data for ieee80211_vif.
  */
 struct rt2x00_intf {
-       /*
-        * All fields within the rt2x00_intf structure
-        * must be protected with a spinlock.
-        */
-       spinlock_t lock;
-
-       /*
-        * MAC of the device.
-        */
-       u8 mac[ETH_ALEN];
-
-       /*
-        * BBSID of the AP to associate with.
-        */
-       u8 bssid[ETH_ALEN];
-
        /*
         * beacon->skb must be protected with the mutex.
         */
@@ -384,8 +372,7 @@ struct rt2x00_intf {
        /*
         * Actions that needed rescheduling.
         */
-       unsigned int delayed_flags;
-#define DELAYED_UPDATE_BEACON          0x00000001
+       unsigned long delayed_flags;
 
        /*
         * Software sequence counter, this is only required
@@ -567,7 +554,15 @@ struct rt2x00lib_ops {
                             struct link_qual *qual);
        void (*link_tuner) (struct rt2x00_dev *rt2x00dev,
                            struct link_qual *qual, const u32 count);
+
+       /*
+        * Data queue handlers.
+        */
        void (*watchdog) (struct rt2x00_dev *rt2x00dev);
+       void (*start_queue) (struct data_queue *queue);
+       void (*kick_queue) (struct data_queue *queue);
+       void (*stop_queue) (struct data_queue *queue);
+       void (*flush_queue) (struct data_queue *queue);
 
        /*
         * TX control handlers
@@ -579,8 +574,6 @@ struct rt2x00lib_ops {
        void (*write_beacon) (struct queue_entry *entry,
                              struct txentry_desc *txdesc);
        int (*get_tx_data_len) (struct queue_entry *entry);
-       void (*kick_tx_queue) (struct data_queue *queue);
-       void (*kill_tx_queue) (struct data_queue *queue);
 
        /*
         * RX control handlers
@@ -902,7 +895,7 @@ struct rt2x00_dev {
        /*
         * FIFO for storing tx status reports between isr and tasklet.
         */
-       struct kfifo txstatus_fifo;
+       DECLARE_KFIFO_PTR(txstatus_fifo, u32);
 
        /*
         * Tasklet for processing tx status reports (rt2800pci).
@@ -916,7 +909,7 @@ struct rt2x00_dev {
  * in those cases REGISTER_BUSY_COUNT attempts should be
  * taken with a REGISTER_BUSY_DELAY interval.
  */
-#define REGISTER_BUSY_COUNT    5
+#define REGISTER_BUSY_COUNT    100
 #define REGISTER_BUSY_DELAY    100
 
 /*
@@ -1068,6 +1061,78 @@ struct data_queue *rt2x00queue_get_queue(struct rt2x00_dev *rt2x00dev,
 struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
                                          enum queue_index index);
 
+/**
+ * rt2x00queue_pause_queue - Pause a data queue
+ * @queue: Pointer to &struct data_queue.
+ *
+ * This function will pause the data queue locally, preventing
+ * new frames to be added to the queue (while the hardware is
+ * still allowed to run).
+ */
+void rt2x00queue_pause_queue(struct data_queue *queue);
+
+/**
+ * rt2x00queue_unpause_queue - unpause a data queue
+ * @queue: Pointer to &struct data_queue.
+ *
+ * This function will unpause the data queue locally, allowing
+ * new frames to be added to the queue again.
+ */
+void rt2x00queue_unpause_queue(struct data_queue *queue);
+
+/**
+ * rt2x00queue_start_queue - Start a data queue
+ * @queue: Pointer to &struct data_queue.
+ *
+ * This function will start handling all pending frames in the queue.
+ */
+void rt2x00queue_start_queue(struct data_queue *queue);
+
+/**
+ * rt2x00queue_stop_queue - Halt a data queue
+ * @queue: Pointer to &struct data_queue.
+ *
+ * This function will stop all pending frames in the queue.
+ */
+void rt2x00queue_stop_queue(struct data_queue *queue);
+
+/**
+ * rt2x00queue_flush_queue - Flush a data queue
+ * @queue: Pointer to &struct data_queue.
+ * @drop: True to drop all pending frames.
+ *
+ * This function will flush the queue. After this call
+ * the queue is guarenteed to be empty.
+ */
+void rt2x00queue_flush_queue(struct data_queue *queue, bool drop);
+
+/**
+ * rt2x00queue_start_queues - Start all data queues
+ * @rt2x00dev: Pointer to &struct rt2x00_dev.
+ *
+ * This function will loop through all available queues to start them
+ */
+void rt2x00queue_start_queues(struct rt2x00_dev *rt2x00dev);
+
+/**
+ * rt2x00queue_stop_queues - Halt all data queues
+ * @rt2x00dev: Pointer to &struct rt2x00_dev.
+ *
+ * This function will loop through all available queues to stop
+ * any pending frames.
+ */
+void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev);
+
+/**
+ * rt2x00queue_flush_queues - Flush all data queues
+ * @rt2x00dev: Pointer to &struct rt2x00_dev.
+ * @drop: True to drop all pending frames.
+ *
+ * This function will loop through all available queues to flush
+ * any pending frames.
+ */
+void rt2x00queue_flush_queues(struct rt2x00_dev *rt2x00dev, bool drop);
+
 /*
  * Debugfs handlers.
  */
@@ -1093,6 +1158,7 @@ static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
  */
 void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev);
 void rt2x00lib_pretbtt(struct rt2x00_dev *rt2x00dev);
+void rt2x00lib_dmastart(struct queue_entry *entry);
 void rt2x00lib_dmadone(struct queue_entry *entry);
 void rt2x00lib_txdone(struct queue_entry *entry,
                      struct txdone_entry_desc *txdesc);
@@ -1134,6 +1200,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
 int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue,
                      const struct ieee80211_tx_queue_params *params);
 void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw);
+void rt2x00mac_flush(struct ieee80211_hw *hw, bool drop);
 
 /*
  * Driver allocation handlers.