ath9k: Remove remaining occurrences of CONFIG_SLOW_ANT_DIV
[linux-2.6-block.git] / drivers / net / wireless / ath9k / core.h
index 0c348209f39c792340c6d9c278a0bc9ebce2347e..0e3c225c749e1b4414ddf8bd935f36cdb3a1172b 100644 (file)
 #ifndef CORE_H
 #define CORE_H
 
-#include <linux/version.h>
-#include <linux/autoconf.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/spinlock.h>
-#include <linux/errno.h>
-#include <linux/skbuff.h>
-#include <linux/netdevice.h>
 #include <linux/etherdevice.h>
-#include <linux/ip.h>
-#include <linux/tcp.h>
-#include <linux/in.h>
-#include <linux/delay.h>
-#include <linux/wait.h>
 #include <linux/pci.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/list.h>
-#include <asm/byteorder.h>
-#include <linux/scatterlist.h>
-#include <asm/page.h>
 #include <net/mac80211.h>
 #include <linux/leds.h>
 #include <linux/rfkill.h>
 
 struct ath_node;
 
-/******************/
-/* Utility macros */
-/******************/
-
 /* Macro to expand scalars to 64-bit objects */
 
 #define        ito64(x) (sizeof(x) == 8) ?                     \
@@ -86,89 +63,123 @@ struct ath_node;
 
 #define        ATH_TXQ_SETUP(sc, i)        ((sc)->sc_txqsetup & (1<<i))
 
-static inline unsigned long get_timestamp(void)
-{
-       return ((jiffies / HZ) * 1000) + (jiffies % HZ) * (1000 / HZ);
-}
-
 static const u8 ath_bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
-/*************/
-/* Debugging */
-/*************/
-
 enum ATH_DEBUG {
        ATH_DBG_RESET           = 0x00000001,
-       ATH_DBG_PHY_IO          = 0x00000002,
-       ATH_DBG_REG_IO          = 0x00000004,
-       ATH_DBG_QUEUE           = 0x00000008,
-       ATH_DBG_EEPROM          = 0x00000010,
-       ATH_DBG_NF_CAL          = 0x00000020,
-       ATH_DBG_CALIBRATE       = 0x00000040,
-       ATH_DBG_CHANNEL         = 0x00000080,
-       ATH_DBG_INTERRUPT       = 0x00000100,
-       ATH_DBG_REGULATORY      = 0x00000200,
-       ATH_DBG_ANI             = 0x00000400,
-       ATH_DBG_POWER_MGMT      = 0x00000800,
-       ATH_DBG_XMIT            = 0x00001000,
-       ATH_DBG_BEACON          = 0x00002000,
-       ATH_DBG_RATE            = 0x00004000,
-       ATH_DBG_CONFIG          = 0x00008000,
-       ATH_DBG_KEYCACHE        = 0x00010000,
-       ATH_DBG_AGGR            = 0x00020000,
-       ATH_DBG_FATAL           = 0x00040000,
+       ATH_DBG_REG_IO          = 0x00000002,
+       ATH_DBG_QUEUE           = 0x00000004,
+       ATH_DBG_EEPROM          = 0x00000008,
+       ATH_DBG_CALIBRATE       = 0x00000010,
+       ATH_DBG_CHANNEL         = 0x00000020,
+       ATH_DBG_INTERRUPT       = 0x00000040,
+       ATH_DBG_REGULATORY      = 0x00000080,
+       ATH_DBG_ANI             = 0x00000100,
+       ATH_DBG_POWER_MGMT      = 0x00000200,
+       ATH_DBG_XMIT            = 0x00000400,
+       ATH_DBG_BEACON          = 0x00001000,
+       ATH_DBG_CONFIG          = 0x00002000,
+       ATH_DBG_KEYCACHE        = 0x00004000,
+       ATH_DBG_FATAL           = 0x00008000,
        ATH_DBG_ANY             = 0xffffffff
 };
 
 #define DBG_DEFAULT (ATH_DBG_FATAL)
 
-#define        DPRINTF(sc, _m, _fmt, ...) do {                 \
-               if (sc->sc_debug & (_m))                \
-                       printk(_fmt , ##__VA_ARGS__);   \
-       } while (0)
+#ifdef CONFIG_ATH9K_DEBUG
+
+/**
+ * struct ath_interrupt_stats - Contains statistics about interrupts
+ * @total: Total no. of interrupts generated so far
+ * @rxok: RX with no errors
+ * @rxeol: RX with no more RXDESC available
+ * @rxorn: RX FIFO overrun
+ * @txok: TX completed at the requested rate
+ * @txurn: TX FIFO underrun
+ * @mib: MIB regs reaching its threshold
+ * @rxphyerr: RX with phy errors
+ * @rx_keycache_miss: RX with key cache misses
+ * @swba: Software Beacon Alert
+ * @bmiss: Beacon Miss
+ * @bnr: Beacon Not Ready
+ * @cst: Carrier Sense TImeout
+ * @gtt: Global TX Timeout
+ * @tim: RX beacon TIM occurrence
+ * @cabend: RX End of CAB traffic
+ * @dtimsync: DTIM sync lossage
+ * @dtim: RX Beacon with DTIM
+ */
+struct ath_interrupt_stats {
+       u32 total;
+       u32 rxok;
+       u32 rxeol;
+       u32 rxorn;
+       u32 txok;
+       u32 txeol;
+       u32 txurn;
+       u32 mib;
+       u32 rxphyerr;
+       u32 rx_keycache_miss;
+       u32 swba;
+       u32 bmiss;
+       u32 bnr;
+       u32 cst;
+       u32 gtt;
+       u32 tim;
+       u32 cabend;
+       u32 dtimsync;
+       u32 dtim;
+};
+
+struct ath_stats {
+       struct ath_interrupt_stats istats;
+};
+
+struct ath9k_debug {
+       int debug_mask;
+       struct dentry *debugfs_root;
+       struct dentry *debugfs_phy;
+       struct dentry *debugfs_dma;
+       struct dentry *debugfs_interrupt;
+       struct ath_stats stats;
+};
+
+void DPRINTF(struct ath_softc *sc, int dbg_mask, const char *fmt, ...);
+int ath9k_init_debug(struct ath_softc *sc);
+void ath9k_exit_debug(struct ath_softc *sc);
+void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
+
+#else
+
+static inline void DPRINTF(struct ath_softc *sc, int dbg_mask,
+                          const char *fmt, ...)
+{
+}
+
+static inline int ath9k_init_debug(struct ath_softc *sc)
+{
+       return 0;
+}
+
+static inline void ath9k_exit_debug(struct ath_softc *sc)
+{
+}
+
+static inline void ath_debug_stat_interrupt(struct ath_softc *sc,
+                                           enum ath9k_int status)
+{
+}
 
-/***************************/
-/* Load-time Configuration */
-/***************************/
+#endif /* CONFIG_ATH9K_DEBUG */
 
-/* Per-instance load-time (note: NOT run-time) configurations
- * for Atheros Device */
 struct ath_config {
        u32 ath_aggr_prot;
        u16 txpowlimit;
        u16 txpowlimit_override;
-       u8 cabqReadytime; /* Cabq Readytime % */
-       u8 swBeaconProcess; /* Process received beacons in SW (vs HW) */
+       u8 cabqReadytime;
+       u8 swBeaconProcess;
 };
 
-/***********************/
-/* Chainmask Selection */
-/***********************/
-
-#define ATH_CHAINMASK_SEL_TIMEOUT         6000
-/* Default - Number of last RSSI values that is used for
- * chainmask selection */
-#define ATH_CHAINMASK_SEL_RSSI_CNT        10
-/* Means use 3x3 chainmask instead of configured chainmask */
-#define ATH_CHAINMASK_SEL_3X3             7
-/* Default - Rssi threshold below which we have to switch to 3x3 */
-#define ATH_CHAINMASK_SEL_UP_RSSI_THRES           20
-/* Default - Rssi threshold above which we have to switch to
- * user configured values */
-#define ATH_CHAINMASK_SEL_DOWN_RSSI_THRES  35
-/* Struct to store the chainmask select related info */
-struct ath_chainmask_sel {
-       struct timer_list timer;
-       int cur_tx_mask;        /* user configured or 3x3 */
-       int cur_rx_mask;        /* user configured or 3x3 */
-       int tx_avgrssi;
-       u8 switch_allowed:1,    /* timer will set this */
-          cm_sel_enabled : 1;
-};
-
-int ath_chainmask_sel_logic(struct ath_softc *sc, struct ath_node *an);
-void ath_update_chainmask(struct ath_softc *sc, int is_ht);
-
 /*************************/
 /* Descriptor Management */
 /*************************/
@@ -197,14 +208,13 @@ enum buffer_type {
 };
 
 struct ath_buf_state {
-       int bfs_nframes;                        /* # frames in aggregate */
-       u16 bfs_al;                             /* length of aggregate */
-       u16 bfs_frmlen;                         /* length of frame */
-       int bfs_seqno;                          /* sequence number */
-       int bfs_tidno;                          /* tid of this frame */
-       int bfs_retries;                        /* current retries */
-       u32 bf_type;                            /* BUF_* (enum buffer_type) */
-       /* key type use to encrypt this frame */
+       int bfs_nframes;                /* # frames in aggregate */
+       u16 bfs_al;                     /* length of aggregate */
+       u16 bfs_frmlen;                 /* length of frame */
+       int bfs_seqno;                  /* sequence number */
+       int bfs_tidno;                  /* tid of this frame */
+       int bfs_retries;                /* current retries */
+       u32 bf_type;                    /* BUF_* (enum buffer_type) */
        u32 bfs_keyix;
        enum ath9k_key_type bfs_keytype;
 };
@@ -240,7 +250,6 @@ struct ath_buf {
                                           an aggregate) */
        struct ath_buf *bf_lastfrm;     /* last buf of this frame */
        struct ath_buf *bf_next;        /* next subframe in the aggregate */
-       struct ath_buf *bf_rifslast;    /* last buf for RIFS burst */
        void *bf_mpdu;                  /* enclosing frame structure */
        struct ath_desc *bf_desc;       /* virtual addr of desc */
        dma_addr_t bf_daddr;            /* physical addr of desc */
@@ -251,13 +260,6 @@ struct ath_buf {
        dma_addr_t bf_dmacontext;
 };
 
-/*
- * reset the rx buffer.
- * any new fields added to the athbuf and require
- * reset need to be added to this macro.
- * currently bf_status is the only one requires that
- * requires reset.
- */
 #define ATH_RXBUF_RESET(_bf)    ((_bf)->bf_status = 0)
 
 /* hw processing complete, desc processed by hal */
@@ -278,16 +280,10 @@ struct ath_descdma {
        dma_addr_t dd_dmacontext;
 };
 
-int ath_descdma_setup(struct ath_softc *sc,
-                     struct ath_descdma *dd,
-                     struct list_head *head,
-                     const char *name,
-                     int nbuf,
-                     int ndesc);
-int ath_desc_alloc(struct ath_softc *sc);
-void ath_desc_free(struct ath_softc *sc);
-void ath_descdma_cleanup(struct ath_softc *sc,
-                        struct ath_descdma *dd,
+int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
+                     struct list_head *head, const char *name,
+                     int nbuf, int ndesc);
+void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd,
                         struct list_head *head);
 
 /***********/
@@ -307,11 +303,8 @@ void ath_rx_cleanup(struct ath_softc *sc);
 int ath_rx_tasklet(struct ath_softc *sc, int flush);
 
 #define ATH_TXBUF               512
-/* max number of transmit attempts (tries) */
 #define ATH_TXMAXTRY            13
-/* max number of 11n transmit attempts (tries) */
 #define ATH_11N_TXMAXTRY        10
-/* max number of tries for management and control frames */
 #define ATH_MGT_TXMAXTRY        4
 #define WME_BA_BMP_SIZE         64
 #define WME_MAX_BA              WME_BA_BMP_SIZE
@@ -323,22 +316,12 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush);
         WME_AC_VO)
 
 
-/* Wireless Multimedia Extension Defines */
-#define WME_AC_BE               0 /* best effort */
-#define WME_AC_BK               1 /* background */
-#define WME_AC_VI               2 /* video */
-#define WME_AC_VO               3 /* voice */
-#define WME_NUM_AC              4
+#define WME_AC_BE   0
+#define WME_AC_BK   1
+#define WME_AC_VI   2
+#define WME_AC_VO   3
+#define WME_NUM_AC  4
 
-/*
- * Data transmit queue state.  One of these exists for each
- * hardware transmit queue.  Packets sent to us from above
- * are assigned to queues based on their priority.  Not all
- * devices support a complete set of hardware transmit queues.
- * For those devices the array sc_ac2q will map multiple
- * priorities to fewer hardware queues (typically all to one
- * hardware queue).
- */
 struct ath_txq {
        u32 axq_qnum;                   /* hardware q number */
        u32 *axq_link;                  /* link ptr in last TX desc */
@@ -416,14 +399,15 @@ struct ath_xmit_status {
 #define ATH_TX_BAR          0x04
 };
 
+/* All RSSI values are noise floor adjusted */
 struct ath_tx_stat {
-       int rssi;               /* RSSI (noise floor ajusted) */
-       int rssictl[ATH_MAX_ANTENNA];   /* RSSI (noise floor ajusted) */
-       int rssiextn[ATH_MAX_ANTENNA];  /* RSSI (noise floor ajusted) */
-       int rateieee;           /* data rate xmitted (IEEE rate code) */
-       int rateKbps;           /* data rate xmitted (Kbps) */
-       int ratecode;           /* phy rate code */
-       int flags;              /* validity flags */
+       int rssi;
+       int rssictl[ATH_MAX_ANTENNA];
+       int rssiextn[ATH_MAX_ANTENNA];
+       int rateieee;
+       int rateKbps;
+       int ratecode;
+       int flags;
 /* if any of ctl,extn chain rssis are valid */
 #define ATH_TX_CHAIN_RSSI_VALID 0x01
 /* if extn chain rssis are valid */
@@ -452,9 +436,6 @@ int ath_tx_start(struct ath_softc *sc, struct sk_buff *skb,
 void ath_tx_tasklet(struct ath_softc *sc);
 u32 ath_txq_depth(struct ath_softc *sc, int qnum);
 u32 ath_txq_aggr_depth(struct ath_softc *sc, int qnum);
-void ath_notify_txq_status(struct ath_softc *sc, u16 queue_depth);
-void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
-                    struct ath_xmit_status *tx_status);
 void ath_tx_cabq(struct ath_softc *sc, struct sk_buff *skb);
 
 /**********************/
@@ -462,7 +443,7 @@ void ath_tx_cabq(struct ath_softc *sc, struct sk_buff *skb);
 /**********************/
 
 #define ADDBA_EXCHANGE_ATTEMPTS    10
-#define ATH_AGGR_DELIM_SZ          4   /* delimiter size   */
+#define ATH_AGGR_DELIM_SZ          4
 #define ATH_AGGR_MINPLEN           256 /* in bytes, minimum packet length */
 /* number of delimiters for encryption padding */
 #define ATH_AGGR_ENCRYPTDELIM      10
@@ -513,31 +494,23 @@ struct aggr_rifs_param {
 
 /* Per-node aggregation state */
 struct ath_node_aggr {
-       struct ath_atx tx;      /* node transmit state */
+       struct ath_atx tx;
 };
 
-/* driver-specific node state */
 struct ath_node {
        struct ath_softc *an_sc;
-       struct ath_chainmask_sel an_chainmask_sel;
        struct ath_node_aggr an_aggr;
        u16 maxampdu;
        u8 mpdudensity;
 };
 
-void ath_tx_resume_tid(struct ath_softc *sc,
-       struct ath_atx_tid *tid);
+void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid);
 bool ath_tx_aggr_check(struct ath_softc *sc, struct ath_node *an, u8 tidno);
-void ath_tx_aggr_teardown(struct ath_softc *sc,
-       struct ath_node *an, u8 tidno);
+void ath_tx_aggr_teardown(struct ath_softc *sc,        struct ath_node *an, u8 tidno);
 int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
                      u16 tid, u16 *ssn);
 int ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
 void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
-void ath_newassoc(struct ath_softc *sc,
-       struct ath_node *node, int isnew, int isuapsd);
-void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta);
-void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta);
 
 /********/
 /* VAPs */
@@ -554,12 +527,11 @@ void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta);
 #define ATH_SET_VAP_BSSID_MASK(bssid_mask) \
        ((bssid_mask)[0] &= ~(((ATH_BCBUF-1)<<2)|0x02))
 
-/* driver-specific vap state */
 struct ath_vap {
-       int av_bslot;                   /* beacon slot index */
-       enum ath9k_opmode av_opmode;    /* VAP operational mode */
-       struct ath_buf *av_bcbuf;       /* beacon buffer */
-       struct ath_tx_control av_btxctl;  /* txctl information for beacon */
+       int av_bslot;
+       enum nl80211_iftype av_opmode;
+       struct ath_buf *av_bcbuf;
+       struct ath_tx_control av_btxctl;
 };
 
 /*******************/
@@ -572,12 +544,11 @@ struct ath_vap {
  * number of beacon intervals, the game's up.
  */
 #define BSTUCK_THRESH                  (9 * ATH_BCBUF)
-#define        ATH_BCBUF                       4   /* number of beacon buffers */
-#define ATH_DEFAULT_BINTVAL            100 /* default beacon interval in TU */
+#define        ATH_BCBUF                       1
+#define ATH_DEFAULT_BINTVAL            100 /* TU */
 #define ATH_DEFAULT_BMISS_LIMIT        10
 #define IEEE80211_MS_TO_TU(x)           (((x) * 1000) / 1024)
 
-/* beacon configuration */
 struct ath_beacon_config {
        u16 beacon_interval;
        u16 listen_interval;
@@ -595,49 +566,8 @@ void ath9k_beacon_tasklet(unsigned long data);
 void ath_beacon_config(struct ath_softc *sc, int if_id);
 int ath_beaconq_setup(struct ath_hal *ah);
 int ath_beacon_alloc(struct ath_softc *sc, int if_id);
-void ath_bstuck_process(struct ath_softc *sc);
 void ath_beacon_return(struct ath_softc *sc, struct ath_vap *avp);
 void ath_beacon_sync(struct ath_softc *sc, int if_id);
-void ath_get_beaconconfig(struct ath_softc *sc,
-                         int if_id,
-                         struct ath_beacon_config *conf);
-/*********************/
-/* Antenna diversity */
-/*********************/
-
-#define ATH_ANT_DIV_MAX_CFG      2
-#define ATH_ANT_DIV_MIN_IDLE_US  1000000  /* us */
-#define ATH_ANT_DIV_MIN_SCAN_US  50000   /* us */
-
-enum ATH_ANT_DIV_STATE{
-       ATH_ANT_DIV_IDLE,
-       ATH_ANT_DIV_SCAN,       /* evaluating antenna */
-};
-
-struct ath_antdiv {
-       struct ath_softc *antdiv_sc;
-       u8 antdiv_start;
-       enum ATH_ANT_DIV_STATE antdiv_state;
-       u8 antdiv_num_antcfg;
-       u8 antdiv_curcfg;
-       u8 antdiv_bestcfg;
-       int32_t antdivf_rssitrig;
-       int32_t antdiv_lastbrssi[ATH_ANT_DIV_MAX_CFG];
-       u64 antdiv_lastbtsf[ATH_ANT_DIV_MAX_CFG];
-       u64 antdiv_laststatetsf;
-       u8 antdiv_bssid[ETH_ALEN];
-};
-
-void ath_slow_ant_div_init(struct ath_antdiv *antdiv,
-       struct ath_softc *sc, int32_t rssitrig);
-void ath_slow_ant_div_start(struct ath_antdiv *antdiv,
-                           u8 num_antcfg,
-                           const u8 *bssid);
-void ath_slow_ant_div_stop(struct ath_antdiv *antdiv);
-void ath_slow_ant_div(struct ath_antdiv *antdiv,
-                     struct ieee80211_hdr *wh,
-                     struct ath_rx_status *rx_stats);
-void ath_setdefantenna(void *sc, u32 antenna);
 
 /*******/
 /* ANI */
@@ -719,30 +649,8 @@ struct ath_rfkill {
 
 #define ATH_IF_ID_ANY          0xff
 #define ATH_TXPOWER_MAX         100     /* .5 dBm units */
-
-#define RSSI_LPF_THRESHOLD         -20
-#define ATH_RSSI_EP_MULTIPLIER     (1<<7)  /* pow2 to optimize out * and / */
-#define ATH_RATE_DUMMY_MARKER      0
-#define ATH_RSSI_LPF_LEN           10
-#define ATH_RSSI_DUMMY_MARKER      0x127
-
-#define ATH_EP_MUL(x, mul)         ((x) * (mul))
-#define ATH_EP_RND(x, mul)                                             \
-       ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
-#define ATH_RSSI_OUT(x)                                                        \
-       (((x) != ATH_RSSI_DUMMY_MARKER) ?                               \
-        (ATH_EP_RND((x), ATH_RSSI_EP_MULTIPLIER)) : ATH_RSSI_DUMMY_MARKER)
-#define ATH_RSSI_IN(x)                                 \
-       (ATH_EP_MUL((x), ATH_RSSI_EP_MULTIPLIER))
-#define ATH_LPF_RSSI(x, y, len)                                                \
-       ((x != ATH_RSSI_DUMMY_MARKER) ? \
-               (((x) * ((len) - 1) + (y)) / (len)) : (y))
-#define ATH_RSSI_LPF(x, y) do {                                                \
-               if ((y) >= RSSI_LPF_THRESHOLD)                          \
-                       x = ATH_LPF_RSSI((x), \
-                               ATH_RSSI_IN((y)), ATH_RSSI_LPF_LEN); \
-       } while (0)
-
+#define ATH_RSSI_DUMMY_MARKER   0x127
+#define ATH_RATE_DUMMY_MARKER   0
 
 enum PROT_MODE {
        PROT_M_NONE = 0,
@@ -750,17 +658,6 @@ enum PROT_MODE {
        PROT_M_CTSONLY
 };
 
-enum RATE_TYPE {
-       NORMAL_RATE = 0,
-       HALF_RATE,
-       QUARTER_RATE
-};
-
-struct ath_ht_info {
-       enum ath9k_ht_macmode tx_chan_width;
-       u8 ext_chan_offset;
-};
-
 #define SC_OP_INVALID          BIT(0)
 #define SC_OP_BEACONS          BIT(1)
 #define SC_OP_RXAGGR           BIT(2)
@@ -789,7 +686,9 @@ struct ath_softc {
        u8 sc_myaddr[ETH_ALEN];
        u8 sc_bssidmask[ETH_ALEN];
 
-       int sc_debug;
+#ifdef CONFIG_ATH9K_DEBUG
+       struct ath9k_debug sc_debug;
+#endif
        u32 sc_intrstatus;
        u32 sc_flags; /* SC_OP_* */
        unsigned int rx_filter;
@@ -802,24 +701,20 @@ struct ath_softc {
        u8 sc_tx_chainmask;
        u8 sc_rx_chainmask;
        enum ath9k_int sc_imask;
-       enum wireless_mode sc_curmode;  /* current phy mode */
        enum PROT_MODE sc_protmode;
 
-       u8 sc_nbcnvaps;                 /* # of vaps sending beacons */
-       u16 sc_nvaps;                   /* # of active virtual ap's */
+       u8 sc_nbcnvaps;
+       u16 sc_nvaps;
        struct ieee80211_vif *sc_vaps[ATH_BCBUF];
 
        u8 sc_mcastantenna;
-       u8 sc_defant;                   /* current default antenna */
-       u8 sc_rxotherant;               /* rx's on non-default antenna */
+       u8 sc_defant;
+       u8 sc_rxotherant;
 
-       struct ath9k_node_stats sc_halstats; /* station-mode rssi stats */
-       struct ath_ht_info sc_ht_info;
+       struct ath9k_node_stats sc_halstats;
        enum ath9k_ht_extprotspacing sc_ht_extprotspacing;
+       enum ath9k_ht_macmode tx_chan_width;
 
-#ifdef CONFIG_SLOW_ANT_DIV
-       struct ath_antdiv sc_antdiv;
-#endif
        enum {
                OK,             /* no change needed */
                UPDATE,         /* update pending */
@@ -827,22 +722,22 @@ struct ath_softc {
        } sc_updateslot;        /* slot time update fsm */
 
        /* Crypto */
-       u32 sc_keymax;          /* size of key cache */
-       DECLARE_BITMAP(sc_keymap, ATH_KEYMAX);  /* key use bit map */
+       u32 sc_keymax;
+       DECLARE_BITMAP(sc_keymap, ATH_KEYMAX);
        u8 sc_splitmic;         /* split TKIP MIC keys */
 
        /* RX */
        struct list_head sc_rxbuf;
        struct ath_descdma sc_rxdma;
-       int sc_rxbufsize;       /* rx size based on mtu */
-       u32 *sc_rxlink;         /* link ptr in last RX desc */
+       int sc_rxbufsize;
+       u32 *sc_rxlink;
 
        /* TX */
        struct list_head sc_txbuf;
        struct ath_txq sc_txq[ATH9K_NUM_TX_QUEUES];
        struct ath_descdma sc_txdma;
        u32 sc_txqsetup;
-       int sc_haltype2q[ATH9K_WME_AC_VO+1]; /* HAL WME AC -> h/w qnum */
+       int sc_haltype2q[ATH9K_WME_AC_VO+1];
        u16 seq_no; /* TX sequence number */
 
        /* Beacon */
@@ -852,13 +747,14 @@ struct ath_softc {
        struct list_head sc_bbuf;
        u32 sc_bhalq;
        u32 sc_bmisscount;
-       u32 ast_be_xmit;        /* beacons transmitted */
+       u32 ast_be_xmit;
        u64 bc_tstamp;
 
        /* Rate */
        struct ieee80211_rate rates[IEEE80211_NUM_BANDS][ATH_RATE_MAX];
        struct ath_rate_table *hw_rate_table[ATH9K_MODE_MAX];
-       u8 sc_protrix;          /* protection rate index */
+       struct ath_rate_table *cur_rate_table;
+       u8 sc_protrix;
 
        /* Channel, Band */
        struct ieee80211_channel channels[IEEE80211_NUM_BANDS][ATH_CHAN_MAX];
@@ -883,27 +779,9 @@ struct ath_softc {
        struct ath_ani sc_ani;
 };
 
-int ath_init(u16 devid, struct ath_softc *sc);
-int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan);
-void ath_stop(struct ath_softc *sc);
-irqreturn_t ath_isr(int irq, void *dev);
 int ath_reset(struct ath_softc *sc, bool retry_tx);
-int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan);
-
-/*********************/
-/* Utility Functions */
-/*********************/
-
-void ath_key_reset(struct ath_softc *sc, u16 keyix, int freeslot);
-int ath_keyset(struct ath_softc *sc,
-              u16 keyix,
-              struct ath9k_keyval *hk,
-              const u8 mac[ETH_ALEN]);
 int ath_get_hal_qnum(u16 queue, struct ath_softc *sc);
 int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
-void ath_setslottime(struct ath_softc *sc);
-void ath_update_txpow(struct ath_softc *sc);
 int ath_cabq_update(struct ath_softc *);
-u64 ath_extend_tsf(struct ath_softc *sc, u32 rstamp);
 
 #endif /* CORE_H */