~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/net/wireless/ath/ath9k/ar9002_calib.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2008-2010 Atheros Communications Inc.
 
2
 * Copyright (c) 2008-2011 Atheros Communications Inc.
3
3
 *
4
4
 * Permission to use, copy, modify, and/or distribute this software for any
5
5
 * purpose with or without fee is hereby granted, provided that the above
26
26
        IQ_MISMATCH_CAL = BIT(2),
27
27
};
28
28
 
 
29
static bool ar9002_hw_is_cal_supported(struct ath_hw *ah,
 
30
                                struct ath9k_channel *chan,
 
31
                                enum ar9002_cal_types cal_type)
 
32
{
 
33
        bool supported = false;
 
34
        switch (ah->supp_cals & cal_type) {
 
35
        case IQ_MISMATCH_CAL:
 
36
                /* Run IQ Mismatch for non-CCK only */
 
37
                if (!IS_CHAN_B(chan))
 
38
                        supported = true;
 
39
                break;
 
40
        case ADC_GAIN_CAL:
 
41
        case ADC_DC_CAL:
 
42
                /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */
 
43
                if (!IS_CHAN_B(chan) &&
 
44
                    !(IS_CHAN_2GHZ(chan) && IS_CHAN_HT20(chan)))
 
45
                        supported = true;
 
46
                break;
 
47
        }
 
48
        return supported;
 
49
}
29
50
 
30
51
static void ar9002_hw_setup_calibration(struct ath_hw *ah,
31
52
                                        struct ath9k_cal_list *currCal)
808
829
        if (AR_SREV_9271(ah)) {
809
830
                if (!ar9285_hw_cl_cal(ah, chan))
810
831
                        return false;
811
 
        } else if (AR_SREV_9285_12_OR_LATER(ah)) {
 
832
        } else if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) {
812
833
                if (!ar9285_hw_clc(ah, chan))
813
834
                        return false;
814
835
        } else {
858
879
        if (AR_SREV_9100(ah) || AR_SREV_9160_10_OR_LATER(ah)) {
859
880
                ah->supp_cals = IQ_MISMATCH_CAL;
860
881
 
861
 
                if (AR_SREV_9160_10_OR_LATER(ah) &&
862
 
                    !(IS_CHAN_2GHZ(chan) && IS_CHAN_HT20(chan))) {
 
882
                if (AR_SREV_9160_10_OR_LATER(ah))
863
883
                        ah->supp_cals |= ADC_GAIN_CAL | ADC_DC_CAL;
864
884
 
 
885
                if (AR_SREV_9287(ah))
 
886
                        ah->supp_cals &= ~ADC_GAIN_CAL;
865
887
 
 
888
                if (ar9002_hw_is_cal_supported(ah, chan, ADC_GAIN_CAL)) {
866
889
                        INIT_CAL(&ah->adcgain_caldata);
867
890
                        INSERT_CAL(ah, &ah->adcgain_caldata);
868
891
                        ath_dbg(common, ATH_DBG_CALIBRATE,
869
 
                                "enabling ADC Gain Calibration.\n");
 
892
                                        "enabling ADC Gain Calibration.\n");
 
893
                }
870
894
 
 
895
                if (ar9002_hw_is_cal_supported(ah, chan, ADC_DC_CAL)) {
871
896
                        INIT_CAL(&ah->adcdc_caldata);
872
897
                        INSERT_CAL(ah, &ah->adcdc_caldata);
873
898
                        ath_dbg(common, ATH_DBG_CALIBRATE,
874
 
                                "enabling ADC DC Calibration.\n");
 
899
                                        "enabling ADC DC Calibration.\n");
875
900
                }
876
901
 
877
 
                INIT_CAL(&ah->iq_caldata);
878
 
                INSERT_CAL(ah, &ah->iq_caldata);
879
 
                ath_dbg(common, ATH_DBG_CALIBRATE,
880
 
                        "enabling IQ Calibration.\n");
 
902
                if (ar9002_hw_is_cal_supported(ah, chan, IQ_MISMATCH_CAL)) {
 
903
                        INIT_CAL(&ah->iq_caldata);
 
904
                        INSERT_CAL(ah, &ah->iq_caldata);
 
905
                        ath_dbg(common, ATH_DBG_CALIBRATE,
 
906
                                        "enabling IQ Calibration.\n");
 
907
                }
881
908
 
882
909
                ah->cal_list_curr = ah->cal_list;
883
910