]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/brcm80211/phy/wlc_phy_n.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / staging / brcm80211 / phy / wlc_phy_n.c
index 950008f122b1696b4a7e12567a22ff10b9557565..c6cce8de1aeeaab5ecf2b1be32641935c088e301 100644 (file)
 #include <linux/string.h>
 #include <bcmdefs.h>
 #include <wlc_cfg.h>
-#include <linuxver.h>
+#include <linux/delay.h>
+#include <linux/pci.h>
 #include <osl.h>
 #include <siutils.h>
 #include <sbchipc.h>
 #include <hndpmu.h>
 #include <bcmendian.h>
 
+#include <bcmdevs.h>
+#include <sbhndpio.h>
+#include <sbhnddma.h>
+
 #include <wlc_phy_radio.h>
 #include <wlc_phy_int.h>
 #include <wlc_phyreg_n.h>
@@ -14554,7 +14559,7 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
                }
        }
 
-       if ((!PHY_IPA(pi)) && (CHIPID(pi->sh->chip) == BCM5357_CHIP_ID)) {
+       if ((!PHY_IPA(pi)) && (pi->sh->chip == BCM5357_CHIP_ID)) {
                si_pmu_chipcontrol(pi->sh->sih, 1, CCTRL5357_EXTPA,
                                   CCTRL5357_EXTPA);
        }
@@ -17599,7 +17604,7 @@ static void wlc_phy_radio_postinit_2057(phy_info_t *pi)
 
        mod_radio_reg(pi, RADIO_2057_XTALPUOVR_PINCTRL, 0x1, 0x1);
 
-       if (CHIPID(pi->sh->chip) == !BCM6362_CHIP_ID) {
+       if (pi->sh->chip == !BCM6362_CHIP_ID) {
 
                mod_radio_reg(pi, RADIO_2057_XTALPUOVR_PINCTRL, 0x2, 0x2);
        }
@@ -18007,8 +18012,8 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
                        write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 |
                                        RADIO_2056_SYN, 0x1f);
 
-                       if ((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) ||
-                           (CHIPID(pi->sh->chip) == BCM47162_CHIP_ID)) {
+                       if ((pi->sh->chip == BCM4716_CHIP_ID) ||
+                           (pi->sh->chip == BCM47162_CHIP_ID)) {
 
                                write_radio_reg(pi,
                                                RADIO_2056_SYN_PLL_LOOPFILTER4 |
@@ -18070,8 +18075,8 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
                                WRITE_RADIO_REG2(pi, RADIO_2056, TX, core,
                                                 PADG_IDAC, 0xcc);
 
-                               if ((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) ||
-                                   (CHIPID(pi->sh->chip) ==
+                               if ((pi->sh->chip == BCM4716_CHIP_ID) ||
+                                   (pi->sh->chip ==
                                     BCM47162_CHIP_ID)) {
                                        bias = 0x40;
                                        cascbias = 0x45;
@@ -18083,11 +18088,11 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
                                        bias = 0x25;
                                        cascbias = 0x20;
 
-                                       if ((CHIPID(pi->sh->chip) ==
+                                       if ((pi->sh->chip ==
                                             BCM43224_CHIP_ID)
-                                           || (CHIPID(pi->sh->chip) ==
+                                           || (pi->sh->chip ==
                                                BCM43225_CHIP_ID)
-                                           || (CHIPID(pi->sh->chip) ==
+                                           || (pi->sh->chip ==
                                                BCM43421_CHIP_ID)) {
                                                if (pi->sh->chippkg ==
                                                    BCM43224_FAB_SMIC) {
@@ -18198,9 +18203,9 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
 
                        cascbias = 0x30;
 
-                       if ((CHIPID(pi->sh->chip) == BCM43224_CHIP_ID) ||
-                           (CHIPID(pi->sh->chip) == BCM43225_CHIP_ID) ||
-                           (CHIPID(pi->sh->chip) == BCM43421_CHIP_ID)) {
+                       if ((pi->sh->chip == BCM43224_CHIP_ID) ||
+                           (pi->sh->chip == BCM43225_CHIP_ID) ||
+                           (pi->sh->chip == BCM43421_CHIP_ID)) {
                                if (pi->sh->chippkg == BCM43224_FAB_SMIC) {
                                        cascbias = 0x35;
                                }
@@ -18927,7 +18932,7 @@ static void wlc_phy_spurwar_nphy(phy_info_t *pi)
                        case 38:
                        case 102:
                        case 118:
-                               if ((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) &&
+                               if ((pi->sh->chip == BCM4716_CHIP_ID) &&
                                    (pi->sh->chippkg == BCM4717_PKG_ID)) {
                                        nphy_adj_tone_id_buf[0] = 32;
                                        nphy_adj_noise_var_buf[0] = 0x21f;
@@ -19062,7 +19067,7 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
                                if (pi->nphy_aband_spurwar_en &&
                                    ((val == 38) || (val == 102)
                                     || (val == 118))) {
-                                       if ((CHIPID(pi->sh->chip) ==
+                                       if ((pi->sh->chip ==
                                             BCM4716_CHIP_ID)
                                            && (pi->sh->chippkg ==
                                                BCM4717_PKG_ID)) {
@@ -19077,8 +19082,8 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
                if (pi->phy_spuravoid == SPURAVOID_FORCEON)
                        spuravoid = 1;
 
-               if ((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) ||
-                   (CHIPID(pi->sh->chip) == BCM47162_CHIP_ID)) {
+               if ((pi->sh->chip == BCM4716_CHIP_ID) ||
+                   (pi->sh->chip == BCM47162_CHIP_ID)) {
                        si_pmu_spuravoid(pi->sh->sih, pi->sh->osh, spuravoid);
                } else {
                        wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false);
@@ -19086,9 +19091,9 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
                        wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true);
                }
 
-               if ((CHIPID(pi->sh->chip) == BCM43224_CHIP_ID) ||
-                   (CHIPID(pi->sh->chip) == BCM43225_CHIP_ID) ||
-                   (CHIPID(pi->sh->chip) == BCM43421_CHIP_ID)) {
+               if ((pi->sh->chip == BCM43224_CHIP_ID) ||
+                   (pi->sh->chip == BCM43225_CHIP_ID) ||
+                   (pi->sh->chip == BCM43421_CHIP_ID)) {
 
                        if (spuravoid == 1) {
 
@@ -19105,8 +19110,8 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
                        }
                }
 
-               if (!((CHIPID(pi->sh->chip) == BCM4716_CHIP_ID) ||
-                     (CHIPID(pi->sh->chip) == BCM47162_CHIP_ID))) {
+               if (!((pi->sh->chip == BCM4716_CHIP_ID) ||
+                     (pi->sh->chip == BCM47162_CHIP_ID))) {
                        wlapi_bmac_core_phypll_reset(pi->sh->physhim);
                }
 
@@ -21062,11 +21067,11 @@ s16 wlc_phy_tempsense_nphy(phy_info_t *pi)
                wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x03, 16,
                                         &auxADC_rssi_ctrlH_save);
 
-               if (CHIPID(pi->sh->chip) == BCM5357_CHIP_ID) {
+               if (pi->sh->chip == BCM5357_CHIP_ID) {
                        radio_temp[0] = (193 * (radio_temp[1] + radio_temp2[1])
                                         + 88 * (auxADC_Vl) - 27111 +
                                         128) / 256;
-               } else if (CHIPID(pi->sh->chip) == BCM43236_CHIP_ID) {
+               } else if (pi->sh->chip == BCM43236_CHIP_ID) {
                        radio_temp[0] = (198 * (radio_temp[1] + radio_temp2[1])
                                         + 91 * (auxADC_Vl) - 27243 +
                                         128) / 256;
@@ -26277,7 +26282,7 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi)
                } else if (NREV_IS(pi->pubpi.phy_rev, 6)) {
 
                        tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev6;
-                       if (CHIPID(pi->sh->chip) == BCM47162_CHIP_ID) {
+                       if (pi->sh->chip == BCM47162_CHIP_ID) {
 
                                tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev5;
                        }
@@ -26833,7 +26838,7 @@ wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *txgains,
                phy_a2 = 63;
 
                if (CHSPEC_IS2G(pi->radio_chanspec)) {
-                       if (CHIPID(pi->sh->chip) == BCM6362_CHIP_ID) {
+                       if (pi->sh->chip == BCM6362_CHIP_ID) {
                                phy_a1 = 35;
                                phy_a3 = 35;
                        } else if ((pi->pubpi.radiorev == 4)
@@ -26946,7 +26951,7 @@ wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *txgains,
                                        if (NREV_GE(pi->pubpi.phy_rev, 6)) {
                                                phy_a5 = 0x00f7 | (phy_a4 << 8);
 
-                                               if (CHIPID(pi->sh->chip) ==
+                                               if (pi->sh->chip ==
                                                    BCM47162_CHIP_ID) {
                                                        phy_a5 =
                                                            0x10f7 | (phy_a4 <<