Search Linux Wireless

[PATCH][RTF][RFC] brcmsmac: add workaround for old BCM4313 devices with Bluetooth

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Rafał Miłecki <zajec5@xxxxxxxxx>
---
Please check if it fixes BCM4313 performance problems.
---
 drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 13 +++++++++++++
 drivers/net/wireless/brcm80211/brcmsmac/aiutils.h |  3 +++
 drivers/net/wireless/brcm80211/brcmsmac/main.c    |  6 ++++++
 3 files changed, 22 insertions(+)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
index 5336597..3d39176 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -310,6 +310,9 @@
 /* External PA enable mask */
 #define GPIO_CTRL_EPA_EN_MASK 0x40
 
+/* WL/BT control enable mask */
+#define GPIO_CTRL_5_6_EN_MASK 0x60
+
 #define DEFAULT_GPIOTIMERVAL \
 	((DEFAULT_GPIO_ONTIME << GPIO_ONTIME_SHIFT) | DEFAULT_GPIO_OFFTIME)
 
@@ -691,6 +694,16 @@ void ai_epa_4313war(struct si_pub *sih)
 	bcma_set32(cc, CHIPCREGOFFS(gpiocontrol), GPIO_CTRL_EPA_EN_MASK);
 }
 
+/* WL/BT control for 4313 btcombo boards >= P250 */
+void ai_btcombo_p250_4313_war(struct si_pub *sih)
+{
+	struct si_info *sii = container_of(sih, struct si_info, pub);
+	struct bcma_device *cc = sii->icbus->drv_cc.core;
+
+	bcma_set32(cc, CHIPCREGOFFS(gpiocontrol), GPIO_CTRL_5_6_EN_MASK);
+	bcma_set32(cc, CHIPCREGOFFS(gpioouten), GPIO_CTRL_5_6_EN_MASK);
+}
+
 /* check if the device is removed */
 bool ai_deviceremoved(struct si_pub *sih)
 {
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
index 2d08c15..7652a0f 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
@@ -186,6 +186,9 @@ bool ai_deviceremoved(struct si_pub *sih);
 /* Enable Ex-PA for 4313 */
 void ai_epa_4313war(struct si_pub *sih);
 
+/* WL/BT control for 4313 btcombo boards >= P250 */
+void ai_btcombo_p250_4313_war(struct si_pub *sih);
+
 static inline u32 ai_get_cccaps(struct si_pub *sih)
 {
 	return sih->cccaps;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 1b47482..046e832 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -4942,6 +4942,12 @@ static void brcms_b_hw_up(struct brcms_hardware *wlc_hw)
 		     && (wlc_hw->boardflags & BFL_FEM_BT)))
 			ai_epa_4313war(wlc_hw->sih);
 	}
+
+	/* TODO: Fix the condition. Only for boards >= P250 */
+	if (ai_get_chip_id(wlc_hw->sih) == BCMA_CHIP_ID_BCM4313 && (wlc_hw->boardflags & BFL_FEM_BT)) {
+		pr_info("Applying BCM4313 WL/BT workaround\n");
+		ai_btcombo_p250_4313_war(wlc_hw->sih);
+	}
 }
 
 static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux