1 /******************************************************************************
2 *
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 ******************************************************************************/
15
16 #include "odm_precomp.h"
17 #include "phy.h"
18 #include <rtw_iol.h>
19
20 /* MAC_REG.TXT */
21
22 static u32 array_MAC_REG_8188E[] = {
23 0x026, 0x00000041,
24 0x027, 0x00000035,
25 0x428, 0x0000000A,
26 0x429, 0x00000010,
27 0x430, 0x00000000,
28 0x431, 0x00000001,
29 0x432, 0x00000002,
30 0x433, 0x00000004,
31 0x434, 0x00000005,
32 0x435, 0x00000006,
33 0x436, 0x00000007,
34 0x437, 0x00000008,
35 0x438, 0x00000000,
36 0x439, 0x00000000,
37 0x43A, 0x00000001,
38 0x43B, 0x00000002,
39 0x43C, 0x00000004,
40 0x43D, 0x00000005,
41 0x43E, 0x00000006,
42 0x43F, 0x00000007,
43 0x440, 0x0000005D,
44 0x441, 0x00000001,
45 0x442, 0x00000000,
46 0x444, 0x00000015,
47 0x445, 0x000000F0,
48 0x446, 0x0000000F,
49 0x447, 0x00000000,
50 0x458, 0x00000041,
51 0x459, 0x000000A8,
52 0x45A, 0x00000072,
53 0x45B, 0x000000B9,
54 0x460, 0x00000066,
55 0x461, 0x00000066,
56 0x480, 0x00000008,
57 0x4C8, 0x000000FF,
58 0x4C9, 0x00000008,
59 0x4CC, 0x000000FF,
60 0x4CD, 0x000000FF,
61 0x4CE, 0x00000001,
62 0x4D3, 0x00000001,
63 0x500, 0x00000026,
64 0x501, 0x000000A2,
65 0x502, 0x0000002F,
66 0x503, 0x00000000,
67 0x504, 0x00000028,
68 0x505, 0x000000A3,
69 0x506, 0x0000005E,
70 0x507, 0x00000000,
71 0x508, 0x0000002B,
72 0x509, 0x000000A4,
73 0x50A, 0x0000005E,
74 0x50B, 0x00000000,
75 0x50C, 0x0000004F,
76 0x50D, 0x000000A4,
77 0x50E, 0x00000000,
78 0x50F, 0x00000000,
79 0x512, 0x0000001C,
80 0x514, 0x0000000A,
81 0x516, 0x0000000A,
82 0x525, 0x0000004F,
83 0x550, 0x00000010,
84 0x551, 0x00000010,
85 0x559, 0x00000002,
86 0x55D, 0x000000FF,
87 0x605, 0x00000030,
88 0x608, 0x0000000E,
89 0x609, 0x0000002A,
90 0x620, 0x000000FF,
91 0x621, 0x000000FF,
92 0x622, 0x000000FF,
93 0x623, 0x000000FF,
94 0x624, 0x000000FF,
95 0x625, 0x000000FF,
96 0x626, 0x000000FF,
97 0x627, 0x000000FF,
98 0x652, 0x00000020,
99 0x63C, 0x0000000A,
100 0x63D, 0x0000000A,
101 0x63E, 0x0000000E,
102 0x63F, 0x0000000E,
103 0x640, 0x00000040,
104 0x66E, 0x00000005,
105 0x700, 0x00000021,
106 0x701, 0x00000043,
107 0x702, 0x00000065,
108 0x703, 0x00000087,
109 0x708, 0x00000021,
110 0x709, 0x00000043,
111 0x70A, 0x00000065,
112 0x70B, 0x00000087,
113 };
114
rtl88eu_phy_mac_config(struct adapter * adapt)115 bool rtl88eu_phy_mac_config(struct adapter *adapt)
116 {
117 u32 i;
118 u32 arraylength;
119 u32 *ptrarray;
120
121 arraylength = ARRAY_SIZE(array_MAC_REG_8188E);
122 ptrarray = array_MAC_REG_8188E;
123
124 for (i = 0; i < arraylength; i += 2)
125 usb_write8(adapt, ptrarray[i], (u8)ptrarray[i + 1]);
126
127 usb_write8(adapt, REG_MAX_AGGR_NUM, MAX_AGGR_NUM);
128 return true;
129 }
130