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 #include "HalEfuseMask8703B_PCIE.h"
21
22
23 /******************************************************************************
24 * MPCIE.TXT
25 ******************************************************************************/
26
27 u8 Array_MP_8703B_MPCIE[] = {
28 0xFF,
29 0xF3,
30 0x00,
31 0x0E,
32 0x70,
33 0x00,
34 0x00,
35 0x00,
36 0x00,
37 0x00,
38 0x00,
39 0x07,
40 0xF3,
41 0xFF,
42 0xFF,
43 0xFF,
44 0xFF,
45 0xFF,
46 0xF1,
47 0x00,
48 0x80,
49 0x00,
50 0x00,
51 0x00,
52 0x00,
53 0x00,
54 0x00,
55 0x00,
56 0x00,
57 0x00,
58 0x00,
59 0x00,
60
61 };
62
63 u16
EFUSE_GetArrayLen_MP_8703B_MPCIE(void)64 EFUSE_GetArrayLen_MP_8703B_MPCIE(void)
65 {
66 return sizeof(Array_MP_8703B_MPCIE) / sizeof(u8);
67 }
68
69 void
EFUSE_GetMaskArray_MP_8703B_MPCIE(u8 * Array)70 EFUSE_GetMaskArray_MP_8703B_MPCIE(
71 u8 *Array
72 )
73 {
74 u16 len = EFUSE_GetArrayLen_MP_8703B_MPCIE(), i = 0;
75
76 for (i = 0; i < len; ++i)
77 Array[i] = Array_MP_8703B_MPCIE[i];
78 }
79 BOOLEAN
EFUSE_IsAddressMasked_MP_8703B_MPCIE(u16 Offset)80 EFUSE_IsAddressMasked_MP_8703B_MPCIE(
81 u16 Offset
82 )
83 {
84 int r = Offset / 16;
85 int c = (Offset % 16) / 2;
86 int result = 0;
87
88 if (c < 4) /* Upper double word */
89 result = (Array_MP_8703B_MPCIE[r] & (0x10 << c));
90 else
91 result = (Array_MP_8703B_MPCIE[r] & (0x01 << (c - 4)));
92
93 return (result > 0) ? 0 : 1;
94 }
95