mac80211: backport brcmfmac fixes from 4.16
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 653-0014-rtl8xxxu-Add-8188e-mac-init-table.patch
1 From 96cb7475c4c5750e8dac3dc85638f8438b9bce4e Mon Sep 17 00:00:00 2001
2 From: Jes Sorensen <Jes.Sorensen@redhat.com>
3 Date: Tue, 19 Jul 2016 15:04:24 -0400
4 Subject: [PATCH] rtl8xxxu: Add 8188e mac init table
5
6 This table was pulled from the vendor driver.
7
8 Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
9 Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
10 ---
11 .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 28 ++++++++++++++++++++++
12 1 file changed, 28 insertions(+)
13
14 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
15 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
16 @@ -40,6 +40,33 @@
17 #include "rtl8xxxu.h"
18 #include "rtl8xxxu_regs.h"
19
20 +static struct rtl8xxxu_reg8val rtl8188e_mac_init_table[] = {
21 + {0x026, 0x41}, {0x027, 0x35}, {0x428, 0x0a}, {0x429, 0x10},
22 + {0x430, 0x00}, {0x431, 0x01}, {0x432, 0x02}, {0x433, 0x04},
23 + {0x434, 0x05}, {0x435, 0x06}, {0x436, 0x07}, {0x437, 0x08},
24 + {0x438, 0x00}, {0x439, 0x00}, {0x43a, 0x01}, {0x43b, 0x02},
25 + {0x43c, 0x04}, {0x43d, 0x05}, {0x43e, 0x06}, {0x43f, 0x07},
26 + {0x440, 0x5d}, {0x441, 0x01}, {0x442, 0x00}, {0x444, 0x15},
27 + {0x445, 0xf0}, {0x446, 0x0f}, {0x447, 0x00}, {0x458, 0x41},
28 + {0x459, 0xa8}, {0x45a, 0x72}, {0x45b, 0xb9}, {0x460, 0x66},
29 + {0x461, 0x66}, {0x480, 0x08}, {0x4c8, 0xff}, {0x4c9, 0x08},
30 + {0x4cc, 0xff}, {0x4cd, 0xff}, {0x4ce, 0x01}, {0x4d3, 0x01},
31 + {0x500, 0x26}, {0x501, 0xa2}, {0x502, 0x2f}, {0x503, 0x00},
32 + {0x504, 0x28}, {0x505, 0xa3}, {0x506, 0x5e}, {0x507, 0x00},
33 + {0x508, 0x2b}, {0x509, 0xa4}, {0x50a, 0x5e}, {0x50b, 0x00},
34 + {0x50c, 0x4f}, {0x50d, 0xa4}, {0x50e, 0x00}, {0x50f, 0x00},
35 + {0x512, 0x1c}, {0x514, 0x0a}, {0x516, 0x0a}, {0x525, 0x4f},
36 + {0x550, 0x10}, {0x551, 0x10}, {0x559, 0x02}, {0x55d, 0xff},
37 + {0x605, 0x30}, {0x608, 0x0e}, {0x609, 0x2a}, {0x620, 0xff},
38 + {0x621, 0xff}, {0x622, 0xff}, {0x623, 0xff}, {0x624, 0xff},
39 + {0x625, 0xff}, {0x626, 0xff}, {0x627, 0xff}, {0x652, 0x20},
40 + {0x63c, 0x0a}, {0x63d, 0x0a}, {0x63e, 0x0e}, {0x63f, 0x0e},
41 + {0x640, 0x40}, {0x66e, 0x05}, {0x700, 0x21}, {0x701, 0x43},
42 + {0x702, 0x65}, {0x703, 0x87}, {0x708, 0x21}, {0x709, 0x43},
43 + {0x70a, 0x65}, {0x70b, 0x87},
44 + {0xffff, 0xff},
45 +};
46 +
47 static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
48 {
49 struct rtl8188eu_efuse *efuse = &priv->efuse_wifi.efuse8188eu;
50 @@ -232,6 +259,7 @@ struct rtl8xxxu_fileops rtl8188eu_fops =
51 * Max RX buffer = 10K - max(TxReportSize(64*8), WOLPattern(16*24))
52 */
53 .trxff_boundary = 0x23ff,
54 + .mactable = rtl8188e_mac_init_table,
55 .total_page_num = TX_TOTAL_PAGE_NUM_8188E,
56 .page_num_hi = TX_PAGE_NUM_HI_PQ_8188E,
57 .page_num_lo = TX_PAGE_NUM_LO_PQ_8188E,