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__
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 /*===================================
46 #define ODM_REG_DIG_11N 0xC50
47 #define ODM_REG_DIG_11AC 0xDDD
50 =====================================*/
52 #define _reg_11N(_name) ODM_REG_##_name##_11N
53 #define _reg_11AC(_name) ODM_REG_##_name##_11AC
54 #define _bit_11N(_name) ODM_BIT_##_name##_11N
55 #define _bit_11AC(_name) ODM_BIT_##_name##_11AC
57 #if 1 //TODO: enable it if we need to support run-time to differentiate between 92C_SERIES and JAGUAR_SERIES.
58 #define _cat(_name, _ic_type, _func) \
60 ((_ic_type) & ODM_IC_11N_SERIES)? _func##_11N(_name): \
65 // _name: name of register or bit.
66 // Example: "ODM_REG(R_A_AGC_CORE1, pDM_Odm)"
67 // gets "ODM_R_A_AGC_CORE1" or "ODM_R_A_AGC_CORE1_8192C", depends on SupportICType.
68 #define ODM_REG(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _reg)
69 #define ODM_BIT(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _bit)
71 typedef enum _ODM_H2C_CMD
73 ODM_H2C_RSSI_REPORT = 0,
81 // 2012/02/17 MH For non-MP compile pass only. Linux does not support workitem.
82 // Suggest HW team to use thread instead of workitem. Windows also support the feature.
84 #if (DM_ODM_SUPPORT_TYPE != ODM_MP)
85 typedef void *PRT_WORK_ITEM ;
86 typedef void RT_WORKITEM_HANDLE,*PRT_WORKITEM_HANDLE;
87 typedef void (*RT_WORKITEM_CALL_BACK)(struct work_struct * pContext);
92 // =========== Extern Variable ??? It should be forbidden.
97 // =========== EXtern Function Prototype
173 ODM_RF_RADIO_PATH_E eRFPath,
182 ODM_RF_RADIO_PATH_E eRFPath,
189 // Memory Relative Function.
204 s4Byte ODM_CompareMemory(
212 // ODM MISC-spin lock relative API.
217 RT_SPINLOCK_TYPE type
223 RT_SPINLOCK_TYPE type
228 // ODM MISC-workitem relative API.
231 ODM_InitializeWorkItem(
233 PRT_WORK_ITEM pRtWorkItem,
234 RT_WORKITEM_CALL_BACK RtWorkItemCallback,
241 PRT_WORK_ITEM pRtWorkItem
246 PRT_WORK_ITEM pRtWorkItem
251 PRT_WORK_ITEM pRtWorkItem
255 ODM_ScheduleWorkItem(
256 PRT_WORK_ITEM pRtWorkItem
260 ODM_IsWorkItemScheduled(
261 PRT_WORK_ITEM pRtWorkItem
265 // ODM Timer relative API.
273 ODM_delay_ms(u4Byte ms);
277 ODM_delay_us(u4Byte us);
280 ODM_sleep_ms(u4Byte ms);
283 ODM_sleep_us(u4Byte us);
296 RT_TIMER_CALL_BACK CallBackFunc,
315 // ODM FW relative API.
317 #if (DM_ODM_SUPPORT_TYPE & ODM_MP)
337 #endif // __ODM_INTERFACE_H__