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_USB.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_USB.h"
18
19
/******************************************************************************
20
* MUSB.TXT
21
******************************************************************************/
22
23
u8 Array_MP_8814A_MUSB[] = {
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
0x7F,
38
0xFF,
39
0xFF,
40
0xFF,
41
0x70,
42
0xF4,
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 EFUSE_GetArrayLen_MP_8814A_MUSB(void)
60
{
61
return sizeof(Array_MP_8814A_MUSB) / sizeof(u8);
62
}
63
64
void EFUSE_GetMaskArray_MP_8814A_MUSB(u8 *Array)
65
{
66
u16 len = EFUSE_GetArrayLen_MP_8814A_MUSB(), i = 0;
67
68
for (i = 0; i < len; ++i)
69
Array[i] = Array_MP_8814A_MUSB[i];
70
}
71
72
BOOLEAN EFUSE_IsAddressMasked_MP_8814A_MUSB(u16 Offset)
73
{
74
int r = Offset / 16;
75
int c = (Offset % 16) / 2;
76
int result = 0;
77
78
if (c < 4) /*Upper double word*/
79
result = (Array_MP_8814A_MUSB[r] & (0x10 << c));
80
else
81
result = (Array_MP_8814A_MUSB[r] & (0x01 << (c - 4)));
82
83
return (result > 0) ? 0 : 1;
84
}
85
86