1 #ifndef __RTL871X_EEPROM_H__
2 #define __RTL871X_EEPROM_H__
3 
4 #include "osdep_service.h"
5 
6 #define	RTL8712_EEPROM_ID		0x8712
7 #define	EEPROM_MAX_SIZE			256
8 #define	CLOCK_RATE			50	/*100us*/
9 
10 /*- EEPROM opcodes*/
11 #define EEPROM_READ_OPCODE		06
12 #define EEPROM_WRITE_OPCODE		05
13 #define EEPROM_ERASE_OPCODE		07
14 #define EEPROM_EWEN_OPCODE		19      /* Erase/write enable*/
15 #define EEPROM_EWDS_OPCODE		16      /* Erase/write disable*/
16 
17 #define	EEPROM_CID_DEFAULT		0x0
18 #define	EEPROM_CID_ALPHA		0x1
19 #define	EEPROM_CID_Senao		0x3
20 #define	EEPROM_CID_NetCore		0x5
21 #define	EEPROM_CID_CAMEO		0X8
22 #define	EEPROM_CID_SITECOM		0x9
23 #define	EEPROM_CID_COREGA		0xB
24 #define	EEPROM_CID_EDIMAX_BELKIN	0xC
25 #define	EEPROM_CID_SERCOMM_BELKIN	0xE
26 #define	EEPROM_CID_CAMEO1		0xF
27 #define	EEPROM_CID_WNC_COREGA		0x12
28 #define	EEPROM_CID_CLEVO		0x13
29 #define	EEPROM_CID_WHQL			0xFE
30 
31 enum RT_CUSTOMER_ID {
32 	RT_CID_DEFAULT = 0,
33 	RT_CID_8187_ALPHA0 = 1,
34 	RT_CID_8187_SERCOMM_PS = 2,
35 	RT_CID_8187_HW_LED = 3,
36 	RT_CID_8187_NETGEAR = 4,
37 	RT_CID_WHQL = 5,
38 	RT_CID_819x_CAMEO  = 6,
39 	RT_CID_819x_RUNTOP = 7,
40 	RT_CID_819x_Senao = 8,
41 	RT_CID_TOSHIBA = 9,
42 	RT_CID_819x_Netcore = 10,
43 	RT_CID_Nettronix = 11,
44 	RT_CID_DLINK = 12,
45 	RT_CID_PRONET = 13,
46 	RT_CID_COREGA = 14,
47 	RT_CID_819x_ALPHA = 15,
48 	RT_CID_819x_Sitecom = 16,
49 	RT_CID_CCX = 17,
50 	RT_CID_819x_Lenovo = 18,
51 	RT_CID_819x_QMI = 19,
52 	RT_CID_819x_Edimax_Belkin = 20,
53 	RT_CID_819x_Sercomm_Belkin = 21,
54 	RT_CID_819x_CAMEO1 = 22,
55 	RT_CID_819x_MSI = 23,
56 	RT_CID_819x_Acer = 24,
57 	RT_CID_819x_AzWave_ASUS = 25,
58 	RT_CID_819x_AzWave = 26,
59 	RT_CID_819x_WNC_COREGA = 27,
60 	RT_CID_819x_CLEVO = 28,
61 };
62 
63 struct eeprom_priv {
64 	u8 bautoload_fail_flag;
65 	u8 bempty;
66 	u8 sys_config;
67 	u8 mac_addr[6];
68 	u8 config0;
69 	u16 channel_plan;
70 	u8 country_string[3];
71 	u8 tx_power_b[15];
72 	u8 tx_power_g[15];
73 	u8 tx_power_a[201];
74 	u8 efuse_eeprom_data[EEPROM_MAX_SIZE];
75 	enum RT_CUSTOMER_ID CustomerID;
76 };
77 
78 void r8712_eeprom_write16(struct _adapter *padapter, u16 reg, u16 data);
79 u16 r8712_eeprom_read16(struct _adapter *padapter, u16 reg);
80 
81 #endif  /*__RTL871X_EEPROM_H__*/
82 
83