Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/efuse/rtl8814a/HalEfuseMask8814A_PCIE.c
1308 views
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
#include <drv_types.h>
16
17
#include "HalEfuseMask8814A_PCIE.h"
18
19
/******************************************************************************
20
* MPCIE.TXT
21
******************************************************************************/
22
23
u8 Array_MP_8814A_MPCIE[] = {
24
0xFF,
25
0xFF,
26
0xFF,
27
0xFF,
28
0xFF,
29
0xFF,
30
0xFF,
31
0xFF,
32
0xFF,
33
0xFF,
34
0xFF,
35
0xFF,
36
0xFF,
37
0xFF,
38
0x10,
39
0x00,
40
0x00,
41
0x00,
42
0xF0,
43
0x00,
44
0x00,
45
0x00,
46
0x00,
47
0x00,
48
0x00,
49
0x00,
50
0x00,
51
0x00,
52
0x00,
53
0x00,
54
0x00,
55
0x00,
56
57
};
58
59
u16
60
EFUSE_GetArrayLen_MP_8814A_MPCIE(void)
61
{
62
return sizeof(Array_MP_8814A_MPCIE) / sizeof(u8);
63
}
64
65
void
66
EFUSE_GetMaskArray_MP_8814A_MPCIE(u8 *Array)
67
{
68
u16 len = EFUSE_GetArrayLen_MP_8814A_MPCIE(), i = 0;
69
70
for (i = 0; i < len; ++i)
71
Array[i] = Array_MP_8814A_MPCIE[i];
72
}
73
74
BOOLEAN
75
EFUSE_IsAddressMasked_MP_8814A_MPCIE(u16 Offset)
76
{
77
int r = Offset / 16;
78
int c = (Offset % 16) / 2;
79
int result = 0;
80
81
if (c < 4) /*Upper double word*/
82
result = (Array_MP_8814A_MPCIE[r] & (0x10 << c));
83
else
84
result = (Array_MP_8814A_MPCIE[r] & (0x01 << (c - 4)));
85
86
return (result > 0) ? 0 : 1;
87
}
88
89