]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/ath/ath9k/ath9k.h
ath9k: Remove unused paprd_txok
[mv-sheeva.git] / drivers / net / wireless / ath / ath9k / ath9k.h
index f67be52591d524b5b4b09695212e6c0b1d975b0f..b1e977c3354f4ab5cc75a64c5e555f8ffcf5a457 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/etherdevice.h>
 #include <linux/device.h>
 #include <linux/leds.h>
+#include <linux/completion.h>
 
 #include "debug.h"
 #include "common.h"
@@ -114,8 +115,10 @@ enum buffer_type {
 #define bf_isretried(bf)       (bf->bf_state.bf_type & BUF_RETRY)
 #define bf_isxretried(bf)      (bf->bf_state.bf_type & BUF_XRETRY)
 
+#define ATH_TXSTATUS_RING_SIZE 64
+
 struct ath_descdma {
-       struct ath_desc *dd_desc;
+       void *dd_desc;
        dma_addr_t dd_desc_paddr;
        u32 dd_desc_len;
        struct ath_buf *dd_bufptr;
@@ -134,6 +137,8 @@ void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd,
 #define ATH_MAX_ANTENNA         3
 #define ATH_RXBUF               512
 #define ATH_TXBUF               512
+#define ATH_TXBUF_RESERVE       5
+#define ATH_MAX_QDEPTH          (ATH_TXBUF / 4 - ATH_TXBUF_RESERVE)
 #define ATH_TXMAXTRY            13
 #define ATH_MGT_TXMAXTRY        4
 
@@ -188,7 +193,9 @@ enum ATH_AGGR_STATUS {
        ATH_AGGR_LIMITED,
 };
 
+#define ATH_TXFIFO_DEPTH 8
 struct ath_txq {
+       int axq_class;
        u32 axq_qnum;
        u32 *axq_link;
        struct list_head axq_q;
@@ -197,6 +204,75 @@ struct ath_txq {
        bool stopped;
        bool axq_tx_inprogress;
        struct list_head axq_acq;
+       struct list_head txq_fifo[ATH_TXFIFO_DEPTH];
+       struct list_head txq_fifo_pending;
+       u8 txq_headidx;
+       u8 txq_tailidx;
+};
+
+struct ath_atx_ac {
+       int sched;
+       int qnum;
+       struct list_head list;
+       struct list_head tid_q;
+};
+
+struct ath_buf_state {
+       int bfs_nframes;
+       u16 bfs_al;
+       u16 bfs_frmlen;
+       int bfs_seqno;
+       int bfs_tidno;
+       int bfs_retries;
+       u8 bf_type;
+       u8 bfs_paprd;
+       unsigned long bfs_paprd_timestamp;
+       u32 bfs_keyix;
+       enum ath9k_key_type bfs_keytype;
+};
+
+struct ath_buf {
+       struct list_head list;
+       struct ath_buf *bf_lastbf;      /* last buf of this unit (a frame or
+                                          an aggregate) */
+       struct ath_buf *bf_next;        /* next subframe in the aggregate */
+       struct sk_buff *bf_mpdu;        /* enclosing frame structure */
+       void *bf_desc;                  /* virtual addr of desc */
+       dma_addr_t bf_daddr;            /* physical addr of desc */
+       dma_addr_t bf_buf_addr;         /* physical addr of data buffer */
+       bool bf_stale;
+       bool bf_isnullfunc;
+       bool bf_tx_aborted;
+       u16 bf_flags;
+       struct ath_buf_state bf_state;
+       dma_addr_t bf_dmacontext;
+       struct ath_wiphy *aphy;
+};
+
+struct ath_atx_tid {
+       struct list_head list;
+       struct list_head buf_q;
+       struct ath_node *an;
+       struct ath_atx_ac *ac;
+       struct ath_buf *tx_buf[ATH_TID_MAX_BUFS];
+       u16 seq_start;
+       u16 seq_next;
+       u16 baw_size;
+       int tidno;
+       int baw_head;   /* first un-acked tx buffer */
+       int baw_tail;   /* next unused tx buffer slot */
+       int sched;
+       int paused;
+       u8 state;
+};
+
+struct ath_node {
+       struct ath_common *common;
+       struct ath_atx_tid tid[WME_NUM_TID];
+       struct ath_atx_ac ac[WME_NUM_AC];
+       u16 maxampdu;
+       u8 mpdudensity;
+       int last_rssi;
 };
 
 #define AGGR_CLEANUP         BIT(1)
@@ -207,6 +283,7 @@ struct ath_tx_control {
        struct ath_txq *txq;
        int if_id;
        enum ath9k_internal_frame_type frame_type;
+       u8 paprd;
 };
 
 #define ATH_TX_ERROR        0x01
@@ -216,11 +293,12 @@ struct ath_tx_control {
 struct ath_tx {
        u16 seq_no;
        u32 txqsetup;
-       int hwq_map[ATH9K_WME_AC_VO+1];
+       int hwq_map[WME_NUM_AC];
        spinlock_t txbuflock;
        struct list_head txbuf;
        struct ath_txq txq[ATH9K_NUM_TX_QUEUES];
        struct ath_descdma txdma;
+       int pending_frames[WME_NUM_AC];
 };
 
 struct ath_rx_edma {
@@ -260,12 +338,12 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an);
 void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq);
 int ath_tx_init(struct ath_softc *sc, int nbufs);
 void ath_tx_cleanup(struct ath_softc *sc);
-struct ath_txq *ath_test_get_txq(struct ath_softc *sc, struct sk_buff *skb);
 int ath_txq_update(struct ath_softc *sc, int qnum,
                   struct ath9k_tx_queue_info *q);
 int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
                 struct ath_tx_control *txctl);
 void ath_tx_tasklet(struct ath_softc *sc);
+void ath_tx_edma_tasklet(struct ath_softc *sc);
 void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb);
 bool ath_tx_aggr_check(struct ath_softc *sc, struct ath_node *an, u8 tidno);
 void ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
@@ -343,10 +421,14 @@ int ath_beaconq_config(struct ath_softc *sc);
 
 #define ATH_STA_SHORT_CALINTERVAL 1000    /* 1 second */
 #define ATH_AP_SHORT_CALINTERVAL  100     /* 100 ms */
-#define ATH_ANI_POLLINTERVAL      100     /* 100 ms */
+#define ATH_ANI_POLLINTERVAL_OLD  100     /* 100 ms */
+#define ATH_ANI_POLLINTERVAL_NEW  1000    /* 1000 ms */
 #define ATH_LONG_CALINTERVAL      30000   /* 30 seconds */
 #define ATH_RESTART_CALINTERVAL   1200000 /* 20 minutes */
 
+#define ATH_PAPRD_TIMEOUT      100 /* msecs */
+
+void ath_paprd_calibrate(struct work_struct *work);
 void ath_ani_calibrate(unsigned long data);
 
 /**********/
@@ -478,6 +560,8 @@ struct ath_softc {
        spinlock_t sc_serial_rw;
        spinlock_t sc_pm_lock;
        struct mutex mutex;
+       struct work_struct paprd_work;
+       struct completion paprd_complete;
 
        u32 intrstatus;
        u32 sc_flags; /* SC_OP_* */
@@ -515,6 +599,8 @@ struct ath_softc {
        struct ath_beacon_config cur_beacon_conf;
        struct delayed_work tx_complete_work;
        struct ath_btcoex btcoex;
+
+       struct ath_descdma txsdma;
 };
 
 struct ath_wiphy {
@@ -534,7 +620,6 @@ struct ath_wiphy {
 
 void ath9k_tasklet(unsigned long data);
 int ath_reset(struct ath_softc *sc, bool retry_tx);
-int ath_get_hal_qnum(u16 queue, struct ath_softc *sc);
 int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
 int ath_cabq_update(struct ath_softc *);
 
@@ -545,13 +630,12 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz)
 
 extern struct ieee80211_ops ath9k_ops;
 extern int modparam_nohwcrypt;
+extern int led_blink;
 
 irqreturn_t ath_isr(int irq, void *dev);
 int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
                    const struct ath_bus_ops *bus_ops);
 void ath9k_deinit_device(struct ath_softc *sc);
-const char *ath_mac_bb_name(u32 mac_bb_version);
-const char *ath_rf_name(u16 rf_version);
 void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw);
 void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw,
                           struct ath9k_channel *ichan);
@@ -602,8 +686,6 @@ void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle);
 void ath_mac80211_stop_queue(struct ath_softc *sc, u16 skb_queue);
 void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue);
 
-int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype);
-
 void ath_start_rfkill_poll(struct ath_softc *sc);
 extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw);