aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ath9k.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ath9k.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h73
1 files changed, 28 insertions, 45 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 1d59f10f68d..13dd0202d6b 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -26,7 +26,7 @@
26#include "rc.h" 26#include "rc.h"
27#include "debug.h" 27#include "debug.h"
28#include "../ath.h" 28#include "../ath.h"
29#include "btcoex.h" 29#include "../debug.h"
30 30
31struct ath_node; 31struct ath_node;
32 32
@@ -54,15 +54,11 @@ struct ath_node;
54 54
55#define A_MAX(a, b) ((a) > (b) ? (a) : (b)) 55#define A_MAX(a, b) ((a) > (b) ? (a) : (b))
56 56
57#define ASSERT(exp) BUG_ON(!(exp))
58
59#define TSF_TO_TU(_h,_l) \ 57#define TSF_TO_TU(_h,_l) \
60 ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) 58 ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
61 59
62#define ATH_TXQ_SETUP(sc, i) ((sc)->tx.txqsetup & (1<<i)) 60#define ATH_TXQ_SETUP(sc, i) ((sc)->tx.txqsetup & (1<<i))
63 61
64static const u8 ath_bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
65
66struct ath_config { 62struct ath_config {
67 u32 ath_aggr_prot; 63 u32 ath_aggr_prot;
68 u16 txpowlimit; 64 u16 txpowlimit;
@@ -191,7 +187,6 @@ void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd,
191/* minimum h/w qdepth to be sustained to maximize aggregation */ 187/* minimum h/w qdepth to be sustained to maximize aggregation */
192#define ATH_AGGR_MIN_QDEPTH 2 188#define ATH_AGGR_MIN_QDEPTH 2
193#define ATH_AMPDU_SUBFRAME_DEFAULT 32 189#define ATH_AMPDU_SUBFRAME_DEFAULT 32
194#define ATH_AMPDU_LIMIT_MAX (64 * 1024 - 1)
195 190
196#define IEEE80211_SEQ_SEQ_SHIFT 4 191#define IEEE80211_SEQ_SEQ_SHIFT 4
197#define IEEE80211_SEQ_MAX 4096 192#define IEEE80211_SEQ_MAX 4096
@@ -293,7 +288,6 @@ struct ath_tx_control {
293 288
294#define ATH_RSSI_LPF_LEN 10 289#define ATH_RSSI_LPF_LEN 10
295#define RSSI_LPF_THRESHOLD -20 290#define RSSI_LPF_THRESHOLD -20
296#define ATH9K_RSSI_BAD 0x80
297#define ATH_RSSI_EP_MULTIPLIER (1<<7) 291#define ATH_RSSI_EP_MULTIPLIER (1<<7)
298#define ATH_EP_MUL(x, mul) ((x) * (mul)) 292#define ATH_EP_MUL(x, mul) ((x) * (mul))
299#define ATH_RSSI_IN(x) (ATH_EP_MUL((x), ATH_RSSI_EP_MULTIPLIER)) 293#define ATH_RSSI_IN(x) (ATH_EP_MUL((x), ATH_RSSI_EP_MULTIPLIER))
@@ -427,7 +421,6 @@ struct ath_beacon {
427 421
428void ath_beacon_tasklet(unsigned long data); 422void ath_beacon_tasklet(unsigned long data);
429void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif); 423void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif);
430int ath_beaconq_setup(struct ath_hw *ah);
431int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif); 424int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif);
432void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp); 425void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp);
433 426
@@ -451,6 +444,26 @@ struct ath_ani {
451 struct timer_list timer; 444 struct timer_list timer;
452}; 445};
453 446
447/* Defines the BT AR_BT_COEX_WGHT used */
448enum ath_stomp_type {
449 ATH_BTCOEX_NO_STOMP,
450 ATH_BTCOEX_STOMP_ALL,
451 ATH_BTCOEX_STOMP_LOW,
452 ATH_BTCOEX_STOMP_NONE
453};
454
455struct ath_btcoex {
456 bool hw_timer_enabled;
457 spinlock_t btcoex_lock;
458 struct timer_list period_timer; /* Timer for BT period */
459 u32 bt_priority_cnt;
460 unsigned long bt_priority_time;
461 int bt_stomp_type; /* Types of BT stomping */
462 u32 btcoex_no_stomp; /* in usec */
463 u32 btcoex_period; /* in usec */
464 struct ath_gen_timer *no_stomp_timer; /* Timer for no BT stomping */
465};
466
454/********************/ 467/********************/
455/* LED Control */ 468/* LED Control */
456/********************/ 469/********************/
@@ -484,7 +497,6 @@ struct ath_led {
484 * Used when PCI device not fully initialized by bootrom/BIOS 497 * Used when PCI device not fully initialized by bootrom/BIOS
485*/ 498*/
486#define DEFAULT_CACHELINE 32 499#define DEFAULT_CACHELINE 32
487#define ATH_DEFAULT_NOISE_FLOOR -95
488#define ATH_REGCLASSIDS_MAX 10 500#define ATH_REGCLASSIDS_MAX 10
489#define ATH_CABQ_READY_TIME 80 /* % of beacon interval */ 501#define ATH_CABQ_READY_TIME 80 /* % of beacon interval */
490#define ATH_MAX_SW_RETRIES 10 502#define ATH_MAX_SW_RETRIES 10
@@ -522,23 +534,14 @@ struct ath_led {
522#define SC_OP_WAIT_FOR_PSPOLL_DATA BIT(17) 534#define SC_OP_WAIT_FOR_PSPOLL_DATA BIT(17)
523#define SC_OP_WAIT_FOR_TX_ACK BIT(18) 535#define SC_OP_WAIT_FOR_TX_ACK BIT(18)
524#define SC_OP_BEACON_SYNC BIT(19) 536#define SC_OP_BEACON_SYNC BIT(19)
525#define SC_OP_BTCOEX_ENABLED BIT(20)
526#define SC_OP_BT_PRIORITY_DETECTED BIT(21) 537#define SC_OP_BT_PRIORITY_DETECTED BIT(21)
527 538
528struct ath_bus_ops {
529 void (*read_cachesize)(struct ath_softc *sc, int *csz);
530 void (*cleanup)(struct ath_softc *sc);
531 bool (*eeprom_read)(struct ath_hw *ah, u32 off, u16 *data);
532};
533
534struct ath_wiphy; 539struct ath_wiphy;
535 540
536struct ath_softc { 541struct ath_softc {
537 struct ieee80211_hw *hw; 542 struct ieee80211_hw *hw;
538 struct device *dev; 543 struct device *dev;
539 544
540 struct ath_common common;
541
542 spinlock_t wiphy_lock; /* spinlock to protect ath_wiphy data */ 545 spinlock_t wiphy_lock; /* spinlock to protect ath_wiphy data */
543 struct ath_wiphy *pri_wiphy; 546 struct ath_wiphy *pri_wiphy;
544 struct ath_wiphy **sec_wiphy; /* secondary wiphys (virtual radios); may 547 struct ath_wiphy **sec_wiphy; /* secondary wiphys (virtual radios); may
@@ -565,24 +568,17 @@ struct ath_softc {
565 spinlock_t sc_pm_lock; 568 spinlock_t sc_pm_lock;
566 struct mutex mutex; 569 struct mutex mutex;
567 570
568 u8 curbssid[ETH_ALEN];
569 u8 bssidmask[ETH_ALEN];
570 u32 intrstatus; 571 u32 intrstatus;
571 u32 sc_flags; /* SC_OP_* */ 572 u32 sc_flags; /* SC_OP_* */
572 u16 curtxpow; 573 u16 curtxpow;
573 u16 curaid;
574 u8 nbcnvifs; 574 u8 nbcnvifs;
575 u16 nvifs; 575 u16 nvifs;
576 u8 tx_chainmask;
577 u8 rx_chainmask;
578 u32 keymax; 576 u32 keymax;
579 DECLARE_BITMAP(keymap, ATH_KEYMAX); 577 DECLARE_BITMAP(keymap, ATH_KEYMAX);
580 u8 splitmic; 578 u8 splitmic;
581 bool ps_enabled; 579 bool ps_enabled;
582 unsigned long ps_usecount; 580 unsigned long ps_usecount;
583 enum ath9k_int imask; 581 enum ath9k_int imask;
584 enum ath9k_ht_extprotspacing ht_extprotspacing;
585 enum ath9k_ht_macmode tx_chan_width;
586 582
587 struct ath_config config; 583 struct ath_config config;
588 struct ath_rx rx; 584 struct ath_rx rx;
@@ -609,10 +605,9 @@ struct ath_softc {
609#ifdef CONFIG_ATH9K_DEBUG 605#ifdef CONFIG_ATH9K_DEBUG
610 struct ath9k_debug debug; 606 struct ath9k_debug debug;
611#endif 607#endif
612 struct ath_bus_ops *bus_ops;
613 struct ath_beacon_config cur_beacon_conf; 608 struct ath_beacon_config cur_beacon_conf;
614 struct delayed_work tx_complete_work; 609 struct delayed_work tx_complete_work;
615 struct ath_btcoex_info btcoex_info; 610 struct ath_btcoex btcoex;
616}; 611};
617 612
618struct ath_wiphy { 613struct ath_wiphy {
@@ -634,31 +629,22 @@ int ath_get_hal_qnum(u16 queue, struct ath_softc *sc);
634int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc); 629int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
635int ath_cabq_update(struct ath_softc *); 630int ath_cabq_update(struct ath_softc *);
636 631
637static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah) 632static inline void ath_read_cachesize(struct ath_common *common, int *csz)
638{
639 return &ah->ah_sc->common;
640}
641
642static inline struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah)
643{ 633{
644 return &(ath9k_hw_common(ah)->regulatory); 634 common->bus_ops->read_cachesize(common, csz);
645} 635}
646 636
647static inline void ath_read_cachesize(struct ath_softc *sc, int *csz) 637static inline void ath_bus_cleanup(struct ath_common *common)
648{ 638{
649 sc->bus_ops->read_cachesize(sc, csz); 639 common->bus_ops->cleanup(common);
650}
651
652static inline void ath_bus_cleanup(struct ath_softc *sc)
653{
654 sc->bus_ops->cleanup(sc);
655} 640}
656 641
657extern struct ieee80211_ops ath9k_ops; 642extern struct ieee80211_ops ath9k_ops;
658 643
659irqreturn_t ath_isr(int irq, void *dev); 644irqreturn_t ath_isr(int irq, void *dev);
660void ath_cleanup(struct ath_softc *sc); 645void ath_cleanup(struct ath_softc *sc);
661int ath_init_device(u16 devid, struct ath_softc *sc, u16 subsysid); 646int ath_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
647 const struct ath_bus_ops *bus_ops);
662void ath_detach(struct ath_softc *sc); 648void ath_detach(struct ath_softc *sc);
663const char *ath_mac_bb_name(u32 mac_bb_version); 649const char *ath_mac_bb_name(u32 mac_bb_version);
664const char *ath_rf_name(u16 rf_version); 650const char *ath_rf_name(u16 rf_version);
@@ -706,8 +692,5 @@ bool ath9k_wiphy_scanning(struct ath_softc *sc);
706void ath9k_wiphy_work(struct work_struct *work); 692void ath9k_wiphy_work(struct work_struct *work);
707bool ath9k_all_wiphys_idle(struct ath_softc *sc); 693bool ath9k_all_wiphys_idle(struct ath_softc *sc);
708 694
709void ath9k_iowrite32(struct ath_hw *ah, u32 reg_offset, u32 val);
710unsigned int ath9k_ioread32(struct ath_hw *ah, u32 reg_offset);
711
712int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype); 695int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype);
713#endif /* ATH9K_H */ 696#endif /* ATH9K_H */