1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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.
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
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
22 #ifndef __ODM_INTERFACE_H__
23 #define __ODM_INTERFACE_H__
25 #define INTERFACE_VERSION "1.1" /*2015.07.29 YuChen*/
28 * =========== Constant/Structure/Enum/... Define
34 * =========== Macro Define
37 #define _reg_all(_name) ODM_##_name
38 #define _reg_ic(_name, _ic) ODM_##_name##_ic
39 #define _bit_all(_name) BIT_##_name
40 #define _bit_ic(_name, _ic) BIT_##_name##_ic
42 /* _cat: implemented by Token-Pasting Operator. */
44 #define _cat(_name, _ic_type, _func) \
50 /*===================================
52 #define ODM_REG_DIG_11N 0xC50
53 #define ODM_REG_DIG_11AC 0xDDD
56 =====================================*/
58 #define _reg_11N(_name) ODM_REG_##_name##_11N
59 #define _reg_11AC(_name) ODM_REG_##_name##_11AC
60 #define _bit_11N(_name) ODM_BIT_##_name##_11N
61 #define _bit_11AC(_name) ODM_BIT_##_name##_11AC
64 #define _rtk_cat(_name, _ic_type, _func) \
66 ((_ic_type) & ODM_IC_11N_SERIES) ? _func##_11N(_name) : \
71 #define _cat(_name, _ic_type, _func) \
73 ((_ic_type) & ODM_IC_11N_SERIES) ? _func##_11N(_name) : \
79 *#define _cat(_name, _ic_type, _func) \
81 * ((_ic_type) & ODM_RTL8188E) ? _func##_ic(_name, _8188E) : \
82 * _func##_ic(_name, _8195) \
86 /* _name: name of register or bit.
87 * Example: "ODM_REG(R_A_AGC_CORE1, p_dm_odm)"
88 * gets "ODM_R_A_AGC_CORE1" or "ODM_R_A_AGC_CORE1_8192C", depends on support_ic_type. */
90 #define ODM_REG(_name, _pdm_odm) _rtk_cat(_name, _pdm_odm->support_ic_type, _reg)
91 #define ODM_BIT(_name, _pdm_odm) _rtk_cat(_name, _pdm_odm->support_ic_type, _bit)
93 #define ODM_REG(_name, _pdm_odm) _cat(_name, _pdm_odm->support_ic_type, _reg)
94 #define ODM_BIT(_name, _pdm_odm) _cat(_name, _pdm_odm->support_ic_type, _bit)
97 PHYDM_H2C_TXBF = 0x41,
98 ODM_H2C_RSSI_REPORT = 0x42,
99 ODM_H2C_IQ_CALIBRATION = 0x45,
100 ODM_H2C_RA_PARA_ADJUST = 0x47,
101 PHYDM_H2C_DYNAMIC_TX_PATH = 0x48,
102 PHYDM_H2C_FW_TRACE_EN = 0x49,
103 ODM_H2C_WIFI_CALIBRATION = 0x6d,
112 PHYDM_C2H_TX_REPORT = 3,
114 PHYDM_C2H_BT_MP = 11,
115 PHYDM_C2H_RA_RPT = 12,
116 PHYDM_C2H_RA_PARA_RPT = 14,
117 PHYDM_C2H_DYNAMIC_TX_PATH_RPT = 15,
118 PHYDM_C2H_IQK_FINISH = 17, /*0x11*/
119 PHYDM_C2H_DBG_CODE = 0xFE,
120 PHYDM_C2H_EXTEND = 0xFF,
123 enum phydm_extend_c2h_evt {
124 PHYDM_EXTEND_C2H_DBG_PRINT = 0
130 * =========== Extern Variable ??? It should be forbidden.
135 * =========== EXtern Function Prototype
141 struct PHY_DM_STRUCT *p_dm_odm,
147 struct PHY_DM_STRUCT *p_dm_odm,
153 struct PHY_DM_STRUCT *p_dm_odm,
159 struct PHY_DM_STRUCT *p_dm_odm,
166 struct PHY_DM_STRUCT *p_dm_odm,
173 struct PHY_DM_STRUCT *p_dm_odm,
180 struct PHY_DM_STRUCT *p_dm_odm,
188 struct PHY_DM_STRUCT *p_dm_odm,
195 struct PHY_DM_STRUCT *p_dm_odm,
203 struct PHY_DM_STRUCT *p_dm_odm,
210 struct PHY_DM_STRUCT *p_dm_odm,
211 enum odm_rf_radio_path_e e_rf_path,
219 struct PHY_DM_STRUCT *p_dm_odm,
220 enum odm_rf_radio_path_e e_rf_path,
227 * Memory Relative Function.
231 struct PHY_DM_STRUCT *p_dm_odm,
237 struct PHY_DM_STRUCT *p_dm_odm,
244 struct PHY_DM_STRUCT *p_dm_odm,
250 s32 odm_compare_memory(
251 struct PHY_DM_STRUCT *p_dm_odm,
258 (struct PHY_DM_STRUCT *p_dm_odm,
264 * ODM MISC-spin lock relative API.
267 odm_acquire_spin_lock(
268 struct PHY_DM_STRUCT *p_dm_odm,
269 enum rt_spinlock_type type
273 odm_release_spin_lock(
274 struct PHY_DM_STRUCT *p_dm_odm,
275 enum rt_spinlock_type type
278 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
280 * ODM MISC-workitem relative API.
283 odm_initialize_work_item(
284 struct PHY_DM_STRUCT *p_dm_odm,
285 PRT_WORK_ITEM p_rt_work_item,
286 RT_WORKITEM_CALL_BACK rt_work_item_callback,
293 PRT_WORK_ITEM p_rt_work_item
298 PRT_WORK_ITEM p_rt_work_item
303 PRT_WORK_ITEM p_rt_work_item
307 odm_schedule_work_item(
308 PRT_WORK_ITEM p_rt_work_item
312 odm_is_work_item_scheduled(
313 PRT_WORK_ITEM p_rt_work_item
318 * ODM Timer relative API.
326 ODM_delay_ms(u32 ms);
331 ODM_delay_us(u32 us);
334 ODM_sleep_ms(u32 ms);
337 ODM_sleep_us(u32 us);
341 struct PHY_DM_STRUCT *p_dm_odm,
342 struct timer_list *p_timer,
347 odm_initialize_timer(
348 struct PHY_DM_STRUCT *p_dm_odm,
349 struct timer_list *p_timer,
350 void *call_back_func,
357 struct PHY_DM_STRUCT *p_dm_odm,
358 struct timer_list *p_timer
363 struct PHY_DM_STRUCT *p_dm_odm,
364 struct timer_list *p_timer
368 * ODM FW relative API.
372 struct PHY_DM_STRUCT *p_dm_odm,
379 phydm_c2H_content_parsing(
387 odm_get_current_time(
388 struct PHY_DM_STRUCT *p_dm_odm
391 odm_get_progressing_time(
392 struct PHY_DM_STRUCT *p_dm_odm,
396 #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
399 phydm_set_hw_reg_handler_interface (
400 struct PHY_DM_STRUCT *p_dm_odm,
406 phydm_get_hal_def_var_handler_interface (
407 struct PHY_DM_STRUCT *p_dm_odm,
408 enum _HAL_DEF_VARIABLE e_variable,
415 odm_set_tx_power_index_by_rate_section (
416 struct PHY_DM_STRUCT *p_dm_odm,
423 odm_get_tx_power_index (
424 struct PHY_DM_STRUCT *p_dm_odm,
433 #endif /* __ODM_INTERFACE_H__ */