brcmsmac: rework switch control table init including iPA BT-combo
authorArend van Spriel <arend@broadcom.com>
Tue, 20 Aug 2013 14:00:43 +0000 (16:00 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 22 Aug 2013 18:30:34 +0000 (14:30 -0400)
Rework the code path in lcnphy tbl_init() for switch control
table programming. This also takes the iPA BT-combo card into
account.

Tested-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
drivers/net/wireless/brcm80211/brcmsmac/phy/phytbl_lcn.c
drivers/net/wireless/brcm80211/brcmsmac/phy/phytbl_lcn.h

index caced820191dffc6bdf1889906da690f6db966c4..08bcae4b8c28dc51b7ad7cb81594c4239e62ad60 100644 (file)
@@ -4573,6 +4573,7 @@ static void wlc_lcnphy_tbl_init(struct brcms_phy *pi)
        uint idx;
        u8 phybw40;
        struct phytbl_info tab;
+       const struct phytbl_info *tb;
        u32 val;
 
        phybw40 = CHSPEC_IS40(pi->radio_chanspec);
@@ -4619,7 +4620,6 @@ static void wlc_lcnphy_tbl_init(struct brcms_phy *pi)
        }
 
        if (LCNREV_IS(pi->pubpi.phy_rev, 2)) {
-               const struct phytbl_info *tb;
                int l;
 
                if (CHSPEC_IS2G(pi->radio_chanspec)) {
@@ -4640,21 +4640,22 @@ static void wlc_lcnphy_tbl_init(struct brcms_phy *pi)
                        wlc_lcnphy_write_table(pi, &tb[idx]);
        }
 
-       if ((pi->sh->boardflags & BFL_FEM)
-           && !(pi->sh->boardflags & BFL_FEM_BT))
-               wlc_lcnphy_write_table(pi, &dot11lcn_sw_ctrl_tbl_info_4313_epa);
-       else if (pi->sh->boardflags & BFL_FEM_BT) {
-               if (pi->sh->boardrev < 0x1250)
-                       wlc_lcnphy_write_table(
-                               pi,
-                               &dot11lcn_sw_ctrl_tbl_info_4313_bt_epa);
+       if (pi->sh->boardflags & BFL_FEM) {
+               if (pi->sh->boardflags & BFL_FEM_BT) {
+                       if (pi->sh->boardrev < 0x1250)
+                               tb = &dot11lcn_sw_ctrl_tbl_info_4313_bt_epa;
+                       else
+                               tb = &dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250;
+               } else {
+                       tb = &dot11lcn_sw_ctrl_tbl_info_4313_epa;
+               }
+       } else {
+               if (pi->sh->boardflags & BFL_FEM_BT)
+                       tb = &dot11lcn_sw_ctrl_tbl_info_4313_bt_ipa;
                else
-                       wlc_lcnphy_write_table(
-                               pi,
-                               &dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250);
-       } else
-               wlc_lcnphy_write_table(pi, &dot11lcn_sw_ctrl_tbl_info_4313);
-
+                       tb = &dot11lcn_sw_ctrl_tbl_info_4313;
+       }
+       wlc_lcnphy_write_table(pi, tb);
        wlc_lcnphy_load_rfpower(pi);
 
        wlc_lcnphy_clear_papd_comptable(pi);
index efd5a58f4ce1c6d865055048995eb25cf5cdb692..d7fa312214f34b0fd6632e547d0531b66794edd4 100644 (file)
@@ -2044,6 +2044,73 @@ static const u16 dot11lcn_sw_ctrl_tbl_4313_rev0[] = {
        0x0005,
 };
 
+static const u16 dot11lcn_sw_ctrl_tbl_4313_ipa_rev0_combo[] = {
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+       0x0005,
+       0x0006,
+       0x0009,
+       0x000a,
+};
+
 static const u16 dot11lcn_sw_ctrl_tbl_rev0[] = {
        0x0004,
        0x0004,
@@ -2808,6 +2875,11 @@ const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313 = {
        ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_4313_rev0), 15, 0, 16
 };
 
+const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_ipa = {
+       &dot11lcn_sw_ctrl_tbl_4313_ipa_rev0_combo,
+       ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_4313_ipa_rev0_combo), 15, 0, 16
+};
+
 const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa = {
        &dot11lcn_sw_ctrl_tbl_4313_epa_rev0,
        ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_4313_epa_rev0), 15, 0, 16
index 5f75e16bf5a712523a193978eb81f1f45a39ecaa..489422a36085e36a67f1e0410f8c64430350bee3 100644 (file)
@@ -20,6 +20,7 @@
 extern const struct phytbl_info dot11lcnphytbl_rx_gain_info_rev0[];
 extern const u32 dot11lcnphytbl_rx_gain_info_sz_rev0;
 extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313;
+extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_ipa;
 extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa;
 extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa_combo;
 extern const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa;