.. | .. |
---|
1 | | -/****************************************************************************** |
---|
2 | | - * |
---|
3 | | - * Copyright(c) 2009-2010 Realtek Corporation. |
---|
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 | | - * The full GNU General Public License is included in this distribution in the |
---|
15 | | - * file called LICENSE. |
---|
16 | | - * |
---|
17 | | - * Contact Information: |
---|
18 | | - * wlanfae <wlanfae@realtek.com> |
---|
19 | | - * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, |
---|
20 | | - * Hsinchu 300, Taiwan. |
---|
21 | | - * |
---|
22 | | - * Larry Finger <Larry.Finger@lwfinger.net> |
---|
23 | | - * |
---|
24 | | - *****************************************************************************/ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
| 2 | +/* Copyright(c) 2009-2010 Realtek Corporation.*/ |
---|
25 | 3 | |
---|
26 | 4 | #include "../wifi.h" |
---|
27 | 5 | #include "../base.h" |
---|
.. | .. |
---|
115 | 93 | 0x3FE /* 36, +6.0dB */ |
---|
116 | 94 | }; |
---|
117 | 95 | |
---|
118 | | -static const u32 ofdmswing_table[] = { |
---|
119 | | - 0x0b40002d, /* 0, -15.0dB */ |
---|
120 | | - 0x0c000030, /* 1, -14.5dB */ |
---|
121 | | - 0x0cc00033, /* 2, -14.0dB */ |
---|
122 | | - 0x0d800036, /* 3, -13.5dB */ |
---|
123 | | - 0x0e400039, /* 4, -13.0dB */ |
---|
124 | | - 0x0f00003c, /* 5, -12.5dB */ |
---|
125 | | - 0x10000040, /* 6, -12.0dB */ |
---|
126 | | - 0x11000044, /* 7, -11.5dB */ |
---|
127 | | - 0x12000048, /* 8, -11.0dB */ |
---|
128 | | - 0x1300004c, /* 9, -10.5dB */ |
---|
129 | | - 0x14400051, /* 10, -10.0dB */ |
---|
130 | | - 0x15800056, /* 11, -9.5dB */ |
---|
131 | | - 0x16c0005b, /* 12, -9.0dB */ |
---|
132 | | - 0x18000060, /* 13, -8.5dB */ |
---|
133 | | - 0x19800066, /* 14, -8.0dB */ |
---|
134 | | - 0x1b00006c, /* 15, -7.5dB */ |
---|
135 | | - 0x1c800072, /* 16, -7.0dB */ |
---|
136 | | - 0x1e400079, /* 17, -6.5dB */ |
---|
137 | | - 0x20000080, /* 18, -6.0dB */ |
---|
138 | | - 0x22000088, /* 19, -5.5dB */ |
---|
139 | | - 0x24000090, /* 20, -5.0dB */ |
---|
140 | | - 0x26000098, /* 21, -4.5dB */ |
---|
141 | | - 0x288000a2, /* 22, -4.0dB */ |
---|
142 | | - 0x2ac000ab, /* 23, -3.5dB */ |
---|
143 | | - 0x2d4000b5, /* 24, -3.0dB */ |
---|
144 | | - 0x300000c0, /* 25, -2.5dB */ |
---|
145 | | - 0x32c000cb, /* 26, -2.0dB */ |
---|
146 | | - 0x35c000d7, /* 27, -1.5dB */ |
---|
147 | | - 0x390000e4, /* 28, -1.0dB */ |
---|
148 | | - 0x3c8000f2, /* 29, -0.5dB */ |
---|
149 | | - 0x40000100, /* 30, +0dB */ |
---|
150 | | - 0x43c0010f, /* 31, +0.5dB */ |
---|
151 | | - 0x47c0011f, /* 32, +1.0dB */ |
---|
152 | | - 0x4c000130, /* 33, +1.5dB */ |
---|
153 | | - 0x50800142, /* 34, +2.0dB */ |
---|
154 | | - 0x55400155, /* 35, +2.5dB */ |
---|
155 | | - 0x5a400169, /* 36, +3.0dB */ |
---|
156 | | - 0x5fc0017f, /* 37, +3.5dB */ |
---|
157 | | - 0x65400195, /* 38, +4.0dB */ |
---|
158 | | - 0x6b8001ae, /* 39, +4.5dB */ |
---|
159 | | - 0x71c001c7, /* 40, +5.0dB */ |
---|
160 | | - 0x788001e2, /* 41, +5.5dB */ |
---|
161 | | - 0x7f8001fe /* 42, +6.0dB */ |
---|
162 | | -}; |
---|
163 | | - |
---|
164 | | -static const u8 cckswing_table_ch1ch13[CCK_TABLE_SIZE][8] = { |
---|
165 | | - {0x09, 0x08, 0x07, 0x06, 0x04, 0x03, 0x01, 0x01}, /* 0, -16.0dB */ |
---|
166 | | - {0x09, 0x09, 0x08, 0x06, 0x05, 0x03, 0x01, 0x01}, /* 1, -15.5dB */ |
---|
167 | | - {0x0a, 0x09, 0x08, 0x07, 0x05, 0x03, 0x02, 0x01}, /* 2, -15.0dB */ |
---|
168 | | - {0x0a, 0x0a, 0x09, 0x07, 0x05, 0x03, 0x02, 0x01}, /* 3, -14.5dB */ |
---|
169 | | - {0x0b, 0x0a, 0x09, 0x08, 0x06, 0x04, 0x02, 0x01}, /* 4, -14.0dB */ |
---|
170 | | - {0x0b, 0x0b, 0x0a, 0x08, 0x06, 0x04, 0x02, 0x01}, /* 5, -13.5dB */ |
---|
171 | | - {0x0c, 0x0c, 0x0a, 0x09, 0x06, 0x04, 0x02, 0x01}, /* 6, -13.0dB */ |
---|
172 | | - {0x0d, 0x0c, 0x0b, 0x09, 0x07, 0x04, 0x02, 0x01}, /* 7, -12.5dB */ |
---|
173 | | - {0x0d, 0x0d, 0x0c, 0x0a, 0x07, 0x05, 0x02, 0x01}, /* 8, -12.0dB */ |
---|
174 | | - {0x0e, 0x0e, 0x0c, 0x0a, 0x08, 0x05, 0x02, 0x01}, /* 9, -11.5dB */ |
---|
175 | | - {0x0f, 0x0f, 0x0d, 0x0b, 0x08, 0x05, 0x03, 0x01}, /* 10, -11.0dB */ |
---|
176 | | - {0x10, 0x10, 0x0e, 0x0b, 0x08, 0x05, 0x03, 0x01}, /* 11, -10.5dB */ |
---|
177 | | - {0x11, 0x11, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, /* 12, -10.0dB */ |
---|
178 | | - {0x12, 0x12, 0x0f, 0x0c, 0x09, 0x06, 0x03, 0x01}, /* 13, -9.5dB */ |
---|
179 | | - {0x13, 0x13, 0x10, 0x0d, 0x0a, 0x06, 0x03, 0x01}, /* 14, -9.0dB */ |
---|
180 | | - {0x14, 0x14, 0x11, 0x0e, 0x0b, 0x07, 0x03, 0x02}, /* 15, -8.5dB */ |
---|
181 | | - {0x16, 0x15, 0x12, 0x0f, 0x0b, 0x07, 0x04, 0x01}, /* 16, -8.0dB */ |
---|
182 | | - {0x17, 0x16, 0x13, 0x10, 0x0c, 0x08, 0x04, 0x02}, /* 17, -7.5dB */ |
---|
183 | | - {0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02}, /* 18, -7.0dB */ |
---|
184 | | - {0x1a, 0x19, 0x16, 0x12, 0x0d, 0x09, 0x04, 0x02}, /* 19, -6.5dB */ |
---|
185 | | - {0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02}, /* 20, -6.0dB */ |
---|
186 | | - {0x1d, 0x1c, 0x18, 0x14, 0x0f, 0x0a, 0x05, 0x02}, /* 21, -5.5dB */ |
---|
187 | | - {0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02}, /* 22, -5.0dB */ |
---|
188 | | - {0x20, 0x20, 0x1b, 0x16, 0x11, 0x08, 0x05, 0x02}, /* 23, -4.5dB */ |
---|
189 | | - {0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02}, /* 24, -4.0dB */ |
---|
190 | | - {0x24, 0x23, 0x1f, 0x19, 0x13, 0x0c, 0x06, 0x03}, /* 25, -3.5dB */ |
---|
191 | | - {0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03}, /* 26, -3.0dB */ |
---|
192 | | - {0x28, 0x28, 0x22, 0x1c, 0x15, 0x0d, 0x07, 0x03}, /* 27, -2.5dB */ |
---|
193 | | - {0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03}, /* 28, -2.0dB */ |
---|
194 | | - {0x2d, 0x2d, 0x27, 0x1f, 0x18, 0x0f, 0x08, 0x03}, /* 29, -1.5dB */ |
---|
195 | | - {0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x03}, /* 30, -1.0dB */ |
---|
196 | | - {0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04}, /* 31, -0.5dB */ |
---|
197 | | - {0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04} /* 32, +0dB */ |
---|
198 | | -}; |
---|
199 | | - |
---|
200 | | -static const u8 cckswing_table_ch14[CCK_TABLE_SIZE][8] = { |
---|
201 | | - {0x09, 0x08, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00}, /* 0, -16.0dB */ |
---|
202 | | - {0x09, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 1, -15.5dB */ |
---|
203 | | - {0x0a, 0x09, 0x08, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 2, -15.0dB */ |
---|
204 | | - {0x0a, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 3, -14.5dB */ |
---|
205 | | - {0x0b, 0x0a, 0x09, 0x05, 0x00, 0x00, 0x00, 0x00}, /* 4, -14.0dB */ |
---|
206 | | - {0x0b, 0x0b, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 5, -13.5dB */ |
---|
207 | | - {0x0c, 0x0c, 0x0a, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 6, -13.0dB */ |
---|
208 | | - {0x0d, 0x0c, 0x0b, 0x06, 0x00, 0x00, 0x00, 0x00}, /* 7, -12.5dB */ |
---|
209 | | - {0x0d, 0x0d, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, /* 8, -12.0dB */ |
---|
210 | | - {0x0e, 0x0e, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x00}, /* 9, -11.5dB */ |
---|
211 | | - {0x0f, 0x0f, 0x0d, 0x08, 0x00, 0x00, 0x00, 0x00}, /* 10, -11.0dB */ |
---|
212 | | - {0x10, 0x10, 0x0e, 0x08, 0x00, 0x00, 0x00, 0x00}, /* 11, -10.5dB */ |
---|
213 | | - {0x11, 0x11, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, /* 12, -10.0dB */ |
---|
214 | | - {0x12, 0x12, 0x0f, 0x09, 0x00, 0x00, 0x00, 0x00}, /* 13, -9.5dB */ |
---|
215 | | - {0x13, 0x13, 0x10, 0x0a, 0x00, 0x00, 0x00, 0x00}, /* 14, -9.0dB */ |
---|
216 | | - {0x14, 0x14, 0x11, 0x0a, 0x00, 0x00, 0x00, 0x00}, /* 15, -8.5dB */ |
---|
217 | | - {0x16, 0x15, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00}, /* 16, -8.0dB */ |
---|
218 | | - {0x17, 0x16, 0x13, 0x0b, 0x00, 0x00, 0x00, 0x00}, /* 17, -7.5dB */ |
---|
219 | | - {0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00}, /* 18, -7.0dB */ |
---|
220 | | - {0x1a, 0x19, 0x16, 0x0d, 0x00, 0x00, 0x00, 0x00}, /* 19, -6.5dB */ |
---|
221 | | - {0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00}, /* 20, -6.0dB */ |
---|
222 | | - {0x1d, 0x1c, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, /* 21, -5.5dB */ |
---|
223 | | - {0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00}, /* 22, -5.0dB */ |
---|
224 | | - {0x20, 0x20, 0x1b, 0x10, 0x00, 0x00, 0x00, 0x00}, /* 23, -4.5dB */ |
---|
225 | | - {0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00}, /* 24, -4.0dB */ |
---|
226 | | - {0x24, 0x23, 0x1f, 0x12, 0x00, 0x00, 0x00, 0x00}, /* 25, -3.5dB */ |
---|
227 | | - {0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00}, /* 26, -3.0dB */ |
---|
228 | | - {0x28, 0x28, 0x24, 0x14, 0x00, 0x00, 0x00, 0x00}, /* 27, -2.5dB */ |
---|
229 | | - {0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00}, /* 28, -2.0dB */ |
---|
230 | | - {0x2d, 0x2d, 0x17, 0x17, 0x00, 0x00, 0x00, 0x00}, /* 29, -1.5dB */ |
---|
231 | | - {0x30, 0x2f, 0x29, 0x18, 0x00, 0x00, 0x00, 0x00}, /* 30, -1.0dB */ |
---|
232 | | - {0x33, 0x32, 0x2b, 0x19, 0x00, 0x00, 0x00, 0x00}, /* 31, -0.5dB */ |
---|
233 | | - {0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00} /* 32, +0dB */ |
---|
234 | | -}; |
---|
235 | | - |
---|
236 | 96 | static const u32 edca_setting_dl[PEER_MAX] = { |
---|
237 | 97 | 0xa44f, /* 0 UNKNOWN */ |
---|
238 | 98 | 0x5ea44f, /* 1 REALTEK_90 */ |
---|
.. | .. |
---|
255 | 115 | 0x5ea44f, /* 7 MARV */ |
---|
256 | 116 | }; |
---|
257 | 117 | |
---|
258 | | -static u8 rtl8818e_delta_swing_table_idx_24gb_p[] = { |
---|
| 118 | +static const u8 rtl8818e_delta_swing_table_idx_24gb_p[] = { |
---|
259 | 119 | 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, |
---|
260 | 120 | 4, 4, 4, 5, 5, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9}; |
---|
261 | 121 | |
---|
262 | | -static u8 rtl8818e_delta_swing_table_idx_24gb_n[] = { |
---|
| 122 | +static const u8 rtl8818e_delta_swing_table_idx_24gb_n[] = { |
---|
263 | 123 | 0, 0, 0, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, |
---|
264 | 124 | 7, 7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 11}; |
---|
265 | 125 | |
---|
266 | | -static u8 rtl8812ae_delta_swing_table_idx_24gb_n[] = { |
---|
| 126 | +static const u8 rtl8812ae_delta_swing_table_idx_24gb_n[] = { |
---|
267 | 127 | 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, |
---|
268 | 128 | 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11}; |
---|
269 | 129 | |
---|
270 | | -static u8 rtl8812ae_delta_swing_table_idx_24gb_p[] = { |
---|
| 130 | +static const u8 rtl8812ae_delta_swing_table_idx_24gb_p[] = { |
---|
271 | 131 | 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, |
---|
272 | 132 | 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; |
---|
273 | 133 | |
---|
274 | | -static u8 rtl8812ae_delta_swing_table_idx_24ga_n[] = { |
---|
| 134 | +static const u8 rtl8812ae_delta_swing_table_idx_24ga_n[] = { |
---|
275 | 135 | 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, |
---|
276 | 136 | 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; |
---|
277 | 137 | |
---|
278 | | -static u8 rtl8812ae_delta_swing_table_idx_24ga_p[] = { |
---|
| 138 | +static const u8 rtl8812ae_delta_swing_table_idx_24ga_p[] = { |
---|
279 | 139 | 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, |
---|
280 | 140 | 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; |
---|
281 | 141 | |
---|
282 | | -static u8 rtl8812ae_delta_swing_table_idx_24gcckb_n[] = { |
---|
| 142 | +static const u8 rtl8812ae_delta_swing_table_idx_24gcckb_n[] = { |
---|
283 | 143 | 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, |
---|
284 | 144 | 6, 6, 7, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11}; |
---|
285 | 145 | |
---|
286 | | -static u8 rtl8812ae_delta_swing_table_idx_24gcckb_p[] = { |
---|
| 146 | +static const u8 rtl8812ae_delta_swing_table_idx_24gcckb_p[] = { |
---|
287 | 147 | 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, |
---|
288 | 148 | 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; |
---|
289 | 149 | |
---|
290 | | -static u8 rtl8812ae_delta_swing_table_idx_24gccka_n[] = { |
---|
| 150 | +static const u8 rtl8812ae_delta_swing_table_idx_24gccka_n[] = { |
---|
291 | 151 | 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, |
---|
292 | 152 | 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11}; |
---|
293 | 153 | |
---|
294 | | -static u8 rtl8812ae_delta_swing_table_idx_24gccka_p[] = { |
---|
| 154 | +static const u8 rtl8812ae_delta_swing_table_idx_24gccka_p[] = { |
---|
295 | 155 | 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, |
---|
296 | 156 | 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 9}; |
---|
297 | 157 | |
---|
298 | | -static u8 rtl8812ae_delta_swing_table_idx_5gb_n[][DEL_SW_IDX_SZ] = { |
---|
| 158 | +static const u8 rtl8812ae_delta_swing_table_idx_5gb_n[][DEL_SW_IDX_SZ] = { |
---|
299 | 159 | {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, |
---|
300 | 160 | 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13}, |
---|
301 | 161 | {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, |
---|
.. | .. |
---|
304 | 164 | 12, 12, 13, 14, 14, 14, 15, 16, 17, 17, 17, 18, 18, 18}, |
---|
305 | 165 | }; |
---|
306 | 166 | |
---|
307 | | -static u8 rtl8812ae_delta_swing_table_idx_5gb_p[][DEL_SW_IDX_SZ] = { |
---|
| 167 | +static const u8 rtl8812ae_delta_swing_table_idx_5gb_p[][DEL_SW_IDX_SZ] = { |
---|
308 | 168 | {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 8, |
---|
309 | 169 | 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11}, |
---|
310 | 170 | {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, |
---|
.. | .. |
---|
313 | 173 | 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, |
---|
314 | 174 | }; |
---|
315 | 175 | |
---|
316 | | -static u8 rtl8812ae_delta_swing_table_idx_5ga_n[][DEL_SW_IDX_SZ] = { |
---|
| 176 | +static const u8 rtl8812ae_delta_swing_table_idx_5ga_n[][DEL_SW_IDX_SZ] = { |
---|
317 | 177 | {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, |
---|
318 | 178 | 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13}, |
---|
319 | 179 | {0, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8, 9, |
---|
.. | .. |
---|
322 | 182 | 12, 13, 14, 14, 15, 15, 15, 16, 16, 16, 17, 17, 18, 18}, |
---|
323 | 183 | }; |
---|
324 | 184 | |
---|
325 | | -static u8 rtl8812ae_delta_swing_table_idx_5ga_p[][DEL_SW_IDX_SZ] = { |
---|
| 185 | +static const u8 rtl8812ae_delta_swing_table_idx_5ga_p[][DEL_SW_IDX_SZ] = { |
---|
326 | 186 | {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 8, |
---|
327 | 187 | 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11}, |
---|
328 | 188 | {0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, |
---|
.. | .. |
---|
331 | 191 | 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, |
---|
332 | 192 | }; |
---|
333 | 193 | |
---|
334 | | -static u8 rtl8821ae_delta_swing_table_idx_24gb_n[] = { |
---|
| 194 | +static const u8 rtl8821ae_delta_swing_table_idx_24ga_n[] = { |
---|
335 | 195 | 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, |
---|
336 | 196 | 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; |
---|
337 | 197 | |
---|
338 | | -static u8 rtl8821ae_delta_swing_table_idx_24gb_p[] = { |
---|
| 198 | +static const u8 rtl8821ae_delta_swing_table_idx_24ga_p[] = { |
---|
339 | 199 | 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, |
---|
340 | 200 | 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; |
---|
341 | 201 | |
---|
342 | | -static u8 rtl8821ae_delta_swing_table_idx_24ga_n[] = { |
---|
| 202 | +static const u8 rtl8821ae_delta_swing_table_idx_24gccka_n[] = { |
---|
343 | 203 | 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, |
---|
344 | 204 | 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; |
---|
345 | 205 | |
---|
346 | | -static u8 rtl8821ae_delta_swing_table_idx_24ga_p[] = { |
---|
| 206 | +static const u8 rtl8821ae_delta_swing_table_idx_24gccka_p[] = { |
---|
347 | 207 | 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, |
---|
348 | 208 | 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; |
---|
349 | 209 | |
---|
350 | | -static u8 rtl8821ae_delta_swing_table_idx_24gcckb_n[] = { |
---|
351 | | - 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, |
---|
352 | | - 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; |
---|
353 | | - |
---|
354 | | -static u8 rtl8821ae_delta_swing_table_idx_24gcckb_p[] = { |
---|
355 | | - 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, |
---|
356 | | - 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; |
---|
357 | | - |
---|
358 | | -static u8 rtl8821ae_delta_swing_table_idx_24gccka_n[] = { |
---|
359 | | - 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, |
---|
360 | | - 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10}; |
---|
361 | | - |
---|
362 | | -static u8 rtl8821ae_delta_swing_table_idx_24gccka_p[] = { |
---|
363 | | - 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, |
---|
364 | | - 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12}; |
---|
365 | | - |
---|
366 | | -static u8 rtl8821ae_delta_swing_table_idx_5gb_n[][DEL_SW_IDX_SZ] = { |
---|
| 210 | +static const u8 rtl8821ae_delta_swing_table_idx_5ga_n[][DEL_SW_IDX_SZ] = { |
---|
367 | 211 | {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
368 | 212 | 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
369 | 213 | {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
.. | .. |
---|
372 | 216 | 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
373 | 217 | }; |
---|
374 | 218 | |
---|
375 | | -static u8 rtl8821ae_delta_swing_table_idx_5gb_p[][DEL_SW_IDX_SZ] = { |
---|
376 | | - {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
377 | | - 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
378 | | - {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
379 | | - 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
380 | | - {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
381 | | - 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
382 | | -}; |
---|
383 | | - |
---|
384 | | -static u8 rtl8821ae_delta_swing_table_idx_5ga_n[][DEL_SW_IDX_SZ] = { |
---|
385 | | - {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
386 | | - 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
387 | | - {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
388 | | - 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
389 | | - {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
390 | | - 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
391 | | -}; |
---|
392 | | - |
---|
393 | | -static u8 rtl8821ae_delta_swing_table_idx_5ga_p[][DEL_SW_IDX_SZ] = { |
---|
| 219 | +static const u8 rtl8821ae_delta_swing_table_idx_5ga_p[][DEL_SW_IDX_SZ] = { |
---|
394 | 220 | {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
395 | 221 | 12, 12, 13, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16}, |
---|
396 | 222 | {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, |
---|
.. | .. |
---|
611 | 437 | mac->opmode == NL80211_IFTYPE_ADHOC) { |
---|
612 | 438 | rtl_dm_dig->min_undec_pwdb_for_dm = |
---|
613 | 439 | rtlpriv->dm.entry_min_undec_sm_pwdb; |
---|
614 | | - RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, |
---|
615 | | - "AP Client PWDB = 0x%lx\n", |
---|
616 | | - rtlpriv->dm.entry_min_undec_sm_pwdb); |
---|
| 440 | + rtl_dbg(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, |
---|
| 441 | + "AP Client PWDB = 0x%lx\n", |
---|
| 442 | + rtlpriv->dm.entry_min_undec_sm_pwdb); |
---|
617 | 443 | } else { |
---|
618 | 444 | rtl_dm_dig->min_undec_pwdb_for_dm = |
---|
619 | 445 | rtlpriv->dm.undec_sm_pwdb; |
---|
620 | | - RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, |
---|
621 | | - "STA Default Port PWDB = 0x%x\n", |
---|
622 | | - rtl_dm_dig->min_undec_pwdb_for_dm); |
---|
| 446 | + rtl_dbg(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, |
---|
| 447 | + "STA Default Port PWDB = 0x%x\n", |
---|
| 448 | + rtl_dm_dig->min_undec_pwdb_for_dm); |
---|
623 | 449 | } |
---|
624 | 450 | } else { |
---|
625 | 451 | rtl_dm_dig->min_undec_pwdb_for_dm = |
---|
626 | 452 | rtlpriv->dm.entry_min_undec_sm_pwdb; |
---|
627 | | - RT_TRACE(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, |
---|
628 | | - "AP Ext Port or disconnect PWDB = 0x%x\n", |
---|
629 | | - rtl_dm_dig->min_undec_pwdb_for_dm); |
---|
| 453 | + rtl_dbg(rtlpriv, COMP_BB_POWERSAVING, DBG_LOUD, |
---|
| 454 | + "AP Ext Port or disconnect PWDB = 0x%x\n", |
---|
| 455 | + rtl_dm_dig->min_undec_pwdb_for_dm); |
---|
630 | 456 | } |
---|
631 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
632 | | - "MinUndecoratedPWDBForDM =%d\n", |
---|
633 | | - rtl_dm_dig->min_undec_pwdb_for_dm); |
---|
| 457 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 458 | + "MinUndecoratedPWDBForDM =%d\n", |
---|
| 459 | + rtl_dm_dig->min_undec_pwdb_for_dm); |
---|
634 | 460 | } |
---|
635 | 461 | |
---|
636 | 462 | static void rtl8812ae_dm_rssi_dump_to_register(struct ieee80211_hw *hw) |
---|
.. | .. |
---|
677 | 503 | u8 h2c_parameter[4] = { 0 }; |
---|
678 | 504 | long tmp_entry_max_pwdb = 0, tmp_entry_min_pwdb = 0xff; |
---|
679 | 505 | u8 stbc_tx = 0; |
---|
680 | | - u64 cur_txokcnt = 0, cur_rxokcnt = 0; |
---|
| 506 | + u64 cur_rxokcnt = 0; |
---|
681 | 507 | static u64 last_txokcnt = 0, last_rxokcnt; |
---|
682 | 508 | |
---|
683 | | - cur_txokcnt = rtlpriv->stats.txbytesunicast - last_txokcnt; |
---|
684 | 509 | cur_rxokcnt = rtlpriv->stats.rxbytesunicast - last_rxokcnt; |
---|
685 | 510 | last_txokcnt = rtlpriv->stats.txbytesunicast; |
---|
686 | 511 | last_rxokcnt = rtlpriv->stats.rxbytesunicast; |
---|
.. | .. |
---|
801 | 626 | u8 dm_dig_max, dm_dig_min, offset; |
---|
802 | 627 | u8 current_igi = dm_digtable->cur_igvalue; |
---|
803 | 628 | |
---|
804 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "\n"); |
---|
| 629 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "\n"); |
---|
805 | 630 | |
---|
806 | 631 | if (mac->act_scanning) { |
---|
807 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
808 | | - "Return: In Scan Progress\n"); |
---|
| 632 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 633 | + "Return: In Scan Progress\n"); |
---|
809 | 634 | return; |
---|
810 | 635 | } |
---|
811 | 636 | |
---|
.. | .. |
---|
841 | 666 | dm_digtable->rx_gain_max = |
---|
842 | 667 | dm_digtable->rssi_val_min + offset; |
---|
843 | 668 | |
---|
844 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
845 | | - "dm_digtable->rssi_val_min=0x%x,dm_digtable->rx_gain_max = 0x%x\n", |
---|
846 | | - dm_digtable->rssi_val_min, |
---|
847 | | - dm_digtable->rx_gain_max); |
---|
| 669 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 670 | + "dm_digtable->rssi_val_min=0x%x,dm_digtable->rx_gain_max = 0x%x\n", |
---|
| 671 | + dm_digtable->rssi_val_min, |
---|
| 672 | + dm_digtable->rx_gain_max); |
---|
848 | 673 | if (rtlpriv->dm.one_entry_only) { |
---|
849 | 674 | offset = 0; |
---|
850 | 675 | |
---|
.. | .. |
---|
857 | 682 | dig_min_0 = |
---|
858 | 683 | dm_digtable->rssi_val_min - offset; |
---|
859 | 684 | |
---|
860 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
861 | | - "bOneEntryOnly=TRUE, dig_min_0=0x%x\n", |
---|
862 | | - dig_min_0); |
---|
| 685 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 686 | + "bOneEntryOnly=TRUE, dig_min_0=0x%x\n", |
---|
| 687 | + dig_min_0); |
---|
863 | 688 | } else { |
---|
864 | 689 | dig_min_0 = dm_dig_min; |
---|
865 | 690 | } |
---|
866 | 691 | } else { |
---|
867 | 692 | dm_digtable->rx_gain_max = dm_dig_max; |
---|
868 | 693 | dig_min_0 = dm_dig_min; |
---|
869 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
870 | | - "No Link\n"); |
---|
| 694 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "No Link\n"); |
---|
871 | 695 | } |
---|
872 | 696 | |
---|
873 | 697 | if (rtlpriv->falsealm_cnt.cnt_all > 10000) { |
---|
874 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
875 | | - "Abnormally false alarm case.\n"); |
---|
| 698 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 699 | + "Abnormally false alarm case.\n"); |
---|
876 | 700 | |
---|
877 | 701 | if (dm_digtable->large_fa_hit != 3) |
---|
878 | 702 | dm_digtable->large_fa_hit++; |
---|
.. | .. |
---|
903 | 727 | dig_min_0; |
---|
904 | 728 | dm_digtable->rx_gain_min = |
---|
905 | 729 | dig_min_0; |
---|
906 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
907 | | - "Normal Case: At Lower Bound\n"); |
---|
| 730 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 731 | + "Normal Case: At Lower Bound\n"); |
---|
908 | 732 | } else { |
---|
909 | 733 | dm_digtable->forbidden_igi--; |
---|
910 | 734 | dm_digtable->rx_gain_min = |
---|
911 | 735 | (dm_digtable->forbidden_igi + 1); |
---|
912 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
913 | | - "Normal Case: Approach Lower Bound\n"); |
---|
| 736 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 737 | + "Normal Case: Approach Lower Bound\n"); |
---|
914 | 738 | } |
---|
915 | 739 | } else { |
---|
916 | 740 | dm_digtable->large_fa_hit = 0; |
---|
917 | 741 | } |
---|
918 | 742 | } |
---|
919 | 743 | } |
---|
920 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
921 | | - "pDM_DigTable->LargeFAHit=%d\n", |
---|
922 | | - dm_digtable->large_fa_hit); |
---|
| 744 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 745 | + "pDM_DigTable->LargeFAHit=%d\n", |
---|
| 746 | + dm_digtable->large_fa_hit); |
---|
923 | 747 | |
---|
924 | 748 | if (rtlpriv->dm.dbginfo.num_qry_beacon_pkt < 10) |
---|
925 | 749 | dm_digtable->rx_gain_min = dm_dig_min; |
---|
.. | .. |
---|
929 | 753 | |
---|
930 | 754 | /*Adjust initial gain by false alarm*/ |
---|
931 | 755 | if (mac->link_state >= MAC80211_LINKED) { |
---|
932 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
933 | | - "DIG AfterLink\n"); |
---|
| 756 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 757 | + "DIG AfterLink\n"); |
---|
934 | 758 | if (first_connect) { |
---|
935 | 759 | if (dm_digtable->rssi_val_min <= dig_max_of_min) |
---|
936 | 760 | current_igi = dm_digtable->rssi_val_min; |
---|
937 | 761 | else |
---|
938 | 762 | current_igi = dig_max_of_min; |
---|
939 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
940 | | - "First Connect\n"); |
---|
| 763 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 764 | + "First Connect\n"); |
---|
941 | 765 | } else { |
---|
942 | 766 | if (rtlpriv->falsealm_cnt.cnt_all > DM_DIG_FA_TH2) |
---|
943 | 767 | current_igi = current_igi + 4; |
---|
.. | .. |
---|
949 | 773 | if ((rtlpriv->dm.dbginfo.num_qry_beacon_pkt < 10) && |
---|
950 | 774 | (rtlpriv->falsealm_cnt.cnt_all < DM_DIG_FA_TH1)) { |
---|
951 | 775 | current_igi = dm_digtable->rx_gain_min; |
---|
952 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
953 | | - "Beacon is less than 10 and FA is less than 768, IGI GOES TO 0x1E!!!!!!!!!!!!\n"); |
---|
| 776 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 777 | + "Beacon is less than 10 and FA is less than 768, IGI GOES TO 0x1E!!!!!!!!!!!!\n"); |
---|
954 | 778 | } |
---|
955 | 779 | } |
---|
956 | 780 | } else { |
---|
957 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
958 | | - "DIG BeforeLink\n"); |
---|
| 781 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 782 | + "DIG BeforeLink\n"); |
---|
959 | 783 | if (first_disconnect) { |
---|
960 | 784 | current_igi = dm_digtable->rx_gain_min; |
---|
961 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
962 | | - "First DisConnect\n"); |
---|
| 785 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 786 | + "First DisConnect\n"); |
---|
963 | 787 | } else { |
---|
964 | 788 | /* 2012.03.30 LukeLee: enable DIG before |
---|
965 | 789 | * link but with very high thresholds |
---|
.. | .. |
---|
974 | 798 | if (current_igi >= 0x3e) |
---|
975 | 799 | current_igi = 0x3e; |
---|
976 | 800 | |
---|
977 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "England DIG\n"); |
---|
| 801 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "England DIG\n"); |
---|
978 | 802 | } |
---|
979 | 803 | } |
---|
980 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
981 | | - "DIG End Adjust IGI\n"); |
---|
| 804 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 805 | + "DIG End Adjust IGI\n"); |
---|
982 | 806 | /* Check initial gain by upper/lower bound*/ |
---|
983 | 807 | |
---|
984 | 808 | if (current_igi > dm_digtable->rx_gain_max) |
---|
.. | .. |
---|
986 | 810 | if (current_igi < dm_digtable->rx_gain_min) |
---|
987 | 811 | current_igi = dm_digtable->rx_gain_min; |
---|
988 | 812 | |
---|
989 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
990 | | - "rx_gain_max=0x%x, rx_gain_min=0x%x\n", |
---|
| 813 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 814 | + "rx_gain_max=0x%x, rx_gain_min=0x%x\n", |
---|
991 | 815 | dm_digtable->rx_gain_max, dm_digtable->rx_gain_min); |
---|
992 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
993 | | - "TotalFA=%d\n", rtlpriv->falsealm_cnt.cnt_all); |
---|
994 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
995 | | - "CurIGValue=0x%x\n", current_igi); |
---|
| 816 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 817 | + "TotalFA=%d\n", rtlpriv->falsealm_cnt.cnt_all); |
---|
| 818 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 819 | + "CurIGValue=0x%x\n", current_igi); |
---|
996 | 820 | |
---|
997 | 821 | rtl8821ae_dm_write_dig(hw, current_igi); |
---|
998 | 822 | dm_digtable->media_connect_0 = |
---|
.. | .. |
---|
1055 | 879 | rtl_set_bbreg(hw, ODM_REG_CCK_FA_RST_11AC, BIT(15), 0); |
---|
1056 | 880 | rtl_set_bbreg(hw, ODM_REG_CCK_FA_RST_11AC, BIT(15), 1); |
---|
1057 | 881 | |
---|
1058 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "Cnt_Cck_fail=%d\n", |
---|
1059 | | - falsealm_cnt->cnt_cck_fail); |
---|
1060 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "cnt_ofdm_fail=%d\n", |
---|
1061 | | - falsealm_cnt->cnt_ofdm_fail); |
---|
1062 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "Total False Alarm=%d\n", |
---|
1063 | | - falsealm_cnt->cnt_all); |
---|
| 882 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "Cnt_Cck_fail=%d\n", |
---|
| 883 | + falsealm_cnt->cnt_cck_fail); |
---|
| 884 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "cnt_ofdm_fail=%d\n", |
---|
| 885 | + falsealm_cnt->cnt_ofdm_fail); |
---|
| 886 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "Total False Alarm=%d\n", |
---|
| 887 | + falsealm_cnt->cnt_all); |
---|
1064 | 888 | } |
---|
1065 | 889 | |
---|
1066 | 890 | static void rtl8812ae_dm_check_txpower_tracking_thermalmeter( |
---|
.. | .. |
---|
1071 | 895 | if (!rtlpriv->dm.tm_trigger) { |
---|
1072 | 896 | rtl_set_rfreg(hw, RF90_PATH_A, RF_T_METER_88E, |
---|
1073 | 897 | BIT(17) | BIT(16), 0x03); |
---|
1074 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1075 | | - "Trigger 8812 Thermal Meter!!\n"); |
---|
| 898 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 899 | + "Trigger 8812 Thermal Meter!!\n"); |
---|
1076 | 900 | rtlpriv->dm.tm_trigger = 1; |
---|
1077 | 901 | return; |
---|
1078 | 902 | } |
---|
1079 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1080 | | - "Schedule TxPowerTracking direct call!!\n"); |
---|
| 903 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 904 | + "Schedule TxPowerTracking direct call!!\n"); |
---|
1081 | 905 | rtl8812ae_dm_txpower_tracking_callback_thermalmeter(hw); |
---|
1082 | 906 | } |
---|
1083 | 907 | |
---|
.. | .. |
---|
1103 | 927 | } |
---|
1104 | 928 | |
---|
1105 | 929 | static void rtl8812ae_get_delta_swing_table(struct ieee80211_hw *hw, |
---|
1106 | | - u8 **up_a, u8 **down_a, |
---|
1107 | | - u8 **up_b, u8 **down_b) |
---|
| 930 | + const u8 **up_a, |
---|
| 931 | + const u8 **down_a, |
---|
| 932 | + const u8 **up_b, |
---|
| 933 | + const u8 **down_b) |
---|
1108 | 934 | { |
---|
1109 | 935 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
1110 | 936 | struct rtl_phy *rtlphy = &rtlpriv->phy; |
---|
.. | .. |
---|
1140 | 966 | *up_b = rtl8812ae_delta_swing_table_idx_5gb_p[2]; |
---|
1141 | 967 | *down_b = rtl8812ae_delta_swing_table_idx_5gb_n[2]; |
---|
1142 | 968 | } else { |
---|
1143 | | - *up_a = (u8 *)rtl8818e_delta_swing_table_idx_24gb_p; |
---|
1144 | | - *down_a = (u8 *)rtl8818e_delta_swing_table_idx_24gb_n; |
---|
1145 | | - *up_b = (u8 *)rtl8818e_delta_swing_table_idx_24gb_p; |
---|
1146 | | - *down_b = (u8 *)rtl8818e_delta_swing_table_idx_24gb_n; |
---|
| 969 | + *up_a = rtl8818e_delta_swing_table_idx_24gb_p; |
---|
| 970 | + *down_a = rtl8818e_delta_swing_table_idx_24gb_n; |
---|
| 971 | + *up_b = rtl8818e_delta_swing_table_idx_24gb_p; |
---|
| 972 | + *down_b = rtl8818e_delta_swing_table_idx_24gb_n; |
---|
1147 | 973 | } |
---|
1148 | 974 | } |
---|
1149 | 975 | |
---|
.. | .. |
---|
1154 | 980 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
---|
1155 | 981 | u8 p = 0; |
---|
1156 | 982 | |
---|
1157 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1158 | | - "Get C2H Command! Rate=0x%x\n", rate); |
---|
| 983 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 984 | + "Get C2H Command! Rate=0x%x\n", rate); |
---|
1159 | 985 | |
---|
1160 | 986 | rtldm->tx_rate = rate; |
---|
1161 | 987 | |
---|
.. | .. |
---|
1318 | 1144 | ret_rate = MGN_VHT2SS_MCS9; |
---|
1319 | 1145 | break; |
---|
1320 | 1146 | default: |
---|
1321 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1322 | | - "HwRateToMRate8812(): Non supported Rate [%x]!!!\n", |
---|
1323 | | - rate); |
---|
| 1147 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1148 | + "HwRateToMRate8812(): Non supported Rate [%x]!!!\n", |
---|
| 1149 | + rate); |
---|
1324 | 1150 | break; |
---|
1325 | 1151 | } |
---|
1326 | 1152 | return ret_rate; |
---|
.. | .. |
---|
1360 | 1186 | tx_rate = |
---|
1361 | 1187 | rtl8821ae_hw_rate_to_mrate(hw, rtldm->tx_rate); |
---|
1362 | 1188 | |
---|
1363 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1364 | | - "===>rtl8812ae_dm_txpwr_track_set_pwr\n"); |
---|
| 1189 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1190 | + "===>%s\n", __func__); |
---|
1365 | 1191 | /*20130429 Mimic Modify High Rate BBSwing Limit.*/ |
---|
1366 | 1192 | if (tx_rate != 0xFF) { |
---|
1367 | 1193 | /*CCK*/ |
---|
.. | .. |
---|
1432 | 1258 | else |
---|
1433 | 1259 | pwr_tracking_limit = 24; |
---|
1434 | 1260 | } |
---|
1435 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1436 | | - "TxRate=0x%x, PwrTrackingLimit=%d\n", |
---|
1437 | | - tx_rate, pwr_tracking_limit); |
---|
| 1261 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1262 | + "TxRate=0x%x, PwrTrackingLimit=%d\n", |
---|
| 1263 | + tx_rate, pwr_tracking_limit); |
---|
1438 | 1264 | |
---|
1439 | 1265 | if (method == BBSWING) { |
---|
1440 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1441 | | - "===>rtl8812ae_dm_txpwr_track_set_pwr\n"); |
---|
| 1266 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1267 | + "===>%s\n", __func__); |
---|
1442 | 1268 | |
---|
1443 | 1269 | if (rf_path == RF90_PATH_A) { |
---|
1444 | 1270 | u32 tmp; |
---|
.. | .. |
---|
1449 | 1275 | pwr_tracking_limit : |
---|
1450 | 1276 | rtldm->ofdm_index[RF90_PATH_A]; |
---|
1451 | 1277 | tmp = final_swing_idx[RF90_PATH_A]; |
---|
1452 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1453 | | - "pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A]=%d,pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_A]=%d\n", |
---|
1454 | | - rtldm->ofdm_index[RF90_PATH_A], |
---|
1455 | | - final_swing_idx[RF90_PATH_A]); |
---|
| 1278 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1279 | + "pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A]=%d,pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_A]=%d\n", |
---|
| 1280 | + rtldm->ofdm_index[RF90_PATH_A], |
---|
| 1281 | + final_swing_idx[RF90_PATH_A]); |
---|
1456 | 1282 | |
---|
1457 | 1283 | rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, |
---|
1458 | 1284 | txscaling_tbl[tmp]); |
---|
.. | .. |
---|
1465 | 1291 | pwr_tracking_limit : |
---|
1466 | 1292 | rtldm->ofdm_index[RF90_PATH_B]; |
---|
1467 | 1293 | tmp = final_swing_idx[RF90_PATH_B]; |
---|
1468 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1469 | | - "pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_B]=%d, pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_B]=%d\n", |
---|
1470 | | - rtldm->ofdm_index[RF90_PATH_B], |
---|
1471 | | - final_swing_idx[RF90_PATH_B]); |
---|
| 1294 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1295 | + "pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_B]=%d, pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_B]=%d\n", |
---|
| 1296 | + rtldm->ofdm_index[RF90_PATH_B], |
---|
| 1297 | + final_swing_idx[RF90_PATH_B]); |
---|
1472 | 1298 | |
---|
1473 | 1299 | rtl_set_bbreg(hw, RB_TXSCALE, 0xFFE00000, |
---|
1474 | 1300 | txscaling_tbl[tmp]); |
---|
1475 | 1301 | } |
---|
1476 | 1302 | } else if (method == MIX_MODE) { |
---|
1477 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1478 | | - "pDM_Odm->DefaultOfdmIndex=%d, pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", |
---|
1479 | | - rtldm->default_ofdm_index, |
---|
1480 | | - rtldm->absolute_ofdm_swing_idx[rf_path], |
---|
1481 | | - rf_path); |
---|
| 1303 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1304 | + "pDM_Odm->DefaultOfdmIndex=%d, pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", |
---|
| 1305 | + rtldm->default_ofdm_index, |
---|
| 1306 | + rtldm->absolute_ofdm_swing_idx[rf_path], |
---|
| 1307 | + rf_path); |
---|
1482 | 1308 | |
---|
1483 | 1309 | final_ofdm_swing_index = rtldm->default_ofdm_index + |
---|
1484 | 1310 | rtldm->absolute_ofdm_swing_idx[rf_path]; |
---|
.. | .. |
---|
1506 | 1332 | rtlphy->current_channel, |
---|
1507 | 1333 | RF90_PATH_A); |
---|
1508 | 1334 | |
---|
1509 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1510 | | - "******Path_A Over BBSwing Limit ,PwrTrackingLimit = %d ,Remnant TxAGC Value = %d\n", |
---|
1511 | | - pwr_tracking_limit, |
---|
1512 | | - rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
| 1335 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1336 | + "******Path_A Over BBSwing Limit ,PwrTrackingLimit = %d ,Remnant TxAGC Value = %d\n", |
---|
| 1337 | + pwr_tracking_limit, |
---|
| 1338 | + rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
1513 | 1339 | } else if (final_ofdm_swing_index < 0) { |
---|
1514 | 1340 | rtldm->remnant_cck_idx = final_ofdm_swing_index; |
---|
1515 | 1341 | /* CCK Follow the same compensate value as Path A*/ |
---|
.. | .. |
---|
1525 | 1351 | rtl8821ae_phy_set_txpower_level_by_path(hw, |
---|
1526 | 1352 | rtlphy->current_channel, RF90_PATH_A); |
---|
1527 | 1353 | |
---|
1528 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1529 | | - "******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", |
---|
1530 | | - rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
| 1354 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1355 | + "******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", |
---|
| 1356 | + rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
1531 | 1357 | } else { |
---|
1532 | 1358 | rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, |
---|
1533 | 1359 | txscaling_tbl[(u8)final_ofdm_swing_index]); |
---|
1534 | 1360 | |
---|
1535 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1536 | | - "******Path_A Compensate with BBSwing, Final_OFDM_Swing_Index = %d\n", |
---|
| 1361 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1362 | + "******Path_A Compensate with BBSwing, Final_OFDM_Swing_Index = %d\n", |
---|
1537 | 1363 | final_ofdm_swing_index); |
---|
1538 | 1364 | /*If TxAGC has changed, reset TxAGC again*/ |
---|
1539 | 1365 | if (rtldm->modify_txagc_flag_path_a) { |
---|
.. | .. |
---|
1545 | 1371 | rtlphy->current_channel, RF90_PATH_A); |
---|
1546 | 1372 | rtldm->modify_txagc_flag_path_a = false; |
---|
1547 | 1373 | |
---|
1548 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, |
---|
1549 | | - DBG_LOUD, |
---|
1550 | | - "******Path_A pDM_Odm->Modify_TxAGC_Flag = FALSE\n"); |
---|
| 1374 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, |
---|
| 1375 | + DBG_LOUD, |
---|
| 1376 | + "******Path_A pDM_Odm->Modify_TxAGC_Flag = FALSE\n"); |
---|
1551 | 1377 | } |
---|
1552 | 1378 | } |
---|
1553 | 1379 | } |
---|
.. | .. |
---|
1568 | 1394 | rtl8821ae_phy_set_txpower_level_by_path(hw, |
---|
1569 | 1395 | rtlphy->current_channel, RF90_PATH_B); |
---|
1570 | 1396 | |
---|
1571 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1572 | | - "******Path_B Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d\n", |
---|
1573 | | - pwr_tracking_limit, |
---|
| 1397 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1398 | + "******Path_B Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d\n", |
---|
| 1399 | + pwr_tracking_limit, |
---|
1574 | 1400 | rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
1575 | 1401 | } else if (final_ofdm_swing_index < 0) { |
---|
1576 | 1402 | rtldm->remnant_ofdm_swing_idx[rf_path] = |
---|
.. | .. |
---|
1585 | 1411 | rtl8821ae_phy_set_txpower_level_by_path(hw, |
---|
1586 | 1412 | rtlphy->current_channel, RF90_PATH_B); |
---|
1587 | 1413 | |
---|
1588 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1589 | | - "******Path_B Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", |
---|
1590 | | - rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
| 1414 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1415 | + "******Path_B Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", |
---|
| 1416 | + rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
1591 | 1417 | } else { |
---|
1592 | 1418 | rtl_set_bbreg(hw, RB_TXSCALE, 0xFFE00000, |
---|
1593 | 1419 | txscaling_tbl[(u8)final_ofdm_swing_index]); |
---|
1594 | 1420 | |
---|
1595 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1596 | | - "******Path_B Compensate with BBSwing ,Final_OFDM_Swing_Index = %d\n", |
---|
| 1421 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1422 | + "******Path_B Compensate with BBSwing ,Final_OFDM_Swing_Index = %d\n", |
---|
1597 | 1423 | final_ofdm_swing_index); |
---|
1598 | 1424 | /*If TxAGC has changed, reset TxAGC again*/ |
---|
1599 | 1425 | if (rtldm->modify_txagc_flag_path_b) { |
---|
.. | .. |
---|
1606 | 1432 | rtldm->modify_txagc_flag_path_b = |
---|
1607 | 1433 | false; |
---|
1608 | 1434 | |
---|
1609 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1610 | | - "******Path_B pDM_Odm->Modify_TxAGC_Flag = FALSE\n"); |
---|
| 1435 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1436 | + "******Path_B pDM_Odm->Modify_TxAGC_Flag = FALSE\n"); |
---|
1611 | 1437 | } |
---|
1612 | 1438 | } |
---|
1613 | 1439 | } |
---|
.. | .. |
---|
1633 | 1459 | /* 1. The following TWO tables decide |
---|
1634 | 1460 | * the final index of OFDM/CCK swing table. |
---|
1635 | 1461 | */ |
---|
1636 | | - u8 *delta_swing_table_idx_tup_a; |
---|
1637 | | - u8 *delta_swing_table_idx_tdown_a; |
---|
1638 | | - u8 *delta_swing_table_idx_tup_b; |
---|
1639 | | - u8 *delta_swing_table_idx_tdown_b; |
---|
| 1462 | + const u8 *delta_swing_table_idx_tup_a; |
---|
| 1463 | + const u8 *delta_swing_table_idx_tdown_a; |
---|
| 1464 | + const u8 *delta_swing_table_idx_tup_b; |
---|
| 1465 | + const u8 *delta_swing_table_idx_tdown_b; |
---|
1640 | 1466 | |
---|
1641 | 1467 | /*2. Initilization ( 7 steps in total )*/ |
---|
1642 | 1468 | rtl8812ae_get_delta_swing_table(hw, |
---|
1643 | | - (u8 **)&delta_swing_table_idx_tup_a, |
---|
1644 | | - (u8 **)&delta_swing_table_idx_tdown_a, |
---|
1645 | | - (u8 **)&delta_swing_table_idx_tup_b, |
---|
1646 | | - (u8 **)&delta_swing_table_idx_tdown_b); |
---|
| 1469 | + &delta_swing_table_idx_tup_a, |
---|
| 1470 | + &delta_swing_table_idx_tdown_a, |
---|
| 1471 | + &delta_swing_table_idx_tup_b, |
---|
| 1472 | + &delta_swing_table_idx_tdown_b); |
---|
1647 | 1473 | |
---|
1648 | 1474 | rtldm->txpower_trackinginit = true; |
---|
1649 | 1475 | |
---|
1650 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1651 | | - "pDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase[A]:%d, pDM_Odm->DefaultOfdmIndex: %d\n", |
---|
1652 | | - rtldm->swing_idx_cck_base, |
---|
1653 | | - rtldm->swing_idx_ofdm_base[RF90_PATH_A], |
---|
1654 | | - rtldm->default_ofdm_index); |
---|
| 1476 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1477 | + "pDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase[A]:%d, pDM_Odm->DefaultOfdmIndex: %d\n", |
---|
| 1478 | + rtldm->swing_idx_cck_base, |
---|
| 1479 | + rtldm->swing_idx_ofdm_base[RF90_PATH_A], |
---|
| 1480 | + rtldm->default_ofdm_index); |
---|
1655 | 1481 | |
---|
1656 | 1482 | thermal_value = (u8)rtl_get_rfreg(hw, RF90_PATH_A, |
---|
1657 | 1483 | /*0x42: RF Reg[15:10] 88E*/ |
---|
1658 | 1484 | RF_T_METER_8812A, 0xfc00); |
---|
1659 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1660 | | - "Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", |
---|
1661 | | - thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
| 1485 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1486 | + "Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", |
---|
| 1487 | + thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
1662 | 1488 | if (!rtldm->txpower_track_control || |
---|
1663 | 1489 | rtlefuse->eeprom_thermalmeter == 0 || |
---|
1664 | 1490 | rtlefuse->eeprom_thermalmeter == 0xFF) |
---|
.. | .. |
---|
1667 | 1493 | /* 3. Initialize ThermalValues of RFCalibrateInfo*/ |
---|
1668 | 1494 | |
---|
1669 | 1495 | if (rtlhal->reloadtxpowerindex) |
---|
1670 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1671 | | - "reload ofdm index for band switch\n"); |
---|
| 1496 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1497 | + "reload ofdm index for band switch\n"); |
---|
1672 | 1498 | |
---|
1673 | 1499 | /*4. Calculate average thermal meter*/ |
---|
1674 | 1500 | rtldm->thermalvalue_avg[rtldm->thermalvalue_avg_index] = thermal_value; |
---|
.. | .. |
---|
1687 | 1513 | if (thermal_value_avg_count) { |
---|
1688 | 1514 | thermal_value = (u8)(thermal_value_avg / |
---|
1689 | 1515 | thermal_value_avg_count); |
---|
1690 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1691 | | - "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", |
---|
1692 | | - thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
| 1516 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1517 | + "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", |
---|
| 1518 | + thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
1693 | 1519 | } |
---|
1694 | 1520 | |
---|
1695 | 1521 | /*5. Calculate delta, delta_LCK, delta_IQK. |
---|
.. | .. |
---|
1706 | 1532 | (thermal_value - rtldm->thermalvalue_iqk) : |
---|
1707 | 1533 | (rtldm->thermalvalue_iqk - thermal_value); |
---|
1708 | 1534 | |
---|
1709 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1710 | | - "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", |
---|
1711 | | - delta, delta_lck, delta_iqk); |
---|
| 1535 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1536 | + "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", |
---|
| 1537 | + delta, delta_lck, delta_iqk); |
---|
1712 | 1538 | |
---|
1713 | 1539 | /* 6. If necessary, do LCK. |
---|
1714 | 1540 | * Delta temperature is equal to or larger than 20 centigrade. |
---|
1715 | 1541 | */ |
---|
1716 | 1542 | if (delta_lck >= IQK_THRESHOLD) { |
---|
1717 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1718 | | - "delta_LCK(%d) >= Threshold_IQK(%d)\n", |
---|
1719 | | - delta_lck, IQK_THRESHOLD); |
---|
| 1543 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1544 | + "delta_LCK(%d) >= Threshold_IQK(%d)\n", |
---|
| 1545 | + delta_lck, IQK_THRESHOLD); |
---|
1720 | 1546 | rtldm->thermalvalue_lck = thermal_value; |
---|
1721 | 1547 | rtl8821ae_phy_lc_calibrate(hw); |
---|
1722 | 1548 | } |
---|
.. | .. |
---|
1737 | 1563 | /*7.1 The Final Power Index = BaseIndex + PowerIndexOffset*/ |
---|
1738 | 1564 | |
---|
1739 | 1565 | if (thermal_value > rtlefuse->eeprom_thermalmeter) { |
---|
1740 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1741 | | - "delta_swing_table_idx_tup_a[%d] = %d\n", |
---|
1742 | | - delta, delta_swing_table_idx_tup_a[delta]); |
---|
| 1566 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1567 | + "delta_swing_table_idx_tup_a[%d] = %d\n", |
---|
| 1568 | + delta, delta_swing_table_idx_tup_a[delta]); |
---|
1743 | 1569 | rtldm->delta_power_index_last[RF90_PATH_A] = |
---|
1744 | 1570 | rtldm->delta_power_index[RF90_PATH_A]; |
---|
1745 | 1571 | rtldm->delta_power_index[RF90_PATH_A] = |
---|
.. | .. |
---|
1749 | 1575 | delta_swing_table_idx_tup_a[delta]; |
---|
1750 | 1576 | /*Record delta swing for mix mode power tracking*/ |
---|
1751 | 1577 | |
---|
1752 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1753 | | - "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", |
---|
| 1578 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1579 | + "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", |
---|
1754 | 1580 | rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); |
---|
1755 | 1581 | |
---|
1756 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1757 | | - "delta_swing_table_idx_tup_b[%d] = %d\n", |
---|
1758 | | - delta, delta_swing_table_idx_tup_b[delta]); |
---|
| 1582 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1583 | + "delta_swing_table_idx_tup_b[%d] = %d\n", |
---|
| 1584 | + delta, delta_swing_table_idx_tup_b[delta]); |
---|
1759 | 1585 | rtldm->delta_power_index_last[RF90_PATH_B] = |
---|
1760 | 1586 | rtldm->delta_power_index[RF90_PATH_B]; |
---|
1761 | 1587 | rtldm->delta_power_index[RF90_PATH_B] = |
---|
.. | .. |
---|
1765 | 1591 | delta_swing_table_idx_tup_b[delta]; |
---|
1766 | 1592 | /*Record delta swing for mix mode power tracking*/ |
---|
1767 | 1593 | |
---|
1768 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1769 | | - "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", |
---|
1770 | | - rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]); |
---|
| 1594 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1595 | + "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", |
---|
| 1596 | + rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]); |
---|
1771 | 1597 | } else { |
---|
1772 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1773 | | - "delta_swing_table_idx_tdown_a[%d] = %d\n", |
---|
1774 | | - delta, delta_swing_table_idx_tdown_a[delta]); |
---|
| 1598 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1599 | + "delta_swing_table_idx_tdown_a[%d] = %d\n", |
---|
| 1600 | + delta, delta_swing_table_idx_tdown_a[delta]); |
---|
1775 | 1601 | |
---|
1776 | 1602 | rtldm->delta_power_index_last[RF90_PATH_A] = |
---|
1777 | 1603 | rtldm->delta_power_index[RF90_PATH_A]; |
---|
.. | .. |
---|
1781 | 1607 | rtldm->absolute_ofdm_swing_idx[RF90_PATH_A] = |
---|
1782 | 1608 | -1 * delta_swing_table_idx_tdown_a[delta]; |
---|
1783 | 1609 | /* Record delta swing for mix mode power tracking*/ |
---|
1784 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1785 | | - "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", |
---|
1786 | | - rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); |
---|
| 1610 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1611 | + "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", |
---|
| 1612 | + rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); |
---|
1787 | 1613 | |
---|
1788 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1789 | | - "deltaSwingTableIdx_TDOWN_B[%d] = %d\n", |
---|
1790 | | - delta, delta_swing_table_idx_tdown_b[delta]); |
---|
| 1614 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1615 | + "deltaSwingTableIdx_TDOWN_B[%d] = %d\n", |
---|
| 1616 | + delta, delta_swing_table_idx_tdown_b[delta]); |
---|
1791 | 1617 | |
---|
1792 | 1618 | rtldm->delta_power_index_last[RF90_PATH_B] = |
---|
1793 | 1619 | rtldm->delta_power_index[RF90_PATH_B]; |
---|
.. | .. |
---|
1798 | 1624 | -1 * delta_swing_table_idx_tdown_b[delta]; |
---|
1799 | 1625 | /*Record delta swing for mix mode power tracking*/ |
---|
1800 | 1626 | |
---|
1801 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1802 | | - "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", |
---|
1803 | | - rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]); |
---|
| 1627 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1628 | + "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", |
---|
| 1629 | + rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]); |
---|
1804 | 1630 | } |
---|
1805 | 1631 | |
---|
1806 | 1632 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) { |
---|
1807 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1808 | | - "============================= [Path-%c]Calculating PowerIndexOffset =============================\n", |
---|
1809 | | - (p == RF90_PATH_A ? 'A' : 'B')); |
---|
| 1633 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1634 | + "============================= [Path-%c]Calculating PowerIndexOffset =============================\n", |
---|
| 1635 | + (p == RF90_PATH_A ? 'A' : 'B')); |
---|
1810 | 1636 | |
---|
1811 | 1637 | if (rtldm->delta_power_index[p] == |
---|
1812 | 1638 | rtldm->delta_power_index_last[p]) |
---|
.. | .. |
---|
1820 | 1646 | /* Power Index Diff between 2 |
---|
1821 | 1647 | * times Power Tracking |
---|
1822 | 1648 | */ |
---|
1823 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1824 | | - "[Path-%c] PowerIndexOffset(%d) =DeltaPowerIndex(%d) -DeltaPowerIndexLast(%d)\n", |
---|
1825 | | - (p == RF90_PATH_A ? 'A' : 'B'), |
---|
1826 | | - rtldm->power_index_offset[p], |
---|
1827 | | - rtldm->delta_power_index[p] , |
---|
1828 | | - rtldm->delta_power_index_last[p]); |
---|
| 1649 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1650 | + "[Path-%c] PowerIndexOffset(%d) =DeltaPowerIndex(%d) -DeltaPowerIndexLast(%d)\n", |
---|
| 1651 | + (p == RF90_PATH_A ? 'A' : 'B'), |
---|
| 1652 | + rtldm->power_index_offset[p], |
---|
| 1653 | + rtldm->delta_power_index[p], |
---|
| 1654 | + rtldm->delta_power_index_last[p]); |
---|
1829 | 1655 | |
---|
1830 | 1656 | rtldm->ofdm_index[p] = |
---|
1831 | 1657 | rtldm->swing_idx_ofdm_base[p] + |
---|
.. | .. |
---|
1839 | 1665 | |
---|
1840 | 1666 | /****Print BB Swing Base and Index Offset */ |
---|
1841 | 1667 | |
---|
1842 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1843 | | - "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", |
---|
1844 | | - rtldm->swing_idx_cck, |
---|
| 1668 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1669 | + "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", |
---|
| 1670 | + rtldm->swing_idx_cck, |
---|
1845 | 1671 | rtldm->swing_idx_cck_base, |
---|
1846 | 1672 | rtldm->power_index_offset[p]); |
---|
1847 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1848 | | - "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", |
---|
1849 | | - rtldm->swing_idx_ofdm[p], |
---|
1850 | | - (p == RF90_PATH_A ? 'A' : 'B'), |
---|
1851 | | - rtldm->swing_idx_ofdm_base[p], |
---|
1852 | | - rtldm->power_index_offset[p]); |
---|
| 1673 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1674 | + "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", |
---|
| 1675 | + rtldm->swing_idx_ofdm[p], |
---|
| 1676 | + (p == RF90_PATH_A ? 'A' : 'B'), |
---|
| 1677 | + rtldm->swing_idx_ofdm_base[p], |
---|
| 1678 | + rtldm->power_index_offset[p]); |
---|
1853 | 1679 | |
---|
1854 | 1680 | /*7.1 Handle boundary conditions of index.*/ |
---|
1855 | 1681 | |
---|
.. | .. |
---|
1858 | 1684 | else if (rtldm->ofdm_index[p] < ofdm_min_index) |
---|
1859 | 1685 | rtldm->ofdm_index[p] = ofdm_min_index; |
---|
1860 | 1686 | } |
---|
1861 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1862 | | - "\n\n====================================================================================\n"); |
---|
| 1687 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1688 | + "\n\n====================================================================================\n"); |
---|
1863 | 1689 | if (rtldm->cck_index > TXSCALE_TABLE_SIZE - 1) |
---|
1864 | 1690 | rtldm->cck_index = TXSCALE_TABLE_SIZE - 1; |
---|
1865 | 1691 | else if (rtldm->cck_index < 0) |
---|
1866 | 1692 | rtldm->cck_index = 0; |
---|
1867 | 1693 | } else { |
---|
1868 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1869 | | - "The thermal meter is unchanged or TxPowerTracking OFF(%d): ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d\n", |
---|
1870 | | - rtldm->txpower_track_control, |
---|
1871 | | - thermal_value, |
---|
1872 | | - rtldm->thermalvalue); |
---|
| 1694 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1695 | + "The thermal meter is unchanged or TxPowerTracking OFF(%d): ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d\n", |
---|
| 1696 | + rtldm->txpower_track_control, |
---|
| 1697 | + thermal_value, |
---|
| 1698 | + rtldm->thermalvalue); |
---|
1873 | 1699 | |
---|
1874 | 1700 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) |
---|
1875 | 1701 | rtldm->power_index_offset[p] = 0; |
---|
1876 | 1702 | } |
---|
1877 | 1703 | /*Print Swing base & current*/ |
---|
1878 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1879 | | - "TxPowerTracking: [CCK] Swing Current Index: %d,Swing Base Index: %d\n", |
---|
1880 | | - rtldm->cck_index, rtldm->swing_idx_cck_base); |
---|
| 1704 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1705 | + "TxPowerTracking: [CCK] Swing Current Index: %d,Swing Base Index: %d\n", |
---|
| 1706 | + rtldm->cck_index, rtldm->swing_idx_cck_base); |
---|
1881 | 1707 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) { |
---|
1882 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1883 | | - "TxPowerTracking: [OFDM] Swing Current Index: %d,Swing Base Index[%c]: %d\n", |
---|
1884 | | - rtldm->ofdm_index[p], |
---|
1885 | | - (p == RF90_PATH_A ? 'A' : 'B'), |
---|
1886 | | - rtldm->swing_idx_ofdm_base[p]); |
---|
| 1708 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1709 | + "TxPowerTracking: [OFDM] Swing Current Index: %d,Swing Base Index[%c]: %d\n", |
---|
| 1710 | + rtldm->ofdm_index[p], |
---|
| 1711 | + (p == RF90_PATH_A ? 'A' : 'B'), |
---|
| 1712 | + rtldm->swing_idx_ofdm_base[p]); |
---|
1887 | 1713 | } |
---|
1888 | 1714 | |
---|
1889 | 1715 | if ((rtldm->power_index_offset[RF90_PATH_A] != 0 || |
---|
.. | .. |
---|
1900 | 1726 | *tx power in tx agc for 88E. |
---|
1901 | 1727 | */ |
---|
1902 | 1728 | if (thermal_value > rtldm->thermalvalue) { |
---|
1903 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1904 | | - "Temperature Increasing(A): delta_pi: %d , delta_t: %d, Now_t: %d,EFUSE_t: %d, Last_t: %d\n", |
---|
1905 | | - rtldm->power_index_offset[RF90_PATH_A], |
---|
1906 | | - delta, thermal_value, |
---|
1907 | | - rtlefuse->eeprom_thermalmeter, |
---|
1908 | | - rtldm->thermalvalue); |
---|
| 1729 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1730 | + "Temperature Increasing(A): delta_pi: %d , delta_t: %d, Now_t: %d,EFUSE_t: %d, Last_t: %d\n", |
---|
| 1731 | + rtldm->power_index_offset[RF90_PATH_A], |
---|
| 1732 | + delta, thermal_value, |
---|
| 1733 | + rtlefuse->eeprom_thermalmeter, |
---|
| 1734 | + rtldm->thermalvalue); |
---|
1909 | 1735 | |
---|
1910 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1911 | | - "Temperature Increasing(B): delta_pi: %d ,delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
1912 | | - rtldm->power_index_offset[RF90_PATH_B], |
---|
1913 | | - delta, thermal_value, |
---|
1914 | | - rtlefuse->eeprom_thermalmeter, |
---|
1915 | | - rtldm->thermalvalue); |
---|
| 1736 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1737 | + "Temperature Increasing(B): delta_pi: %d ,delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
| 1738 | + rtldm->power_index_offset[RF90_PATH_B], |
---|
| 1739 | + delta, thermal_value, |
---|
| 1740 | + rtlefuse->eeprom_thermalmeter, |
---|
| 1741 | + rtldm->thermalvalue); |
---|
1916 | 1742 | } else if (thermal_value < rtldm->thermalvalue) { /*Low temperature*/ |
---|
1917 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1918 | | - "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
1919 | | - rtldm->power_index_offset[RF90_PATH_A], |
---|
1920 | | - delta, thermal_value, |
---|
1921 | | - rtlefuse->eeprom_thermalmeter, |
---|
1922 | | - rtldm->thermalvalue); |
---|
| 1743 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1744 | + "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
| 1745 | + rtldm->power_index_offset[RF90_PATH_A], |
---|
| 1746 | + delta, thermal_value, |
---|
| 1747 | + rtlefuse->eeprom_thermalmeter, |
---|
| 1748 | + rtldm->thermalvalue); |
---|
1923 | 1749 | |
---|
1924 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1925 | | - "Temperature Decreasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
1926 | | - rtldm->power_index_offset[RF90_PATH_B], |
---|
1927 | | - delta, thermal_value, |
---|
1928 | | - rtlefuse->eeprom_thermalmeter, |
---|
1929 | | - rtldm->thermalvalue); |
---|
| 1750 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1751 | + "Temperature Decreasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
| 1752 | + rtldm->power_index_offset[RF90_PATH_B], |
---|
| 1753 | + delta, thermal_value, |
---|
| 1754 | + rtlefuse->eeprom_thermalmeter, |
---|
| 1755 | + rtldm->thermalvalue); |
---|
1930 | 1756 | } |
---|
1931 | 1757 | |
---|
1932 | 1758 | if (thermal_value > rtlefuse->eeprom_thermalmeter) { |
---|
1933 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1934 | | - "Temperature(%d) higher than PG value(%d)\n", |
---|
1935 | | - thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
| 1759 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1760 | + "Temperature(%d) higher than PG value(%d)\n", |
---|
| 1761 | + thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
1936 | 1762 | |
---|
1937 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1938 | | - "**********Enter POWER Tracking MIX_MODE**********\n"); |
---|
| 1763 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1764 | + "**********Enter POWER Tracking MIX_MODE**********\n"); |
---|
1939 | 1765 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) |
---|
1940 | 1766 | rtl8812ae_dm_txpwr_track_set_pwr(hw, MIX_MODE, |
---|
1941 | 1767 | p, 0); |
---|
1942 | 1768 | } else { |
---|
1943 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1944 | | - "Temperature(%d) lower than PG value(%d)\n", |
---|
1945 | | - thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
| 1769 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1770 | + "Temperature(%d) lower than PG value(%d)\n", |
---|
| 1771 | + thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
1946 | 1772 | |
---|
1947 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1948 | | - "**********Enter POWER Tracking MIX_MODE**********\n"); |
---|
| 1773 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1774 | + "**********Enter POWER Tracking MIX_MODE**********\n"); |
---|
1949 | 1775 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8812A; p++) |
---|
1950 | 1776 | rtl8812ae_dm_txpwr_track_set_pwr(hw, MIX_MODE, |
---|
1951 | 1777 | p, index_for_channel); |
---|
.. | .. |
---|
1956 | 1782 | rtldm->swing_idx_ofdm_base[p] = |
---|
1957 | 1783 | rtldm->swing_idx_ofdm[p]; |
---|
1958 | 1784 | |
---|
1959 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1960 | | - "pDM_Odm->RFCalibrateInfo.ThermalValue =%d ThermalValue= %d\n", |
---|
1961 | | - rtldm->thermalvalue, thermal_value); |
---|
| 1785 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1786 | + "pDM_Odm->RFCalibrateInfo.ThermalValue =%d ThermalValue= %d\n", |
---|
| 1787 | + rtldm->thermalvalue, thermal_value); |
---|
1962 | 1788 | /*Record last Power Tracking Thermal Value*/ |
---|
1963 | 1789 | rtldm->thermalvalue = thermal_value; |
---|
1964 | 1790 | } |
---|
.. | .. |
---|
1967 | 1793 | if (delta_iqk >= IQK_THRESHOLD) |
---|
1968 | 1794 | rtl8812ae_do_iqk(hw, delta_iqk, thermal_value, 8); |
---|
1969 | 1795 | |
---|
1970 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
1971 | | - "<===rtl8812ae_dm_txpower_tracking_callback_thermalmeter\n"); |
---|
| 1796 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1797 | + "<===%s\n", __func__); |
---|
1972 | 1798 | } |
---|
1973 | 1799 | |
---|
1974 | | -static void rtl8821ae_get_delta_swing_table(struct ieee80211_hw *hw, u8 **up_a, |
---|
1975 | | - u8 **down_a, u8 **up_b, u8 **down_b) |
---|
| 1800 | +static void rtl8821ae_get_delta_swing_table(struct ieee80211_hw *hw, |
---|
| 1801 | + const u8 **up_a, |
---|
| 1802 | + const u8 **down_a) |
---|
1976 | 1803 | { |
---|
1977 | 1804 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
---|
1978 | 1805 | struct rtl_phy *rtlphy = &rtlpriv->phy; |
---|
.. | .. |
---|
1984 | 1811 | if (RTL8821AE_RX_HAL_IS_CCK_RATE(rate)) { |
---|
1985 | 1812 | *up_a = rtl8821ae_delta_swing_table_idx_24gccka_p; |
---|
1986 | 1813 | *down_a = rtl8821ae_delta_swing_table_idx_24gccka_n; |
---|
1987 | | - *up_b = rtl8821ae_delta_swing_table_idx_24gcckb_p; |
---|
1988 | | - *down_b = rtl8821ae_delta_swing_table_idx_24gcckb_n; |
---|
1989 | 1814 | } else { |
---|
1990 | 1815 | *up_a = rtl8821ae_delta_swing_table_idx_24ga_p; |
---|
1991 | 1816 | *down_a = rtl8821ae_delta_swing_table_idx_24ga_n; |
---|
1992 | | - *up_b = rtl8821ae_delta_swing_table_idx_24gb_p; |
---|
1993 | | - *down_b = rtl8821ae_delta_swing_table_idx_24gb_n; |
---|
1994 | 1817 | } |
---|
1995 | 1818 | } else if (36 <= channel && channel <= 64) { |
---|
1996 | 1819 | *up_a = rtl8821ae_delta_swing_table_idx_5ga_p[0]; |
---|
1997 | 1820 | *down_a = rtl8821ae_delta_swing_table_idx_5ga_n[0]; |
---|
1998 | | - *up_b = rtl8821ae_delta_swing_table_idx_5gb_p[0]; |
---|
1999 | | - *down_b = rtl8821ae_delta_swing_table_idx_5gb_n[0]; |
---|
2000 | 1821 | } else if (100 <= channel && channel <= 140) { |
---|
2001 | 1822 | *up_a = rtl8821ae_delta_swing_table_idx_5ga_p[1]; |
---|
2002 | 1823 | *down_a = rtl8821ae_delta_swing_table_idx_5ga_n[1]; |
---|
2003 | | - *up_b = rtl8821ae_delta_swing_table_idx_5gb_p[1]; |
---|
2004 | | - *down_b = rtl8821ae_delta_swing_table_idx_5gb_n[1]; |
---|
2005 | 1824 | } else if (149 <= channel && channel <= 173) { |
---|
2006 | 1825 | *up_a = rtl8821ae_delta_swing_table_idx_5ga_p[2]; |
---|
2007 | 1826 | *down_a = rtl8821ae_delta_swing_table_idx_5ga_n[2]; |
---|
2008 | | - *up_b = rtl8821ae_delta_swing_table_idx_5gb_p[2]; |
---|
2009 | | - *down_b = rtl8821ae_delta_swing_table_idx_5gb_n[2]; |
---|
2010 | 1827 | } else { |
---|
2011 | | - *up_a = (u8 *)rtl8818e_delta_swing_table_idx_24gb_p; |
---|
2012 | | - *down_a = (u8 *)rtl8818e_delta_swing_table_idx_24gb_n; |
---|
2013 | | - *up_b = (u8 *)rtl8818e_delta_swing_table_idx_24gb_p; |
---|
2014 | | - *down_b = (u8 *)rtl8818e_delta_swing_table_idx_24gb_n; |
---|
| 1828 | + *up_a = rtl8818e_delta_swing_table_idx_24gb_p; |
---|
| 1829 | + *down_a = rtl8818e_delta_swing_table_idx_24gb_n; |
---|
2015 | 1830 | } |
---|
2016 | 1831 | return; |
---|
2017 | 1832 | } |
---|
.. | .. |
---|
2049 | 1864 | if (rtldm->tx_rate != 0xFF) |
---|
2050 | 1865 | tx_rate = rtl8821ae_hw_rate_to_mrate(hw, rtldm->tx_rate); |
---|
2051 | 1866 | |
---|
2052 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "===>%s\n", __func__); |
---|
| 1867 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "===>%s\n", __func__); |
---|
2053 | 1868 | |
---|
2054 | 1869 | if (tx_rate != 0xFF) { /* Mimic Modify High Rate BBSwing Limit.*/ |
---|
2055 | 1870 | /*CCK*/ |
---|
.. | .. |
---|
2092 | 1907 | else |
---|
2093 | 1908 | pwr_tracking_limit = 24; |
---|
2094 | 1909 | } |
---|
2095 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2096 | | - "TxRate=0x%x, PwrTrackingLimit=%d\n", |
---|
2097 | | - tx_rate, pwr_tracking_limit); |
---|
| 1910 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1911 | + "TxRate=0x%x, PwrTrackingLimit=%d\n", |
---|
| 1912 | + tx_rate, pwr_tracking_limit); |
---|
2098 | 1913 | |
---|
2099 | 1914 | if (method == BBSWING) { |
---|
2100 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2101 | | - "===>%s\n", __func__); |
---|
| 1915 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1916 | + "===>%s\n", __func__); |
---|
2102 | 1917 | if (rf_path == RF90_PATH_A) { |
---|
2103 | 1918 | final_swing_idx[RF90_PATH_A] = |
---|
2104 | 1919 | (rtldm->ofdm_index[RF90_PATH_A] > |
---|
2105 | 1920 | pwr_tracking_limit) ? |
---|
2106 | 1921 | pwr_tracking_limit : |
---|
2107 | 1922 | rtldm->ofdm_index[RF90_PATH_A]; |
---|
2108 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2109 | | - "pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A]=%d,pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_A]=%d\n", |
---|
2110 | | - rtldm->ofdm_index[RF90_PATH_A], |
---|
2111 | | - final_swing_idx[RF90_PATH_A]); |
---|
| 1923 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1924 | + "pDM_Odm->RFCalibrateInfo.OFDM_index[ODM_RF_PATH_A]=%d,pDM_Odm->RealBbSwingIdx[ODM_RF_PATH_A]=%d\n", |
---|
| 1925 | + rtldm->ofdm_index[RF90_PATH_A], |
---|
| 1926 | + final_swing_idx[RF90_PATH_A]); |
---|
2112 | 1927 | |
---|
2113 | 1928 | rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, |
---|
2114 | 1929 | txscaling_tbl[final_swing_idx[RF90_PATH_A]]); |
---|
2115 | 1930 | } |
---|
2116 | 1931 | } else if (method == MIX_MODE) { |
---|
2117 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2118 | | - "pDM_Odm->DefaultOfdmIndex=%d,pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", |
---|
2119 | | - rtldm->default_ofdm_index, |
---|
2120 | | - rtldm->absolute_ofdm_swing_idx[rf_path], |
---|
2121 | | - rf_path); |
---|
| 1932 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1933 | + "pDM_Odm->DefaultOfdmIndex=%d,pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", |
---|
| 1934 | + rtldm->default_ofdm_index, |
---|
| 1935 | + rtldm->absolute_ofdm_swing_idx[rf_path], |
---|
| 1936 | + rf_path); |
---|
2122 | 1937 | |
---|
2123 | 1938 | final_ofdm_swing_index = |
---|
2124 | 1939 | rtldm->default_ofdm_index + |
---|
.. | .. |
---|
2145 | 1960 | rtlphy->current_channel, |
---|
2146 | 1961 | RF90_PATH_A); |
---|
2147 | 1962 | |
---|
2148 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1963 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2149 | 1964 | " ******Path_A Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d\n", |
---|
2150 | | - pwr_tracking_limit, |
---|
2151 | | - rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
| 1965 | + pwr_tracking_limit, |
---|
| 1966 | + rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
2152 | 1967 | } else if (final_ofdm_swing_index < 0) { |
---|
2153 | 1968 | rtldm->remnant_cck_idx = final_ofdm_swing_index; |
---|
2154 | 1969 | /* CCK Follow the same compensate value as Path A*/ |
---|
.. | .. |
---|
2164 | 1979 | rtl8821ae_phy_set_txpower_level_by_path(hw, |
---|
2165 | 1980 | rtlphy->current_channel, RF90_PATH_A); |
---|
2166 | 1981 | |
---|
2167 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2168 | | - "******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", |
---|
2169 | | - rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
| 1982 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1983 | + "******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", |
---|
| 1984 | + rtldm->remnant_ofdm_swing_idx[rf_path]); |
---|
2170 | 1985 | } else { |
---|
2171 | 1986 | rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, |
---|
2172 | 1987 | txscaling_tbl[(u8)final_ofdm_swing_index]); |
---|
2173 | 1988 | |
---|
2174 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2175 | | - "******Path_A Compensate with BBSwing ,Final_OFDM_Swing_Index = %d\n", |
---|
2176 | | - final_ofdm_swing_index); |
---|
| 1989 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 1990 | + "******Path_A Compensate with BBSwing ,Final_OFDM_Swing_Index = %d\n", |
---|
| 1991 | + final_ofdm_swing_index); |
---|
2177 | 1992 | /*If TxAGC has changed, reset TxAGC again*/ |
---|
2178 | 1993 | if (rtldm->modify_txagc_flag_path_a) { |
---|
2179 | 1994 | rtldm->remnant_cck_idx = 0; |
---|
.. | .. |
---|
2185 | 2000 | |
---|
2186 | 2001 | rtldm->modify_txagc_flag_path_a = false; |
---|
2187 | 2002 | |
---|
2188 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, |
---|
2189 | | - DBG_LOUD, |
---|
2190 | | - "******Path_A pDM_Odm->Modify_TxAGC_Flag= FALSE\n"); |
---|
| 2003 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, |
---|
| 2004 | + DBG_LOUD, |
---|
| 2005 | + "******Path_A pDM_Odm->Modify_TxAGC_Flag= FALSE\n"); |
---|
2191 | 2006 | } |
---|
2192 | 2007 | } |
---|
2193 | 2008 | } |
---|
.. | .. |
---|
2216 | 2031 | /* 1. The following TWO tables decide the final |
---|
2217 | 2032 | * index of OFDM/CCK swing table. |
---|
2218 | 2033 | */ |
---|
2219 | | - u8 *delta_swing_table_idx_tup_a; |
---|
2220 | | - u8 *delta_swing_table_idx_tdown_a; |
---|
2221 | | - u8 *delta_swing_table_idx_tup_b; |
---|
2222 | | - u8 *delta_swing_table_idx_tdown_b; |
---|
| 2034 | + const u8 *delta_swing_table_idx_tup_a; |
---|
| 2035 | + const u8 *delta_swing_table_idx_tdown_a; |
---|
2223 | 2036 | |
---|
2224 | 2037 | /*2. Initilization ( 7 steps in total )*/ |
---|
2225 | | - rtl8821ae_get_delta_swing_table(hw, (u8 **)&delta_swing_table_idx_tup_a, |
---|
2226 | | - (u8 **)&delta_swing_table_idx_tdown_a, |
---|
2227 | | - (u8 **)&delta_swing_table_idx_tup_b, |
---|
2228 | | - (u8 **)&delta_swing_table_idx_tdown_b); |
---|
| 2038 | + rtl8821ae_get_delta_swing_table(hw, |
---|
| 2039 | + &delta_swing_table_idx_tup_a, |
---|
| 2040 | + &delta_swing_table_idx_tdown_a); |
---|
2229 | 2041 | |
---|
2230 | 2042 | rtldm->txpower_trackinginit = true; |
---|
2231 | 2043 | |
---|
2232 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2233 | | - "===>%s,\n pDM_Odm->BbSwingIdxCckBase: %d,pDM_Odm->BbSwingIdxOfdmBase[A]:%d, pDM_Odm->DefaultOfdmIndex: %d\n", |
---|
2234 | | - __func__, |
---|
2235 | | - rtldm->swing_idx_cck_base, |
---|
2236 | | - rtldm->swing_idx_ofdm_base[RF90_PATH_A], |
---|
2237 | | - rtldm->default_ofdm_index); |
---|
| 2044 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2045 | + "===>%s,\n pDM_Odm->BbSwingIdxCckBase: %d,pDM_Odm->BbSwingIdxOfdmBase[A]:%d, pDM_Odm->DefaultOfdmIndex: %d\n", |
---|
| 2046 | + __func__, |
---|
| 2047 | + rtldm->swing_idx_cck_base, |
---|
| 2048 | + rtldm->swing_idx_ofdm_base[RF90_PATH_A], |
---|
| 2049 | + rtldm->default_ofdm_index); |
---|
2238 | 2050 | /*0x42: RF Reg[15:10] 88E*/ |
---|
2239 | 2051 | thermal_value = (u8)rtl_get_rfreg(hw, |
---|
2240 | 2052 | RF90_PATH_A, RF_T_METER_8812A, 0xfc00); |
---|
.. | .. |
---|
2246 | 2058 | /* 3. Initialize ThermalValues of RFCalibrateInfo*/ |
---|
2247 | 2059 | |
---|
2248 | 2060 | if (rtlhal->reloadtxpowerindex) { |
---|
2249 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2250 | | - "reload ofdm index for band switch\n"); |
---|
| 2061 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2062 | + "reload ofdm index for band switch\n"); |
---|
2251 | 2063 | } |
---|
2252 | 2064 | |
---|
2253 | 2065 | /*4. Calculate average thermal meter*/ |
---|
.. | .. |
---|
2267 | 2079 | if (thermal_value_avg_count) { |
---|
2268 | 2080 | thermal_value = (u8)(thermal_value_avg / |
---|
2269 | 2081 | thermal_value_avg_count); |
---|
2270 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2271 | | - "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", |
---|
2272 | | - thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
| 2082 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2083 | + "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", |
---|
| 2084 | + thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
2273 | 2085 | } |
---|
2274 | 2086 | |
---|
2275 | 2087 | /*5. Calculate delta, delta_LCK, delta_IQK. |
---|
.. | .. |
---|
2286 | 2098 | (thermal_value - rtldm->thermalvalue_iqk) : |
---|
2287 | 2099 | (rtldm->thermalvalue_iqk - thermal_value); |
---|
2288 | 2100 | |
---|
2289 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2290 | | - "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", |
---|
2291 | | - delta, delta_lck, delta_iqk); |
---|
| 2101 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2102 | + "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", |
---|
| 2103 | + delta, delta_lck, delta_iqk); |
---|
2292 | 2104 | |
---|
2293 | 2105 | /* 6. If necessary, do LCK. */ |
---|
2294 | 2106 | /*Delta temperature is equal to or larger than 20 centigrade.*/ |
---|
2295 | 2107 | if (delta_lck >= IQK_THRESHOLD) { |
---|
2296 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2297 | | - "delta_LCK(%d) >= Threshold_IQK(%d)\n", |
---|
2298 | | - delta_lck, IQK_THRESHOLD); |
---|
| 2108 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2109 | + "delta_LCK(%d) >= Threshold_IQK(%d)\n", |
---|
| 2110 | + delta_lck, IQK_THRESHOLD); |
---|
2299 | 2111 | rtldm->thermalvalue_lck = thermal_value; |
---|
2300 | 2112 | rtl8821ae_phy_lc_calibrate(hw); |
---|
2301 | 2113 | } |
---|
.. | .. |
---|
2316 | 2128 | /*7.1 The Final Power Index = BaseIndex + PowerIndexOffset*/ |
---|
2317 | 2129 | |
---|
2318 | 2130 | if (thermal_value > rtlefuse->eeprom_thermalmeter) { |
---|
2319 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2320 | | - "delta_swing_table_idx_tup_a[%d] = %d\n", |
---|
2321 | | - delta, delta_swing_table_idx_tup_a[delta]); |
---|
| 2131 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2132 | + "delta_swing_table_idx_tup_a[%d] = %d\n", |
---|
| 2133 | + delta, delta_swing_table_idx_tup_a[delta]); |
---|
2322 | 2134 | rtldm->delta_power_index_last[RF90_PATH_A] = |
---|
2323 | 2135 | rtldm->delta_power_index[RF90_PATH_A]; |
---|
2324 | 2136 | rtldm->delta_power_index[RF90_PATH_A] = |
---|
.. | .. |
---|
2328 | 2140 | delta_swing_table_idx_tup_a[delta]; |
---|
2329 | 2141 | /*Record delta swing for mix mode power tracking*/ |
---|
2330 | 2142 | |
---|
2331 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2332 | | - "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", |
---|
2333 | | - rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); |
---|
| 2143 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2144 | + "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", |
---|
| 2145 | + rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); |
---|
2334 | 2146 | } else { |
---|
2335 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2336 | | - "delta_swing_table_idx_tdown_a[%d] = %d\n", |
---|
2337 | | - delta, delta_swing_table_idx_tdown_a[delta]); |
---|
| 2147 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2148 | + "delta_swing_table_idx_tdown_a[%d] = %d\n", |
---|
| 2149 | + delta, delta_swing_table_idx_tdown_a[delta]); |
---|
2338 | 2150 | |
---|
2339 | 2151 | rtldm->delta_power_index_last[RF90_PATH_A] = |
---|
2340 | 2152 | rtldm->delta_power_index[RF90_PATH_A]; |
---|
.. | .. |
---|
2344 | 2156 | rtldm->absolute_ofdm_swing_idx[RF90_PATH_A] = |
---|
2345 | 2157 | -1 * delta_swing_table_idx_tdown_a[delta]; |
---|
2346 | 2158 | /* Record delta swing for mix mode power tracking*/ |
---|
2347 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2348 | | - "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", |
---|
2349 | | - rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); |
---|
| 2159 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2160 | + "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", |
---|
| 2161 | + rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]); |
---|
2350 | 2162 | } |
---|
2351 | 2163 | |
---|
2352 | 2164 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++) { |
---|
2353 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2354 | | - "\n\n================================ [Path-%c]Calculating PowerIndexOffset ================================\n", |
---|
2355 | | - (p == RF90_PATH_A ? 'A' : 'B')); |
---|
| 2165 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2166 | + "\n\n================================ [Path-%c]Calculating PowerIndexOffset ================================\n", |
---|
| 2167 | + (p == RF90_PATH_A ? 'A' : 'B')); |
---|
2356 | 2168 | /*If Thermal value changes but lookup table value |
---|
2357 | 2169 | * still the same |
---|
2358 | 2170 | */ |
---|
.. | .. |
---|
2366 | 2178 | rtldm->delta_power_index_last[p]; |
---|
2367 | 2179 | /*Power Index Diff between 2 times Power Tracking*/ |
---|
2368 | 2180 | |
---|
2369 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2370 | | - "[Path-%c] PowerIndexOffset(%d) = DeltaPowerIndex(%d) - DeltaPowerIndexLast(%d)\n", |
---|
2371 | | - (p == RF90_PATH_A ? 'A' : 'B'), |
---|
| 2181 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2182 | + "[Path-%c] PowerIndexOffset(%d) = DeltaPowerIndex(%d) - DeltaPowerIndexLast(%d)\n", |
---|
| 2183 | + (p == RF90_PATH_A ? 'A' : 'B'), |
---|
2372 | 2184 | rtldm->power_index_offset[p], |
---|
2373 | 2185 | rtldm->delta_power_index[p] , |
---|
2374 | 2186 | rtldm->delta_power_index_last[p]); |
---|
.. | .. |
---|
2385 | 2197 | |
---|
2386 | 2198 | /*********Print BB Swing Base and Index Offset********/ |
---|
2387 | 2199 | |
---|
2388 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2389 | | - "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", |
---|
2390 | | - rtldm->swing_idx_cck, |
---|
2391 | | - rtldm->swing_idx_cck_base, |
---|
2392 | | - rtldm->power_index_offset[p]); |
---|
2393 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2394 | | - "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", |
---|
2395 | | - rtldm->swing_idx_ofdm[p], |
---|
2396 | | - (p == RF90_PATH_A ? 'A' : 'B'), |
---|
2397 | | - rtldm->swing_idx_ofdm_base[p], |
---|
2398 | | - rtldm->power_index_offset[p]); |
---|
| 2200 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2201 | + "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", |
---|
| 2202 | + rtldm->swing_idx_cck, |
---|
| 2203 | + rtldm->swing_idx_cck_base, |
---|
| 2204 | + rtldm->power_index_offset[p]); |
---|
| 2205 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2206 | + "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", |
---|
| 2207 | + rtldm->swing_idx_ofdm[p], |
---|
| 2208 | + (p == RF90_PATH_A ? 'A' : 'B'), |
---|
| 2209 | + rtldm->swing_idx_ofdm_base[p], |
---|
| 2210 | + rtldm->power_index_offset[p]); |
---|
2399 | 2211 | |
---|
2400 | 2212 | /*7.1 Handle boundary conditions of index.*/ |
---|
2401 | 2213 | |
---|
.. | .. |
---|
2404 | 2216 | else if (rtldm->ofdm_index[p] < ofdm_min_index) |
---|
2405 | 2217 | rtldm->ofdm_index[p] = ofdm_min_index; |
---|
2406 | 2218 | } |
---|
2407 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2408 | | - "\n\n========================================================================================================\n"); |
---|
| 2219 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2220 | + "\n\n========================================================================================================\n"); |
---|
2409 | 2221 | if (rtldm->cck_index > TXSCALE_TABLE_SIZE - 1) |
---|
2410 | 2222 | rtldm->cck_index = TXSCALE_TABLE_SIZE - 1; |
---|
2411 | 2223 | else if (rtldm->cck_index < 0) |
---|
2412 | 2224 | rtldm->cck_index = 0; |
---|
2413 | 2225 | } else { |
---|
2414 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2415 | | - "The thermal meter is unchanged or TxPowerTracking OFF(%d):ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d\n", |
---|
2416 | | - rtldm->txpower_track_control, |
---|
2417 | | - thermal_value, |
---|
2418 | | - rtldm->thermalvalue); |
---|
| 2226 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2227 | + "The thermal meter is unchanged or TxPowerTracking OFF(%d):ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d\n", |
---|
| 2228 | + rtldm->txpower_track_control, |
---|
| 2229 | + thermal_value, |
---|
| 2230 | + rtldm->thermalvalue); |
---|
2419 | 2231 | |
---|
2420 | 2232 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++) |
---|
2421 | 2233 | rtldm->power_index_offset[p] = 0; |
---|
2422 | 2234 | } |
---|
2423 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2424 | | - "TxPowerTracking: [CCK] Swing Current Index: %d, Swing Base Index: %d\n", |
---|
2425 | | - /*Print Swing base & current*/ |
---|
| 2235 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2236 | + "TxPowerTracking: [CCK] Swing Current Index: %d, Swing Base Index: %d\n", |
---|
| 2237 | + /*Print Swing base & current*/ |
---|
2426 | 2238 | rtldm->cck_index, rtldm->swing_idx_cck_base); |
---|
2427 | 2239 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++) { |
---|
2428 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2429 | | - "TxPowerTracking: [OFDM] Swing Current Index: %d, Swing Base Index[%c]: %d\n", |
---|
2430 | | - rtldm->ofdm_index[p], |
---|
2431 | | - (p == RF90_PATH_A ? 'A' : 'B'), |
---|
2432 | | - rtldm->swing_idx_ofdm_base[p]); |
---|
| 2240 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2241 | + "TxPowerTracking: [OFDM] Swing Current Index: %d, Swing Base Index[%c]: %d\n", |
---|
| 2242 | + rtldm->ofdm_index[p], |
---|
| 2243 | + (p == RF90_PATH_A ? 'A' : 'B'), |
---|
| 2244 | + rtldm->swing_idx_ofdm_base[p]); |
---|
2433 | 2245 | } |
---|
2434 | 2246 | |
---|
2435 | 2247 | if ((rtldm->power_index_offset[RF90_PATH_A] != 0 || |
---|
.. | .. |
---|
2446 | 2258 | * set tx power in tx agc for 88E. |
---|
2447 | 2259 | */ |
---|
2448 | 2260 | if (thermal_value > rtldm->thermalvalue) { |
---|
2449 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2450 | | - "Temperature Increasing(A): delta_pi: %d , delta_t: %d,Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
2451 | | - rtldm->power_index_offset[RF90_PATH_A], |
---|
2452 | | - delta, thermal_value, |
---|
2453 | | - rtlefuse->eeprom_thermalmeter, |
---|
2454 | | - rtldm->thermalvalue); |
---|
| 2261 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2262 | + "Temperature Increasing(A): delta_pi: %d , delta_t: %d,Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
| 2263 | + rtldm->power_index_offset[RF90_PATH_A], |
---|
| 2264 | + delta, thermal_value, |
---|
| 2265 | + rtlefuse->eeprom_thermalmeter, |
---|
| 2266 | + rtldm->thermalvalue); |
---|
2455 | 2267 | } else if (thermal_value < rtldm->thermalvalue) { /*Low temperature*/ |
---|
2456 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2457 | | - "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
2458 | | - rtldm->power_index_offset[RF90_PATH_A], |
---|
2459 | | - delta, thermal_value, |
---|
2460 | | - rtlefuse->eeprom_thermalmeter, |
---|
2461 | | - rtldm->thermalvalue); |
---|
| 2268 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2269 | + "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", |
---|
| 2270 | + rtldm->power_index_offset[RF90_PATH_A], |
---|
| 2271 | + delta, thermal_value, |
---|
| 2272 | + rtlefuse->eeprom_thermalmeter, |
---|
| 2273 | + rtldm->thermalvalue); |
---|
2462 | 2274 | } |
---|
2463 | 2275 | |
---|
2464 | 2276 | if (thermal_value > rtlefuse->eeprom_thermalmeter) { |
---|
2465 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2466 | | - "Temperature(%d) higher than PG value(%d)\n", |
---|
2467 | | - thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
| 2277 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2278 | + "Temperature(%d) higher than PG value(%d)\n", |
---|
| 2279 | + thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
2468 | 2280 | |
---|
2469 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2470 | | - "****Enter POWER Tracking MIX_MODE****\n"); |
---|
| 2281 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2282 | + "****Enter POWER Tracking MIX_MODE****\n"); |
---|
2471 | 2283 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++) |
---|
2472 | 2284 | rtl8821ae_dm_txpwr_track_set_pwr(hw, |
---|
2473 | 2285 | MIX_MODE, p, index_for_channel); |
---|
2474 | 2286 | } else { |
---|
2475 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2476 | | - "Temperature(%d) lower than PG value(%d)\n", |
---|
2477 | | - thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
| 2287 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2288 | + "Temperature(%d) lower than PG value(%d)\n", |
---|
| 2289 | + thermal_value, rtlefuse->eeprom_thermalmeter); |
---|
2478 | 2290 | |
---|
2479 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2480 | | - "*****Enter POWER Tracking MIX_MODE*****\n"); |
---|
| 2291 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2292 | + "*****Enter POWER Tracking MIX_MODE*****\n"); |
---|
2481 | 2293 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++) |
---|
2482 | 2294 | rtl8812ae_dm_txpwr_track_set_pwr(hw, |
---|
2483 | 2295 | MIX_MODE, p, index_for_channel); |
---|
.. | .. |
---|
2487 | 2299 | for (p = RF90_PATH_A; p < MAX_PATH_NUM_8821A; p++) |
---|
2488 | 2300 | rtldm->swing_idx_ofdm_base[p] = rtldm->swing_idx_ofdm[p]; |
---|
2489 | 2301 | |
---|
2490 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2491 | | - "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue= %d\n", |
---|
2492 | | - rtldm->thermalvalue, thermal_value); |
---|
| 2302 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2303 | + "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue= %d\n", |
---|
| 2304 | + rtldm->thermalvalue, thermal_value); |
---|
2493 | 2305 | /*Record last Power Tracking Thermal Value*/ |
---|
2494 | 2306 | rtldm->thermalvalue = thermal_value; |
---|
2495 | 2307 | } |
---|
.. | .. |
---|
2510 | 2322 | } |
---|
2511 | 2323 | } |
---|
2512 | 2324 | |
---|
2513 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "<===%s\n", __func__); |
---|
| 2325 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, "<===%s\n", __func__); |
---|
2514 | 2326 | } |
---|
2515 | 2327 | |
---|
2516 | 2328 | void rtl8821ae_dm_check_txpower_tracking_thermalmeter(struct ieee80211_hw *hw) |
---|
.. | .. |
---|
2519 | 2331 | if (!rtlpriv->dm.tm_trigger) { |
---|
2520 | 2332 | rtl_set_rfreg(hw, RF90_PATH_A, RF_T_METER_88E, BIT(17)|BIT(16), |
---|
2521 | 2333 | 0x03); |
---|
2522 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2523 | | - "Trigger 8821ae Thermal Meter!!\n"); |
---|
| 2334 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2335 | + "Trigger 8821ae Thermal Meter!!\n"); |
---|
2524 | 2336 | rtlpriv->dm.tm_trigger = 1; |
---|
2525 | 2337 | return; |
---|
2526 | 2338 | } else { |
---|
2527 | | - RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
2528 | | - "Schedule TxPowerTracking !!\n"); |
---|
| 2339 | + rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD, |
---|
| 2340 | + "Schedule TxPowerTracking !!\n"); |
---|
2529 | 2341 | |
---|
2530 | 2342 | rtl8821ae_dm_txpower_tracking_callback_thermalmeter(hw); |
---|
2531 | 2343 | rtlpriv->dm.tm_trigger = 0; |
---|
.. | .. |
---|
2544 | 2356 | struct ieee80211_sta *sta = NULL; |
---|
2545 | 2357 | |
---|
2546 | 2358 | if (is_hal_stop(rtlhal)) { |
---|
2547 | | - RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
2548 | | - "driver is going to unload\n"); |
---|
| 2359 | + rtl_dbg(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
| 2360 | + "driver is going to unload\n"); |
---|
2549 | 2361 | return; |
---|
2550 | 2362 | } |
---|
2551 | 2363 | |
---|
2552 | 2364 | if (!rtlpriv->dm.useramask) { |
---|
2553 | | - RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
2554 | | - "driver does not control rate adaptive mask\n"); |
---|
| 2365 | + rtl_dbg(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
| 2366 | + "driver does not control rate adaptive mask\n"); |
---|
2555 | 2367 | return; |
---|
2556 | 2368 | } |
---|
2557 | 2369 | |
---|
.. | .. |
---|
2579 | 2391 | p_ra->ratr_state = DM_RATR_STA_LOW; |
---|
2580 | 2392 | |
---|
2581 | 2393 | if (p_ra->pre_ratr_state != p_ra->ratr_state) { |
---|
2582 | | - RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
2583 | | - "RSSI = %ld\n", |
---|
2584 | | - rtlpriv->dm.undec_sm_pwdb); |
---|
2585 | | - RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
2586 | | - "RSSI_LEVEL = %d\n", p_ra->ratr_state); |
---|
2587 | | - RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
2588 | | - "PreState = %d, CurState = %d\n", |
---|
2589 | | - p_ra->pre_ratr_state, p_ra->ratr_state); |
---|
| 2394 | + rtl_dbg(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
| 2395 | + "RSSI = %ld\n", |
---|
| 2396 | + rtlpriv->dm.undec_sm_pwdb); |
---|
| 2397 | + rtl_dbg(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
| 2398 | + "RSSI_LEVEL = %d\n", p_ra->ratr_state); |
---|
| 2399 | + rtl_dbg(rtlpriv, COMP_RATE, DBG_LOUD, |
---|
| 2400 | + "PreState = %d, CurState = %d\n", |
---|
| 2401 | + p_ra->pre_ratr_state, p_ra->ratr_state); |
---|
2590 | 2402 | |
---|
2591 | 2403 | rcu_read_lock(); |
---|
2592 | 2404 | sta = rtl_find_sta(hw, mac->bssid); |
---|
.. | .. |
---|
2641 | 2453 | if (b_bias_on_rx) { |
---|
2642 | 2454 | if (cur_tx_bytes > (cur_rx_bytes*4)) { |
---|
2643 | 2455 | *pb_is_cur_rdl_state = false; |
---|
2644 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2645 | | - "Uplink Traffic\n"); |
---|
| 2456 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2457 | + "Uplink Traffic\n"); |
---|
2646 | 2458 | } else { |
---|
2647 | 2459 | *pb_is_cur_rdl_state = true; |
---|
2648 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2649 | | - "Balance Traffic\n"); |
---|
| 2460 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2461 | + "Balance Traffic\n"); |
---|
2650 | 2462 | } |
---|
2651 | 2463 | } else { |
---|
2652 | 2464 | if (cur_rx_bytes > (cur_tx_bytes*4)) { |
---|
2653 | 2465 | *pb_is_cur_rdl_state = true; |
---|
2654 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2655 | | - "Downlink Traffic\n"); |
---|
| 2466 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2467 | + "Downlink Traffic\n"); |
---|
2656 | 2468 | } else { |
---|
2657 | 2469 | *pb_is_cur_rdl_state = false; |
---|
2658 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2659 | | - "Balance Traffic\n"); |
---|
| 2470 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2471 | + "Balance Traffic\n"); |
---|
2660 | 2472 | } |
---|
2661 | 2473 | } |
---|
2662 | 2474 | return; |
---|
.. | .. |
---|
2676 | 2488 | u32 edca_be = 0x5ea42b; |
---|
2677 | 2489 | u8 iot_peer = 0; |
---|
2678 | 2490 | bool *pb_is_cur_rdl_state = NULL; |
---|
2679 | | - bool b_last_is_cur_rdl_state = false; |
---|
2680 | 2491 | bool b_bias_on_rx = false; |
---|
2681 | 2492 | bool b_edca_turbo_on = false; |
---|
2682 | 2493 | |
---|
2683 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2684 | | - "rtl8821ae_dm_check_edca_turbo=====>\n"); |
---|
2685 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2686 | | - "Original BE PARAM: 0x%x\n", |
---|
2687 | | - rtl_read_dword(rtlpriv, DM_REG_EDCA_BE_11N)); |
---|
| 2494 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2495 | + "%s=====>\n", __func__); |
---|
| 2496 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2497 | + "Original BE PARAM: 0x%x\n", |
---|
| 2498 | + rtl_read_dword(rtlpriv, DM_REG_EDCA_BE_11N)); |
---|
2688 | 2499 | |
---|
2689 | 2500 | if (rtlpriv->dm.dbginfo.num_non_be_pkt > 0x100) |
---|
2690 | 2501 | rtlpriv->dm.is_any_nonbepkts = true; |
---|
.. | .. |
---|
2694 | 2505 | * list paramter for different platform |
---|
2695 | 2506 | *=============================== |
---|
2696 | 2507 | */ |
---|
2697 | | - b_last_is_cur_rdl_state = rtlpriv->dm.is_cur_rdlstate; |
---|
2698 | 2508 | pb_is_cur_rdl_state = &rtlpriv->dm.is_cur_rdlstate; |
---|
2699 | 2509 | |
---|
2700 | 2510 | cur_tx_ok_cnt = rtlpriv->stats.txbytesunicast - rtldm->last_tx_ok_cnt; |
---|
.. | .. |
---|
2717 | 2527 | } |
---|
2718 | 2528 | } |
---|
2719 | 2529 | |
---|
2720 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2721 | | - "bIsAnyNonBEPkts : 0x%x bDisableFrameBursting : 0x%x\n", |
---|
2722 | | - rtlpriv->dm.is_any_nonbepkts, |
---|
2723 | | - rtlpriv->dm.disable_framebursting); |
---|
| 2530 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2531 | + "bIsAnyNonBEPkts : 0x%x bDisableFrameBursting : 0x%x\n", |
---|
| 2532 | + rtlpriv->dm.is_any_nonbepkts, |
---|
| 2533 | + rtlpriv->dm.disable_framebursting); |
---|
2724 | 2534 | |
---|
2725 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2726 | | - "bEdcaTurboOn : 0x%x bBiasOnRx : 0x%x\n", |
---|
2727 | | - b_edca_turbo_on, b_bias_on_rx); |
---|
| 2535 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2536 | + "bEdcaTurboOn : 0x%x bBiasOnRx : 0x%x\n", |
---|
| 2537 | + b_edca_turbo_on, b_bias_on_rx); |
---|
2728 | 2538 | |
---|
2729 | 2539 | if (b_edca_turbo_on) { |
---|
2730 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2731 | | - "curTxOkCnt : 0x%llx\n", cur_tx_ok_cnt); |
---|
2732 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2733 | | - "curRxOkCnt : 0x%llx\n", cur_rx_ok_cnt); |
---|
| 2540 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2541 | + "curTxOkCnt : 0x%llx\n", cur_tx_ok_cnt); |
---|
| 2542 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2543 | + "curRxOkCnt : 0x%llx\n", cur_rx_ok_cnt); |
---|
2734 | 2544 | if (b_bias_on_rx) |
---|
2735 | 2545 | rtl8821ae_dm_edca_choose_traffic_idx(hw, cur_tx_ok_cnt, |
---|
2736 | 2546 | cur_rx_ok_cnt, true, pb_is_cur_rdl_state); |
---|
.. | .. |
---|
2742 | 2552 | |
---|
2743 | 2553 | rtl_write_dword(rtlpriv, DM_REG_EDCA_BE_11N, edca_be); |
---|
2744 | 2554 | |
---|
2745 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2746 | | - "EDCA Turbo on: EDCA_BE:0x%x\n", edca_be); |
---|
| 2555 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2556 | + "EDCA Turbo on: EDCA_BE:0x%x\n", edca_be); |
---|
2747 | 2557 | |
---|
2748 | 2558 | rtlpriv->dm.current_turbo_edca = true; |
---|
2749 | 2559 | |
---|
2750 | | - RT_TRACE(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
2751 | | - "EDCA_BE_DL : 0x%x EDCA_BE_UL : 0x%x EDCA_BE : 0x%x\n", |
---|
2752 | | - edca_be_dl, edca_be_ul, edca_be); |
---|
| 2560 | + rtl_dbg(rtlpriv, COMP_TURBO, DBG_LOUD, |
---|
| 2561 | + "EDCA_BE_DL : 0x%x EDCA_BE_UL : 0x%x EDCA_BE : 0x%x\n", |
---|
| 2562 | + edca_be_dl, edca_be_ul, edca_be); |
---|
2753 | 2563 | } else { |
---|
2754 | 2564 | if (rtlpriv->dm.current_turbo_edca) { |
---|
2755 | 2565 | u8 tmp = AC0_BE; |
---|
.. | .. |
---|
2795 | 2605 | |
---|
2796 | 2606 | dm_digtable->pre_cck_cca_thres = dm_digtable->cur_cck_cca_thres; |
---|
2797 | 2607 | dm_digtable->cur_cck_cca_thres = cur_cck_cca_thresh; |
---|
2798 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_TRACE, |
---|
2799 | | - "CCK cca thresh hold =%x\n", dm_digtable->cur_cck_cca_thres); |
---|
| 2608 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_TRACE, |
---|
| 2609 | + "CCK cca thresh hold =%x\n", dm_digtable->cur_cck_cca_thres); |
---|
2800 | 2610 | } |
---|
2801 | 2611 | |
---|
2802 | 2612 | static void rtl8821ae_dm_dynamic_atc_switch(struct ieee80211_hw *hw) |
---|
.. | .. |
---|
2815 | 2625 | rtldm->atc_status = ATC_STATUS_ON; |
---|
2816 | 2626 | } |
---|
2817 | 2627 | |
---|
2818 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "No link!!\n"); |
---|
2819 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
2820 | | - "atc_status = %d\n", rtldm->atc_status); |
---|
| 2628 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "No link!!\n"); |
---|
| 2629 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 2630 | + "atc_status = %d\n", rtldm->atc_status); |
---|
2821 | 2631 | |
---|
2822 | 2632 | if (rtldm->crystal_cap != rtlpriv->efuse.crystalcap) { |
---|
2823 | 2633 | rtldm->crystal_cap = rtlpriv->efuse.crystalcap; |
---|
.. | .. |
---|
2832 | 2642 | 0xfff000, (crystal_cap | |
---|
2833 | 2643 | (crystal_cap << 6))); |
---|
2834 | 2644 | } |
---|
2835 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, "crystal_cap = 0x%x\n", |
---|
2836 | | - rtldm->crystal_cap); |
---|
| 2645 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, "crystal_cap = 0x%x\n", |
---|
| 2646 | + rtldm->crystal_cap); |
---|
2837 | 2647 | } else{ |
---|
2838 | 2648 | /*1. Calculate CFO for path-A & path-B*/ |
---|
2839 | 2649 | cfo_khz_a = (int)(rtldm->cfo_tail[0] * 3125) / 1280; |
---|
.. | .. |
---|
2842 | 2652 | |
---|
2843 | 2653 | /*2.No new packet*/ |
---|
2844 | 2654 | if (packet_count == rtldm->packet_count_pre) { |
---|
2845 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
2846 | | - "packet counter doesn't change\n"); |
---|
| 2655 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 2656 | + "packet counter doesn't change\n"); |
---|
2847 | 2657 | return; |
---|
2848 | 2658 | } |
---|
2849 | 2659 | |
---|
2850 | 2660 | rtldm->packet_count_pre = packet_count; |
---|
2851 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
2852 | | - "packet counter = %d\n", |
---|
2853 | | - rtldm->packet_count); |
---|
| 2661 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 2662 | + "packet counter = %d\n", |
---|
| 2663 | + rtldm->packet_count); |
---|
2854 | 2664 | |
---|
2855 | 2665 | /*3.Average CFO*/ |
---|
2856 | 2666 | if (rtlpriv->phy.rf_type == RF_1T1R) |
---|
.. | .. |
---|
2858 | 2668 | else |
---|
2859 | 2669 | cfo_ave = (cfo_khz_a + cfo_khz_b) >> 1; |
---|
2860 | 2670 | |
---|
2861 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
2862 | | - "cfo_khz_a = %dkHz, cfo_khz_b = %dkHz, cfo_ave = %dkHz\n", |
---|
2863 | | - cfo_khz_a, cfo_khz_b, cfo_ave); |
---|
| 2671 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 2672 | + "cfo_khz_a = %dkHz, cfo_khz_b = %dkHz, cfo_ave = %dkHz\n", |
---|
| 2673 | + cfo_khz_a, cfo_khz_b, cfo_ave); |
---|
2864 | 2674 | |
---|
2865 | 2675 | /*4.Avoid abnormal large CFO*/ |
---|
2866 | 2676 | cfo_ave_diff = (rtldm->cfo_ave_pre >= cfo_ave) ? |
---|
2867 | 2677 | (rtldm->cfo_ave_pre - cfo_ave) : |
---|
2868 | 2678 | (cfo_ave - rtldm->cfo_ave_pre); |
---|
2869 | 2679 | |
---|
2870 | | - if (cfo_ave_diff > 20 && rtldm->large_cfo_hit == 0) { |
---|
2871 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
2872 | | - "first large CFO hit\n"); |
---|
2873 | | - rtldm->large_cfo_hit = 1; |
---|
| 2680 | + if (cfo_ave_diff > 20 && !rtldm->large_cfo_hit) { |
---|
| 2681 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 2682 | + "first large CFO hit\n"); |
---|
| 2683 | + rtldm->large_cfo_hit = true; |
---|
2874 | 2684 | return; |
---|
2875 | 2685 | } else |
---|
2876 | | - rtldm->large_cfo_hit = 0; |
---|
| 2686 | + rtldm->large_cfo_hit = false; |
---|
2877 | 2687 | |
---|
2878 | 2688 | rtldm->cfo_ave_pre = cfo_ave; |
---|
2879 | 2689 | |
---|
.. | .. |
---|
2890 | 2700 | rtldm->cfo_threshold = CFO_THRESHOLD_XTAL; |
---|
2891 | 2701 | } |
---|
2892 | 2702 | } |
---|
2893 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
2894 | | - "Dynamic threshold = %d\n", |
---|
2895 | | - rtldm->cfo_threshold); |
---|
| 2703 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 2704 | + "Dynamic threshold = %d\n", |
---|
| 2705 | + rtldm->cfo_threshold); |
---|
2896 | 2706 | |
---|
2897 | 2707 | /* 2.Calculate Xtal offset*/ |
---|
2898 | 2708 | if (cfo_ave > rtldm->cfo_threshold && rtldm->crystal_cap < 0x3f) |
---|
.. | .. |
---|
2900 | 2710 | else if ((cfo_ave < -rtlpriv->dm.cfo_threshold) && |
---|
2901 | 2711 | rtlpriv->dm.crystal_cap > 0) |
---|
2902 | 2712 | adjust_xtal = ((cfo_ave + CFO_THRESHOLD_XTAL) >> 2) - 1; |
---|
2903 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
2904 | | - "Crystal cap = 0x%x, Crystal cap offset = %d\n", |
---|
2905 | | - rtldm->crystal_cap, adjust_xtal); |
---|
| 2713 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 2714 | + "Crystal cap = 0x%x, Crystal cap offset = %d\n", |
---|
| 2715 | + rtldm->crystal_cap, adjust_xtal); |
---|
2906 | 2716 | |
---|
2907 | 2717 | /*3.Adjudt Crystal Cap.*/ |
---|
2908 | 2718 | if (adjust_xtal != 0) { |
---|
.. | .. |
---|
2924 | 2734 | rtl_set_bbreg(hw, REG_MAC_PHY_CTRL, |
---|
2925 | 2735 | 0xfff000, (crystal_cap | |
---|
2926 | 2736 | (crystal_cap << 6))); |
---|
2927 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
2928 | | - "New crystal cap = 0x%x\n", |
---|
2929 | | - rtldm->crystal_cap); |
---|
| 2737 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_LOUD, |
---|
| 2738 | + "New crystal cap = 0x%x\n", |
---|
| 2739 | + rtldm->crystal_cap); |
---|
2930 | 2740 | } |
---|
2931 | 2741 | } |
---|
2932 | 2742 | } |
---|
.. | .. |
---|
2970 | 2780 | spin_unlock(&rtlpriv->locks.rf_ps_lock); |
---|
2971 | 2781 | |
---|
2972 | 2782 | rtlpriv->dm.dbginfo.num_qry_beacon_pkt = 0; |
---|
2973 | | - RT_TRACE(rtlpriv, COMP_DIG, DBG_DMESG, "\n"); |
---|
| 2783 | + rtl_dbg(rtlpriv, COMP_DIG, DBG_DMESG, "\n"); |
---|
2974 | 2784 | } |
---|
2975 | 2785 | |
---|
2976 | 2786 | void rtl8821ae_dm_set_tx_ant_by_tx_info(struct ieee80211_hw *hw, |
---|
.. | .. |
---|
2980 | 2790 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); |
---|
2981 | 2791 | struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw)); |
---|
2982 | 2792 | struct fast_ant_training *pfat_table = &rtldm->fat_table; |
---|
| 2793 | + __le32 *pdesc32 = (__le32 *)pdesc; |
---|
2983 | 2794 | |
---|
2984 | 2795 | if (rtlhal->hw_type != HARDWARE_TYPE_RTL8812AE) |
---|
2985 | 2796 | return; |
---|
2986 | 2797 | |
---|
2987 | 2798 | if (rtlefuse->antenna_div_type == CG_TRX_HW_ANTDIV) |
---|
2988 | | - SET_TX_DESC_TX_ANT(pdesc, pfat_table->antsel_a[mac_id]); |
---|
| 2799 | + set_tx_desc_tx_ant(pdesc32, pfat_table->antsel_a[mac_id]); |
---|
2989 | 2800 | } |
---|