This source file includes following definitions.
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
- GEN_MP_IOCTL_SUBCODE
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #ifndef _RTL871X_MP_IOCTL_H
15 #define _RTL871X_MP_IOCTL_H
16
17 #include "osdep_service.h"
18 #include "drv_types.h"
19 #include "mp_custom_oid.h"
20 #include "rtl871x_ioctl.h"
21 #include "rtl871x_ioctl_rtl.h"
22 #include "rtl8712_efuse.h"
23
24 #define TESTFWCMDNUMBER 1000000
25 #define TEST_H2CINT_WAIT_TIME 500
26 #define TEST_C2HINT_WAIT_TIME 500
27 #define HCI_TEST_SYSCFG_HWMASK 1
28 #define _BUSCLK_40M (4 << 2)
29
30 struct CFG_DBG_MSG_STRUCT {
31 u32 DebugLevel;
32 u32 DebugComponent_H32;
33 u32 DebugComponent_L32;
34 };
35
36 struct mp_rw_reg {
37 uint offset;
38 uint width;
39 u32 value;
40 };
41
42
43 struct eeprom_rw_param {
44 uint offset;
45 u16 value;
46 };
47
48 struct EFUSE_ACCESS_STRUCT {
49 u16 start_addr;
50 u16 cnts;
51 u8 data[0];
52 };
53
54 struct burst_rw_reg {
55 uint offset;
56 uint len;
57 u8 Data[256];
58 };
59
60 struct usb_vendor_req {
61 u8 bRequest;
62 u16 wValue;
63 u16 wIndex;
64 u16 wLength;
65 u8 u8Dir;
66 u8 u8InData;
67 };
68
69 struct DR_VARIABLE_STRUCT {
70 u8 offset;
71 u32 variable;
72 };
73
74
75 uint oid_rt_pro_read_register_hdl(struct oid_par_priv *poid_par_priv);
76 uint oid_rt_pro_write_register_hdl(struct oid_par_priv *poid_par_priv);
77
78 uint oid_rt_pro_set_data_rate_hdl(
79 struct oid_par_priv *poid_par_priv);
80 uint oid_rt_pro_start_test_hdl(struct oid_par_priv *poid_par_priv);
81 uint oid_rt_pro_stop_test_hdl(struct oid_par_priv *poid_par_priv);
82 uint oid_rt_pro_set_channel_direct_call_hdl(
83 struct oid_par_priv *poid_par_priv);
84 uint oid_rt_pro_set_antenna_bb_hdl(
85 struct oid_par_priv *poid_par_priv);
86 uint oid_rt_pro_set_tx_power_control_hdl(
87 struct oid_par_priv *poid_par_priv);
88
89 uint oid_rt_pro_query_tx_packet_sent_hdl(
90 struct oid_par_priv *poid_par_priv);
91 uint oid_rt_pro_query_rx_packet_received_hdl(
92 struct oid_par_priv *poid_par_priv);
93 uint oid_rt_pro_query_rx_packet_crc32_error_hdl(
94 struct oid_par_priv *poid_par_priv);
95 uint oid_rt_pro_reset_tx_packet_sent_hdl(
96 struct oid_par_priv *poid_par_priv);
97 uint oid_rt_pro_reset_rx_packet_received_hdl(
98 struct oid_par_priv *poid_par_priv);
99 uint oid_rt_pro_set_modulation_hdl(struct oid_par_priv *poid_par_priv);
100 uint oid_rt_pro_set_continuous_tx_hdl(
101 struct oid_par_priv *poid_par_priv);
102 uint oid_rt_pro_set_single_carrier_tx_hdl(
103 struct oid_par_priv *poid_par_priv);
104 uint oid_rt_pro_set_carrier_suppression_tx_hdl(
105 struct oid_par_priv *poid_par_priv);
106 uint oid_rt_pro_set_single_tone_tx_hdl(
107 struct oid_par_priv *poid_par_priv);
108
109 uint oid_rt_pro_write_bb_reg_hdl(struct oid_par_priv *poid_par_priv);
110 uint oid_rt_pro_read_bb_reg_hdl(struct oid_par_priv *poid_par_priv);
111 uint oid_rt_pro_write_rf_reg_hdl(struct oid_par_priv *poid_par_priv);
112 uint oid_rt_pro_read_rf_reg_hdl(struct oid_par_priv *poid_par_priv);
113
114 uint oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv);
115 uint oid_rt_pro_read_efuse_hdl(struct oid_par_priv *poid_par_priv);
116 uint oid_rt_pro_write_efuse_hdl(struct oid_par_priv *poid_par_priv);
117 uint oid_rt_get_efuse_current_size_hdl(
118 struct oid_par_priv *poid_par_priv);
119 uint oid_rt_pro_efuse_hdl(struct oid_par_priv *poid_par_priv);
120 uint oid_rt_pro_efuse_map_hdl(struct oid_par_priv *poid_par_priv);
121 uint oid_rt_set_bandwidth_hdl(struct oid_par_priv *poid_par_priv);
122 uint oid_rt_set_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv);
123 uint oid_rt_get_efuse_max_size_hdl(struct oid_par_priv *poid_par_priv);
124 uint oid_rt_get_thermal_meter_hdl(
125 struct oid_par_priv *poid_par_priv);
126 uint oid_rt_reset_phy_rx_packet_count_hdl(
127 struct oid_par_priv *poid_par_priv);
128 uint oid_rt_get_phy_rx_packet_received_hdl(
129 struct oid_par_priv *poid_par_priv);
130 uint oid_rt_get_phy_rx_packet_crc32_error_hdl(
131 struct oid_par_priv *poid_par_priv);
132 uint oid_rt_set_power_down_hdl(
133 struct oid_par_priv *poid_par_priv);
134 uint oid_rt_get_power_mode_hdl(
135 struct oid_par_priv *poid_par_priv);
136 #ifdef _RTL871X_MP_IOCTL_C_
137
138 static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = {
139
140 {1, oid_null_function},
141
142 {1, oid_rt_pro_set_data_rate_hdl},
143
144 {1, oid_rt_pro_start_test_hdl},
145
146 {1, oid_rt_pro_stop_test_hdl},
147
148 {1, oid_null_function},
149
150 {1, oid_null_function},
151
152 {1, oid_null_function},
153
154 {1, oid_null_function},
155
156 {1, oid_rt_pro_set_channel_direct_call_hdl},
157
158 {1, oid_null_function},
159
160 {1, oid_null_function},
161
162 {1, oid_rt_pro_set_continuous_tx_hdl},
163
164 {1, oid_rt_pro_set_single_carrier_tx_hdl},
165
166 {1, oid_null_function},
167
168 {1, oid_rt_pro_set_antenna_bb_hdl},
169
170 {1, oid_null_function},
171
172 {1, oid_null_function},
173
174 {1, oid_rt_pro_set_tx_power_control_hdl},
175
176 {1, oid_null_function},
177
178 {1, oid_null_function},
179
180 {1, oid_null_function},
181
182 {1, oid_null_function},
183
184 {1, oid_null_function},
185
186 {1, oid_null_function},
187
188 {1, oid_null_function},
189
190 {1, oid_null_function},
191
192 {1, oid_null_function},
193
194 {1, oid_null_function},
195
196 {1, oid_null_function},
197
198 {1, oid_null_function},
199
200 {1, oid_null_function},
201
202 {1, oid_null_function}
203 };
204
205 static const struct oid_obj_priv oid_rtl_seg_81_80_20[] = {
206
207 {1, oid_null_function},
208
209 {1, oid_null_function},
210
211 {1, oid_null_function},
212
213 {1, oid_rt_pro_reset_tx_packet_sent_hdl},
214
215 {1, oid_rt_pro_query_tx_packet_sent_hdl},
216
217 {1, oid_rt_pro_reset_rx_packet_received_hdl},
218
219 {1, oid_rt_pro_query_rx_packet_received_hdl},
220
221 {1, oid_rt_pro_query_rx_packet_crc32_error_hdl},
222
223 {1, oid_null_function},
224
225 {1, oid_null_function},
226
227 {1, oid_null_function},
228
229 {1, oid_rt_pro_set_carrier_suppression_tx_hdl},
230
231 {1, oid_null_function},
232
233 {1, oid_null_function},
234
235 {1, oid_null_function},
236
237 {1, oid_rt_pro_set_modulation_hdl}
238 };
239
240 static const struct oid_obj_priv oid_rtl_seg_81_80_40[] = {
241 {1, oid_null_function},
242 {1, oid_null_function},
243 {1, oid_null_function},
244 {1, oid_rt_pro_set_single_tone_tx_hdl},
245 {1, oid_null_function},
246 {1, oid_null_function}
247 };
248
249 static const struct oid_obj_priv oid_rtl_seg_81_80_80[] = {
250 {1, oid_null_function},
251 {1, oid_null_function},
252 {1, oid_null_function}
253
254 };
255
256 static const struct oid_obj_priv oid_rtl_seg_81_85[] = {
257
258 {1, oid_rt_wireless_mode_hdl}
259 };
260
261 #else
262 extern struct oid_obj_priv oid_rtl_seg_81_80_00[32];
263 extern struct oid_obj_priv oid_rtl_seg_81_80_20[16];
264 extern struct oid_obj_priv oid_rtl_seg_81_80_40[6];
265 extern struct oid_obj_priv oid_rtl_seg_81_80_80[3];
266 extern struct oid_obj_priv oid_rtl_seg_81_85[1];
267 extern struct oid_obj_priv oid_rtl_seg_81_87[5];
268 extern struct oid_obj_priv oid_rtl_seg_87_11_00[32];
269 extern struct oid_obj_priv oid_rtl_seg_87_11_20[5];
270 extern struct oid_obj_priv oid_rtl_seg_87_11_50[2];
271 extern struct oid_obj_priv oid_rtl_seg_87_11_80[1];
272 extern struct oid_obj_priv oid_rtl_seg_87_11_B0[1];
273 extern struct oid_obj_priv oid_rtl_seg_87_11_F0[16];
274 extern struct oid_obj_priv oid_rtl_seg_87_12_00[32];
275
276 #endif
277
278
279 enum MP_MODE {
280 MP_START_MODE,
281 MP_STOP_MODE,
282 MP_ERR_MODE
283 };
284
285 struct rwreg_param {
286 unsigned int offset;
287 unsigned int width;
288 unsigned int value;
289 };
290
291 struct bbreg_param {
292 unsigned int offset;
293 unsigned int phymask;
294 unsigned int value;
295 };
296
297 struct txpower_param {
298 unsigned int pwr_index;
299 };
300
301 struct datarate_param {
302 unsigned int rate_index;
303 };
304
305 struct rfintfs_parm {
306 unsigned int rfintfs;
307 };
308
309 struct mp_xmit_packet {
310 unsigned int len;
311 };
312
313 struct psmode_param {
314 unsigned int ps_mode;
315 unsigned int smart_ps;
316 };
317
318 struct mp_ioctl_handler {
319 unsigned int paramsize;
320 unsigned int (*handler)(struct oid_par_priv *poid_par_priv);
321 unsigned int oid;
322 };
323
324 struct mp_ioctl_param {
325 unsigned int subcode;
326 unsigned int len;
327 unsigned char data[0];
328 };
329
330 #define GEN_MP_IOCTL_SUBCODE(code) _MP_IOCTL_ ## code ## _CMD_
331
332 enum RTL871X_MP_IOCTL_SUBCODE {
333 GEN_MP_IOCTL_SUBCODE(MP_START),
334 GEN_MP_IOCTL_SUBCODE(MP_STOP),
335 GEN_MP_IOCTL_SUBCODE(READ_REG),
336 GEN_MP_IOCTL_SUBCODE(WRITE_REG),
337 GEN_MP_IOCTL_SUBCODE(SET_CHANNEL),
338 GEN_MP_IOCTL_SUBCODE(SET_TXPOWER),
339 GEN_MP_IOCTL_SUBCODE(SET_DATARATE),
340 GEN_MP_IOCTL_SUBCODE(READ_BB_REG),
341 GEN_MP_IOCTL_SUBCODE(WRITE_BB_REG),
342 GEN_MP_IOCTL_SUBCODE(READ_RF_REG),
343 GEN_MP_IOCTL_SUBCODE(WRITE_RF_REG),
344 GEN_MP_IOCTL_SUBCODE(SET_RF_INTFS),
345 GEN_MP_IOCTL_SUBCODE(IOCTL_XMIT_PACKET),
346 GEN_MP_IOCTL_SUBCODE(PS_STATE),
347 GEN_MP_IOCTL_SUBCODE(READ16_EEPROM),
348 GEN_MP_IOCTL_SUBCODE(WRITE16_EEPROM),
349 GEN_MP_IOCTL_SUBCODE(SET_PTM),
350 GEN_MP_IOCTL_SUBCODE(READ_TSSI),
351 GEN_MP_IOCTL_SUBCODE(CNTU_TX),
352 GEN_MP_IOCTL_SUBCODE(SET_BANDWIDTH),
353 GEN_MP_IOCTL_SUBCODE(SET_RX_PKT_TYPE),
354 GEN_MP_IOCTL_SUBCODE(RESET_PHY_RX_PKT_CNT),
355 GEN_MP_IOCTL_SUBCODE(GET_PHY_RX_PKT_RECV),
356 GEN_MP_IOCTL_SUBCODE(GET_PHY_RX_PKT_ERROR),
357 GEN_MP_IOCTL_SUBCODE(SET_POWER_DOWN),
358 GEN_MP_IOCTL_SUBCODE(GET_THERMAL_METER),
359 GEN_MP_IOCTL_SUBCODE(GET_POWER_MODE),
360 GEN_MP_IOCTL_SUBCODE(EFUSE),
361 GEN_MP_IOCTL_SUBCODE(EFUSE_MAP),
362 GEN_MP_IOCTL_SUBCODE(GET_EFUSE_MAX_SIZE),
363 GEN_MP_IOCTL_SUBCODE(GET_EFUSE_CURRENT_SIZE),
364 GEN_MP_IOCTL_SUBCODE(SC_TX),
365 GEN_MP_IOCTL_SUBCODE(CS_TX),
366 GEN_MP_IOCTL_SUBCODE(ST_TX),
367 GEN_MP_IOCTL_SUBCODE(SET_ANTENNA),
368 MAX_MP_IOCTL_SUBCODE,
369 };
370
371 unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv);
372
373 #ifdef _RTL871X_MP_IOCTL_C_
374
375
376 static struct mp_ioctl_handler mp_ioctl_hdl[] = {
377 {sizeof(u32), oid_rt_pro_start_test_hdl,
378 OID_RT_PRO_START_TEST},
379 {sizeof(u32), oid_rt_pro_stop_test_hdl,
380 OID_RT_PRO_STOP_TEST},
381 {sizeof(struct rwreg_param),
382 oid_rt_pro_read_register_hdl,
383 OID_RT_PRO_READ_REGISTER},
384 {sizeof(struct rwreg_param),
385 oid_rt_pro_write_register_hdl,
386 OID_RT_PRO_WRITE_REGISTER},
387 {sizeof(u32),
388 oid_rt_pro_set_channel_direct_call_hdl,
389 OID_RT_PRO_SET_CHANNEL_DIRECT_CALL},
390 {sizeof(struct txpower_param),
391 oid_rt_pro_set_tx_power_control_hdl,
392 OID_RT_PRO_SET_TX_POWER_CONTROL},
393 {sizeof(u32),
394 oid_rt_pro_set_data_rate_hdl,
395 OID_RT_PRO_SET_DATA_RATE},
396 {sizeof(struct bb_reg_param),
397 oid_rt_pro_read_bb_reg_hdl,
398 OID_RT_PRO_READ_BB_REG},
399 {sizeof(struct bb_reg_param),
400 oid_rt_pro_write_bb_reg_hdl,
401 OID_RT_PRO_WRITE_BB_REG},
402 {sizeof(struct rwreg_param),
403 oid_rt_pro_read_rf_reg_hdl,
404 OID_RT_PRO_RF_READ_REGISTRY},
405 {sizeof(struct rwreg_param),
406 oid_rt_pro_write_rf_reg_hdl,
407 OID_RT_PRO_RF_WRITE_REGISTRY},
408 {sizeof(struct rfintfs_parm), NULL, 0},
409 {0, mp_ioctl_xmit_packet_hdl, 0},
410 {sizeof(struct psmode_param), NULL, 0},
411 {sizeof(struct eeprom_rw_param), NULL, 0},
412 {sizeof(struct eeprom_rw_param), NULL, 0},
413 {sizeof(unsigned char), NULL, 0},
414 {sizeof(u32), NULL, 0},
415 {sizeof(u32), oid_rt_pro_set_continuous_tx_hdl,
416 OID_RT_PRO_SET_CONTINUOUS_TX},
417 {sizeof(u32), oid_rt_set_bandwidth_hdl,
418 OID_RT_SET_BANDWIDTH},
419 {sizeof(u32), oid_rt_set_rx_packet_type_hdl,
420 OID_RT_SET_RX_PACKET_TYPE},
421 {0, oid_rt_reset_phy_rx_packet_count_hdl,
422 OID_RT_RESET_PHY_RX_PACKET_COUNT},
423 {sizeof(u32), oid_rt_get_phy_rx_packet_received_hdl,
424 OID_RT_GET_PHY_RX_PACKET_RECEIVED},
425 {sizeof(u32), oid_rt_get_phy_rx_packet_crc32_error_hdl,
426 OID_RT_GET_PHY_RX_PACKET_CRC32_ERROR},
427 {sizeof(unsigned char), oid_rt_set_power_down_hdl,
428 OID_RT_SET_POWER_DOWN},
429 {sizeof(u32), oid_rt_get_thermal_meter_hdl,
430 OID_RT_PRO_GET_THERMAL_METER},
431 {sizeof(u32), oid_rt_get_power_mode_hdl,
432 OID_RT_GET_POWER_MODE},
433 {sizeof(struct EFUSE_ACCESS_STRUCT),
434 oid_rt_pro_efuse_hdl, OID_RT_PRO_EFUSE},
435 {EFUSE_MAP_MAX_SIZE, oid_rt_pro_efuse_map_hdl,
436 OID_RT_PRO_EFUSE_MAP},
437 {sizeof(u32), oid_rt_get_efuse_max_size_hdl,
438 OID_RT_GET_EFUSE_MAX_SIZE},
439 {sizeof(u32), oid_rt_get_efuse_current_size_hdl,
440 OID_RT_GET_EFUSE_CURRENT_SIZE},
441 {sizeof(u32), oid_rt_pro_set_single_carrier_tx_hdl,
442 OID_RT_PRO_SET_SINGLE_CARRIER_TX},
443 {sizeof(u32), oid_rt_pro_set_carrier_suppression_tx_hdl,
444 OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX},
445 {sizeof(u32), oid_rt_pro_set_single_tone_tx_hdl,
446 OID_RT_PRO_SET_SINGLE_TONE_TX},
447 {sizeof(u32), oid_rt_pro_set_antenna_bb_hdl,
448 OID_RT_PRO_SET_ANTENNA_BB},
449 };
450
451 #else
452 extern struct mp_ioctl_handler mp_ioctl_hdl[];
453 #endif
454
455 #endif
456