1 #ifndef __RTL8712_CMD_H_
2 #define __RTL8712_CMD_H_
3 
4 u8 r8712_fw_cmd(struct _adapter *pAdapter, u32 cmd);
5 void r8712_fw_cmd_data(struct _adapter *pAdapter, u32 *value, u8 flag);
6 
7 
8 enum rtl8712_h2c_cmd {
9 	GEN_CMD_CODE(_Read_MACREG),	/*0*/
10 	GEN_CMD_CODE(_Write_MACREG),
11 	GEN_CMD_CODE(_Read_BBREG),
12 	GEN_CMD_CODE(_Write_BBREG),
13 	GEN_CMD_CODE(_Read_RFREG),
14 	GEN_CMD_CODE(_Write_RFREG), /*5*/
15 	GEN_CMD_CODE(_Read_EEPROM),
16 	GEN_CMD_CODE(_Write_EEPROM),
17 	GEN_CMD_CODE(_Read_EFUSE),
18 	GEN_CMD_CODE(_Write_EFUSE),
19 
20 	GEN_CMD_CODE(_Read_CAM),	/*10*/
21 	GEN_CMD_CODE(_Write_CAM),
22 	GEN_CMD_CODE(_setBCNITV),
23 	GEN_CMD_CODE(_setMBIDCFG),
24 	GEN_CMD_CODE(_JoinBss),   /*14*/
25 	GEN_CMD_CODE(_DisConnect), /*15*/
26 	GEN_CMD_CODE(_CreateBss),
27 	GEN_CMD_CODE(_SetOpMode),
28 	GEN_CMD_CODE(_SiteSurvey),  /*18*/
29 	GEN_CMD_CODE(_SetAuth),
30 
31 	GEN_CMD_CODE(_SetKey),	/*20*/
32 	GEN_CMD_CODE(_SetStaKey),
33 	GEN_CMD_CODE(_SetAssocSta),
34 	GEN_CMD_CODE(_DelAssocSta),
35 	GEN_CMD_CODE(_SetStaPwrState),
36 	GEN_CMD_CODE(_SetBasicRate), /*25*/
37 	GEN_CMD_CODE(_GetBasicRate),
38 	GEN_CMD_CODE(_SetDataRate),
39 	GEN_CMD_CODE(_GetDataRate),
40 	GEN_CMD_CODE(_SetPhyInfo),
41 
42 	GEN_CMD_CODE(_GetPhyInfo),	/*30*/
43 	GEN_CMD_CODE(_SetPhy),
44 	GEN_CMD_CODE(_GetPhy),
45 	GEN_CMD_CODE(_readRssi),
46 	GEN_CMD_CODE(_readGain),
47 	GEN_CMD_CODE(_SetAtim), /*35*/
48 	GEN_CMD_CODE(_SetPwrMode),
49 	GEN_CMD_CODE(_JoinbssRpt),
50 	GEN_CMD_CODE(_SetRaTable),
51 	GEN_CMD_CODE(_GetRaTable),
52 
53 	GEN_CMD_CODE(_GetCCXReport), /*40*/
54 	GEN_CMD_CODE(_GetDTMReport),
55 	GEN_CMD_CODE(_GetTXRateStatistics),
56 	GEN_CMD_CODE(_SetUsbSuspend),
57 	GEN_CMD_CODE(_SetH2cLbk),
58 	GEN_CMD_CODE(_AddBAReq), /*45*/
59 
60 	GEN_CMD_CODE(_SetChannel), /*46*/
61 /* MP_OFFLOAD Start (47~54)*/
62 	GEN_CMD_CODE(_SetTxPower),
63 	GEN_CMD_CODE(_SwitchAntenna),
64 	GEN_CMD_CODE(_SetCrystalCap),
65 	GEN_CMD_CODE(_SetSingleCarrierTx), /*50*/
66 	GEN_CMD_CODE(_SetSingleToneTx),
67 	GEN_CMD_CODE(_SetCarrierSuppressionTx),
68 	GEN_CMD_CODE(_SetContinuousTx),
69 	GEN_CMD_CODE(_SwitchBandwidth), /*54*/
70 /* MP_OFFLOAD End*/
71 	GEN_CMD_CODE(_TX_Beacon), /*55*/
72 	GEN_CMD_CODE(_SetPowerTracking),
73 	GEN_CMD_CODE(_AMSDU_TO_AMPDU), /*57*/
74 	GEN_CMD_CODE(_SetMacAddress), /*58*/
75 	MAX_H2CCMD
76 };
77 
78 
79 #define _GetBBReg_CMD_		_Read_BBREG_CMD_
80 #define _SetBBReg_CMD_		_Write_BBREG_CMD_
81 #define _GetRFReg_CMD_		_Read_RFREG_CMD_
82 #define _SetRFReg_CMD_		_Write_RFREG_CMD_
83 #define _DRV_INT_CMD_		(MAX_H2CCMD+1)
84 #define _SetRFIntFs_CMD_	(MAX_H2CCMD+2)
85 
86 #ifdef _RTL8712_CMD_C_
87 static struct _cmd_callback	cmd_callback[] = {
88 	{GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
89 	{GEN_CMD_CODE(_Write_MACREG), NULL},
90 	{GEN_CMD_CODE(_Read_BBREG), &r8712_getbbrfreg_cmdrsp_callback},
91 	{GEN_CMD_CODE(_Write_BBREG), NULL},
92 	{GEN_CMD_CODE(_Read_RFREG), &r8712_getbbrfreg_cmdrsp_callback},
93 	{GEN_CMD_CODE(_Write_RFREG), NULL}, /*5*/
94 	{GEN_CMD_CODE(_Read_EEPROM), NULL},
95 	{GEN_CMD_CODE(_Write_EEPROM), NULL},
96 	{GEN_CMD_CODE(_Read_EFUSE), NULL},
97 	{GEN_CMD_CODE(_Write_EFUSE), NULL},
98 
99 	{GEN_CMD_CODE(_Read_CAM),	NULL},	/*10*/
100 	{GEN_CMD_CODE(_Write_CAM),	 NULL},
101 	{GEN_CMD_CODE(_setBCNITV), NULL},
102 	{GEN_CMD_CODE(_setMBIDCFG), NULL},
103 	{GEN_CMD_CODE(_JoinBss), &r8712_joinbss_cmd_callback},  /*14*/
104 	{GEN_CMD_CODE(_DisConnect), &r8712_disassoc_cmd_callback}, /*15*/
105 	{GEN_CMD_CODE(_CreateBss), &r8712_createbss_cmd_callback},
106 	{GEN_CMD_CODE(_SetOpMode), NULL},
107 	{GEN_CMD_CODE(_SiteSurvey), &r8712_survey_cmd_callback}, /*18*/
108 	{GEN_CMD_CODE(_SetAuth), NULL},
109 
110 	{GEN_CMD_CODE(_SetKey), NULL},	/*20*/
111 	{GEN_CMD_CODE(_SetStaKey), &r8712_setstaKey_cmdrsp_callback},
112 	{GEN_CMD_CODE(_SetAssocSta), &r8712_setassocsta_cmdrsp_callback},
113 	{GEN_CMD_CODE(_DelAssocSta), NULL},
114 	{GEN_CMD_CODE(_SetStaPwrState), NULL},
115 	{GEN_CMD_CODE(_SetBasicRate), NULL}, /*25*/
116 	{GEN_CMD_CODE(_GetBasicRate), NULL},
117 	{GEN_CMD_CODE(_SetDataRate), NULL},
118 	{GEN_CMD_CODE(_GetDataRate), NULL},
119 	{GEN_CMD_CODE(_SetPhyInfo), NULL},
120 
121 	{GEN_CMD_CODE(_GetPhyInfo), NULL}, /*30*/
122 	{GEN_CMD_CODE(_SetPhy), NULL},
123 	{GEN_CMD_CODE(_GetPhy), NULL},
124 	{GEN_CMD_CODE(_readRssi), NULL},
125 	{GEN_CMD_CODE(_readGain), NULL},
126 	{GEN_CMD_CODE(_SetAtim), NULL}, /*35*/
127 	{GEN_CMD_CODE(_SetPwrMode), NULL},
128 	{GEN_CMD_CODE(_JoinbssRpt), NULL},
129 	{GEN_CMD_CODE(_SetRaTable), NULL},
130 	{GEN_CMD_CODE(_GetRaTable), NULL},
131 
132 	{GEN_CMD_CODE(_GetCCXReport), NULL}, /*40*/
133 	{GEN_CMD_CODE(_GetDTMReport),	NULL},
134 	{GEN_CMD_CODE(_GetTXRateStatistics), NULL},
135 	{GEN_CMD_CODE(_SetUsbSuspend), NULL},
136 	{GEN_CMD_CODE(_SetH2cLbk), NULL},
137 	{GEN_CMD_CODE(_AddBAReq), NULL}, /*45*/
138 
139 	{GEN_CMD_CODE(_SetChannel), NULL},		/*46*/
140 /* MP_OFFLOAD Start (47~54)*/
141 	{GEN_CMD_CODE(_SetTxPower), NULL},
142 	{GEN_CMD_CODE(_SwitchAntenna), NULL},
143 	{GEN_CMD_CODE(_SetCrystalCap), NULL},
144 	{GEN_CMD_CODE(_SetSingleCarrierTx), NULL},	/*50*/
145 	{GEN_CMD_CODE(_SetSingleToneTx), NULL},
146 	{GEN_CMD_CODE(_SetCarrierSuppressionTx), NULL},
147 	{GEN_CMD_CODE(_SetContinuousTx), NULL},
148 	{GEN_CMD_CODE(_SwitchBandwidth), NULL},		/*54*/
149 /* MP_OFFLOAD End*/
150 	{GEN_CMD_CODE(_TX_Beacon), NULL}, /*55*/
151 	{GEN_CMD_CODE(_SetPowerTracking), NULL},
152 	{GEN_CMD_CODE(_AMSDU_TO_AMPDU), NULL}, /*57*/
153 	{GEN_CMD_CODE(_SetMacAddress), NULL}, /*58*/
154 };
155 #endif
156 
157 #endif
158