net: wireless: rockchip_wlan: add rtl8723ds support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723ds / hal / efuse / rtl8723d / HalEfuseMask8723D_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 <drv_types.h>
23
24 #include "HalEfuseMask8723D_PCIE.h"
25
26 /******************************************************************************
27 *                           MPCIE.TXT
28 ******************************************************************************/
29
30 u1Byte Array_MP_8723D_MPCIE[] = {
31         0xFF,
32         0xF3,
33         0x00,
34         0x0E,
35         0x70,
36         0x00,
37         0x00,
38         0x00,
39         0x00,
40         0x00,
41         0x00,
42         0x07,
43         0xF3,
44         0xFF,
45         0xFF,
46         0x7C,
47         0x70,
48         0x00,
49         0x00,
50         0x00,
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 };
64
65 u2Byte
66 EFUSE_GetArrayLen_MP_8723D_MPCIE(VOID)
67 {
68         return sizeof(Array_MP_8723D_MPCIE) / sizeof(u1Byte);
69 }
70
71 VOID
72 EFUSE_GetMaskArray_MP_8723D_MPCIE(
73         IN      OUT pu1Byte Array
74 )
75 {
76         u2Byte len = EFUSE_GetArrayLen_MP_8723D_MPCIE(), i = 0;
77
78         for (i = 0; i < len; ++i)
79                 Array[i] = Array_MP_8723D_MPCIE[i];
80 }
81 BOOLEAN
82 EFUSE_IsAddressMasked_MP_8723D_MPCIE(
83         IN   u2Byte  Offset
84 )
85 {
86         int r = Offset / 16;
87         int c = (Offset % 16) / 2;
88         int result = 0;
89
90         if (c < 4) /* Upper double word */
91                 result = (Array_MP_8723D_MPCIE[r] & (0x10 << c));
92         else
93                 result = (Array_MP_8723D_MPCIE[r] & (0x01 << (c - 4)));
94
95         return (result > 0) ? 0 : 1;
96 }