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:39:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-16 15:43:31 -0400
commit795f5e2ca672727a96bacf97075976cfe1249fcf (patch)
tree194a0f9920377520a1591638eacab205db365dbe /drivers/net/wireless/ath/ath9k/hw.h
parent0df13da4555320f6dc9b901fd5f22cf54065c708 (diff)
ath9k_hw: split calib code by hardware families
Calibration code touches phy registers and since these change the calibration code needs to be abstracted. Noise floor calibration is the only thing remaining but since the remaining calls only touch the AR_PHY_AGC_CONTROL register we'll just define that register conditionally, that will be done separately. The goal is to remove the dependency of ar9002_phy.h on calib.c This also adds stubs to be filled for AR9003 calibration code. 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.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 48fb5ce8294b..7ef93c8df923 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -469,7 +469,9 @@ struct ath_gen_timer_table {
469 * This structure contains private callbacks designed to only be used internally 469 * This structure contains private callbacks designed to only be used internally
470 * by the hardware core. 470 * by the hardware core.
471 * 471 *
472 * @init_cal_settings: Initializes calibration settings 472 * @init_cal_settings: setup types of calibrations supported
473 * @init_cal: starts actual calibration
474 *
473 * @init_mode_regs: Initializes mode registers 475 * @init_mode_regs: Initializes mode registers
474 * @macversion_supported: If this specific mac revision is supported 476 * @macversion_supported: If this specific mac revision is supported
475 * 477 *
@@ -480,11 +482,20 @@ struct ath_gen_timer_table {
480 * @set_rf_regs: 482 * @set_rf_regs:
481 * @compute_pll_control: compute the PLL control value to use for 483 * @compute_pll_control: compute the PLL control value to use for
482 * AR_RTC_PLL_CONTROL for a given channel 484 * AR_RTC_PLL_CONTROL for a given channel
485 * @setup_calibration: set up calibration
486 * @iscal_supported: used to query if a type of calibration is supported
483 */ 487 */
484struct ath_hw_private_ops { 488struct ath_hw_private_ops {
489 /* Calibration ops */
485 void (*init_cal_settings)(struct ath_hw *ah); 490 void (*init_cal_settings)(struct ath_hw *ah);
491 bool (*init_cal)(struct ath_hw *ah, struct ath9k_channel *chan);
492
486 void (*init_mode_regs)(struct ath_hw *ah); 493 void (*init_mode_regs)(struct ath_hw *ah);
487 bool (*macversion_supported)(u32 macversion); 494 bool (*macversion_supported)(u32 macversion);
495 void (*setup_calibration)(struct ath_hw *ah,
496 struct ath9k_cal_list *currCal);
497 bool (*iscal_supported)(struct ath_hw *ah,
498 enum ath9k_cal_types calType);
488 499
489 /* PHY ops */ 500 /* PHY ops */
490 int (*rf_set_freq)(struct ath_hw *ah, 501 int (*rf_set_freq)(struct ath_hw *ah,
@@ -523,6 +534,7 @@ struct ath_hw_private_ops {
523 * hardware code and also by the lower level driver. 534 * hardware code and also by the lower level driver.
524 * 535 *
525 * @config_pci_powersave: 536 * @config_pci_powersave:
537 * @calibrate: periodic calibration for NF, ANI, IQ, ADC gain, ADC-DC
526 */ 538 */
527struct ath_hw_ops { 539struct ath_hw_ops {
528 void (*config_pci_powersave)(struct ath_hw *ah, 540 void (*config_pci_powersave)(struct ath_hw *ah,
@@ -531,6 +543,10 @@ struct ath_hw_ops {
531 void (*rx_enable)(struct ath_hw *ah); 543 void (*rx_enable)(struct ath_hw *ah);
532 void (*set_desc_link)(void *ds, u32 link); 544 void (*set_desc_link)(void *ds, u32 link);
533 void (*get_desc_link)(void *ds, u32 **link); 545 void (*get_desc_link)(void *ds, u32 **link);
546 bool (*calibrate)(struct ath_hw *ah,
547 struct ath9k_channel *chan,
548 u8 rxchainmask,
549 bool longcal);
534}; 550};
535 551
536struct ath_hw { 552struct ath_hw {
@@ -833,6 +849,9 @@ void ar5008_hw_attach_phy_ops(struct ath_hw *ah);
833void ar9002_hw_attach_phy_ops(struct ath_hw *ah); 849void ar9002_hw_attach_phy_ops(struct ath_hw *ah);
834void ar9003_hw_attach_phy_ops(struct ath_hw *ah); 850void ar9003_hw_attach_phy_ops(struct ath_hw *ah);
835 851
852void ar9002_hw_attach_calib_ops(struct ath_hw *ah);
853void ar9003_hw_attach_calib_ops(struct ath_hw *ah);
854
836#define ATH_PCIE_CAP_LINK_CTRL 0x70 855#define ATH_PCIE_CAP_LINK_CTRL 0x70
837#define ATH_PCIE_CAP_LINK_L0S 1 856#define ATH_PCIE_CAP_LINK_L0S 1
838#define ATH_PCIE_CAP_LINK_L1 2 857#define ATH_PCIE_CAP_LINK_L1 2