mac80211: brcmfmac: backport scheduled scan cleanup and chip support
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 653-0007-rtl8xxxu-8188e-Enable-scheduler.patch
1 From 682ffd261c494581b8fdbc81f42035a53c67f5c4 Mon Sep 17 00:00:00 2001
2 From: Jes Sorensen <Jes.Sorensen@redhat.com>
3 Date: Wed, 29 Jun 2016 11:07:13 -0400
4 Subject: [PATCH] rtl8xxxu: 8188e: Enable scheduler
5
6 This enables the schduler, DMA, etc, except for MAC RX/TX which has to
7 be set after REG_TRXFF_BNDY due to a hardware bug in the 8188e
8
9 Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
10 ---
11 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 16 ++++++++++++++++
12 1 file changed, 16 insertions(+)
13
14 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
15 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
16 @@ -172,6 +172,7 @@ exit:
17
18 static int rtl8188eu_power_on(struct rtl8xxxu_priv *priv)
19 {
20 + u16 val16;
21 int ret;
22
23 rtl8188e_disabled_to_emu(priv);
24 @@ -180,6 +181,21 @@ static int rtl8188eu_power_on(struct rtl
25 if (ret)
26 goto exit;
27
28 + /*
29 + * Enable MAC DMA/WMAC/SCHEDULE/SEC block
30 + * Set CR bit10 to enable 32k calibration.
31 + * We do not set CR_MAC_TX_ENABLE | CR_MAC_RX_ENABLE here
32 + * due to a hardware bug in the 88E, requiring those to be
33 + * set after REG_TRXFF_BNDY is set. If not the RXFF bundary
34 + * will get set to a larger buffer size than the real buffer
35 + * size.
36 + */
37 + val16 = (CR_HCI_TXDMA_ENABLE | CR_HCI_RXDMA_ENABLE |
38 + CR_TXDMA_ENABLE | CR_RXDMA_ENABLE |
39 + CR_PROTOCOL_ENABLE | CR_SCHEDULE_ENABLE |
40 + CR_SECURITY_ENABLE | CR_CALTIMER_ENABLE);
41 + rtl8xxxu_write16(priv, REG_CR, val16);
42 +
43 exit:
44 return ret;
45 }