OSDN Git Service

staging: rtl8723bs: update to the latest driver
[android-x86/kernel.git] / drivers / staging / rtl8723bs / hal / odm_RTL8723B.c
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  ******************************************************************************/
15
16 #include "odm_precomp.h"
17
18  s8
19 odm_CCKRSSI_8723B(
20         u8 LNA_idx,
21         u8 VGA_idx
22         )
23 {
24         s8      rx_pwr_all = 0x00;
25         switch (LNA_idx)
26         {
27                 /* 46  53 73 95 201301231630 */
28                 /*  46 53 77 99 201301241630 */
29
30                 case 6:
31                         rx_pwr_all = -34 - (2 * VGA_idx);
32                         break;
33                 case 4:
34                         rx_pwr_all = -14 - (2 * VGA_idx);
35                         break;
36                 case 1:
37                         rx_pwr_all = 6 - (2 * VGA_idx);
38                         break;
39                 case 0:
40                         rx_pwr_all = 16 - (2 * VGA_idx);
41                         break;
42                 default:
43                         /* rx_pwr_all = -53+(2*(31-VGA_idx)); */
44                         /* DbgPrint("wrong LNA index\n"); */
45                         break;
46
47         }
48         return  rx_pwr_all;
49 }