~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

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
44
44
static const int m2ThreshExt_off = 127;
45
45
 
46
46
 
 
47
static void ar5008_rf_bank_setup(u32 *bank, struct ar5416IniArray *array,
 
48
                                 int col)
 
49
{
 
50
        int i;
 
51
 
 
52
        for (i = 0; i < array->ia_rows; i++)
 
53
                bank[i] = INI_RA(array, i, col);
 
54
}
 
55
 
 
56
 
 
57
#define REG_WRITE_RF_ARRAY(iniarray, regData, regWr) \
 
58
        ar5008_write_rf_array(ah, iniarray, regData, &(regWr))
 
59
 
 
60
static void ar5008_write_rf_array(struct ath_hw *ah, struct ar5416IniArray *array,
 
61
                                  u32 *data, unsigned int *writecnt)
 
62
{
 
63
        int r;
 
64
 
 
65
        ENABLE_REGWRITE_BUFFER(ah);
 
66
 
 
67
        for (r = 0; r < array->ia_rows; r++) {
 
68
                REG_WRITE(ah, INI_RA(array, r, 0), data[r]);
 
69
                DO_DELAY(*writecnt);
 
70
        }
 
71
 
 
72
        REGWRITE_BUFFER_FLUSH(ah);
 
73
}
 
74
 
47
75
/**
48
76
 * ar5008_hw_phy_modify_rx_buffer() - perform analog swizzling of parameters
49
77
 * @rfbuf:
142
170
 
143
171
/**
144
172
 * ar5008_hw_set_channel - tune to a channel on the external AR2133/AR5133 radios
145
 
 * @ah: atheros hardware stucture
 
173
 * @ah: atheros hardware structure
146
174
 * @chan:
147
175
 *
148
176
 * For the external AR2133/AR5133 radios, takes the MHz channel value and set
530
558
        eepMinorRev = ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV);
531
559
 
532
560
        /* Setup Bank 0 Write */
533
 
        RF_BANK_SETUP(ah->analogBank0Data, &ah->iniBank0, 1);
 
561
        ar5008_rf_bank_setup(ah->analogBank0Data, &ah->iniBank0, 1);
534
562
 
535
563
        /* Setup Bank 1 Write */
536
 
        RF_BANK_SETUP(ah->analogBank1Data, &ah->iniBank1, 1);
 
564
        ar5008_rf_bank_setup(ah->analogBank1Data, &ah->iniBank1, 1);
537
565
 
538
566
        /* Setup Bank 2 Write */
539
 
        RF_BANK_SETUP(ah->analogBank2Data, &ah->iniBank2, 1);
 
567
        ar5008_rf_bank_setup(ah->analogBank2Data, &ah->iniBank2, 1);
540
568
 
541
569
        /* Setup Bank 6 Write */
542
 
        RF_BANK_SETUP(ah->analogBank3Data, &ah->iniBank3,
 
570
        ar5008_rf_bank_setup(ah->analogBank3Data, &ah->iniBank3,
543
571
                      modesIndex);
544
572
        {
545
573
                int i;
569
597
        }
570
598
 
571
599
        /* Setup Bank 7 Setup */
572
 
        RF_BANK_SETUP(ah->analogBank7Data, &ah->iniBank7, 1);
 
600
        ar5008_rf_bank_setup(ah->analogBank7Data, &ah->iniBank7, 1);
573
601
 
574
602
        /* Write Analog registers */
575
603
        REG_WRITE_RF_ARRAY(&ah->iniBank0, ah->analogBank0Data,
729
757
                                 struct ath9k_channel *chan)
730
758
{
731
759
        struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
 
760
        struct ath_common *common = ath9k_hw_common(ah);
732
761
        int i, regWrites = 0;
733
762
        struct ieee80211_channel *channel = chan->chan;
734
763
        u32 modesIndex, freqIndex;
805
834
                REG_WRITE(ah, reg, val);
806
835
 
807
836
                if (reg >= 0x7800 && reg < 0x78a0
808
 
                    && ah->config.analog_shiftreg) {
 
837
                    && ah->config.analog_shiftreg
 
838
                    && (common->bus_ops->ath_bus_type != ATH_USB)) {
809
839
                        udelay(100);
810
840
                }
811
841
 
835
865
                REG_WRITE(ah, reg, val);
836
866
 
837
867
                if (reg >= 0x7800 && reg < 0x78a0
838
 
                    && ah->config.analog_shiftreg) {
 
868
                    && ah->config.analog_shiftreg
 
869
                    && (common->bus_ops->ath_bus_type != ATH_USB)) {
839
870
                        udelay(100);
840
871
                }
841
872