net: wireless: rockchip_wlan: add rtl8188eu support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8188eu / hal / efuse / rtl8188e / HalEfuseMask8188E_PCIE.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 * You should have received a copy of the GNU General Public License along with 
15 * this program; if not, write to the Free Software Foundation, Inc., 
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 
17
18
19 ******************************************************************************/
20
21 //#include "Mp_Precomp.h"
22 //#include "../odm_precomp.h"
23
24 #include <drv_types.h>
25
26 #include "HalEfuseMask8188E_PCIE.h"
27
28
29
30 /******************************************************************************
31 *                           MPCIE.TXT
32 ******************************************************************************/
33
34 u1Byte Array_MP_8188E_MPCIE[] = { 
35                 0xFF,
36                 0xF3,
37                 0x00,
38                 0x00,
39                 0x00,
40                 0x00,
41                 0x00,
42                 0x00,
43                 0x00,
44                 0x00,
45                 0x00,
46                 0x0F,
47                 0xF1,
48                 0xFF,
49                 0xFF,
50                 0x70,
51                 0x00,
52                 0x00,
53                 0x00,
54                 0x00,
55                 0x00,
56                 0x00,
57                 0x00,
58                 0x00,
59                 0x00,
60                 0x00,
61                 0x00,
62                 0x00,
63                 0x00,
64                 0x00,
65                 0x00,
66                 0x00,
67
68 };
69
70 u2Byte
71 EFUSE_GetArrayLen_MP_8188E_MPCIE(VOID)
72 {
73         return sizeof(Array_MP_8188E_MPCIE)/sizeof(u1Byte);
74 }
75
76 VOID
77 EFUSE_GetMaskArray_MP_8188E_MPCIE(
78         IN      OUT pu1Byte Array
79         )
80 {
81         u2Byte len = EFUSE_GetArrayLen_MP_8188E_MPCIE(), i = 0;
82
83         for (i = 0; i < len; ++i)
84            Array[i] = Array_MP_8188E_MPCIE[i];
85 }
86 BOOLEAN
87 EFUSE_IsAddressMasked_MP_8188E_MPCIE(
88         IN   u2Byte  Offset
89         )
90 {
91         int r = Offset/16;
92         int c = (Offset%16) / 2;
93         int result = 0;
94
95         if (c < 4) // Upper double word
96             result = (Array_MP_8188E_MPCIE[r] & (0x10 << c));
97         else
98             result = (Array_MP_8188E_MPCIE[r] & (0x01 << (c-4)));
99
100         return (result > 0) ? 0 : 1;
101 }
102
103