gpio: rcar: Fix runtime PM imbalance on error
[linux/fpc-iii.git] / drivers / staging / vt6655 / baseband.c
blobb4cdc0b7fee7664204703cf2643ade33c18ae011
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
4 * All rights reserved.
6 * File: baseband.c
8 * Purpose: Implement functions to access baseband
10 * Author: Kyle Hsu
12 * Date: Aug.22, 2002
14 * Functions:
15 * BBuGetFrameTime - Calculate data frame transmitting time
16 * BBvCalculateParameter - Calculate PhyLength, PhyService and Phy Signal
17 * parameter for baseband Tx
18 * BBbReadEmbedded - Embedded read baseband register via MAC
19 * BBbWriteEmbedded - Embedded write baseband register via MAC
20 * BBbVT3253Init - VIA VT3253 baseband chip init code
22 * Revision History:
23 * 06-10-2003 Bryan YC Fan: Re-write codes to support VT3253 spec.
24 * 08-07-2003 Bryan YC Fan: Add MAXIM2827/2825 and RFMD2959 support.
25 * 08-26-2003 Kyle Hsu : Modify BBuGetFrameTime() and
26 * BBvCalculateParameter().
27 * cancel the setting of MAC_REG_SOFTPWRCTL on
28 * BBbVT3253Init().
29 * Add the comments.
30 * 09-01-2003 Bryan YC Fan: RF & BB tables updated.
31 * Modified BBvLoopbackOn & BBvLoopbackOff().
36 #include "tmacro.h"
37 #include "mac.h"
38 #include "baseband.h"
39 #include "srom.h"
40 #include "rf.h"
42 /*--------------------- Static Classes ----------------------------*/
44 /*--------------------- Static Variables --------------------------*/
46 /*--------------------- Static Functions --------------------------*/
48 /*--------------------- Export Variables --------------------------*/
50 /*--------------------- Static Definitions -------------------------*/
52 /*--------------------- Static Classes ----------------------------*/
54 /*--------------------- Static Variables --------------------------*/
56 #define CB_VT3253_INIT_FOR_RFMD 446
57 static const unsigned char byVT3253InitTab_RFMD[CB_VT3253_INIT_FOR_RFMD][2] = {
58 {0x00, 0x30},
59 {0x01, 0x00},
60 {0x02, 0x00},
61 {0x03, 0x00},
62 {0x04, 0x00},
63 {0x05, 0x00},
64 {0x06, 0x00},
65 {0x07, 0x00},
66 {0x08, 0x70},
67 {0x09, 0x45},
68 {0x0a, 0x2a},
69 {0x0b, 0x76},
70 {0x0c, 0x00},
71 {0x0d, 0x01},
72 {0x0e, 0x80},
73 {0x0f, 0x00},
74 {0x10, 0x00},
75 {0x11, 0x00},
76 {0x12, 0x00},
77 {0x13, 0x00},
78 {0x14, 0x00},
79 {0x15, 0x00},
80 {0x16, 0x00},
81 {0x17, 0x00},
82 {0x18, 0x00},
83 {0x19, 0x00},
84 {0x1a, 0x00},
85 {0x1b, 0x9d},
86 {0x1c, 0x05},
87 {0x1d, 0x00},
88 {0x1e, 0x00},
89 {0x1f, 0x00},
90 {0x20, 0x00},
91 {0x21, 0x00},
92 {0x22, 0x00},
93 {0x23, 0x00},
94 {0x24, 0x00},
95 {0x25, 0x4a},
96 {0x26, 0x00},
97 {0x27, 0x00},
98 {0x28, 0x00},
99 {0x29, 0x00},
100 {0x2a, 0x00},
101 {0x2b, 0x00},
102 {0x2c, 0x00},
103 {0x2d, 0xa8},
104 {0x2e, 0x1a},
105 {0x2f, 0x0c},
106 {0x30, 0x26},
107 {0x31, 0x5b},
108 {0x32, 0x00},
109 {0x33, 0x00},
110 {0x34, 0x00},
111 {0x35, 0x00},
112 {0x36, 0xaa},
113 {0x37, 0xaa},
114 {0x38, 0xff},
115 {0x39, 0xff},
116 {0x3a, 0x00},
117 {0x3b, 0x00},
118 {0x3c, 0x00},
119 {0x3d, 0x0d},
120 {0x3e, 0x51},
121 {0x3f, 0x04},
122 {0x40, 0x00},
123 {0x41, 0x08},
124 {0x42, 0x00},
125 {0x43, 0x08},
126 {0x44, 0x06},
127 {0x45, 0x14},
128 {0x46, 0x05},
129 {0x47, 0x08},
130 {0x48, 0x00},
131 {0x49, 0x00},
132 {0x4a, 0x00},
133 {0x4b, 0x00},
134 {0x4c, 0x09},
135 {0x4d, 0x80},
136 {0x4e, 0x00},
137 {0x4f, 0xc5},
138 {0x50, 0x14},
139 {0x51, 0x19},
140 {0x52, 0x00},
141 {0x53, 0x00},
142 {0x54, 0x00},
143 {0x55, 0x00},
144 {0x56, 0x00},
145 {0x57, 0x00},
146 {0x58, 0x00},
147 {0x59, 0xb0},
148 {0x5a, 0x00},
149 {0x5b, 0x00},
150 {0x5c, 0x00},
151 {0x5d, 0x00},
152 {0x5e, 0x00},
153 {0x5f, 0x00},
154 {0x60, 0x44},
155 {0x61, 0x04},
156 {0x62, 0x00},
157 {0x63, 0x00},
158 {0x64, 0x00},
159 {0x65, 0x00},
160 {0x66, 0x04},
161 {0x67, 0xb7},
162 {0x68, 0x00},
163 {0x69, 0x00},
164 {0x6a, 0x00},
165 {0x6b, 0x00},
166 {0x6c, 0x00},
167 {0x6d, 0x03},
168 {0x6e, 0x01},
169 {0x6f, 0x00},
170 {0x70, 0x00},
171 {0x71, 0x00},
172 {0x72, 0x00},
173 {0x73, 0x00},
174 {0x74, 0x00},
175 {0x75, 0x00},
176 {0x76, 0x00},
177 {0x77, 0x00},
178 {0x78, 0x00},
179 {0x79, 0x00},
180 {0x7a, 0x00},
181 {0x7b, 0x00},
182 {0x7c, 0x00},
183 {0x7d, 0x00},
184 {0x7e, 0x00},
185 {0x7f, 0x00},
186 {0x80, 0x0b},
187 {0x81, 0x00},
188 {0x82, 0x3c},
189 {0x83, 0x00},
190 {0x84, 0x00},
191 {0x85, 0x00},
192 {0x86, 0x00},
193 {0x87, 0x00},
194 {0x88, 0x08},
195 {0x89, 0x00},
196 {0x8a, 0x08},
197 {0x8b, 0xa6},
198 {0x8c, 0x84},
199 {0x8d, 0x47},
200 {0x8e, 0xbb},
201 {0x8f, 0x02},
202 {0x90, 0x21},
203 {0x91, 0x0c},
204 {0x92, 0x04},
205 {0x93, 0x22},
206 {0x94, 0x00},
207 {0x95, 0x00},
208 {0x96, 0x00},
209 {0x97, 0xeb},
210 {0x98, 0x00},
211 {0x99, 0x00},
212 {0x9a, 0x00},
213 {0x9b, 0x00},
214 {0x9c, 0x00},
215 {0x9d, 0x00},
216 {0x9e, 0x00},
217 {0x9f, 0x00},
218 {0xa0, 0x00},
219 {0xa1, 0x00},
220 {0xa2, 0x00},
221 {0xa3, 0x00},
222 {0xa4, 0x00},
223 {0xa5, 0x00},
224 {0xa6, 0x10},
225 {0xa7, 0x04},
226 {0xa8, 0x10},
227 {0xa9, 0x00},
228 {0xaa, 0x8f},
229 {0xab, 0x00},
230 {0xac, 0x00},
231 {0xad, 0x00},
232 {0xae, 0x00},
233 {0xaf, 0x80},
234 {0xb0, 0x38},
235 {0xb1, 0x00},
236 {0xb2, 0x00},
237 {0xb3, 0x00},
238 {0xb4, 0xee},
239 {0xb5, 0xff},
240 {0xb6, 0x10},
241 {0xb7, 0x00},
242 {0xb8, 0x00},
243 {0xb9, 0x00},
244 {0xba, 0x00},
245 {0xbb, 0x03},
246 {0xbc, 0x00},
247 {0xbd, 0x00},
248 {0xbe, 0x00},
249 {0xbf, 0x00},
250 {0xc0, 0x10},
251 {0xc1, 0x10},
252 {0xc2, 0x18},
253 {0xc3, 0x20},
254 {0xc4, 0x10},
255 {0xc5, 0x00},
256 {0xc6, 0x22},
257 {0xc7, 0x14},
258 {0xc8, 0x0f},
259 {0xc9, 0x08},
260 {0xca, 0xa4},
261 {0xcb, 0xa7},
262 {0xcc, 0x3c},
263 {0xcd, 0x10},
264 {0xce, 0x20},
265 {0xcf, 0x00},
266 {0xd0, 0x00},
267 {0xd1, 0x10},
268 {0xd2, 0x00},
269 {0xd3, 0x00},
270 {0xd4, 0x10},
271 {0xd5, 0x33},
272 {0xd6, 0x70},
273 {0xd7, 0x01},
274 {0xd8, 0x00},
275 {0xd9, 0x00},
276 {0xda, 0x00},
277 {0xdb, 0x00},
278 {0xdc, 0x00},
279 {0xdd, 0x00},
280 {0xde, 0x00},
281 {0xdf, 0x00},
282 {0xe0, 0x00},
283 {0xe1, 0x00},
284 {0xe2, 0xcc},
285 {0xe3, 0x04},
286 {0xe4, 0x08},
287 {0xe5, 0x10},
288 {0xe6, 0x00},
289 {0xe7, 0x0e},
290 {0xe8, 0x88},
291 {0xe9, 0xd4},
292 {0xea, 0x05},
293 {0xeb, 0xf0},
294 {0xec, 0x79},
295 {0xed, 0x0f},
296 {0xee, 0x04},
297 {0xef, 0x04},
298 {0xf0, 0x00},
299 {0xf1, 0x00},
300 {0xf2, 0x00},
301 {0xf3, 0x00},
302 {0xf4, 0x00},
303 {0xf5, 0x00},
304 {0xf6, 0x00},
305 {0xf7, 0x00},
306 {0xf8, 0x00},
307 {0xf9, 0x00},
308 {0xF0, 0x00},
309 {0xF1, 0xF8},
310 {0xF0, 0x80},
311 {0xF0, 0x00},
312 {0xF1, 0xF4},
313 {0xF0, 0x81},
314 {0xF0, 0x01},
315 {0xF1, 0xF0},
316 {0xF0, 0x82},
317 {0xF0, 0x02},
318 {0xF1, 0xEC},
319 {0xF0, 0x83},
320 {0xF0, 0x03},
321 {0xF1, 0xE8},
322 {0xF0, 0x84},
323 {0xF0, 0x04},
324 {0xF1, 0xE4},
325 {0xF0, 0x85},
326 {0xF0, 0x05},
327 {0xF1, 0xE0},
328 {0xF0, 0x86},
329 {0xF0, 0x06},
330 {0xF1, 0xDC},
331 {0xF0, 0x87},
332 {0xF0, 0x07},
333 {0xF1, 0xD8},
334 {0xF0, 0x88},
335 {0xF0, 0x08},
336 {0xF1, 0xD4},
337 {0xF0, 0x89},
338 {0xF0, 0x09},
339 {0xF1, 0xD0},
340 {0xF0, 0x8A},
341 {0xF0, 0x0A},
342 {0xF1, 0xCC},
343 {0xF0, 0x8B},
344 {0xF0, 0x0B},
345 {0xF1, 0xC8},
346 {0xF0, 0x8C},
347 {0xF0, 0x0C},
348 {0xF1, 0xC4},
349 {0xF0, 0x8D},
350 {0xF0, 0x0D},
351 {0xF1, 0xC0},
352 {0xF0, 0x8E},
353 {0xF0, 0x0E},
354 {0xF1, 0xBC},
355 {0xF0, 0x8F},
356 {0xF0, 0x0F},
357 {0xF1, 0xB8},
358 {0xF0, 0x90},
359 {0xF0, 0x10},
360 {0xF1, 0xB4},
361 {0xF0, 0x91},
362 {0xF0, 0x11},
363 {0xF1, 0xB0},
364 {0xF0, 0x92},
365 {0xF0, 0x12},
366 {0xF1, 0xAC},
367 {0xF0, 0x93},
368 {0xF0, 0x13},
369 {0xF1, 0xA8},
370 {0xF0, 0x94},
371 {0xF0, 0x14},
372 {0xF1, 0xA4},
373 {0xF0, 0x95},
374 {0xF0, 0x15},
375 {0xF1, 0xA0},
376 {0xF0, 0x96},
377 {0xF0, 0x16},
378 {0xF1, 0x9C},
379 {0xF0, 0x97},
380 {0xF0, 0x17},
381 {0xF1, 0x98},
382 {0xF0, 0x98},
383 {0xF0, 0x18},
384 {0xF1, 0x94},
385 {0xF0, 0x99},
386 {0xF0, 0x19},
387 {0xF1, 0x90},
388 {0xF0, 0x9A},
389 {0xF0, 0x1A},
390 {0xF1, 0x8C},
391 {0xF0, 0x9B},
392 {0xF0, 0x1B},
393 {0xF1, 0x88},
394 {0xF0, 0x9C},
395 {0xF0, 0x1C},
396 {0xF1, 0x84},
397 {0xF0, 0x9D},
398 {0xF0, 0x1D},
399 {0xF1, 0x80},
400 {0xF0, 0x9E},
401 {0xF0, 0x1E},
402 {0xF1, 0x7C},
403 {0xF0, 0x9F},
404 {0xF0, 0x1F},
405 {0xF1, 0x78},
406 {0xF0, 0xA0},
407 {0xF0, 0x20},
408 {0xF1, 0x74},
409 {0xF0, 0xA1},
410 {0xF0, 0x21},
411 {0xF1, 0x70},
412 {0xF0, 0xA2},
413 {0xF0, 0x22},
414 {0xF1, 0x6C},
415 {0xF0, 0xA3},
416 {0xF0, 0x23},
417 {0xF1, 0x68},
418 {0xF0, 0xA4},
419 {0xF0, 0x24},
420 {0xF1, 0x64},
421 {0xF0, 0xA5},
422 {0xF0, 0x25},
423 {0xF1, 0x60},
424 {0xF0, 0xA6},
425 {0xF0, 0x26},
426 {0xF1, 0x5C},
427 {0xF0, 0xA7},
428 {0xF0, 0x27},
429 {0xF1, 0x58},
430 {0xF0, 0xA8},
431 {0xF0, 0x28},
432 {0xF1, 0x54},
433 {0xF0, 0xA9},
434 {0xF0, 0x29},
435 {0xF1, 0x50},
436 {0xF0, 0xAA},
437 {0xF0, 0x2A},
438 {0xF1, 0x4C},
439 {0xF0, 0xAB},
440 {0xF0, 0x2B},
441 {0xF1, 0x48},
442 {0xF0, 0xAC},
443 {0xF0, 0x2C},
444 {0xF1, 0x44},
445 {0xF0, 0xAD},
446 {0xF0, 0x2D},
447 {0xF1, 0x40},
448 {0xF0, 0xAE},
449 {0xF0, 0x2E},
450 {0xF1, 0x3C},
451 {0xF0, 0xAF},
452 {0xF0, 0x2F},
453 {0xF1, 0x38},
454 {0xF0, 0xB0},
455 {0xF0, 0x30},
456 {0xF1, 0x34},
457 {0xF0, 0xB1},
458 {0xF0, 0x31},
459 {0xF1, 0x30},
460 {0xF0, 0xB2},
461 {0xF0, 0x32},
462 {0xF1, 0x2C},
463 {0xF0, 0xB3},
464 {0xF0, 0x33},
465 {0xF1, 0x28},
466 {0xF0, 0xB4},
467 {0xF0, 0x34},
468 {0xF1, 0x24},
469 {0xF0, 0xB5},
470 {0xF0, 0x35},
471 {0xF1, 0x20},
472 {0xF0, 0xB6},
473 {0xF0, 0x36},
474 {0xF1, 0x1C},
475 {0xF0, 0xB7},
476 {0xF0, 0x37},
477 {0xF1, 0x18},
478 {0xF0, 0xB8},
479 {0xF0, 0x38},
480 {0xF1, 0x14},
481 {0xF0, 0xB9},
482 {0xF0, 0x39},
483 {0xF1, 0x10},
484 {0xF0, 0xBA},
485 {0xF0, 0x3A},
486 {0xF1, 0x0C},
487 {0xF0, 0xBB},
488 {0xF0, 0x3B},
489 {0xF1, 0x08},
490 {0xF0, 0x00},
491 {0xF0, 0x3C},
492 {0xF1, 0x04},
493 {0xF0, 0xBD},
494 {0xF0, 0x3D},
495 {0xF1, 0x00},
496 {0xF0, 0xBE},
497 {0xF0, 0x3E},
498 {0xF1, 0x00},
499 {0xF0, 0xBF},
500 {0xF0, 0x3F},
501 {0xF1, 0x00},
502 {0xF0, 0xC0},
503 {0xF0, 0x00},
506 #define CB_VT3253B0_INIT_FOR_RFMD 256
507 static const unsigned char byVT3253B0_RFMD[CB_VT3253B0_INIT_FOR_RFMD][2] = {
508 {0x00, 0x31},
509 {0x01, 0x00},
510 {0x02, 0x00},
511 {0x03, 0x00},
512 {0x04, 0x00},
513 {0x05, 0x81},
514 {0x06, 0x00},
515 {0x07, 0x00},
516 {0x08, 0x38},
517 {0x09, 0x45},
518 {0x0a, 0x2a},
519 {0x0b, 0x76},
520 {0x0c, 0x00},
521 {0x0d, 0x00},
522 {0x0e, 0x80},
523 {0x0f, 0x00},
524 {0x10, 0x00},
525 {0x11, 0x00},
526 {0x12, 0x00},
527 {0x13, 0x00},
528 {0x14, 0x00},
529 {0x15, 0x00},
530 {0x16, 0x00},
531 {0x17, 0x00},
532 {0x18, 0x00},
533 {0x19, 0x00},
534 {0x1a, 0x00},
535 {0x1b, 0x8e},
536 {0x1c, 0x06},
537 {0x1d, 0x00},
538 {0x1e, 0x00},
539 {0x1f, 0x00},
540 {0x20, 0x00},
541 {0x21, 0x00},
542 {0x22, 0x00},
543 {0x23, 0x00},
544 {0x24, 0x00},
545 {0x25, 0x4a},
546 {0x26, 0x00},
547 {0x27, 0x00},
548 {0x28, 0x00},
549 {0x29, 0x00},
550 {0x2a, 0x00},
551 {0x2b, 0x00},
552 {0x2c, 0x00},
553 {0x2d, 0x34},
554 {0x2e, 0x18},
555 {0x2f, 0x0c},
556 {0x30, 0x26},
557 {0x31, 0x5b},
558 {0x32, 0x00},
559 {0x33, 0x00},
560 {0x34, 0x00},
561 {0x35, 0x00},
562 {0x36, 0xaa},
563 {0x37, 0xaa},
564 {0x38, 0xff},
565 {0x39, 0xff},
566 {0x3a, 0xf8},
567 {0x3b, 0x00},
568 {0x3c, 0x00},
569 {0x3d, 0x09},
570 {0x3e, 0x0d},
571 {0x3f, 0x04},
572 {0x40, 0x00},
573 {0x41, 0x08},
574 {0x42, 0x00},
575 {0x43, 0x08},
576 {0x44, 0x08},
577 {0x45, 0x14},
578 {0x46, 0x05},
579 {0x47, 0x08},
580 {0x48, 0x00},
581 {0x49, 0x00},
582 {0x4a, 0x00},
583 {0x4b, 0x00},
584 {0x4c, 0x09},
585 {0x4d, 0x80},
586 {0x4e, 0x00},
587 {0x4f, 0xc5},
588 {0x50, 0x14},
589 {0x51, 0x19},
590 {0x52, 0x00},
591 {0x53, 0x00},
592 {0x54, 0x00},
593 {0x55, 0x00},
594 {0x56, 0x00},
595 {0x57, 0x00},
596 {0x58, 0x00},
597 {0x59, 0xb0},
598 {0x5a, 0x00},
599 {0x5b, 0x00},
600 {0x5c, 0x00},
601 {0x5d, 0x00},
602 {0x5e, 0x00},
603 {0x5f, 0x00},
604 {0x60, 0x39},
605 {0x61, 0x83},
606 {0x62, 0x00},
607 {0x63, 0x00},
608 {0x64, 0x00},
609 {0x65, 0x00},
610 {0x66, 0xc0},
611 {0x67, 0x49},
612 {0x68, 0x00},
613 {0x69, 0x00},
614 {0x6a, 0x00},
615 {0x6b, 0x00},
616 {0x6c, 0x00},
617 {0x6d, 0x03},
618 {0x6e, 0x01},
619 {0x6f, 0x00},
620 {0x70, 0x00},
621 {0x71, 0x00},
622 {0x72, 0x00},
623 {0x73, 0x00},
624 {0x74, 0x00},
625 {0x75, 0x00},
626 {0x76, 0x00},
627 {0x77, 0x00},
628 {0x78, 0x00},
629 {0x79, 0x00},
630 {0x7a, 0x00},
631 {0x7b, 0x00},
632 {0x7c, 0x00},
633 {0x7d, 0x00},
634 {0x7e, 0x00},
635 {0x7f, 0x00},
636 {0x80, 0x89},
637 {0x81, 0x00},
638 {0x82, 0x0e},
639 {0x83, 0x00},
640 {0x84, 0x00},
641 {0x85, 0x00},
642 {0x86, 0x00},
643 {0x87, 0x00},
644 {0x88, 0x08},
645 {0x89, 0x00},
646 {0x8a, 0x0e},
647 {0x8b, 0xa7},
648 {0x8c, 0x88},
649 {0x8d, 0x47},
650 {0x8e, 0xaa},
651 {0x8f, 0x02},
652 {0x90, 0x23},
653 {0x91, 0x0c},
654 {0x92, 0x06},
655 {0x93, 0x08},
656 {0x94, 0x00},
657 {0x95, 0x00},
658 {0x96, 0x00},
659 {0x97, 0xeb},
660 {0x98, 0x00},
661 {0x99, 0x00},
662 {0x9a, 0x00},
663 {0x9b, 0x00},
664 {0x9c, 0x00},
665 {0x9d, 0x00},
666 {0x9e, 0x00},
667 {0x9f, 0x00},
668 {0xa0, 0x00},
669 {0xa1, 0x00},
670 {0xa2, 0x00},
671 {0xa3, 0xcd},
672 {0xa4, 0x07},
673 {0xa5, 0x33},
674 {0xa6, 0x18},
675 {0xa7, 0x00},
676 {0xa8, 0x18},
677 {0xa9, 0x00},
678 {0xaa, 0x28},
679 {0xab, 0x00},
680 {0xac, 0x00},
681 {0xad, 0x00},
682 {0xae, 0x00},
683 {0xaf, 0x18},
684 {0xb0, 0x38},
685 {0xb1, 0x30},
686 {0xb2, 0x00},
687 {0xb3, 0x00},
688 {0xb4, 0x00},
689 {0xb5, 0x00},
690 {0xb6, 0x84},
691 {0xb7, 0xfd},
692 {0xb8, 0x00},
693 {0xb9, 0x00},
694 {0xba, 0x00},
695 {0xbb, 0x03},
696 {0xbc, 0x00},
697 {0xbd, 0x00},
698 {0xbe, 0x00},
699 {0xbf, 0x00},
700 {0xc0, 0x10},
701 {0xc1, 0x20},
702 {0xc2, 0x18},
703 {0xc3, 0x20},
704 {0xc4, 0x10},
705 {0xc5, 0x2c},
706 {0xc6, 0x1e},
707 {0xc7, 0x10},
708 {0xc8, 0x12},
709 {0xc9, 0x01},
710 {0xca, 0x6f},
711 {0xcb, 0xa7},
712 {0xcc, 0x3c},
713 {0xcd, 0x10},
714 {0xce, 0x00},
715 {0xcf, 0x22},
716 {0xd0, 0x00},
717 {0xd1, 0x10},
718 {0xd2, 0x00},
719 {0xd3, 0x00},
720 {0xd4, 0x10},
721 {0xd5, 0x33},
722 {0xd6, 0x80},
723 {0xd7, 0x21},
724 {0xd8, 0x00},
725 {0xd9, 0x00},
726 {0xda, 0x00},
727 {0xdb, 0x00},
728 {0xdc, 0x00},
729 {0xdd, 0x00},
730 {0xde, 0x00},
731 {0xdf, 0x00},
732 {0xe0, 0x00},
733 {0xe1, 0xB3},
734 {0xe2, 0x00},
735 {0xe3, 0x00},
736 {0xe4, 0x00},
737 {0xe5, 0x10},
738 {0xe6, 0x00},
739 {0xe7, 0x18},
740 {0xe8, 0x08},
741 {0xe9, 0xd4},
742 {0xea, 0x00},
743 {0xeb, 0xff},
744 {0xec, 0x79},
745 {0xed, 0x10},
746 {0xee, 0x30},
747 {0xef, 0x02},
748 {0xf0, 0x00},
749 {0xf1, 0x09},
750 {0xf2, 0x00},
751 {0xf3, 0x00},
752 {0xf4, 0x00},
753 {0xf5, 0x00},
754 {0xf6, 0x00},
755 {0xf7, 0x00},
756 {0xf8, 0x00},
757 {0xf9, 0x00},
758 {0xfa, 0x00},
759 {0xfb, 0x00},
760 {0xfc, 0x00},
761 {0xfd, 0x00},
762 {0xfe, 0x00},
763 {0xff, 0x00},
766 #define CB_VT3253B0_AGC_FOR_RFMD2959 195
767 /* For RFMD2959 */
768 static
769 unsigned char byVT3253B0_AGC4_RFMD2959[CB_VT3253B0_AGC_FOR_RFMD2959][2] = {
770 {0xF0, 0x00},
771 {0xF1, 0x3E},
772 {0xF0, 0x80},
773 {0xF0, 0x00},
774 {0xF1, 0x3E},
775 {0xF0, 0x81},
776 {0xF0, 0x01},
777 {0xF1, 0x3E},
778 {0xF0, 0x82},
779 {0xF0, 0x02},
780 {0xF1, 0x3E},
781 {0xF0, 0x83},
782 {0xF0, 0x03},
783 {0xF1, 0x3B},
784 {0xF0, 0x84},
785 {0xF0, 0x04},
786 {0xF1, 0x39},
787 {0xF0, 0x85},
788 {0xF0, 0x05},
789 {0xF1, 0x38},
790 {0xF0, 0x86},
791 {0xF0, 0x06},
792 {0xF1, 0x37},
793 {0xF0, 0x87},
794 {0xF0, 0x07},
795 {0xF1, 0x36},
796 {0xF0, 0x88},
797 {0xF0, 0x08},
798 {0xF1, 0x35},
799 {0xF0, 0x89},
800 {0xF0, 0x09},
801 {0xF1, 0x35},
802 {0xF0, 0x8A},
803 {0xF0, 0x0A},
804 {0xF1, 0x34},
805 {0xF0, 0x8B},
806 {0xF0, 0x0B},
807 {0xF1, 0x34},
808 {0xF0, 0x8C},
809 {0xF0, 0x0C},
810 {0xF1, 0x33},
811 {0xF0, 0x8D},
812 {0xF0, 0x0D},
813 {0xF1, 0x32},
814 {0xF0, 0x8E},
815 {0xF0, 0x0E},
816 {0xF1, 0x31},
817 {0xF0, 0x8F},
818 {0xF0, 0x0F},
819 {0xF1, 0x30},
820 {0xF0, 0x90},
821 {0xF0, 0x10},
822 {0xF1, 0x2F},
823 {0xF0, 0x91},
824 {0xF0, 0x11},
825 {0xF1, 0x2F},
826 {0xF0, 0x92},
827 {0xF0, 0x12},
828 {0xF1, 0x2E},
829 {0xF0, 0x93},
830 {0xF0, 0x13},
831 {0xF1, 0x2D},
832 {0xF0, 0x94},
833 {0xF0, 0x14},
834 {0xF1, 0x2C},
835 {0xF0, 0x95},
836 {0xF0, 0x15},
837 {0xF1, 0x2B},
838 {0xF0, 0x96},
839 {0xF0, 0x16},
840 {0xF1, 0x2B},
841 {0xF0, 0x97},
842 {0xF0, 0x17},
843 {0xF1, 0x2A},
844 {0xF0, 0x98},
845 {0xF0, 0x18},
846 {0xF1, 0x29},
847 {0xF0, 0x99},
848 {0xF0, 0x19},
849 {0xF1, 0x28},
850 {0xF0, 0x9A},
851 {0xF0, 0x1A},
852 {0xF1, 0x27},
853 {0xF0, 0x9B},
854 {0xF0, 0x1B},
855 {0xF1, 0x26},
856 {0xF0, 0x9C},
857 {0xF0, 0x1C},
858 {0xF1, 0x25},
859 {0xF0, 0x9D},
860 {0xF0, 0x1D},
861 {0xF1, 0x24},
862 {0xF0, 0x9E},
863 {0xF0, 0x1E},
864 {0xF1, 0x24},
865 {0xF0, 0x9F},
866 {0xF0, 0x1F},
867 {0xF1, 0x23},
868 {0xF0, 0xA0},
869 {0xF0, 0x20},
870 {0xF1, 0x22},
871 {0xF0, 0xA1},
872 {0xF0, 0x21},
873 {0xF1, 0x21},
874 {0xF0, 0xA2},
875 {0xF0, 0x22},
876 {0xF1, 0x20},
877 {0xF0, 0xA3},
878 {0xF0, 0x23},
879 {0xF1, 0x20},
880 {0xF0, 0xA4},
881 {0xF0, 0x24},
882 {0xF1, 0x1F},
883 {0xF0, 0xA5},
884 {0xF0, 0x25},
885 {0xF1, 0x1E},
886 {0xF0, 0xA6},
887 {0xF0, 0x26},
888 {0xF1, 0x1D},
889 {0xF0, 0xA7},
890 {0xF0, 0x27},
891 {0xF1, 0x1C},
892 {0xF0, 0xA8},
893 {0xF0, 0x28},
894 {0xF1, 0x1B},
895 {0xF0, 0xA9},
896 {0xF0, 0x29},
897 {0xF1, 0x1B},
898 {0xF0, 0xAA},
899 {0xF0, 0x2A},
900 {0xF1, 0x1A},
901 {0xF0, 0xAB},
902 {0xF0, 0x2B},
903 {0xF1, 0x1A},
904 {0xF0, 0xAC},
905 {0xF0, 0x2C},
906 {0xF1, 0x19},
907 {0xF0, 0xAD},
908 {0xF0, 0x2D},
909 {0xF1, 0x18},
910 {0xF0, 0xAE},
911 {0xF0, 0x2E},
912 {0xF1, 0x17},
913 {0xF0, 0xAF},
914 {0xF0, 0x2F},
915 {0xF1, 0x16},
916 {0xF0, 0xB0},
917 {0xF0, 0x30},
918 {0xF1, 0x15},
919 {0xF0, 0xB1},
920 {0xF0, 0x31},
921 {0xF1, 0x15},
922 {0xF0, 0xB2},
923 {0xF0, 0x32},
924 {0xF1, 0x15},
925 {0xF0, 0xB3},
926 {0xF0, 0x33},
927 {0xF1, 0x14},
928 {0xF0, 0xB4},
929 {0xF0, 0x34},
930 {0xF1, 0x13},
931 {0xF0, 0xB5},
932 {0xF0, 0x35},
933 {0xF1, 0x12},
934 {0xF0, 0xB6},
935 {0xF0, 0x36},
936 {0xF1, 0x11},
937 {0xF0, 0xB7},
938 {0xF0, 0x37},
939 {0xF1, 0x10},
940 {0xF0, 0xB8},
941 {0xF0, 0x38},
942 {0xF1, 0x0F},
943 {0xF0, 0xB9},
944 {0xF0, 0x39},
945 {0xF1, 0x0E},
946 {0xF0, 0xBA},
947 {0xF0, 0x3A},
948 {0xF1, 0x0D},
949 {0xF0, 0xBB},
950 {0xF0, 0x3B},
951 {0xF1, 0x0C},
952 {0xF0, 0xBC},
953 {0xF0, 0x3C},
954 {0xF1, 0x0B},
955 {0xF0, 0xBD},
956 {0xF0, 0x3D},
957 {0xF1, 0x0B},
958 {0xF0, 0xBE},
959 {0xF0, 0x3E},
960 {0xF1, 0x0A},
961 {0xF0, 0xBF},
962 {0xF0, 0x3F},
963 {0xF1, 0x09},
964 {0xF0, 0x00},
967 #define CB_VT3253B0_INIT_FOR_AIROHA2230 256
968 /* For AIROHA */
969 static
970 unsigned char byVT3253B0_AIROHA2230[CB_VT3253B0_INIT_FOR_AIROHA2230][2] = {
971 {0x00, 0x31},
972 {0x01, 0x00},
973 {0x02, 0x00},
974 {0x03, 0x00},
975 {0x04, 0x00},
976 {0x05, 0x80},
977 {0x06, 0x00},
978 {0x07, 0x00},
979 {0x08, 0x70},
980 {0x09, 0x41},
981 {0x0a, 0x2A},
982 {0x0b, 0x76},
983 {0x0c, 0x00},
984 {0x0d, 0x00},
985 {0x0e, 0x80},
986 {0x0f, 0x00},
987 {0x10, 0x00},
988 {0x11, 0x00},
989 {0x12, 0x00},
990 {0x13, 0x00},
991 {0x14, 0x00},
992 {0x15, 0x00},
993 {0x16, 0x00},
994 {0x17, 0x00},
995 {0x18, 0x00},
996 {0x19, 0x00},
997 {0x1a, 0x00},
998 {0x1b, 0x8f},
999 {0x1c, 0x09},
1000 {0x1d, 0x00},
1001 {0x1e, 0x00},
1002 {0x1f, 0x00},
1003 {0x20, 0x00},
1004 {0x21, 0x00},
1005 {0x22, 0x00},
1006 {0x23, 0x00},
1007 {0x24, 0x00},
1008 {0x25, 0x4a},
1009 {0x26, 0x00},
1010 {0x27, 0x00},
1011 {0x28, 0x00},
1012 {0x29, 0x00},
1013 {0x2a, 0x00},
1014 {0x2b, 0x00},
1015 {0x2c, 0x00},
1016 {0x2d, 0x4a},
1017 {0x2e, 0x00},
1018 {0x2f, 0x0a},
1019 {0x30, 0x26},
1020 {0x31, 0x5b},
1021 {0x32, 0x00},
1022 {0x33, 0x00},
1023 {0x34, 0x00},
1024 {0x35, 0x00},
1025 {0x36, 0xaa},
1026 {0x37, 0xaa},
1027 {0x38, 0xff},
1028 {0x39, 0xff},
1029 {0x3a, 0x79},
1030 {0x3b, 0x00},
1031 {0x3c, 0x00},
1032 {0x3d, 0x0b},
1033 {0x3e, 0x48},
1034 {0x3f, 0x04},
1035 {0x40, 0x00},
1036 {0x41, 0x08},
1037 {0x42, 0x00},
1038 {0x43, 0x08},
1039 {0x44, 0x08},
1040 {0x45, 0x14},
1041 {0x46, 0x05},
1042 {0x47, 0x09},
1043 {0x48, 0x00},
1044 {0x49, 0x00},
1045 {0x4a, 0x00},
1046 {0x4b, 0x00},
1047 {0x4c, 0x09},
1048 {0x4d, 0x73},
1049 {0x4e, 0x00},
1050 {0x4f, 0xc5},
1051 {0x50, 0x15},
1052 {0x51, 0x19},
1053 {0x52, 0x00},
1054 {0x53, 0x00},
1055 {0x54, 0x00},
1056 {0x55, 0x00},
1057 {0x56, 0x00},
1058 {0x57, 0x00},
1059 {0x58, 0x00},
1060 {0x59, 0xb0},
1061 {0x5a, 0x00},
1062 {0x5b, 0x00},
1063 {0x5c, 0x00},
1064 {0x5d, 0x00},
1065 {0x5e, 0x00},
1066 {0x5f, 0x00},
1067 {0x60, 0xe4},
1068 {0x61, 0x80},
1069 {0x62, 0x00},
1070 {0x63, 0x00},
1071 {0x64, 0x00},
1072 {0x65, 0x00},
1073 {0x66, 0x98},
1074 {0x67, 0x0a},
1075 {0x68, 0x00},
1076 {0x69, 0x00},
1077 {0x6a, 0x00},
1078 {0x6b, 0x00},
1079 {0x6c, 0x00}, /* RobertYu:20050125, request by JJSue */
1080 {0x6d, 0x03},
1081 {0x6e, 0x01},
1082 {0x6f, 0x00},
1083 {0x70, 0x00},
1084 {0x71, 0x00},
1085 {0x72, 0x00},
1086 {0x73, 0x00},
1087 {0x74, 0x00},
1088 {0x75, 0x00},
1089 {0x76, 0x00},
1090 {0x77, 0x00},
1091 {0x78, 0x00},
1092 {0x79, 0x00},
1093 {0x7a, 0x00},
1094 {0x7b, 0x00},
1095 {0x7c, 0x00},
1096 {0x7d, 0x00},
1097 {0x7e, 0x00},
1098 {0x7f, 0x00},
1099 {0x80, 0x8c},
1100 {0x81, 0x01},
1101 {0x82, 0x09},
1102 {0x83, 0x00},
1103 {0x84, 0x00},
1104 {0x85, 0x00},
1105 {0x86, 0x00},
1106 {0x87, 0x00},
1107 {0x88, 0x08},
1108 {0x89, 0x00},
1109 {0x8a, 0x0f},
1110 {0x8b, 0xb7},
1111 {0x8c, 0x88},
1112 {0x8d, 0x47},
1113 {0x8e, 0xaa},
1114 {0x8f, 0x02},
1115 {0x90, 0x22},
1116 {0x91, 0x00},
1117 {0x92, 0x00},
1118 {0x93, 0x00},
1119 {0x94, 0x00},
1120 {0x95, 0x00},
1121 {0x96, 0x00},
1122 {0x97, 0xeb},
1123 {0x98, 0x00},
1124 {0x99, 0x00},
1125 {0x9a, 0x00},
1126 {0x9b, 0x00},
1127 {0x9c, 0x00},
1128 {0x9d, 0x00},
1129 {0x9e, 0x00},
1130 {0x9f, 0x01},
1131 {0xa0, 0x00},
1132 {0xa1, 0x00},
1133 {0xa2, 0x00},
1134 {0xa3, 0x00},
1135 {0xa4, 0x00},
1136 {0xa5, 0x00},
1137 {0xa6, 0x10},
1138 {0xa7, 0x00},
1139 {0xa8, 0x18},
1140 {0xa9, 0x00},
1141 {0xaa, 0x00},
1142 {0xab, 0x00},
1143 {0xac, 0x00},
1144 {0xad, 0x00},
1145 {0xae, 0x00},
1146 {0xaf, 0x18},
1147 {0xb0, 0x38},
1148 {0xb1, 0x30},
1149 {0xb2, 0x00},
1150 {0xb3, 0x00},
1151 {0xb4, 0xff},
1152 {0xb5, 0x0f},
1153 {0xb6, 0xe4},
1154 {0xb7, 0xe2},
1155 {0xb8, 0x00},
1156 {0xb9, 0x00},
1157 {0xba, 0x00},
1158 {0xbb, 0x03},
1159 {0xbc, 0x01},
1160 {0xbd, 0x00},
1161 {0xbe, 0x00},
1162 {0xbf, 0x00},
1163 {0xc0, 0x18},
1164 {0xc1, 0x20},
1165 {0xc2, 0x07},
1166 {0xc3, 0x18},
1167 {0xc4, 0xff},
1168 {0xc5, 0x2c},
1169 {0xc6, 0x0c},
1170 {0xc7, 0x0a},
1171 {0xc8, 0x0e},
1172 {0xc9, 0x01},
1173 {0xca, 0x68},
1174 {0xcb, 0xa7},
1175 {0xcc, 0x3c},
1176 {0xcd, 0x10},
1177 {0xce, 0x00},
1178 {0xcf, 0x25},
1179 {0xd0, 0x40},
1180 {0xd1, 0x12},
1181 {0xd2, 0x00},
1182 {0xd3, 0x00},
1183 {0xd4, 0x10},
1184 {0xd5, 0x28},
1185 {0xd6, 0x80},
1186 {0xd7, 0x2A},
1187 {0xd8, 0x00},
1188 {0xd9, 0x00},
1189 {0xda, 0x00},
1190 {0xdb, 0x00},
1191 {0xdc, 0x00},
1192 {0xdd, 0x00},
1193 {0xde, 0x00},
1194 {0xdf, 0x00},
1195 {0xe0, 0x00},
1196 {0xe1, 0xB3},
1197 {0xe2, 0x00},
1198 {0xe3, 0x00},
1199 {0xe4, 0x00},
1200 {0xe5, 0x10},
1201 {0xe6, 0x00},
1202 {0xe7, 0x1C},
1203 {0xe8, 0x00},
1204 {0xe9, 0xf4},
1205 {0xea, 0x00},
1206 {0xeb, 0xff},
1207 {0xec, 0x79},
1208 {0xed, 0x20},
1209 {0xee, 0x30},
1210 {0xef, 0x01},
1211 {0xf0, 0x00},
1212 {0xf1, 0x3e},
1213 {0xf2, 0x00},
1214 {0xf3, 0x00},
1215 {0xf4, 0x00},
1216 {0xf5, 0x00},
1217 {0xf6, 0x00},
1218 {0xf7, 0x00},
1219 {0xf8, 0x00},
1220 {0xf9, 0x00},
1221 {0xfa, 0x00},
1222 {0xfb, 0x00},
1223 {0xfc, 0x00},
1224 {0xfd, 0x00},
1225 {0xfe, 0x00},
1226 {0xff, 0x00},
1229 #define CB_VT3253B0_INIT_FOR_UW2451 256
1230 /* For UW2451 */
1231 static unsigned char byVT3253B0_UW2451[CB_VT3253B0_INIT_FOR_UW2451][2] = {
1232 {0x00, 0x31},
1233 {0x01, 0x00},
1234 {0x02, 0x00},
1235 {0x03, 0x00},
1236 {0x04, 0x00},
1237 {0x05, 0x81},
1238 {0x06, 0x00},
1239 {0x07, 0x00},
1240 {0x08, 0x38},
1241 {0x09, 0x45},
1242 {0x0a, 0x28},
1243 {0x0b, 0x76},
1244 {0x0c, 0x00},
1245 {0x0d, 0x00},
1246 {0x0e, 0x80},
1247 {0x0f, 0x00},
1248 {0x10, 0x00},
1249 {0x11, 0x00},
1250 {0x12, 0x00},
1251 {0x13, 0x00},
1252 {0x14, 0x00},
1253 {0x15, 0x00},
1254 {0x16, 0x00},
1255 {0x17, 0x00},
1256 {0x18, 0x00},
1257 {0x19, 0x00},
1258 {0x1a, 0x00},
1259 {0x1b, 0x8f},
1260 {0x1c, 0x0f},
1261 {0x1d, 0x00},
1262 {0x1e, 0x00},
1263 {0x1f, 0x00},
1264 {0x20, 0x00},
1265 {0x21, 0x00},
1266 {0x22, 0x00},
1267 {0x23, 0x00},
1268 {0x24, 0x00},
1269 {0x25, 0x4a},
1270 {0x26, 0x00},
1271 {0x27, 0x00},
1272 {0x28, 0x00},
1273 {0x29, 0x00},
1274 {0x2a, 0x00},
1275 {0x2b, 0x00},
1276 {0x2c, 0x00},
1277 {0x2d, 0x18},
1278 {0x2e, 0x00},
1279 {0x2f, 0x0a},
1280 {0x30, 0x26},
1281 {0x31, 0x5b},
1282 {0x32, 0x00},
1283 {0x33, 0x00},
1284 {0x34, 0x00},
1285 {0x35, 0x00},
1286 {0x36, 0xaa},
1287 {0x37, 0xaa},
1288 {0x38, 0xff},
1289 {0x39, 0xff},
1290 {0x3a, 0x00},
1291 {0x3b, 0x00},
1292 {0x3c, 0x00},
1293 {0x3d, 0x03},
1294 {0x3e, 0x1d},
1295 {0x3f, 0x04},
1296 {0x40, 0x00},
1297 {0x41, 0x08},
1298 {0x42, 0x00},
1299 {0x43, 0x08},
1300 {0x44, 0x08},
1301 {0x45, 0x14},
1302 {0x46, 0x05},
1303 {0x47, 0x09},
1304 {0x48, 0x00},
1305 {0x49, 0x00},
1306 {0x4a, 0x00},
1307 {0x4b, 0x00},
1308 {0x4c, 0x09},
1309 {0x4d, 0x90},
1310 {0x4e, 0x00},
1311 {0x4f, 0xc5},
1312 {0x50, 0x15},
1313 {0x51, 0x19},
1314 {0x52, 0x00},
1315 {0x53, 0x00},
1316 {0x54, 0x00},
1317 {0x55, 0x00},
1318 {0x56, 0x00},
1319 {0x57, 0x00},
1320 {0x58, 0x00},
1321 {0x59, 0xb0},
1322 {0x5a, 0x00},
1323 {0x5b, 0x00},
1324 {0x5c, 0x00},
1325 {0x5d, 0x00},
1326 {0x5e, 0x00},
1327 {0x5f, 0x00},
1328 {0x60, 0xb3},
1329 {0x61, 0x81},
1330 {0x62, 0x00},
1331 {0x63, 0x00},
1332 {0x64, 0x00},
1333 {0x65, 0x00},
1334 {0x66, 0x57},
1335 {0x67, 0x6c},
1336 {0x68, 0x00},
1337 {0x69, 0x00},
1338 {0x6a, 0x00},
1339 {0x6b, 0x00},
1340 {0x6c, 0x00}, /* RobertYu:20050125, request by JJSue */
1341 {0x6d, 0x03},
1342 {0x6e, 0x01},
1343 {0x6f, 0x00},
1344 {0x70, 0x00},
1345 {0x71, 0x00},
1346 {0x72, 0x00},
1347 {0x73, 0x00},
1348 {0x74, 0x00},
1349 {0x75, 0x00},
1350 {0x76, 0x00},
1351 {0x77, 0x00},
1352 {0x78, 0x00},
1353 {0x79, 0x00},
1354 {0x7a, 0x00},
1355 {0x7b, 0x00},
1356 {0x7c, 0x00},
1357 {0x7d, 0x00},
1358 {0x7e, 0x00},
1359 {0x7f, 0x00},
1360 {0x80, 0x8c},
1361 {0x81, 0x00},
1362 {0x82, 0x0e},
1363 {0x83, 0x00},
1364 {0x84, 0x00},
1365 {0x85, 0x00},
1366 {0x86, 0x00},
1367 {0x87, 0x00},
1368 {0x88, 0x08},
1369 {0x89, 0x00},
1370 {0x8a, 0x0e},
1371 {0x8b, 0xa7},
1372 {0x8c, 0x88},
1373 {0x8d, 0x47},
1374 {0x8e, 0xaa},
1375 {0x8f, 0x02},
1376 {0x90, 0x00},
1377 {0x91, 0x00},
1378 {0x92, 0x00},
1379 {0x93, 0x00},
1380 {0x94, 0x00},
1381 {0x95, 0x00},
1382 {0x96, 0x00},
1383 {0x97, 0xe3},
1384 {0x98, 0x00},
1385 {0x99, 0x00},
1386 {0x9a, 0x00},
1387 {0x9b, 0x00},
1388 {0x9c, 0x00},
1389 {0x9d, 0x00},
1390 {0x9e, 0x00},
1391 {0x9f, 0x00},
1392 {0xa0, 0x00},
1393 {0xa1, 0x00},
1394 {0xa2, 0x00},
1395 {0xa3, 0x00},
1396 {0xa4, 0x00},
1397 {0xa5, 0x00},
1398 {0xa6, 0x10},
1399 {0xa7, 0x00},
1400 {0xa8, 0x18},
1401 {0xa9, 0x00},
1402 {0xaa, 0x00},
1403 {0xab, 0x00},
1404 {0xac, 0x00},
1405 {0xad, 0x00},
1406 {0xae, 0x00},
1407 {0xaf, 0x18},
1408 {0xb0, 0x18},
1409 {0xb1, 0x30},
1410 {0xb2, 0x00},
1411 {0xb3, 0x00},
1412 {0xb4, 0x00},
1413 {0xb5, 0x00},
1414 {0xb6, 0x00},
1415 {0xb7, 0x00},
1416 {0xb8, 0x00},
1417 {0xb9, 0x00},
1418 {0xba, 0x00},
1419 {0xbb, 0x03},
1420 {0xbc, 0x01},
1421 {0xbd, 0x00},
1422 {0xbe, 0x00},
1423 {0xbf, 0x00},
1424 {0xc0, 0x10},
1425 {0xc1, 0x20},
1426 {0xc2, 0x00},
1427 {0xc3, 0x20},
1428 {0xc4, 0x00},
1429 {0xc5, 0x2c},
1430 {0xc6, 0x1c},
1431 {0xc7, 0x10},
1432 {0xc8, 0x10},
1433 {0xc9, 0x01},
1434 {0xca, 0x68},
1435 {0xcb, 0xa7},
1436 {0xcc, 0x3c},
1437 {0xcd, 0x09},
1438 {0xce, 0x00},
1439 {0xcf, 0x20},
1440 {0xd0, 0x40},
1441 {0xd1, 0x10},
1442 {0xd2, 0x00},
1443 {0xd3, 0x00},
1444 {0xd4, 0x20},
1445 {0xd5, 0x28},
1446 {0xd6, 0xa0},
1447 {0xd7, 0x2a},
1448 {0xd8, 0x00},
1449 {0xd9, 0x00},
1450 {0xda, 0x00},
1451 {0xdb, 0x00},
1452 {0xdc, 0x00},
1453 {0xdd, 0x00},
1454 {0xde, 0x00},
1455 {0xdf, 0x00},
1456 {0xe0, 0x00},
1457 {0xe1, 0xd3},
1458 {0xe2, 0xc0},
1459 {0xe3, 0x00},
1460 {0xe4, 0x00},
1461 {0xe5, 0x10},
1462 {0xe6, 0x00},
1463 {0xe7, 0x12},
1464 {0xe8, 0x12},
1465 {0xe9, 0x34},
1466 {0xea, 0x00},
1467 {0xeb, 0xff},
1468 {0xec, 0x79},
1469 {0xed, 0x20},
1470 {0xee, 0x30},
1471 {0xef, 0x01},
1472 {0xf0, 0x00},
1473 {0xf1, 0x3e},
1474 {0xf2, 0x00},
1475 {0xf3, 0x00},
1476 {0xf4, 0x00},
1477 {0xf5, 0x00},
1478 {0xf6, 0x00},
1479 {0xf7, 0x00},
1480 {0xf8, 0x00},
1481 {0xf9, 0x00},
1482 {0xfa, 0x00},
1483 {0xfb, 0x00},
1484 {0xfc, 0x00},
1485 {0xfd, 0x00},
1486 {0xfe, 0x00},
1487 {0xff, 0x00},
1490 #define CB_VT3253B0_AGC 193
1491 /* For AIROHA */
1492 static unsigned char byVT3253B0_AGC[CB_VT3253B0_AGC][2] = {
1493 {0xF0, 0x00},
1494 {0xF1, 0x00},
1495 {0xF0, 0x80},
1496 {0xF0, 0x01},
1497 {0xF1, 0x00},
1498 {0xF0, 0x81},
1499 {0xF0, 0x02},
1500 {0xF1, 0x02},
1501 {0xF0, 0x82},
1502 {0xF0, 0x03},
1503 {0xF1, 0x04},
1504 {0xF0, 0x83},
1505 {0xF0, 0x03},
1506 {0xF1, 0x04},
1507 {0xF0, 0x84},
1508 {0xF0, 0x04},
1509 {0xF1, 0x06},
1510 {0xF0, 0x85},
1511 {0xF0, 0x05},
1512 {0xF1, 0x06},
1513 {0xF0, 0x86},
1514 {0xF0, 0x06},
1515 {0xF1, 0x06},
1516 {0xF0, 0x87},
1517 {0xF0, 0x07},
1518 {0xF1, 0x08},
1519 {0xF0, 0x88},
1520 {0xF0, 0x08},
1521 {0xF1, 0x08},
1522 {0xF0, 0x89},
1523 {0xF0, 0x09},
1524 {0xF1, 0x0A},
1525 {0xF0, 0x8A},
1526 {0xF0, 0x0A},
1527 {0xF1, 0x0A},
1528 {0xF0, 0x8B},
1529 {0xF0, 0x0B},
1530 {0xF1, 0x0C},
1531 {0xF0, 0x8C},
1532 {0xF0, 0x0C},
1533 {0xF1, 0x0C},
1534 {0xF0, 0x8D},
1535 {0xF0, 0x0D},
1536 {0xF1, 0x0E},
1537 {0xF0, 0x8E},
1538 {0xF0, 0x0E},
1539 {0xF1, 0x0E},
1540 {0xF0, 0x8F},
1541 {0xF0, 0x0F},
1542 {0xF1, 0x10},
1543 {0xF0, 0x90},
1544 {0xF0, 0x10},
1545 {0xF1, 0x10},
1546 {0xF0, 0x91},
1547 {0xF0, 0x11},
1548 {0xF1, 0x12},
1549 {0xF0, 0x92},
1550 {0xF0, 0x12},
1551 {0xF1, 0x12},
1552 {0xF0, 0x93},
1553 {0xF0, 0x13},
1554 {0xF1, 0x14},
1555 {0xF0, 0x94},
1556 {0xF0, 0x14},
1557 {0xF1, 0x14},
1558 {0xF0, 0x95},
1559 {0xF0, 0x15},
1560 {0xF1, 0x16},
1561 {0xF0, 0x96},
1562 {0xF0, 0x16},
1563 {0xF1, 0x16},
1564 {0xF0, 0x97},
1565 {0xF0, 0x17},
1566 {0xF1, 0x18},
1567 {0xF0, 0x98},
1568 {0xF0, 0x18},
1569 {0xF1, 0x18},
1570 {0xF0, 0x99},
1571 {0xF0, 0x19},
1572 {0xF1, 0x1A},
1573 {0xF0, 0x9A},
1574 {0xF0, 0x1A},
1575 {0xF1, 0x1A},
1576 {0xF0, 0x9B},
1577 {0xF0, 0x1B},
1578 {0xF1, 0x1C},
1579 {0xF0, 0x9C},
1580 {0xF0, 0x1C},
1581 {0xF1, 0x1C},
1582 {0xF0, 0x9D},
1583 {0xF0, 0x1D},
1584 {0xF1, 0x1E},
1585 {0xF0, 0x9E},
1586 {0xF0, 0x1E},
1587 {0xF1, 0x1E},
1588 {0xF0, 0x9F},
1589 {0xF0, 0x1F},
1590 {0xF1, 0x20},
1591 {0xF0, 0xA0},
1592 {0xF0, 0x20},
1593 {0xF1, 0x20},
1594 {0xF0, 0xA1},
1595 {0xF0, 0x21},
1596 {0xF1, 0x22},
1597 {0xF0, 0xA2},
1598 {0xF0, 0x22},
1599 {0xF1, 0x22},
1600 {0xF0, 0xA3},
1601 {0xF0, 0x23},
1602 {0xF1, 0x24},
1603 {0xF0, 0xA4},
1604 {0xF0, 0x24},
1605 {0xF1, 0x24},
1606 {0xF0, 0xA5},
1607 {0xF0, 0x25},
1608 {0xF1, 0x26},
1609 {0xF0, 0xA6},
1610 {0xF0, 0x26},
1611 {0xF1, 0x26},
1612 {0xF0, 0xA7},
1613 {0xF0, 0x27},
1614 {0xF1, 0x28},
1615 {0xF0, 0xA8},
1616 {0xF0, 0x28},
1617 {0xF1, 0x28},
1618 {0xF0, 0xA9},
1619 {0xF0, 0x29},
1620 {0xF1, 0x2A},
1621 {0xF0, 0xAA},
1622 {0xF0, 0x2A},
1623 {0xF1, 0x2A},
1624 {0xF0, 0xAB},
1625 {0xF0, 0x2B},
1626 {0xF1, 0x2C},
1627 {0xF0, 0xAC},
1628 {0xF0, 0x2C},
1629 {0xF1, 0x2C},
1630 {0xF0, 0xAD},
1631 {0xF0, 0x2D},
1632 {0xF1, 0x2E},
1633 {0xF0, 0xAE},
1634 {0xF0, 0x2E},
1635 {0xF1, 0x2E},
1636 {0xF0, 0xAF},
1637 {0xF0, 0x2F},
1638 {0xF1, 0x30},
1639 {0xF0, 0xB0},
1640 {0xF0, 0x30},
1641 {0xF1, 0x30},
1642 {0xF0, 0xB1},
1643 {0xF0, 0x31},
1644 {0xF1, 0x32},
1645 {0xF0, 0xB2},
1646 {0xF0, 0x32},
1647 {0xF1, 0x32},
1648 {0xF0, 0xB3},
1649 {0xF0, 0x33},
1650 {0xF1, 0x34},
1651 {0xF0, 0xB4},
1652 {0xF0, 0x34},
1653 {0xF1, 0x34},
1654 {0xF0, 0xB5},
1655 {0xF0, 0x35},
1656 {0xF1, 0x36},
1657 {0xF0, 0xB6},
1658 {0xF0, 0x36},
1659 {0xF1, 0x36},
1660 {0xF0, 0xB7},
1661 {0xF0, 0x37},
1662 {0xF1, 0x38},
1663 {0xF0, 0xB8},
1664 {0xF0, 0x38},
1665 {0xF1, 0x38},
1666 {0xF0, 0xB9},
1667 {0xF0, 0x39},
1668 {0xF1, 0x3A},
1669 {0xF0, 0xBA},
1670 {0xF0, 0x3A},
1671 {0xF1, 0x3A},
1672 {0xF0, 0xBB},
1673 {0xF0, 0x3B},
1674 {0xF1, 0x3C},
1675 {0xF0, 0xBC},
1676 {0xF0, 0x3C},
1677 {0xF1, 0x3C},
1678 {0xF0, 0xBD},
1679 {0xF0, 0x3D},
1680 {0xF1, 0x3E},
1681 {0xF0, 0xBE},
1682 {0xF0, 0x3E},
1683 {0xF1, 0x3E},
1684 {0xF0, 0xBF},
1685 {0xF0, 0x00},
1688 static const unsigned short awcFrameTime[MAX_RATE] = {
1689 10, 20, 55, 110, 24, 36, 48, 72, 96, 144, 192, 216
1692 /*--------------------- Export Variables --------------------------*/
1694 * Description: Calculate data frame transmitting time
1696 * Parameters:
1697 * In:
1698 * byPreambleType - Preamble Type
1699 * byPktType - PK_TYPE_11A, PK_TYPE_11B, PK_TYPE_11GB, PK_TYPE_11GA
1700 * cbFrameLength - Baseband Type
1701 * wRate - Tx Rate
1702 * Out:
1704 * Return Value: FrameTime
1707 unsigned int BBuGetFrameTime(unsigned char byPreambleType,
1708 unsigned char byPktType,
1709 unsigned int cbFrameLength, unsigned short wRate)
1711 unsigned int uFrameTime;
1712 unsigned int uPreamble;
1713 unsigned int uTmp;
1714 unsigned int uRateIdx = (unsigned int)wRate;
1715 unsigned int uRate = 0;
1717 if (uRateIdx > RATE_54M)
1718 return 0;
1720 uRate = (unsigned int)awcFrameTime[uRateIdx];
1722 if (uRateIdx <= 3) { /* CCK mode */
1723 if (byPreambleType == 1) /* Short */
1724 uPreamble = 96;
1725 else
1726 uPreamble = 192;
1728 uFrameTime = (cbFrameLength * 80) / uRate; /* ????? */
1729 uTmp = (uFrameTime * uRate) / 80;
1730 if (cbFrameLength != uTmp)
1731 uFrameTime++;
1733 return uPreamble + uFrameTime;
1735 uFrameTime = (cbFrameLength * 8 + 22) / uRate; /* ???????? */
1736 uTmp = ((uFrameTime * uRate) - 22) / 8;
1737 if (cbFrameLength != uTmp)
1738 uFrameTime++;
1740 uFrameTime = uFrameTime * 4; /* ??????? */
1741 if (byPktType != PK_TYPE_11A)
1742 uFrameTime += 6; /* ?????? */
1744 return 20 + uFrameTime; /* ?????? */
1748 * Description: Calculate Length, Service, and Signal fields of Phy for Tx
1750 * Parameters:
1751 * In:
1752 * priv - Device Structure
1753 * frame_length - Tx Frame Length
1754 * tx_rate - Tx Rate
1755 * Out:
1756 * struct vnt_phy_field *phy
1757 * - pointer to Phy Length field
1758 * - pointer to Phy Service field
1759 * - pointer to Phy Signal field
1761 * Return Value: none
1764 void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
1765 u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy)
1767 u32 bit_count;
1768 u32 count = 0;
1769 u32 tmp;
1770 int ext_bit;
1771 u8 preamble_type = priv->byPreambleType;
1773 bit_count = frame_length * 8;
1774 ext_bit = false;
1776 switch (tx_rate) {
1777 case RATE_1M:
1778 count = bit_count;
1780 phy->signal = 0x00;
1782 break;
1783 case RATE_2M:
1784 count = bit_count / 2;
1786 if (preamble_type == 1)
1787 phy->signal = 0x09;
1788 else
1789 phy->signal = 0x01;
1791 break;
1792 case RATE_5M:
1793 count = (bit_count * 10) / 55;
1794 tmp = (count * 55) / 10;
1796 if (tmp != bit_count)
1797 count++;
1799 if (preamble_type == 1)
1800 phy->signal = 0x0a;
1801 else
1802 phy->signal = 0x02;
1804 break;
1805 case RATE_11M:
1806 count = bit_count / 11;
1807 tmp = count * 11;
1809 if (tmp != bit_count) {
1810 count++;
1812 if ((bit_count - tmp) <= 3)
1813 ext_bit = true;
1816 if (preamble_type == 1)
1817 phy->signal = 0x0b;
1818 else
1819 phy->signal = 0x03;
1821 break;
1822 case RATE_6M:
1823 if (pkt_type == PK_TYPE_11A)
1824 phy->signal = 0x9b;
1825 else
1826 phy->signal = 0x8b;
1828 break;
1829 case RATE_9M:
1830 if (pkt_type == PK_TYPE_11A)
1831 phy->signal = 0x9f;
1832 else
1833 phy->signal = 0x8f;
1835 break;
1836 case RATE_12M:
1837 if (pkt_type == PK_TYPE_11A)
1838 phy->signal = 0x9a;
1839 else
1840 phy->signal = 0x8a;
1842 break;
1843 case RATE_18M:
1844 if (pkt_type == PK_TYPE_11A)
1845 phy->signal = 0x9e;
1846 else
1847 phy->signal = 0x8e;
1849 break;
1850 case RATE_24M:
1851 if (pkt_type == PK_TYPE_11A)
1852 phy->signal = 0x99;
1853 else
1854 phy->signal = 0x89;
1856 break;
1857 case RATE_36M:
1858 if (pkt_type == PK_TYPE_11A)
1859 phy->signal = 0x9d;
1860 else
1861 phy->signal = 0x8d;
1863 break;
1864 case RATE_48M:
1865 if (pkt_type == PK_TYPE_11A)
1866 phy->signal = 0x98;
1867 else
1868 phy->signal = 0x88;
1870 break;
1871 case RATE_54M:
1872 if (pkt_type == PK_TYPE_11A)
1873 phy->signal = 0x9c;
1874 else
1875 phy->signal = 0x8c;
1876 break;
1877 default:
1878 if (pkt_type == PK_TYPE_11A)
1879 phy->signal = 0x9c;
1880 else
1881 phy->signal = 0x8c;
1882 break;
1885 if (pkt_type == PK_TYPE_11B) {
1886 phy->service = 0x00;
1887 if (ext_bit)
1888 phy->service |= 0x80;
1889 phy->len = cpu_to_le16((u16)count);
1890 } else {
1891 phy->service = 0x00;
1892 phy->len = cpu_to_le16((u16)frame_length);
1897 * Description: Read a byte from BASEBAND, by embedded programming
1899 * Parameters:
1900 * In:
1901 * iobase - I/O base address
1902 * byBBAddr - address of register in Baseband
1903 * Out:
1904 * pbyData - data read
1906 * Return Value: true if succeeded; false if failed.
1909 bool BBbReadEmbedded(struct vnt_private *priv,
1910 unsigned char byBBAddr, unsigned char *pbyData)
1912 void __iomem *iobase = priv->PortOffset;
1913 unsigned short ww;
1914 unsigned char byValue;
1916 /* BB reg offset */
1917 VNSvOutPortB(iobase + MAC_REG_BBREGADR, byBBAddr);
1919 /* turn on REGR */
1920 MACvRegBitsOn(iobase, MAC_REG_BBREGCTL, BBREGCTL_REGR);
1921 /* W_MAX_TIMEOUT is the timeout period */
1922 for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
1923 VNSvInPortB(iobase + MAC_REG_BBREGCTL, &byValue);
1924 if (byValue & BBREGCTL_DONE)
1925 break;
1928 /* get BB data */
1929 VNSvInPortB(iobase + MAC_REG_BBREGDATA, pbyData);
1931 if (ww == W_MAX_TIMEOUT) {
1932 pr_debug(" DBG_PORT80(0x30)\n");
1933 return false;
1935 return true;
1939 * Description: Write a Byte to BASEBAND, by embedded programming
1941 * Parameters:
1942 * In:
1943 * iobase - I/O base address
1944 * byBBAddr - address of register in Baseband
1945 * byData - data to write
1946 * Out:
1947 * none
1949 * Return Value: true if succeeded; false if failed.
1952 bool BBbWriteEmbedded(struct vnt_private *priv,
1953 unsigned char byBBAddr, unsigned char byData)
1955 void __iomem *iobase = priv->PortOffset;
1956 unsigned short ww;
1957 unsigned char byValue;
1959 /* BB reg offset */
1960 VNSvOutPortB(iobase + MAC_REG_BBREGADR, byBBAddr);
1961 /* set BB data */
1962 VNSvOutPortB(iobase + MAC_REG_BBREGDATA, byData);
1964 /* turn on BBREGCTL_REGW */
1965 MACvRegBitsOn(iobase, MAC_REG_BBREGCTL, BBREGCTL_REGW);
1966 /* W_MAX_TIMEOUT is the timeout period */
1967 for (ww = 0; ww < W_MAX_TIMEOUT; ww++) {
1968 VNSvInPortB(iobase + MAC_REG_BBREGCTL, &byValue);
1969 if (byValue & BBREGCTL_DONE)
1970 break;
1973 if (ww == W_MAX_TIMEOUT) {
1974 pr_debug(" DBG_PORT80(0x31)\n");
1975 return false;
1977 return true;
1981 * Description: VIA VT3253 Baseband chip init function
1983 * Parameters:
1984 * In:
1985 * iobase - I/O base address
1986 * byRevId - Revision ID
1987 * byRFType - RF type
1988 * Out:
1989 * none
1991 * Return Value: true if succeeded; false if failed.
1995 bool BBbVT3253Init(struct vnt_private *priv)
1997 bool bResult = true;
1998 int ii;
1999 void __iomem *iobase = priv->PortOffset;
2000 unsigned char byRFType = priv->byRFType;
2001 unsigned char byLocalID = priv->byLocalID;
2003 if (byRFType == RF_RFMD2959) {
2004 if (byLocalID <= REV_ID_VT3253_A1) {
2005 for (ii = 0; ii < CB_VT3253_INIT_FOR_RFMD; ii++)
2006 bResult &= BBbWriteEmbedded(priv,
2007 byVT3253InitTab_RFMD[ii][0],
2008 byVT3253InitTab_RFMD[ii][1]);
2010 } else {
2011 for (ii = 0; ii < CB_VT3253B0_INIT_FOR_RFMD; ii++)
2012 bResult &= BBbWriteEmbedded(priv,
2013 byVT3253B0_RFMD[ii][0],
2014 byVT3253B0_RFMD[ii][1]);
2016 for (ii = 0; ii < CB_VT3253B0_AGC_FOR_RFMD2959; ii++)
2017 bResult &= BBbWriteEmbedded(priv,
2018 byVT3253B0_AGC4_RFMD2959[ii][0],
2019 byVT3253B0_AGC4_RFMD2959[ii][1]);
2021 VNSvOutPortD(iobase + MAC_REG_ITRTMSET, 0x23);
2022 MACvRegBitsOn(iobase, MAC_REG_PAPEDELAY, BIT(0));
2024 priv->abyBBVGA[0] = 0x18;
2025 priv->abyBBVGA[1] = 0x0A;
2026 priv->abyBBVGA[2] = 0x0;
2027 priv->abyBBVGA[3] = 0x0;
2028 priv->ldBmThreshold[0] = -70;
2029 priv->ldBmThreshold[1] = -50;
2030 priv->ldBmThreshold[2] = 0;
2031 priv->ldBmThreshold[3] = 0;
2032 } else if ((byRFType == RF_AIROHA) || (byRFType == RF_AL2230S)) {
2033 for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++)
2034 bResult &= BBbWriteEmbedded(priv,
2035 byVT3253B0_AIROHA2230[ii][0],
2036 byVT3253B0_AIROHA2230[ii][1]);
2038 for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
2039 bResult &= BBbWriteEmbedded(priv,
2040 byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
2042 priv->abyBBVGA[0] = 0x1C;
2043 priv->abyBBVGA[1] = 0x10;
2044 priv->abyBBVGA[2] = 0x0;
2045 priv->abyBBVGA[3] = 0x0;
2046 priv->ldBmThreshold[0] = -70;
2047 priv->ldBmThreshold[1] = -48;
2048 priv->ldBmThreshold[2] = 0;
2049 priv->ldBmThreshold[3] = 0;
2050 } else if (byRFType == RF_UW2451) {
2051 for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++)
2052 bResult &= BBbWriteEmbedded(priv,
2053 byVT3253B0_UW2451[ii][0],
2054 byVT3253B0_UW2451[ii][1]);
2056 for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
2057 bResult &= BBbWriteEmbedded(priv,
2058 byVT3253B0_AGC[ii][0],
2059 byVT3253B0_AGC[ii][1]);
2061 VNSvOutPortB(iobase + MAC_REG_ITRTMSET, 0x23);
2062 MACvRegBitsOn(iobase, MAC_REG_PAPEDELAY, BIT(0));
2064 priv->abyBBVGA[0] = 0x14;
2065 priv->abyBBVGA[1] = 0x0A;
2066 priv->abyBBVGA[2] = 0x0;
2067 priv->abyBBVGA[3] = 0x0;
2068 priv->ldBmThreshold[0] = -60;
2069 priv->ldBmThreshold[1] = -50;
2070 priv->ldBmThreshold[2] = 0;
2071 priv->ldBmThreshold[3] = 0;
2072 } else if (byRFType == RF_UW2452) {
2073 for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++)
2074 bResult &= BBbWriteEmbedded(priv,
2075 byVT3253B0_UW2451[ii][0],
2076 byVT3253B0_UW2451[ii][1]);
2078 /* Init ANT B select,
2079 * TX Config CR09 = 0x61->0x45,
2080 * 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
2083 /*bResult &= BBbWriteEmbedded(iobase,0x09,0x41);*/
2085 /* Init ANT B select,
2086 * RX Config CR10 = 0x28->0x2A,
2087 * 0x2A->0x28(VC1/VC2 define,
2088 * make the ANT_A, ANT_B inverted)
2091 /*bResult &= BBbWriteEmbedded(iobase,0x0a,0x28);*/
2092 /* Select VC1/VC2, CR215 = 0x02->0x06 */
2093 bResult &= BBbWriteEmbedded(priv, 0xd7, 0x06);
2095 /* {{RobertYu:20050125, request by Jack */
2096 bResult &= BBbWriteEmbedded(priv, 0x90, 0x20);
2097 bResult &= BBbWriteEmbedded(priv, 0x97, 0xeb);
2098 /* }} */
2100 /* {{RobertYu:20050221, request by Jack */
2101 bResult &= BBbWriteEmbedded(priv, 0xa6, 0x00);
2102 bResult &= BBbWriteEmbedded(priv, 0xa8, 0x30);
2103 /* }} */
2104 bResult &= BBbWriteEmbedded(priv, 0xb0, 0x58);
2106 for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
2107 bResult &= BBbWriteEmbedded(priv,
2108 byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
2110 priv->abyBBVGA[0] = 0x14;
2111 priv->abyBBVGA[1] = 0x0A;
2112 priv->abyBBVGA[2] = 0x0;
2113 priv->abyBBVGA[3] = 0x0;
2114 priv->ldBmThreshold[0] = -60;
2115 priv->ldBmThreshold[1] = -50;
2116 priv->ldBmThreshold[2] = 0;
2117 priv->ldBmThreshold[3] = 0;
2118 /* }} RobertYu */
2120 } else if (byRFType == RF_VT3226) {
2121 for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++)
2122 bResult &= BBbWriteEmbedded(priv,
2123 byVT3253B0_AIROHA2230[ii][0],
2124 byVT3253B0_AIROHA2230[ii][1]);
2126 for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
2127 bResult &= BBbWriteEmbedded(priv,
2128 byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
2130 priv->abyBBVGA[0] = 0x1C;
2131 priv->abyBBVGA[1] = 0x10;
2132 priv->abyBBVGA[2] = 0x0;
2133 priv->abyBBVGA[3] = 0x0;
2134 priv->ldBmThreshold[0] = -70;
2135 priv->ldBmThreshold[1] = -48;
2136 priv->ldBmThreshold[2] = 0;
2137 priv->ldBmThreshold[3] = 0;
2138 /* Fix VT3226 DFC system timing issue */
2139 MACvSetRFLE_LatchBase(iobase);
2140 /* {{ RobertYu: 20050104 */
2141 } else if (byRFType == RF_AIROHA7230) {
2142 for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++)
2143 bResult &= BBbWriteEmbedded(priv,
2144 byVT3253B0_AIROHA2230[ii][0],
2145 byVT3253B0_AIROHA2230[ii][1]);
2147 /* {{ RobertYu:20050223, request by JerryChung */
2148 /* Init ANT B select,TX Config CR09 = 0x61->0x45,
2149 * 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
2151 /*bResult &= BBbWriteEmbedded(iobase,0x09,0x41);*/
2152 /* Init ANT B select,RX Config CR10 = 0x28->0x2A,
2153 * 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
2155 /*bResult &= BBbWriteEmbedded(iobase,0x0a,0x28);*/
2156 /* Select VC1/VC2, CR215 = 0x02->0x06 */
2157 bResult &= BBbWriteEmbedded(priv, 0xd7, 0x06);
2158 /* }} */
2160 for (ii = 0; ii < CB_VT3253B0_AGC; ii++)
2161 bResult &= BBbWriteEmbedded(priv,
2162 byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
2164 priv->abyBBVGA[0] = 0x1C;
2165 priv->abyBBVGA[1] = 0x10;
2166 priv->abyBBVGA[2] = 0x0;
2167 priv->abyBBVGA[3] = 0x0;
2168 priv->ldBmThreshold[0] = -70;
2169 priv->ldBmThreshold[1] = -48;
2170 priv->ldBmThreshold[2] = 0;
2171 priv->ldBmThreshold[3] = 0;
2172 /* }} RobertYu */
2173 } else {
2174 /* No VGA Table now */
2175 priv->bUpdateBBVGA = false;
2176 priv->abyBBVGA[0] = 0x1C;
2179 if (byLocalID > REV_ID_VT3253_A1) {
2180 BBbWriteEmbedded(priv, 0x04, 0x7F);
2181 BBbWriteEmbedded(priv, 0x0D, 0x01);
2184 return bResult;
2188 * Description: Set ShortSlotTime mode
2190 * Parameters:
2191 * In:
2192 * priv - Device Structure
2193 * Out:
2194 * none
2196 * Return Value: none
2199 void
2200 BBvSetShortSlotTime(struct vnt_private *priv)
2202 unsigned char byBBRxConf = 0;
2203 unsigned char byBBVGA = 0;
2205 BBbReadEmbedded(priv, 0x0A, &byBBRxConf); /* CR10 */
2207 if (priv->bShortSlotTime)
2208 byBBRxConf &= 0xDF; /* 1101 1111 */
2209 else
2210 byBBRxConf |= 0x20; /* 0010 0000 */
2212 /* patch for 3253B0 Baseband with Cardbus module */
2213 BBbReadEmbedded(priv, 0xE7, &byBBVGA);
2214 if (byBBVGA == priv->abyBBVGA[0])
2215 byBBRxConf |= 0x20; /* 0010 0000 */
2217 BBbWriteEmbedded(priv, 0x0A, byBBRxConf); /* CR10 */
2220 void BBvSetVGAGainOffset(struct vnt_private *priv, unsigned char byData)
2222 unsigned char byBBRxConf = 0;
2224 BBbWriteEmbedded(priv, 0xE7, byData);
2226 BBbReadEmbedded(priv, 0x0A, &byBBRxConf); /* CR10 */
2227 /* patch for 3253B0 Baseband with Cardbus module */
2228 if (byData == priv->abyBBVGA[0])
2229 byBBRxConf |= 0x20; /* 0010 0000 */
2230 else if (priv->bShortSlotTime)
2231 byBBRxConf &= 0xDF; /* 1101 1111 */
2232 else
2233 byBBRxConf |= 0x20; /* 0010 0000 */
2234 priv->byBBVGACurrent = byData;
2235 BBbWriteEmbedded(priv, 0x0A, byBBRxConf); /* CR10 */
2239 * Description: Baseband SoftwareReset
2241 * Parameters:
2242 * In:
2243 * iobase - I/O base address
2244 * Out:
2245 * none
2247 * Return Value: none
2250 void
2251 BBvSoftwareReset(struct vnt_private *priv)
2253 BBbWriteEmbedded(priv, 0x50, 0x40);
2254 BBbWriteEmbedded(priv, 0x50, 0);
2255 BBbWriteEmbedded(priv, 0x9C, 0x01);
2256 BBbWriteEmbedded(priv, 0x9C, 0);
2260 * Description: Baseband Power Save Mode ON
2262 * Parameters:
2263 * In:
2264 * iobase - I/O base address
2265 * Out:
2266 * none
2268 * Return Value: none
2271 void
2272 BBvPowerSaveModeON(struct vnt_private *priv)
2274 unsigned char byOrgData;
2276 BBbReadEmbedded(priv, 0x0D, &byOrgData);
2277 byOrgData |= BIT(0);
2278 BBbWriteEmbedded(priv, 0x0D, byOrgData);
2282 * Description: Baseband Power Save Mode OFF
2284 * Parameters:
2285 * In:
2286 * iobase - I/O base address
2287 * Out:
2288 * none
2290 * Return Value: none
2293 void
2294 BBvPowerSaveModeOFF(struct vnt_private *priv)
2296 unsigned char byOrgData;
2298 BBbReadEmbedded(priv, 0x0D, &byOrgData);
2299 byOrgData &= ~(BIT(0));
2300 BBbWriteEmbedded(priv, 0x0D, byOrgData);
2304 * Description: Set Tx Antenna mode
2306 * Parameters:
2307 * In:
2308 * priv - Device Structure
2309 * byAntennaMode - Antenna Mode
2310 * Out:
2311 * none
2313 * Return Value: none
2317 void
2318 BBvSetTxAntennaMode(struct vnt_private *priv, unsigned char byAntennaMode)
2320 unsigned char byBBTxConf;
2322 BBbReadEmbedded(priv, 0x09, &byBBTxConf); /* CR09 */
2323 if (byAntennaMode == ANT_DIVERSITY) {
2324 /* bit 1 is diversity */
2325 byBBTxConf |= 0x02;
2326 } else if (byAntennaMode == ANT_A) {
2327 /* bit 2 is ANTSEL */
2328 byBBTxConf &= 0xF9; /* 1111 1001 */
2329 } else if (byAntennaMode == ANT_B) {
2330 byBBTxConf &= 0xFD; /* 1111 1101 */
2331 byBBTxConf |= 0x04;
2333 BBbWriteEmbedded(priv, 0x09, byBBTxConf); /* CR09 */
2337 * Description: Set Rx Antenna mode
2339 * Parameters:
2340 * In:
2341 * priv - Device Structure
2342 * byAntennaMode - Antenna Mode
2343 * Out:
2344 * none
2346 * Return Value: none
2350 void
2351 BBvSetRxAntennaMode(struct vnt_private *priv, unsigned char byAntennaMode)
2353 unsigned char byBBRxConf;
2355 BBbReadEmbedded(priv, 0x0A, &byBBRxConf); /* CR10 */
2356 if (byAntennaMode == ANT_DIVERSITY) {
2357 byBBRxConf |= 0x01;
2359 } else if (byAntennaMode == ANT_A) {
2360 byBBRxConf &= 0xFC; /* 1111 1100 */
2361 } else if (byAntennaMode == ANT_B) {
2362 byBBRxConf &= 0xFE; /* 1111 1110 */
2363 byBBRxConf |= 0x02;
2365 BBbWriteEmbedded(priv, 0x0A, byBBRxConf); /* CR10 */
2369 * Description: BBvSetDeepSleep
2371 * Parameters:
2372 * In:
2373 * priv - Device Structure
2374 * Out:
2375 * none
2377 * Return Value: none
2380 void
2381 BBvSetDeepSleep(struct vnt_private *priv, unsigned char byLocalID)
2383 BBbWriteEmbedded(priv, 0x0C, 0x17); /* CR12 */
2384 BBbWriteEmbedded(priv, 0x0D, 0xB9); /* CR13 */
2387 void
2388 BBvExitDeepSleep(struct vnt_private *priv, unsigned char byLocalID)
2390 BBbWriteEmbedded(priv, 0x0C, 0x00); /* CR12 */
2391 BBbWriteEmbedded(priv, 0x0D, 0x01); /* CR13 */