1 /******************************************************************************
2 *
3 * Copyright(c) 2007 - 2017 Realtek Corporation.
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 "Mp_Precomp.h" */
17 /* #include "../odm_precomp.h" */
18
19 #include <drv_types.h>
20
21 #include "HalEfuseMask8188F_SDIO.h"
22
23
24
25 /******************************************************************************
26 * MSDIO.TXT
27 ******************************************************************************/
28
29 u8 Array_MP_8188F_MSDIO[] = {
30 0xFF,
31 0xF3,
32 0x00,
33 0x00,
34 0x00,
35 0x00,
36 0x00,
37 0x00,
38 0x00,
39 0x00,
40 0x00,
41 0x0F,
42 0xF1,
43 0xFF,
44 0xFF,
45 0xFF,
46 0xFF,
47 0xFF,
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
63 };
64
65 u16
EFUSE_GetArrayLen_MP_8188F_MSDIO(void)66 EFUSE_GetArrayLen_MP_8188F_MSDIO(void)
67 {
68 return sizeof(Array_MP_8188F_MSDIO) / sizeof(u8);
69 }
70
71 void
EFUSE_GetMaskArray_MP_8188F_MSDIO(u8 * Array)72 EFUSE_GetMaskArray_MP_8188F_MSDIO(
73 u8 *Array
74 )
75 {
76 u16 len = EFUSE_GetArrayLen_MP_8188F_MSDIO(), i = 0;
77
78 for (i = 0; i < len; ++i)
79 Array[i] = Array_MP_8188F_MSDIO[i];
80 }
81 BOOLEAN
EFUSE_IsAddressMasked_MP_8188F_MSDIO(u16 Offset)82 EFUSE_IsAddressMasked_MP_8188F_MSDIO(
83 u16 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_8188F_MSDIO[r] & (0x10 << c));
92 else
93 result = (Array_MP_8188F_MSDIO[r] & (0x01 << (c - 4)));
94
95 return (result > 0) ? 0 : 1;
96 }
97