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