aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.h
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2010-04-15 17:38:06 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-16 15:32:01 -0400
commitd70357d56942fa587e39505547cb69e10a8d59a0 (patch)
treeeb715d856b4ef48fd63805b0845f35024e1e8faa /drivers/net/wireless/ath/ath9k/hw.h
parentac1a474d71d6cbf94bf26889da5768f5f2b0ca2b (diff)
ath9k_hw: start building an abstraction layer for hardware routines
ath9k supports the AR5008, AR9001 and AR9002 family of Atheros chipsets, all 802.11n. The new breed of 802.11n chips, the AR9003 family will be supported as well soon. To help with its support we're going to add a few callbacks for hardware routines which differ considerably instead of adding branch checks for the revision at runtime. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h47
1 files changed, 45 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index f4821cf33b87..dfe8502866bb 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -440,6 +440,36 @@ struct ath_gen_timer_table {
440 } timer_mask; 440 } timer_mask;
441}; 441};
442 442
443/**
444 * struct ath_hw_private_ops - callbacks used internally by hardware code
445 *
446 * This structure contains private callbacks designed to only be used internally
447 * by the hardware core.
448 *
449 * @init_cal_settings: Initializes calibration settings
450 * @init_mode_regs: Initializes mode registers
451 * @macversion_supported: If this specific mac revision is supported
452 */
453struct ath_hw_private_ops {
454 void (*init_cal_settings)(struct ath_hw *ah);
455 void (*init_mode_regs)(struct ath_hw *ah);
456 bool (*macversion_supported)(u32 macversion);
457};
458
459/**
460 * struct ath_hw_ops - callbacks used by hardware code and driver code
461 *
462 * This structure contains callbacks designed to to be used internally by
463 * hardware code and also by the lower level driver.
464 *
465 * @config_pci_powersave:
466 */
467struct ath_hw_ops {
468 void (*config_pci_powersave)(struct ath_hw *ah,
469 int restore,
470 int power_off);
471};
472
443struct ath_hw { 473struct ath_hw {
444 struct ieee80211_hw *hw; 474 struct ieee80211_hw *hw;
445 struct ath_common common; 475 struct ath_common common;
@@ -540,6 +570,11 @@ struct ath_hw {
540 void (*ath9k_hw_spur_mitigate_freq)(struct ath_hw *ah, 570 void (*ath9k_hw_spur_mitigate_freq)(struct ath_hw *ah,
541 struct ath9k_channel *chan); 571 struct ath9k_channel *chan);
542 572
573 /* Private to hardware code */
574 struct ath_hw_private_ops private_ops;
575 /* Accessed by the lower level driver */
576 struct ath_hw_ops ops;
577
543 /* Used to program the radio on non single-chip devices */ 578 /* Used to program the radio on non single-chip devices */
544 u32 *analogBank0Data; 579 u32 *analogBank0Data;
545 u32 *analogBank1Data; 580 u32 *analogBank1Data;
@@ -619,6 +654,16 @@ static inline struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah)
619 return &(ath9k_hw_common(ah)->regulatory); 654 return &(ath9k_hw_common(ah)->regulatory);
620} 655}
621 656
657static inline struct ath_hw_private_ops *ath9k_hw_private_ops(struct ath_hw *ah)
658{
659 return &ah->private_ops;
660}
661
662static inline struct ath_hw_ops *ath9k_hw_ops(struct ath_hw *ah)
663{
664 return &ah->ops;
665}
666
622/* Initialization, Detach, Reset */ 667/* Initialization, Detach, Reset */
623const char *ath9k_hw_probe(u16 vendorid, u16 devid); 668const char *ath9k_hw_probe(u16 vendorid, u16 devid);
624void ath9k_hw_deinit(struct ath_hw *ah); 669void ath9k_hw_deinit(struct ath_hw *ah);
@@ -681,8 +726,6 @@ void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
681 726
682bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); 727bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
683 728
684void ath9k_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off);
685
686/* Interrupt Handling */ 729/* Interrupt Handling */
687bool ath9k_hw_intrpend(struct ath_hw *ah); 730bool ath9k_hw_intrpend(struct ath_hw *ah);
688bool ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked); 731bool ath9k_hw_getisr(struct ath_hw *ah, enum ath9k_int *masked);