8723BU: Update 8723BU wifi driver to version v4.3.16_14189.20150519_BTCOEX2015119...
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723bu / hal / efuse / rtl8723b / HalEfuseMask8723B_USB.c
1 /****************************************************************************** \r
2\r
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. \r
4\r
5 * This program is free software; you can redistribute it and/or modify it \r
6 * under the terms of version 2 of the GNU General Public License as \r
7 * published by the Free Software Foundation. \r
8\r
9 * This program is distributed in the hope that it will be useful, but WITHOUT \r
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \r
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for \r
12 * more details. \r
13\r
14 * You should have received a copy of the GNU General Public License along with \r
15 * this program; if not, write to the Free Software Foundation, Inc., \r
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA \r
17\r
18\r
19 ******************************************************************************/\r
20 \r
21 //#include "Mp_Precomp.h"\r
22 //#include "../odm_precomp.h"\r
23 \r
24 #include <drv_types.h>\r
25 #include "../../../hal/OUTSRC/phydm_precomp.h"\r
26 #include "HalEfuseMask8723B_USB.h"\r
27 /******************************************************************************\r
28 *                           MUSB.TXT\r
29 ******************************************************************************/\r
30 \r
31 u1Byte Array_MP_8723B_MUSB[] = { \r
32                 0xFF,\r
33                 0xF3,\r
34                 0x00,\r
35                 0x0E,\r
36                 0x70,\r
37                 0x00,\r
38                 0x00,\r
39                 0x00,\r
40                 0x00,\r
41                 0x00,\r
42                 0x00,\r
43                 0x07,\r
44                 0xF1,\r
45                 0x00,\r
46                 0x00,\r
47                 0x00,\r
48                 0xFF,\r
49                 0xFF,\r
50                 0xFF,\r
51                 0xFF,\r
52                 0xB0,\r
53                 0x00,\r
54                 0x00,\r
55                 0x00,\r
56                 0x00,\r
57                 0x00,\r
58                 0x00,\r
59                 0x00,\r
60                 0x00,\r
61                 0x00,\r
62                 0x00,\r
63                 0x00,\r
64 \r
65 };\r
66 \r
67 u2Byte\r
68 EFUSE_GetArrayLen_MP_8723B_MUSB(VOID)\r
69 {\r
70         return sizeof(Array_MP_8723B_MUSB)/sizeof(u1Byte);\r
71 }\r
72 \r
73 VOID\r
74 EFUSE_GetMaskArray_MP_8723B_MUSB(\r
75         IN      OUT pu1Byte Array\r
76         )\r
77 {\r
78         u2Byte len = EFUSE_GetArrayLen_MP_8723B_MUSB(), i = 0;\r
79 \r
80         for (i = 0; i < len; ++i)\r
81            Array[i] = Array_MP_8723B_MUSB[i];\r
82 }\r
83 BOOLEAN\r
84 EFUSE_IsAddressMasked_MP_8723B_MUSB(\r
85         IN   u2Byte  Offset\r
86         )\r
87 {\r
88         int r = Offset/16;\r
89         int c = (Offset%16) / 2;\r
90         int result = 0;\r
91 \r
92         if (c < 4) // Upper double word\r
93             result = (Array_MP_8723B_MUSB[r] & (0x10 << c));\r
94         else\r
95             result = (Array_MP_8723B_MUSB[r] & (0x01 << (c-4)));\r
96 \r
97         return (result > 0) ? 0 : 1;\r
98 }\r
99 \r
100 \r