1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef __RTW_EEPROM_H__
16#define __RTW_EEPROM_H__
17
18#include <osdep_service.h>
19#include <drv_types.h>
20
21#define RTL8712_EEPROM_ID 0x8712
22
23#define HWSET_MAX_SIZE_512 512
24#define EEPROM_MAX_SIZE HWSET_MAX_SIZE_512
25
26#define CLOCK_RATE 50
27
28
29#define EEPROM_READ_OPCODE 06
30#define EEPROM_WRITE_OPCODE 05
31#define EEPROM_ERASE_OPCODE 07
32#define EEPROM_EWEN_OPCODE 19
33#define EEPROM_EWDS_OPCODE 16
34
35
36#define USA 0x555320
37#define EUROPE 0x1
38#define JAPAN 0x2
39
40#define EEPROM_CID_DEFAULT 0x0
41#define EEPROM_CID_ALPHA 0x1
42#define EEPROM_CID_Senao 0x3
43#define EEPROM_CID_NetCore 0x5
44#define EEPROM_CID_CAMEO 0X8
45#define EEPROM_CID_SITECOM 0x9
46#define EEPROM_CID_COREGA 0xB
47#define EEPROM_CID_EDIMAX_BELK 0xC
48#define EEPROM_CID_SERCOMM_BELK 0xE
49#define EEPROM_CID_CAMEO1 0xF
50#define EEPROM_CID_WNC_COREGA 0x12
51#define EEPROM_CID_CLEVO 0x13
52#define EEPROM_CID_WHQL 0xFE
53
54
55
56
57
58
59
60
61
62enum RT_CUSTOMER_ID {
63 RT_CID_DEFAULT = 0,
64 RT_CID_8187_ALPHA0 = 1,
65 RT_CID_8187_SERCOMM_PS = 2,
66 RT_CID_8187_HW_LED = 3,
67 RT_CID_8187_NETGEAR = 4,
68 RT_CID_WHQL = 5,
69 RT_CID_819x_CAMEO = 6,
70 RT_CID_819x_RUNTOP = 7,
71 RT_CID_819x_Senao = 8,
72 RT_CID_TOSHIBA = 9,
73 RT_CID_819x_Netcore = 10,
74 RT_CID_Nettronix = 11,
75 RT_CID_DLINK = 12,
76 RT_CID_PRONET = 13,
77 RT_CID_COREGA = 14,
78 RT_CID_CHINA_MOBILE = 15,
79 RT_CID_819x_ALPHA = 16,
80 RT_CID_819x_Sitecom = 17,
81 RT_CID_CCX = 18,
82
83
84
85 RT_CID_819x_Lenovo = 19,
86 RT_CID_819x_QMI = 20,
87 RT_CID_819x_Edimax_Belkin = 21,
88 RT_CID_819x_Sercomm_Belkin = 22,
89 RT_CID_819x_CAMEO1 = 23,
90 RT_CID_819x_MSI = 24,
91 RT_CID_819x_Acer = 25,
92 RT_CID_819x_AzWave_ASUS = 26,
93 RT_CID_819x_AzWave = 27,
94
95
96 RT_CID_819x_HP = 28,
97 RT_CID_819x_WNC_COREGA = 29,
98 RT_CID_819x_Arcadyan_Belkin = 30,
99 RT_CID_819x_SAMSUNG = 31,
100 RT_CID_819x_CLEVO = 32,
101 RT_CID_819x_DELL = 33,
102 RT_CID_819x_PRONETS = 34,
103 RT_CID_819x_Edimax_ASUS = 35,
104 RT_CID_819x_CAMEO_NETGEAR = 36,
105 RT_CID_PLANEX = 37,
106 RT_CID_CC_C = 38,
107 RT_CID_819x_Xavi = 39,
108 RT_CID_819x_FUNAI_TV = 40,
109 RT_CID_819x_ALPHA_WD = 41,
110};
111
112struct eeprom_priv {
113 u8 bautoload_fail_flag;
114 u8 bloadfile_fail_flag;
115 u8 bloadmac_fail_flag;
116 u8 mac_addr[6];
117 u16 channel_plan;
118 u8 EepromOrEfuse;
119 u8 efuse_eeprom_data[HWSET_MAX_SIZE_512];
120};
121
122void eeprom_write16(struct adapter *padapter, u16 reg, u16 data);
123u16 eeprom_read16(struct adapter *padapter, u16 reg);
124void read_eeprom_content(struct adapter *padapter);
125void eeprom_read_sz(struct adapter *adapt, u16 reg, u8 *data, u32 sz);
126void read_eeprom_content_by_attrib(struct adapter *padapter);
127
128#endif
129